IDoc validation; populating in error tables from IDoc

IDoc validation; populating in error tables from IDoc

Once I receive orders IDoc data from webMethods, I need to do validation for the following: 1. PO Number and date: exists or not ? 2. Material: exists or not ? 3. Pricing calculation If I find any mismatches in the data, I have to populate these in SAP error tables. Is there any simple way to populate in error tables from IDoc ? I am getting 51 (Status reset after editing IDoc) because I made some changes in IDoc (we05) and reprocessed the IDoc using BD87.

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Is there any simple way to populate in error tables from IDoc? Yes. In your IDoc processing routine, add these lines: idoc_status-docnum = idoc_contrl-docnum. idoc_status-status = '51'. idoc_status-msgty = 'E'. idoc_status-msgid = 'VG'. idoc_status-msgno = '204'. idoc_status-msgv1 = xvbak-kunnr. idoc_status-msgv2 = lieferant. APPEND idoc_status IDoc processing is a fully customized process. When you receive an IDoc, the IDoc engine looks for the IDOCTYP and MSGTYP in the IDoc header and loks up the processing function module intable EDIFCT. You can now create an own function module Z_IDOC_ORDER_INPUT and replace the original entry. Then your function will be called instead, and you can pre-process the IDoc as you need it. The best way is like this: Copy the original idoc processing function IDOC_INPUT_ORDERS05 to Z_IDOC_INPUT_ORDERS Delete the coding from the function Z_IDOC_INPUT_ORDERS, and make call function to IDOC_INPUT_ORDERS05 Replace the entry in EDIFCT (with WE42 or with SM31 and view V_EDIFCT) Test it ; it should work as before. Now you can change Z_IDOC_INPUT_ORDERS by adding your code before calling IDOC_INPUT_ORDERS05. If you decide to quit Z_IDOC_INPUT_ORDERS before calling IDOC_INPUT_ORDERS05, do not forget to set the EDIDC-STATUS value correctly.

This was first published in August 2008