<?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: Reg:IDOCS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598022#M866480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can read the control record and compare the Segment Name,&lt;/P&gt;&lt;P&gt;If it is fine then,&lt;/P&gt;&lt;P&gt;U can read the internal table of type EDIDS with index,&lt;/P&gt;&lt;P&gt;which will give u the status of the iDoc.&lt;/P&gt;&lt;P&gt;Now u implement if else according whether it is 51 or 63.&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;Navin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2008 07:05:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-01T07:05:23Z</dc:date>
    <item>
      <title>Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598017#M866475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have declared a internal table edids have to check the status of idoc in status 51 and 63 then according to that have to perform some tasks.How to code to check the status of IDOC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 06:46:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598017#M866475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T06:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598018#M866476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this Tcodes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WE09 / WE02	IDoc lists according to content. &lt;/P&gt;&lt;P&gt;WE05	View IDocs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;P&gt;~&lt;SUB&gt;Lakshmiraj&lt;/SUB&gt;~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 06:49:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598018#M866476</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-01T06:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598019#M866477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the whole list of IDOC status is below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Status     Description&lt;/P&gt;&lt;P&gt;00	Not used, only R/2&lt;/P&gt;&lt;P&gt;01	IDoc created&lt;/P&gt;&lt;P&gt;02	Error passing data to port&lt;/P&gt;&lt;P&gt;03	Data passed to port OK&lt;/P&gt;&lt;P&gt;04	Error within control information of EDI subsystem&lt;/P&gt;&lt;P&gt;05	Error during translation&lt;/P&gt;&lt;P&gt;06	Translation OK&lt;/P&gt;&lt;P&gt;07	Error during syntax check&lt;/P&gt;&lt;P&gt;08	Syntax check OK&lt;/P&gt;&lt;P&gt;09	Error during interchange handling&lt;/P&gt;&lt;P&gt;10	Interchange handling OK&lt;/P&gt;&lt;P&gt;11	Error during dispatch&lt;/P&gt;&lt;P&gt;12	Dispatch OK&lt;/P&gt;&lt;P&gt;13	Retransmission OK&lt;/P&gt;&lt;P&gt;14	Interchange Acknowledgement positive&lt;/P&gt;&lt;P&gt;15	Interchange Acknowledgement negative&lt;/P&gt;&lt;P&gt;16	Functional Acknowledgement positive&lt;/P&gt;&lt;P&gt;17	Functional Acknowledgement negative&lt;/P&gt;&lt;P&gt;18	Triggering EDI subsystem OK&lt;/P&gt;&lt;P&gt;19	Data transfer for test OK&lt;/P&gt;&lt;P&gt;20	Error triggering EDI subsystem&lt;/P&gt;&lt;P&gt;21	Error passing data for test&lt;/P&gt;&lt;P&gt;22	Dispatch OK, acknowledgement still due&lt;/P&gt;&lt;P&gt;23	Error during retransmission&lt;/P&gt;&lt;P&gt;24	Control information of EDI subsystem OK&lt;/P&gt;&lt;P&gt;25	Processing despite syntax error (outbound)&lt;/P&gt;&lt;P&gt;26	Error during syntax check of IDoc (outbound)&lt;/P&gt;&lt;P&gt;27	Error in dispatch level (ALE service)&lt;/P&gt;&lt;P&gt;28	Not used&lt;/P&gt;&lt;P&gt;29	Error in ALE service&lt;/P&gt;&lt;P&gt;30	IDoc ready for dispatch (ALE service)&lt;/P&gt;&lt;P&gt;31	Error - no further processing&lt;/P&gt;&lt;P&gt;32	IDoc was edited&lt;/P&gt;&lt;P&gt;33	Original of an IDoc which was edited&lt;/P&gt;&lt;P&gt;34	Error in control record of IDoc&lt;/P&gt;&lt;P&gt;35	IDoc reloaded from archive&lt;/P&gt;&lt;P&gt;36	Electronic signature not performed (timeout)&lt;/P&gt;&lt;P&gt;37	IDoc added incorrectly&lt;/P&gt;&lt;P&gt;38	IDoc archived&lt;/P&gt;&lt;P&gt;39	IDoc is in the receiving system (ALE service)&lt;/P&gt;&lt;P&gt;40	Application document not created in receiving system&lt;/P&gt;&lt;P&gt;41	Application document created in receiving system&lt;/P&gt;&lt;P&gt;42	IDoc was created by test transaction&lt;/P&gt;&lt;P&gt;50	IDoc added&lt;/P&gt;&lt;P&gt;51	Error: Application document not posted&lt;/P&gt;&lt;P&gt;52	Application document not fully posted&lt;/P&gt;&lt;P&gt;53	Application document posted&lt;/P&gt;&lt;P&gt;54	Error during formal application check&lt;/P&gt;&lt;P&gt;55	Formal application check OK&lt;/P&gt;&lt;P&gt;56	IDoc with errors added&lt;/P&gt;&lt;P&gt;57	Test IDoc: Error during application check&lt;/P&gt;&lt;P&gt;58	IDoc-Copy from an R/2 connection&lt;/P&gt;&lt;P&gt;59	Not used&lt;/P&gt;&lt;P&gt;60	Error during syntax check of IDoc (inbound)&lt;/P&gt;&lt;P&gt;61	Processing despite syntax error (inbound)&lt;/P&gt;&lt;P&gt;62	IDoc passed to application&lt;/P&gt;&lt;P&gt;63	Error passing IDoc to application&lt;/P&gt;&lt;P&gt;64	IDoc ready to be transferred to application&lt;/P&gt;&lt;P&gt;65	Error in ALE service&lt;/P&gt;&lt;P&gt;66	IDoc is waiting for predecessor IDoc (serialization)&lt;/P&gt;&lt;P&gt;67	Not used&lt;/P&gt;&lt;P&gt;68	Error - no further processing&lt;/P&gt;&lt;P&gt;69	IDoc was edited&lt;/P&gt;&lt;P&gt;70	Original of an IDoc which was edited&lt;/P&gt;&lt;P&gt;71	IDoc reloaded from archive&lt;/P&gt;&lt;P&gt;72	Not used, only R/2&lt;/P&gt;&lt;P&gt;73	IDoc archived&lt;/P&gt;&lt;P&gt;74	IDoc was created by test transaction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;P&gt;~&lt;SUB&gt;Lakshmiraj&lt;/SUB&gt;~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 06:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598019#M866477</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-01T06:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598020#M866478</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;Hope it will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Reward if help.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IDOC STATUS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WE05 T CODE gives the status&lt;/P&gt;&lt;P&gt;Subject: Re: how to know the idocs which are under process&lt;/P&gt;&lt;P&gt;Message: Tcode: WE02&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;outbound&lt;/P&gt;&lt;P&gt;if the status is 26,29,30 ..idoc is in waiting status&lt;/P&gt;&lt;P&gt;03,12,38     successfully transferres&lt;/P&gt;&lt;P&gt;2,4,5,25      processing error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inbound&lt;/P&gt;&lt;P&gt;53   successfully updated&lt;/P&gt;&lt;P&gt;64  waiting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is list you will get containing the various status and Idoc could be  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;00	Not used, only R/2&lt;/P&gt;&lt;P&gt;01	IDoc created&lt;/P&gt;&lt;P&gt;02	Error passing data to port&lt;/P&gt;&lt;P&gt;03	Data passed to port OK&lt;/P&gt;&lt;P&gt;04	Error within control information of EDI subsystem&lt;/P&gt;&lt;P&gt;05	Error during translation&lt;/P&gt;&lt;P&gt;06	Translation OK&lt;/P&gt;&lt;P&gt;07	Error during syntax check&lt;/P&gt;&lt;P&gt;08	Syntax check OK&lt;/P&gt;&lt;P&gt;09	Error during interchange handling&lt;/P&gt;&lt;P&gt;10	Interchange handling OK&lt;/P&gt;&lt;P&gt;11	Error during dispatch&lt;/P&gt;&lt;P&gt;12	Dispatch OK&lt;/P&gt;&lt;P&gt;13	Retransmission OK&lt;/P&gt;&lt;P&gt;14	Interchange Acknowledgement positive&lt;/P&gt;&lt;P&gt;15	Interchange Acknowledgement negative&lt;/P&gt;&lt;P&gt;16	Functional Acknowledgement positive&lt;/P&gt;&lt;P&gt;17	Functional Acknowledgement negative&lt;/P&gt;&lt;P&gt;18	Triggering EDI subsystem OK&lt;/P&gt;&lt;P&gt;19	Data transfer for test OK&lt;/P&gt;&lt;P&gt;20	Error triggering EDI subsystem&lt;/P&gt;&lt;P&gt;21	Error passing data for test&lt;/P&gt;&lt;P&gt;22	Dispatch OK, acknowledgement still due&lt;/P&gt;&lt;P&gt;23	Error during retransmission&lt;/P&gt;&lt;P&gt;24	Control information of EDI subsystem OK&lt;/P&gt;&lt;P&gt;25	Processing despite syntax error (outbound)&lt;/P&gt;&lt;P&gt;26	Error during syntax check of IDoc (outbound)&lt;/P&gt;&lt;P&gt;27	Error in dispatch level (ALE service)&lt;/P&gt;&lt;P&gt;28	Not used&lt;/P&gt;&lt;P&gt;29	Error in ALE service&lt;/P&gt;&lt;P&gt;30	IDoc ready for dispatch (ALE service)&lt;/P&gt;&lt;P&gt;31	Error - no further processing&lt;/P&gt;&lt;P&gt;32	IDoc was edited&lt;/P&gt;&lt;P&gt;33	Original of an IDoc which was edited&lt;/P&gt;&lt;P&gt;34	Error in control record of IDoc&lt;/P&gt;&lt;P&gt;35	IDoc reloaded from archive&lt;/P&gt;&lt;P&gt;36	Electronic signature not performed (timeout)&lt;/P&gt;&lt;P&gt;37	IDoc added incorrectly&lt;/P&gt;&lt;P&gt;38	IDoc archived&lt;/P&gt;&lt;P&gt;39	IDoc is in the receiving system (ALE service)&lt;/P&gt;&lt;P&gt;40	Application document not created in receiving system&lt;/P&gt;&lt;P&gt;41	Application document created in receiving system&lt;/P&gt;&lt;P&gt;42	IDoc was created by test transaction&lt;/P&gt;&lt;P&gt;50	IDoc added&lt;/P&gt;&lt;P&gt;51	Error: Application document not posted&lt;/P&gt;&lt;P&gt;52	Application document not fully posted&lt;/P&gt;&lt;P&gt;53	Application document posted&lt;/P&gt;&lt;P&gt;54	Error during formal application check&lt;/P&gt;&lt;P&gt;55	Formal application check OK&lt;/P&gt;&lt;P&gt;56	IDoc with errors added&lt;/P&gt;&lt;P&gt;57	Test IDoc: Error during application check&lt;/P&gt;&lt;P&gt;58	IDoc-Copy from an R/2 connection&lt;/P&gt;&lt;P&gt;59	Not used&lt;/P&gt;&lt;P&gt;60	Error during syntax check of IDoc (inbound)&lt;/P&gt;&lt;P&gt;61	Processing despite syntax error (inbound)&lt;/P&gt;&lt;P&gt;62	IDoc passed to application&lt;/P&gt;&lt;P&gt;63	Error passing IDoc to application&lt;/P&gt;&lt;P&gt;64	IDoc ready to be transferred to application&lt;/P&gt;&lt;P&gt;65	Error in ALE service&lt;/P&gt;&lt;P&gt;66	IDoc is waiting for predecessor IDoc (serialization)&lt;/P&gt;&lt;P&gt;67	Not used&lt;/P&gt;&lt;P&gt;68	Error - no further processing&lt;/P&gt;&lt;P&gt;69	IDoc was edited&lt;/P&gt;&lt;P&gt;70	Original of an IDoc which was edited&lt;/P&gt;&lt;P&gt;71	IDoc reloaded from archive&lt;/P&gt;&lt;P&gt;72	Not used, only R/2&lt;/P&gt;&lt;P&gt;73	IDoc archived&lt;/P&gt;&lt;P&gt;74	IDoc was created by test transaction&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 06:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598020#M866478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T06:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598021#M866479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How should i code for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 06:56:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598021#M866479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T06:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598022#M866480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can read the control record and compare the Segment Name,&lt;/P&gt;&lt;P&gt;If it is fine then,&lt;/P&gt;&lt;P&gt;U can read the internal table of type EDIDS with index,&lt;/P&gt;&lt;P&gt;which will give u the status of the iDoc.&lt;/P&gt;&lt;P&gt;Now u implement if else according whether it is 51 or 63.&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;Navin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:05:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598022#M866480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598023#M866481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u explain me ur actual requirment???  Whether idoc is created ????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my undestanding  pls find the solution below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;	READING AN IDOC

