<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Regarding capturing error messages while posting IDOC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902660#M376679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that your Idoc is getting created and then you want to validate the PO's.&lt;/P&gt;&lt;P&gt;So your Idoc unpacking is being done there in that program which creates the Idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now all you want to do is check for duplicates against table ztable right?&lt;/P&gt;&lt;P&gt;So now whereever you append the PO from the idoc to Ztable, there just before doing that check for the PO number against the Ztable entries.&lt;/P&gt;&lt;P&gt;Below is just some rough example. there are better/efficient ways to write this , so use this just as a guide.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;Select single EBELN from Ztable&lt;/P&gt;&lt;P&gt;where EBELN = Itab-ebeln.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0. ( Po is present , then error)&lt;/P&gt;&lt;P&gt;move itab-ebeln to itab_z_err_po-ebeln.&lt;/P&gt;&lt;P&gt;append z_err_po.&lt;/P&gt;&lt;P&gt;else. ( not found)&lt;/P&gt;&lt;P&gt;move itab to ztable&lt;/P&gt;&lt;P&gt;append ztable.endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Feb 2007 18:41:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-23T18:41:28Z</dc:date>
    <item>
      <title>Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902655#M376674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i am getting a data in XML format which consists of all purchase orders and there is a standard program available which converts this XML data to IDOC but before posting this IDOC  in SAP database, i need to validate data in IDOC with SAP data if error the i need to display content in error idoc to screen.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;i.e XML files have purchase order no's so this PO's should be validated with PO's in SAP if matches or exist then update details of PO in to SAP using IDOC or else display error idocs or error message to screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one please help me how do we do this, if possible with a piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 14:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902655#M376674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T14:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902656#M376675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pavan , what is the name of his program you are talking about.&lt;/P&gt;&lt;P&gt;Also do you mean the X12 file has lot of PO numbers and you need to csreen them first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing is if the X12 data has PO #'s and they are existing PO numbers then are these PO changes? the Idoc which will post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give more details&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 16:46:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902656#M376675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T16:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902657#M376676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i will just elaborate it. This XML files consists of Po's and materials from all vendors and these PO's and materials are already existing one in SAP so, there is an inbound program which converts this XML data in to IDOC. Now my job to validate data in IDOC before posting it to Ztable. and i hope it should create one idoc for every PO no in XML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can you please tell me how to unpack the idoc and validate the data in idoc before posting it to Ztable. ex: Purchase order is in Idoc - so before posting this PO in to Ztable how should i validate whether this PO there in Ztable or not so if there only then i need to post details of it to ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because we need to track the PO's coming from vendor are existing are not in our SAP database and generate an Error report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope u understood me plss guide me regarding this and please get back to me if u still have any queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 17:52:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902657#M376676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T17:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902658#M376677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok before I tell you anything, if you have a mapping software which maps XML file to an Idoc , then that is where you first check for duplicates, and send back to the sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But about your query, since you append to a ZTABLE , then you must have some custom code written.&lt;/P&gt;&lt;P&gt;So take all the PO's and select from Ztable where PO = POin xml file.&lt;/P&gt;&lt;P&gt;If you get a hit , thats a duplicate so put it in an internal table , if yuo do not get a hit, thats a new PO . &lt;/P&gt;&lt;P&gt;So append tat to your Ztable. there are many ways you can write the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding unpacking the idoc. you need to say for example,&lt;/P&gt;&lt;P&gt;if idoc-segnam = segment , move idoc-sdata to zsegment&lt;/P&gt;&lt;P&gt;where zsegment has been defined like the idoc segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sdata field has the data in the Idoc.&lt;/P&gt;&lt;P&gt;so for example when you move the segment containing PO number to the zsegment , there you can validate the PO number from Zsegment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But again, finding a duplaicte should be done by the mapping system. it the most efficient way.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 18:14:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902658#M376677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T18:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902659#M376678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actually vendor stores their XML file in a path and when a file is stored there then a batch program runs and converts it in to IDOC so i just have to unpack this idoc and validate the data in it with SAP data and just display the error report thats all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know that sdata field consists of actual data of idoc and need to check the message type to know the segment details but could not understand how to unpack the idoc and check for validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is that possible for you to help me with a piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 18:30:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902659#M376678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T18:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902660#M376679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that your Idoc is getting created and then you want to validate the PO's.&lt;/P&gt;&lt;P&gt;So your Idoc unpacking is being done there in that program which creates the Idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now all you want to do is check for duplicates against table ztable right?&lt;/P&gt;&lt;P&gt;So now whereever you append the PO from the idoc to Ztable, there just before doing that check for the PO number against the Ztable entries.&lt;/P&gt;&lt;P&gt;Below is just some rough example. there are better/efficient ways to write this , so use this just as a guide.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;Select single EBELN from Ztable&lt;/P&gt;&lt;P&gt;where EBELN = Itab-ebeln.&lt;/P&gt;&lt;P&gt;If sy-subrc = 0. ( Po is present , then error)&lt;/P&gt;&lt;P&gt;move itab-ebeln to itab_z_err_po-ebeln.&lt;/P&gt;&lt;P&gt;append z_err_po.&lt;/P&gt;&lt;P&gt;else. ( not found)&lt;/P&gt;&lt;P&gt;move itab to ztable&lt;/P&gt;&lt;P&gt;append ztable.endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 18:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902660#M376679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T18:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding capturing error messages while posting IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902661#M376680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually unpacking is not done in this program, as you see the scenario where outbound  program exists which only creates the idoc using master_idoc_distribute with required data, the same thing this program in our requirement does which only creates idoc with required data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so my job is to unpack and validate it with SAP data since i never worked on creating inbound function module i was just confused of how to unpack and validate&lt;/P&gt;&lt;P&gt;it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way thanks for your answers, if possible try to answer how to unpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; pts will be awarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; thank you&lt;/P&gt;&lt;P&gt; pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 19:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-capturing-error-messages-while-posting-idoc/m-p/1902661#M376680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T19:04:49Z</dc:date>
    </item>
  </channel>
</rss>

