In this blog we will look at the how PO XML output is triggered and how can we debug the process. In standard SRM setup, as soon as PO gets into ordered status, an entry is made into table PPFTRIGG. This entry is processed by running report RSPPFPROCESS with PO number or other selection criteria. During the processing of report, system picks up relevant entry from PPFTTRIGG table and calls EXECUTE method of class CL_TRIGGER_PPF. From there the call stack goes as shown below

Method IF_MEDIUM_PPF~EXECUTE of class CL_METHODCALL_PPF

Method EXECUTE of class CL_METHODCALL_PPF

Method IF_EX_EXEC_METHODCALL_PPF~EXECUTE of class CL_EX_EXEC_METHODCALL_PPF

Method IF_EX_EXEC_METHODCALL_PPF~EXECUTE of class CL_IM_BBP_PO_SEND_XML

Please note that the prerequisite for system to generate XML output for a PO, entry in PPFTRIGG table should have ‘MET’ in field ‘Processing’. This is influenced by output medium of vendor in PO.

The last method is actually something that appears in the SPRO configuration that we do for PO output under “define actions for document output”

/wp-content/uploads/2014/06/pic1_469835.jpg

/wp-content/uploads/2014/06/pic2_469836.jpg

BBP_PO_SEND_XML   is nothing but standard implementation of BADI EXEC_METHODCALL_PPF with implementing class CL_IM_BBP_PO_SEND_XML (last one in above call stack).

Inside this implementation is a call to FM BBP_PO_SEND which takes the PO guid as input

CALL FUNCTION ‘BBP_PO_SEND’
EXPORTING
iv_system_type            = ‘XISAPXML1’
iv_guid                   = ‘PO header guid’
iv_send_changed_data_only =  ‘X’
TABLES
et_messages               = lt_message.

Inside this there is a call to META_PO_SEND, where META_BAPI_DISPATCH is used to determine the driver FM from BBP_FUNCTION_MAP.

/wp-content/uploads/2014/06/pic3_469837.jpg

FM BBP_DOCUMENT_TO_EXT_MAPV is used to do mapping/conversions of PO data to XML related structures.

After this, driver FM BBP_SAPXML1_PO_SEND is called to populate the XML message and send it to PI. Inside the driver FM we have a BADI BBP_SAPXML1_OUT_BADI to influence the values stored in XML. For example if you want to overwrite some values based on logic or if you want to fill in custom XML fields that you introduced.

Have a nice day 🙂

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply