Posting commission documents After formatting the document headers and the related line items, thedata to be updated is sent to the update function module CACS0 0_POST_DOCUMENTS. The update can take place in an update work processdepending upon the flag IFLG_UPDATE_TASK, which is transferred to moduleCACS00_DOC_POST2. Along with the line items, their supplementation tables are alsoupdated. In addition, the linked totals tables are also updated. As the assignment of final document number takes place only in theupdate function module CACS00_POST_DOCUMENTS, references to the documentnumber can also be updated in this module (after assigning DOC_ID). Document posting process flow: Following are expected as input parameters: 1.,,Document headers as internal table in meta structure 2.,,Remuneration lines as internal table in meta structure 3.,,Settlement items as internal table in meta structure 4.,,Valuation lines as internal table in meta structure 5.,,Detail lines as internal table in meta structure 6.,,Corrected remuneration lines as internal table in meta structure ,,Corrected remuneration lines can, e.g., emerge as a result ofsettlement runs. They are corrected by other ,,remuneration lines. Corresponding references run via fields CORRTO...and CORRBY... ,,Remuneration lines already available in the database as well as thenew remuneration lines ,,sent with the current update can be corrected.Decision, whether a corrected remuneration line ,,is already there in the database or not, is taken with the help ofdocument number. A preliminary (with prefix ,,'$') document number identifies the remuneration line, which is stillnot there in the database. ,,Remuneration lines still not there in the database must also beavailable in the table 'remuneration lines' ,,otherwise these are notupdated. 7.,,Assignment of temporary to final document number as internal table 8.,,Number range interval Document posting is divided in the following steps: 1.,,Initialization,,FUNCTION 'CACS_DOC_INITIALIZE' ,,Initialization of internal tables, which are kept in the functiongroup memory 2.,,Transfer of document assignments to the special internal table,,FORMsave_doc_mapping 3.,,Reading function module names required during update ,,Reading and buffering function module names required for writing theextension tables to the ,,remuneration lines, settlement items and valuation lines.,,FORMread_extension_modules ,,Reading and buffering the names of function modules, which arerequired for updating the ,,totals tables.,, ,,FORM read_sum_update_modules 4.,,Complete the transferred documents ,,Complete the document headers,,FORM complete_header ,,,,-,,Use the system date (SY-DATUM), in case the posting date isinitial ,,,,-,,Derive month and year from the posting date ,,,,-,,Transfer document number from transfer table, in casecorresponding entry available; ,,,,,,otherwise use the document number from number range interval (s.parameter). ,,,,- ,,Mark the new document number with the corresponding temporarydocument number ,,,,-,,Use the current transaction code ,,,,-,,Use the current user as last modifier ,,Complete the remuneration lines,,FORM complete_remun ,,,,-,,Determine document number, posting year and month from theinternal mapping table, s.a. ,,,,-,,In all the related detail lines, replace the temporary documentnumber and posting year by the ,,,,,,above document number or posting year ,,,,-,,In all the detail lines, replace references, which appear on thecurrent remuneration line (via ,,,,,,temporary document number) with the henceforth final documentnumbers and the respective ,,,,,,posting year ,,,,-,,Replace the correction information (reference to correctedremuneration line) in the current ,,,, ,,,,,,remuneration line, in case the reference contains temporarydocument number. ,,,,-,,Replace information via a correcting remuneration line('corrected by') in the current ,,,,,,remuneration line, in case the reference contains temporarydocument number. ,,,,-,,Set flag 'reversed', in case an entry is available on acorrecting remuneration line. ,,Complete the settlement items,,FORM complete_due ,,,,-,,Determine document number, posting year and month from theinternal mapping table, s.a. ,,Complete the valuation lines,,FORM complete_valuation ,,,,-,,Determine document number, posting year and month from theinternal mapping table, s.a. ,,Complete the corrected remuneration lines,,FORMcomplete_corrected_remun ,,,,-,,Determine document number, posting year and month from theinternal mapping table, s.a. ,,,,-,,Replace correction information (reference to correctedremuneration line) in the current ,,,, ,,,,,,remuneration line, in case the reference contains temporarydocument number. ,,,,-,,Replace information about a correcting remuneration line('corrected by') in the current ,,,,,,remuneration line, in case the reference contains temporarydocument numbers. 5.,,Post the transferred documents,,FORM post_doc ,,Post the document headers,,FORM post_header ,,Document headers are written via mass insert to the database tableCACS00_DOCHD. ,,Post remuneration lines,,FORM post_remun ,,Remuneration lines are, at first, individually written to the databasetable CACS00_DOCRE. ,,Subsequently, the line is updated in the related supplementationtables. Finally, the ,,totals tables are updated. ,,Posting the detail lines,,FORM post_detail ,,Detail lines are written via a mass insert to the database. ,,Posting the settlement items,,FORM post_due ,,similar to 'posting the remuneration lines' ,,Posting the valuation lines,,FORM post_valuation ,,similar to 'posting the valuation lines' ,, ,,Update the corrected remuneration lines,,FORM update_corrected_remun ,,The corrected remuneration lines already available in the databasebefore the update are indicated as reversed using ,,mass update, and the totals tables are corrected. ,, |