<p>Hi!</p>
<p>Want to leave here a reminder for myself how to develop programs for PUST/PEST transactions. Source &#8211; <a href="http://help.sap.com/erp2005_ehp_04/helpdata/EN/2e/3ae153038a424de10000000a174cb4/content.htm?frameset=/EN/55/3ae153038a424de10000000a174cb4/frameset.htm&;current_toc=/EN/11/3ac2531bb9b44ce10000000a174cb4/plain.htm&;node_id=14" target="_blank" rel="noopener">help.sap.com</a>.</p>
<p>Sometime SAP deletes its own links, so let the text stay here for a while.</p>
<p><!--more--></p>
<h1 id="N25708" class="sansserif"><span class="SAPXDPTitle">Example: Program in Process Model</span></h1>
<p class="SAPXDPParagraph">See below for examples of source texts in programs you can use in a process model.</p>
<div class="SAPXDPNote SAPXDPSkb">
<p class="SAPXDPSkbtitle sansserif"><img class="SAPXDPSkb" title="Note" src="http://help.sap.com/static/erp2005_ehp_04/en/graphics/note.gif" alt="Note" /> Note</p>
<p class="SAPXDPParagraph">If you use the <span class="SAPXDPDocuLink"><a title="Go to document: workflow container" href="http://help.sap.com/erp2005_ehp_04/helpdata/EN/55/3ae153038a424de10000000a174cb4/content.htm">workflow container</a></span> , you require additional source text. These parts are displayed in italics.</p>
</div>
<p class="SAPXDPParagraph">You will also find examples of programs that are used within process models in the standard system.</p>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">Programs That Process Personnel Numbers Using a Logical Database</h5>
</div>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">Source Text</h5>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">REPORT MY_STEP_PROGRAM.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><i class="SAPXDPScreenElement" title="Object name">INCLUDE <;CNTN01>;.</i></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">START-OF-SELECTION.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">GET PERNR.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IF not employee is ok.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">CALL FUNCTION 'HRPY_PROCESS_SET_PERNR_STATUS'</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">EXPORTING</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_PERNR=PERNR-PERNR</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_PARCEL=PYPARAID</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_SET_ERR='X'.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">REJECT.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">ENDIF.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">CALL FUNCTION 'HRPY_PROCESS_SET_PERNR_STATUS'</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">EXPORTING</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_PERNR=PERNR-PERNR</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_PARCEL=PYPARAID</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_SET_SUC='X'.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">END-OF-SELECTION.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">* Fill container</tt></p>
</div>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">SAP Programs</h5>
<div class="SAPXDPBulletedList">
<ul>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph"><i class="SAPXDPScreenElement" title="Object name">Posting to Accounting: Create Posting Run</i></p>
<p class="SAPXDPParagraph">Program RPCIPE00 <i class="SAPXDPScreenElement" title="Object name">(Posting to Accounting: Create Posting Run)</i> starts with include <;CNTN01>;. Subroutine REJECTION is accessed in this include if a personnel number is not relevant to this process step. This happens in the following situations:</p>
<div class="SAPXDPBulletedList">
<ul>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph">The personnel number was rejected during payroll.</p>
</li>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph">The personnel number has already been evaluated.</p>
<p class="SAPXDPParagraph">In the first instance, subroutine REJECTION sets the status of the personnel number to <i class="SAPXDPScreenElement" title="Object name">incorrect</i> . In the second instance, it sets the status to <i class="SAPXDPScreenElement" title="Object name">successful</i> .</p>
<p class="SAPXDPParagraph">If the personnel number has the status <i class="SAPXDPScreenElement" title="Object name">successful</i> , program RPCIPE00 informs the process managerusing routine REGISTER_AND_INDEX. The routine is called just before END-OF-SELECTION. At the end of END-OF-SELECTION, routine END_PROCESS_MODEL transfers the number of the posting run and, if necessary, the name of the TemSe fileto the workflow container.</p>
</li>
</ul>
</div>
</li>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph"><i class="SAPXDPScreenElement" title="Object name">Payroll driver</i></p>
<p class="SAPXDPParagraph">In the payroll programs, the include statement for container macros can be found in include RPCFDC19. In program RPCALCX0 <i class="SAPXDPScreenElement" title="Object name">(Payroll Driver &#8211; International)</i> , for example, the container is only filled in an evaluation run after END-OF-SELECTION. Include RPCFDC19 transfers the names of TemSe files to the container.</p>
<p class="SAPXDPParagraph">If necessary, subroutine NEW_ABLEHNUNG sets the status of the personnel number to <i class="SAPXDPScreenElement" title="Object name">incorrect</i> .</p>
<p class="SAPXDPParagraph">At the end of subroutine MAIN , routine PROCESS_SET_PERNR_STATUS sets the status for successful personnel numbers.</p>
<p class="SAPXDPParagraph">END-OF-SELECTION ends with the LEAVE LIST-PROCESSING command, so subroutine FIRE_EVENT first calls function module HRPY_PROCESS_FIRE_EVENT to return control to the process manager.</p>
</li>
</ul>
</div>
</div>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">Programs That Do Not Use a Logical Database And Do Not Process Personnel Numbers</h5>
</div>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">Source Text</h5>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">INCLUDE RPUPMDP3.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><i class="SAPXDPScreenElement" title="Object name">INCLUDE <;CNTN01>;.</i></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">START-OF-SELECTION.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><i class="SAPXDPScreenElement" title="Object name"><em class="SAPXDPEmphasis">CALL FUNCTION 'HRPY_PUST_GET_CONTAINER’</em></i></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><em class="SAPXDPEmphasis"> EXPORTING</em></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><em class="SAPXDPEmphasis"> IMP_PARCEL = PYPARAID</em></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><em class="SAPXDPEmphasis"> TABLES</em></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><em class="SAPXDPEmphasis"> CONTAINER = PY_PM_CONTAINER.</em></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">[...]</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">END-OF-SELECTION.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">* Fill container</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IF NOT PYPARAID IS INITIAL.</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">CALL FUNCTION 'HRPY_PROCESS_FIRE_EVENT'</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">EXPORTING</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">IMP_PARCEL=PYPARAID</tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><i class="SAPXDPScreenElement" title="Object name">TABLES</i></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output"><i class="SAPXDPScreenElement" title="Object name">IMP_CONTAINER=PY_PM_CONTAINER .</i></tt></p>
<p class="SAPXDPParagraph"><tt class="SAPXDPScreenOutput monospace" title="Output">ENDIF.</tt></p>
<div class="SAPXDPNote SAPXDPSkb">
<p class="SAPXDPSkbtitle sansserif"><img class="SAPXDPSkb" title="Note" src="http://help.sap.com/static/erp2005_ehp_04/en/graphics/note.gif" alt="Note" /> Note</p>
<p class="SAPXDPParagraph">You only need to use the source text in italics and bold type if you require data from the workflow container that does not satisfy the program’s selection criteria. For more information, see <span class="SAPXDPDocuLink"><a title="Go to document: Workflow Container" href="http://help.sap.com/erp2005_ehp_04/helpdata/EN/55/3ae153038a424de10000000a174cb4/content.htm">Workflow Container</a></span> .</p>
</div>
</div>
<div class="SAPXDPSection">
<h5 class="SAPXDPTitle sansserif">SAP Programs</h5>
<div class="SAPXDPBulletedList">
<ul>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph"><i class="SAPXDPScreenElement" title="Object name">Display Posting Document</i></p>
<p class="SAPXDPParagraph">Program RPCIPS00 <i class="SAPXDPScreenElement" title="Object name">(Display Posting Document)</i> contains include RPUPMDP3. This program does not process personnel numbers or fill the workflow container, which means it does not require any further function modules, includes, or macros. At the end of END-OF-SELECTION, program RPCIPS00 returns control to the process manager.</p>
</li>
<li class="SAPXDPListItem">
<p class="SAPXDPParagraph"><i class="SAPXDPScreenElement" title="Object name">Transfer to FI/CO: Export to R/2 or R/3 <; 4.0</i></p>
<p class="SAPXDPParagraph">Program RPCIPX00 <i class="SAPXDPScreenElement" title="Object name">(Transfer to FI/CO: Export to R/2 or R/3 <; 4.0)</i> imports a TemSe file, processes it, and writes a new TemSe file. It must therefore use routine START_PROCESS to import the workflow container, and routine END_PROCESS to store new data in the workflow container. Function module HRPY_PROCESS_FIRE_EVENT is also called in routine END_PROCESS.</p>
</li>
</ul>
</div>
</div>