CALL FUNCTION 'IDOC_READ_COMPLETELY'
     EXPORTING
          document_number         = p_docnum
     IMPORTING
          idoc_control            = s_ordchg_edidc
     TABLES
          int_edidd               = itab_ordchg_edidd
     EXCEPTIONS
          document_not_exist      = 1
          document_number_invalid = 2
          OTHERS                  = 3.


Eample &amp;#150; Open document for read
    CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'
         EXPORTING
              DOCUMENT_NUMBER         = iedidc-docnum
         IMPORTING
              IDOC_CONTROL            = IEDIDC
         EXCEPTIONS
              DOCUMENT_FOREIGN_LOCK   = 01
              DOCUMENT_NOT_EXIST      = 02
              DOCUMENT_NUMBER_INVALID = 03
              ERROR_MESSAGE           = 04
              OTHERS                  = 05.

    call function 'EDI_SEGMENTS_GET_ALL'
        exporting
         document_number         = iedidc-docnum
        tables
         idoc_containers         = data_rec
        exceptions
         document_number_invalid = 1
         end_of_document         = 2
         others                  = 3.

    if not sy-subrc is initial.
      CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
          EXPORTING
            DOCUMENT_NUMBER         =  iedidc-docnum
          IMPORTING
            IDOC_CONTROL            =  iedidc&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to loop that IEDIDC to check its STATUS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Best way to say thanks in SDN is by rewarding points for helpful answers  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds~ Lakshmiraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:07:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598023#M866481</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-01T07:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598024#M866482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sorry am new to ABAP so can u explain me better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I should give as read table itab(internal table name) with index r8.what does the index specifies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598024#M866482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598025#M866483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider&lt;/P&gt;&lt;P&gt;Idoc message type is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants:&lt;/P&gt;&lt;P&gt;l_c_msgtyp      TYPE edimsg-mestyp  VALUE '/GLB/RGTKNKK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE: &lt;/P&gt;&lt;P&gt;l_wa_edidc    TYPE   edidc,        " Idoc_Control&lt;/P&gt;&lt;P&gt;l_wa_edids type    edids-status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; READ TABLE idoc_contrl INTO l_wa_edidc INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF idoc_contrl-mestyp = l_c_msgtyp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now since IDoc_status is a internal table with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table idoc_status[] index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_wa_edids = idoc_status-status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_wa_edids holds the value i.e 51 or 63.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u will get the latest status of  idoc which u see in T-Code WE05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u can find the status whether it is 51 or 63 and code accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598025#M866483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598026#M866484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The idocs are generated for a particular range of date.now i have to display a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)In that first have to fetch the idocs of status 51 or 68.&lt;/P&gt;&lt;P&gt;2)Then have to link this idoc to the particular vendor &lt;/P&gt;&lt;P&gt;3)The segment related to the vendor is E1EDKA1LF and the field is PARTN and get the details such as invoice number,date etc and display in a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u get me?I dont know how to code in this part?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598026#M866484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598027#M866485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have already got the status of the idocs using FM idoc_Read_completely now have to only filter the idocs of status 51 0r 68&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598027#M866485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598028#M866486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of outbound, when you call the function module 'MASTER_IDOC_DISTRIBUTE', there is a parameter 'COMMUNICATION_IDOC_CONTROL' which is of type EDIDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After calling the above function module, the generated IDoc details can be read from the Communication IDoc Control internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following code:&lt;/P&gt;&lt;P&gt;Read table index 1 gt_comm_idoc into gw_comm_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then check the status of the generated IDoc using the field gw_comm_idoc-status. Based on this you can include your logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598028#M866486</guid>
      <dc:creator>arunkumar_yerram</dc:creator>
      <dc:date>2008-04-01T07:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598029#M866487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood that your requirement is in inbound.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you call the FM 'IDOC_READ_COMPLETELY', there is an Import parameter IDOC_CONTROL.&lt;/P&gt;&lt;P&gt;Use the case statement like this to achieve your functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE IDOC_CONTROL-STATUS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN '51' OR '67'.&lt;/P&gt;&lt;P&gt;......add your logic here.&lt;/P&gt;&lt;P&gt;...... perform f_do_this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN OTHERS.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:29:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598029#M866487</guid>
      <dc:creator>arunkumar_yerram</dc:creator>
      <dc:date>2008-04-01T07:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598030#M866488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have to make use of idoc_read_completely in my requirement so have used it and got the status of the idocs within particular range of date.now i have to filter the idocs of status 51 0r 68 alone and have to link to the segment inorder to relate to the vendor and get the details of the vendor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598030#M866488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598031#M866489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For performance issue it would be better if i use read statement .how to use it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:32:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598031#M866489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598032#M866490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls check this program . It is closely related to IDOC status checking , meanwhile I'l try to work on your requirement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;***********************************************
*Change IDoc status to error status and send to workflow
REPORT ZS7BM000007 MESSAGE-ID ZS7 .
*______________________________________________________________________

*/ Program Name: Process invoice IDocs with Goods Receipt
*/ Description : This program checks all INVOIC MM IDocs in status 64
*                and 66 to determine if they have been received. Those
*                IDocs older than 10 days that have still not been
*                goods receipted are given error status 51.
*/ Transaction : N/A - run via scheduled job
*______________________________________________________________________

TABLES: EDIDC,
        MKPF,
        EKPO,
        RBKP,
        E1EDK01,
        E1EDKA1,
        E1EDK02,
        E1EDP02.

DATA: IEDIDC   LIKE EDIDC OCCURS 1 WITH HEADER LINE,
      DATA_REC LIKE EDIDD OCCURS 1 WITH HEADER LINE.

DATA: C_DOCNUM(16) TYPE C,
      C_MBLNR(10)  TYPE C,
      C_INVOIC(10) TYPE C,
      RC(1)        TYPE C,
      LEAD_TIME    LIKE LFM1-PLIFZ,
      GR_QTY       LIKE MSEG-ERFMG,
      TEST_DATE    LIKE SY-DATUM,
      GR_REQUIRED  LIKE EKPO-WEBRE,
      PO_NUMBER(10)    TYPE N,
      PO_LINENO    LIKE EKPO-EBELP,
      N_VEND(10)   TYPE N,
      VENDOR_ID    LIKE LFA1-LIFNR.

DATA: BEGIN OF ITAB_GR OCCURS 0,
        MBLNR LIKE MKPF-MBLNR,
        BWART LIKE MSEG-BWART,
        ERFMG LIKE MSEG-ERFMG,
      END OF ITAB_GR.

CONSTANTS:
* name of container element (workitem object id)
  C_ELEMENT_WI_OBJ_ID      LIKE SWCONT-ELEMENT VALUE '_WI_OBJECT_ID',
* name of container element (NumberPlusEventcode)
  C_ELEMENT_NO_PLUS_INFO   LIKE SWCONT-ELEMENT
                           VALUE 'NumberPlusEventcode'.

RANGES: R_STATUS FOR EDIDC-STATUS.

TYPE-POOLS:
* general idoc type pool
  TIDOC.

************************************************************************
* INCLUDES                                                             *
************************************************************************
* include for workflow programming
INCLUDE &amp;lt;CNTN01&amp;gt;.

************************************************************************
* INNITIALIZATION                                                      *
************************************************************************
INITIALIZATION.
* create IDoc status selection table.
  CLEAR R_STATUS. REFRESH R_STATUS.

  MOVE: 'EQ'      TO R_STATUS-OPTION,   "equals
        'I'       TO R_STATUS-SIGN,     "include
        '64'      TO R_STATUS-LOW.
  APPEND R_STATUS.
  MOVE: '66'      TO R_STATUS-LOW.
  APPEND R_STATUS.

************************************************************************
* START-OF-SELECTION
************************************************************************
START-OF-SELECTION.

  SELECT * FROM EDIDC INTO TABLE IEDIDC
    WHERE STATUS IN R_STATUS AND
          DIRECT = '2' AND      "inbound
          MESTYP = 'INVOIC' AND
          MESCOD = 'MM'.

  LOOP AT IEDIDC.
    CLEAR RC.

    CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'
         EXPORTING
              DOCUMENT_NUMBER         = IEDIDC-DOCNUM
         IMPORTING
              IDOC_CONTROL            = IEDIDC
         EXCEPTIONS
              DOCUMENT_FOREIGN_LOCK   = 01
              DOCUMENT_NOT_EXIST      = 02
              DOCUMENT_NUMBER_INVALID = 03
              ERROR_MESSAGE           = 04
              OTHERS                  = 05.

    IF NOT SY-SUBRC IS INITIAL.
      C_DOCNUM = IEDIDC-DOCNUM.
      SHIFT C_DOCNUM LEFT DELETING LEADING '0'.
* 'Cannot open INVOIC IDoc &amp;amp; for Goods Receipt processing'
      MESSAGE W025 WITH C_DOCNUM.
      CONTINUE.
    ENDIF.

    CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
        EXPORTING
         DOCUMENT_NUMBER         = IEDIDC-DOCNUM
        TABLES
         IDOC_CONTAINERS         = DATA_REC
        EXCEPTIONS
         DOCUMENT_NUMBER_INVALID = 1
         END_OF_DOCUMENT         = 2
         OTHERS                  = 3.

    IF NOT SY-SUBRC IS INITIAL.
      CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
          EXPORTING
            DOCUMENT_NUMBER         =  IEDIDC-DOCNUM
          IMPORTING
            IDOC_CONTROL            =  IEDIDC

      C_DOCNUM = IEDIDC-DOCNUM.
      SHIFT C_DOCNUM LEFT DELETING LEADING '0'.
* 'Cannot retrieve data for INVOIC IDoc &amp;amp; (Goods Receipt processing)'
      MESSAGE W030 WITH C_DOCNUM.
      CONTINUE.
    ELSE.
      CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'
          EXPORTING
            DOCUMENT_NUMBER         =  IEDIDC-DOCNUM
          IMPORTING
            IDOC_CONTROL            =  IEDIDC.
* If this is a change or modify IDoc, change status to 51 (error).
* One &amp;amp; only one K01 segment should exist -
      READ TABLE DATA_REC WITH KEY SEGNAM = 'E1EDK01'.
      IF SY-SUBRC IS INITIAL.
        MOVE DATA_REC-SDATA TO E1EDK01.
        CASE E1EDK01-ACTION.
          WHEN '000'.  "original data
* OK - do nothing
          WHEN '002'.  "modified data
* 'Invoice &amp;amp; - IDoc for Review Only'
            PERFORM IDOC_STATUS_UPDATE USING '51' '028'
                                             'Modification' ' '.
          WHEN '002'.  "modified data
* 'Invoice &amp;amp; - IDoc for Review Only'
            PERFORM IDOC_STATUS_UPDATE USING '51' '028'
                                             'Cancellation' ' '.
        ENDCASE.
      ENDIF.
      CHECK RC IS INITIAL.
* get the vendor no.
      CLEAR VENDOR_ID.
      LOOP AT DATA_REC WHERE SEGNAM = 'E1EDKA1'.
        MOVE DATA_REC-SDATA TO E1EDKA1.
        CHECK: E1EDKA1-PARVW = 'LF',
               E1EDKA1-PARTN CO ' 0123456789',
               E1EDKA1-PARTN &amp;lt;&amp;gt; ' '.
        N_VEND = E1EDKA1-PARTN.
        VENDOR_ID = N_VEND.
      ENDLOOP.
* if this is a new IDoc, check to make sure it even needs the GR test
      CLEAR GR_REQUIRED.
      LOOP AT DATA_REC WHERE SEGNAM = 'E1EDP02'.
        MOVE DATA_REC-SDATA TO E1EDP02.
        CHECK: E1EDP02-QUALF = '001',
               E1EDP02-BELNR &amp;lt;&amp;gt; ' ',
               E1EDP02-ZEILE &amp;lt;&amp;gt; ' '.
* Note that a missing PO number / line number is NOT an error here -
* the IDoc will error in the standard SAP processing in RBDAPP01
        SHIFT E1EDP02-BELNR LEFT DELETING LEADING '0'.
        CLEAR: PO_NUMBER, PO_LINENO.
        IF E1EDP02-BELNR CO ' 0123456789'.
          PO_NUMBER = E1EDP02-BELNR.
        ENDIF.
        IF E1EDP02-ZEILE CO ' 0123456789'.
          PO_LINENO = E1EDP02-ZEILE.
        ENDIF.
        SELECT SINGLE WEBRE FROM EKPO INTO GR_REQUIRED
            WHERE EBELN = PO_NUMBER
              AND EBELP = PO_LINENO.
        IF ( SY-SUBRC IS INITIAL AND GR_REQUIRED = 'X' ).
          EXIT.
        ENDIF.
      ENDLOOP.  "E1EDP02 segments
* if any line item on this invoice requires a goods receipt, continue
* receipt evaluation. Otherwise, status the IDoc to go to standard SAP
* processing. (Assumption is made that if an IDoc has status 66, the GR
* flag was turned "on" at some point and has since been removed.)
      IF GR_REQUIRED IS INITIAL.  "no goods receipt required
        IF IEDIDC-STATUS = '66'.
* 'Goods Receipt no longer required'
          PERFORM IDOC_STATUS_UPDATE USING '64' '026' ' ' ' '.
        ENDIF.
        CONTINUE. "next IDoc
      ENDIF.

* Should be only one K02, but loop just in case...
      LOOP AT DATA_REC WHERE SEGNAM = 'E1EDK02'.
        MOVE DATA_REC-SDATA TO E1EDK02.
        IF E1EDK02-QUALF = '009'.
* if an invoice already exists for this ref. no., give the IDoc
* an error status
          SELECT SINGLE BELNR FROM RBKP INTO RBKP-BELNR
            WHERE XBLNR = E1EDK02-BELNR(16)
              AND BLART = 'KR' "invoice
              AND STBLG = ' '. "no reversal
          IF SY-SUBRC IS INITIAL.
*'Invoice &amp;amp; already exists for ref.no. &amp;amp;'
            C_INVOIC = RBKP-BELNR.
            SHIFT C_INVOIC LEFT DELETING LEADING '0'.
            PERFORM IDOC_STATUS_UPDATE USING '51' '027'
                             C_INVOIC E1EDK02-BELNR(16).
            EXIT. "exit loop on data recs for this IDoc
          ENDIF.
          CLEAR: ITAB_GR, GR_QTY.
          REFRESH: ITAB_GR.
          SELECT A~MBLNR
                 B~BWART B~ERFMG
            INTO CORRESPONDING FIELDS OF TABLE ITAB_GR
              FROM MKPF AS A
                 INNER JOIN MSEG AS B
                    ON A~MBLNR = B~MBLNR
              WHERE A~VGART = 'WE' "goods receipt for PO
                AND A~BLART = 'WE' "goods receipt
                AND A~XBLNR = E1EDK02-BELNR(16).
          LOOP AT ITAB_GR.
            CASE ITAB_GR-BWART.
              WHEN '101'. "receipt
                GR_QTY = GR_QTY + ITAB_GR-ERFMG.
              WHEN '102'. "reversal
                GR_QTY = GR_QTY - ITAB_GR-ERFMG.
            ENDCASE.
          ENDLOOP.
* if no goods receipt
          IF GR_QTY &amp;lt;= 0.
           CASE IEDIDC-STATUS.
* if new IDoc, status to '66'
             WHEN '64'.
* 'Waiting for Goods Receipt'
               PERFORM IDOC_STATUS_UPDATE USING '66' '022' ' ' ' '.
* if reprocessed IDoc, check length of delay and status to 51
* (late receipt) if &amp;gt; 10 days.
             WHEN '66'.
               CLEAR LEAD_TIME.
               SELECT SINGLE PLIFZ FROM LFM1 INTO LEAD_TIME
                   WHERE LIFNR = VENDOR_ID
                     AND EKORG = '7100'.
               IF LEAD_TIME IS INITIAL.
                 LEAD_TIME = 10.
               ENDIF.
               TEST_DATE = IEDIDC-CREDAT + LEAD_TIME.
**TEST
**               if test_date &amp;gt; sy-datum.
**TEST
               IF TEST_DATE &amp;lt;= SY-DATUM.

* 'Goods Receipt Overdue'
                 PERFORM IDOC_STATUS_UPDATE USING '51' '024' ' ' ' '.
               ELSE.
* do nothing - IDoc stays in status 66 and gets tested for GR in next
* job run
               ENDIF.
            ENDCASE.
          ELSE. "goods receipt exists
* if this is a reprocess of an IDoc for which a goods receipt now
* exists, give the IDoc status 64, so it is processed by RBDAPP01
* in the next job step.
            IF IEDIDC-STATUS = '66'.
              C_MBLNR = MKPF-MBLNR.
              SHIFT C_MBLNR LEFT DELETING LEADING '0'.
* 'Goods Receipt found for ref.no. &amp;amp;'
              PERFORM IDOC_STATUS_UPDATE
                            USING '64' '023' E1EDK02-BELNR(16) ' '.
            ENDIF.
          ENDIF.
        ELSE.  "wrong K02 qualifier
* do nothing - IDoc will try to post and be handled manually
        ENDIF.  "QUALF='009'
      ENDLOOP.  "data_rec
    ENDIF.  "successful retrieval of IDoc data segments &amp;gt; data_rec

  ENDLOOP.  "iedidc

END-OF-SELECTION.

*-----------------------------------------------------------------------
*  FORM IDOC_STATUS_UPDATE
*  Creates status records for the selected IDocs.
*-----------------------------------------------------------------------
FORM IDOC_STATUS_UPDATE USING VALUE(I_STAT)
                              VALUE(I_MSGNO)
                              VALUE(I_MSGV1)
                              VALUE(I_MSGV2).
TABLES: EDI_DS, TEDE2.

DATA: MESS LIKE EDIMESSAGE.

DATA:
    L_COMMIT_COUNTER        LIKE EDIGLODATA-COMCOUNT VALUE '00000001',
    INBSYNC                 LIKE EDIGLODATA-INBSYNC,
    T_COUPLE_TO_PROCESS     LIKE EDIINBOUND OCCURS 0 WITH HEADER LINE.

  CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_PROCESS'
         EXPORTING
              DOCUMENT_NUMBER         = IEDIDC-DOCNUM
         IMPORTING
              IDOC_CONTROL            = IEDIDC
         EXCEPTIONS
              DOCUMENT_FOREIGN_LOCK   = 01
              DOCUMENT_NOT_EXIST      = 02
              DOCUMENT_NUMBER_INVALID = 03
              ERROR_MESSAGE           = 04
              OTHERS                  = 05.

  IF NOT SY-SUBRC IS INITIAL.
      C_DOCNUM = IEDIDC-DOCNUM.
      SHIFT C_DOCNUM LEFT DELETING LEADING '0'.
* 'Cannot open INVOIC IDoc &amp;amp; for Goods Receipt processing'
      MESSAGE W025 WITH C_DOCNUM.
      RC = 'X'.
      EXIT.
  ENDIF.

  CLEAR EDI_DS.
  EDI_DS-DOCNUM      = IEDIDC-DOCNUM.
  EDI_DS-STATUS      = I_STAT.
  EDI_DS-REPID       = 'ZS7BM000007'.
  EDI_DS-TABNAM      = 'EDI_DS'.
  EDI_DS-MANDT       = SY-MANDT.
  EDI_DS-STAMQU      = 'SAP'.
  EDI_DS-STAMID      = 'ZS7'.
  EDI_DS-STAMNO      = I_MSGNO.
  EDI_DS-STAPA1      = I_MSGV1.
  EDI_DS-STAPA2      = I_MSGV2.
  GET TIME.
  EDI_DS-LOGDAT      = SY-DATUM.
  EDI_DS-LOGTIM      = SY-UZEIT.

  CALL FUNCTION 'EDI_DOCUMENT_STATUS_SET'
    EXPORTING
      DOCUMENT_NUMBER               = IEDIDC-DOCNUM
      IDOC_STATUS                   = EDI_DS
    IMPORTING
      IDOC_CONTROL                  = IEDIDC
    EXCEPTIONS
      DOCUMENT_NUMBER_INVALID       = 1
      OTHER_FIELDS_INVALID          = 2
      STATUS_INVALID                = 3
      OTHERS                        = 4
            .
  IF NOT SY-SUBRC IS INITIAL.
    C_DOCNUM = IEDIDC-DOCNUM.
    SHIFT C_DOCNUM LEFT DELETING LEADING '0'.
* IDoc no. &amp;amp; failed status update to &amp;amp;
    MESSAGE W021 WITH C_DOCNUM I_STAT.
  ENDIF.

  CALL FUNCTION 'EDI_DOCUMENT_CLOSE_PROCESS'
        EXPORTING
          DOCUMENT_NUMBER     =  IEDIDC-DOCNUM.

  IF I_STAT = '51'.

      CLEAR: T_COUPLE_TO_PROCESS.
      REFRESH: T_COUPLE_TO_PROCESS.

      SELECT SINGLE * FROM TEDE2 INTO TEDE2
         WHERE EVCODE = 'INVL'.
      IF SY-SUBRC IS INITIAL.
        T_COUPLE_TO_PROCESS(16) = IEDIDC-DOCNUM.
        T_COUPLE_TO_PROCESS+16(138) = TEDE2.
        APPEND T_COUPLE_TO_PROCESS.

        PERFORM ANALYZING_EVENT_CREATE
                TABLES
                   T_COUPLE_TO_PROCESS
                USING
                   L_COMMIT_COUNTER
                   INBSYNC.
        IF SY-SUBRC IS INITIAL.

          MESS-MSGID = 'ZS7'.
          MESS-MSGTY = 'E'.
          MESS-MSGNO = I_MSGNO.
          MESS-MSGV1 = I_MSGV1.
          MESS-MSGV2 = I_MSGV2.
          CALL FUNCTION 'IDOC_ERROR_WORKFLOW_START'
            EXPORTING
              DOCNUM                        = 0
              EVENTCODE                     = 'EDIM'
              MESS                          = MESS
              STATUSMESS                    = MESS
            EXCEPTIONS
              NO_ENTRY_IN_TEDE5             = 1
              ERROR_IN_START_WORKFLOW       = 2
              OTHERS                        = 3.

          COMMIT WORK.
        ENDIF.  "link created
      ENDIF.  "tede2 found

  ENDIF.

* Set return code to stop further processing of this IDoc
  RC = 'X'.

ENDFORM.


*-----------------------------------------------------------------------
*  FORM ANALYZING_EVENT_CREATE
*  Creates link between IDoc and workflow container.
*  SAP code stolen from LEDINF01
*-----------------------------------------------------------------------
FORM ANALYZING_EVENT_CREATE
                TABLES
                   T_COUPLE_TO_PROCESS_IN  STRUCTURE EDIINBOUND
                USING
                   COMMIT_COUNTER_IN       LIKE      EDIGLODATA-COMCOUNT
                   START_RECFB_SYNCHRON_IN LIKE      EDIGLODATA-INBSYNC.
* local variables
  DATA:
* instance that is created
    L_OBJECT               TYPE SWC_OBJECT,
* object key, e.g IDoc number
    L_OBJECT_KEY           LIKE SWOTOBJID-OBJKEY,
* id of wf event
    L_EVENT_ID             LIKE SWEDUMEVID-EVTID,
* status record for case of error
    L_STATUS_RECORD        TYPE TIDOC_STATUS_RECORD_EXT,
* flag indicating whether subscribed task is started synchronously
    L_START_RECFB_SYNCHRON LIKE SWEFLAGS-SYNCFLAG VALUE ' ',
* idoc number (needed because of type checking)
    L_IDOC_NUMBER          LIKE EDIDC-DOCNUM.
* local constants
  CONSTANTS:
* object type 'IDOC'
    C_OBJECT_TYPE          LIKE SWETYPECOU-OBJTYPE VALUE 'IDOCINVOIC',
* name of event to be created
    C_IDC_EVT     LIKE SWETYPECOU-EVENT VALUE 'INPUTERROROCCURREDMM'
.

 IF T_COUPLE_TO_PROCESS_IN[] IS INITIAL.
    COMMIT WORK.
    CALL FUNCTION 'DEQUEUE_ALL'.
    CLEAR COMMIT_COUNTER_IN.
    EXIT.
  ENDIF.

* cast
  L_START_RECFB_SYNCHRON = START_RECFB_SYNCHRON_IN.
* declaration of container
  SWC_CONTAINER       L_T_EV_CONTAINER.
* initialize container
  SWC_CLEAR_CONTAINER L_T_EV_CONTAINER.

* dequeue all idocs at the same time
  LOOP AT T_COUPLE_TO_PROCESS_IN.
* cast
    L_IDOC_NUMBER = T_COUPLE_TO_PROCESS_IN(16).
    CALL FUNCTION 'EDI_DOCUMENT_DEQUEUE_LATER'
         EXPORTING
              DOCNUM = L_IDOC_NUMBER
         EXCEPTIONS
              OTHERS = 0.
  ENDLOOP.

* get first idoc number in table in order to create an object
  READ TABLE T_COUPLE_TO_PROCESS_IN INDEX 1.
* set object key in variable of correct type (casting)
  L_OBJECT_KEY = T_COUPLE_TO_PROCESS_IN(16).

* create an object, i.e. an IDoc
  SWC_CREATE_OBJECT L_OBJECT C_OBJECT_TYPE L_OBJECT_KEY.

* fill container: work item object id (idoc)
  SWC_SET_ELEMENT L_T_EV_CONTAINER     "EC *
                  C_ELEMENT_WI_OBJ_ID  "EC *
                  L_OBJECT.            "EC *
* fill container:  NumberPlusEventcode (table of couples)
  SWC_SET_TABLE L_T_EV_CONTAINER
                C_ELEMENT_NO_PLUS_INFO
                T_COUPLE_TO_PROCESS_IN.

* fire event that will trigger the idoc inbound processing
  CALL FUNCTION 'SWE_EVENT_CREATE'
       EXPORTING
            OBJTYPE              = C_OBJECT_TYPE
            OBJKEY               = L_OBJECT_KEY
            EVENT                = C_IDC_EVT
*           CREATOR              = ' '
*           START_WITH_DELAY     = ' '
            START_RECFB_SYNCHRON = L_START_RECFB_SYNCHRON
       IMPORTING
            EVENT_ID             = L_EVENT_ID
       TABLES
            EVENT_CONTAINER      = L_T_EV_CONTAINER
       EXCEPTIONS
            OBJTYPE_NOT_FOUND    = 1
            OTHERS               = 2.

  IF   ( SY-SUBRC &amp;lt;&amp;gt; 0 )
* event was not created =&amp;gt; error handling for this idoc (EDIM)
    OR ( L_EVENT_ID = 0 ).
* stop processing, no commit
    MESSAGE ID      'E0'
            TYPE    'A'
            NUMBER  '374'
            WITH    L_STATUS_RECORD-DOCNUM
                    C_IDC_EVT
            RAISING EVENT_CREATE_FAILED.
  ELSE.
* do commit and reset counter
* the commit will get the idocs to the database and at the same time
* activate the event that was created
    COMMIT WORK.
* dequeue all unprocessed IDocs to avoid log-overflow
    CALL FUNCTION 'DEQUEUE_ALL'.
    CLEAR COMMIT_COUNTER_IN.
* reset table of idocs that need to be processed
    CLEAR   T_COUPLE_TO_PROCESS_IN.
    REFRESH T_COUPLE_TO_PROCESS_IN.
  ENDIF.

ENDFORM.                               " ANALYZING_EVENT_CREATE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;Lakshmiraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:34:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598032#M866490</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-01T07:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598033#M866491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,Really your answer would be helpful.Think u can understand my requirement.In my report The output needs to show: &lt;/P&gt;&lt;P&gt;Vendor &lt;/P&gt;&lt;P&gt;Inbound iDoc Number &lt;/P&gt;&lt;P&gt;iDoc Date &lt;/P&gt;&lt;P&gt;iDoc Status: 51 or 68 &lt;/P&gt;&lt;P&gt;PO Number &lt;/P&gt;&lt;P&gt;Invoice Number &lt;/P&gt;&lt;P&gt;Invoice date &lt;/P&gt;&lt;P&gt;Invoice Amount &lt;/P&gt;&lt;P&gt;Error Message: For multiple errors on a single iDoc, multiple records should be shown.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 07:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598033#M866491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T07:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598034#M866492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usage of CASE is preferred to READ, when considering performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, usage of the Read Statement is given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IDOC_CONTROL WITH KEY STATUS = 57 OR 68.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 08:18:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598034#M866492</guid>
      <dc:creator>arunkumar_yerram</dc:creator>
      <dc:date>2008-04-01T08:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598035#M866493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi if i give that syntax it is showing the syntax error as "= ..." expected after "OR".how to code using if.for both the status same action only should be performed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 09:25:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598035#M866493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T09:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:IDOCS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598036#M866494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi for fetching the vendor details i used ur code.I get a error in  line E1EDKA1-PARTN  ' '. as Unable to interpret "' '". Possible causes of error: Incorrect spellingor comma error.whats the error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 07:08:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-idocs/m-p/3598036#M866494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T07:08:36Z</dc:date>
    </item>
  </channel>
</rss>

