<?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: Problem with IDOC_OUTPUT_ORDERS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745538#M638170</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;already i have suggested to change the code,did u chek that..anyways once again do like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'V1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of  'E0' use V1  for sales,as V1 is the application area for sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2007 07:46:26 GMT</pubDate>
    <dc:creator>former_member404244</dc:creator>
    <dc:date>2007-09-11T07:46:26Z</dc:date>
    <item>
      <title>Problem with IDOC_OUTPUT_ORDERS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745537#M638169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement calls for all previous sales documents where an outbound IDOC were successfully generated be resent.  The steps that I did are the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form read_data.

  CLEAR i_nast[].

  SELECT *
  INTO CORRESPONDING FIELDS OF TABLE i_nast
  FROM       NAST AS a
  INNER JOIN VBAK AS b ON b~vbeln = a~objky
  WHERE b~vbeln  IN s_vbeln
    AND b~erdat  IN s_erdat
    AND a~kappl  EQ 'V1'
    AND a~kschl  EQ 'ZALE'
    AND a~vstat  EQ '1'.

endform.                    " read_data

*==============================================

form process_data.
  DATA v_idoc       TYPE edidc-docnum.
  DATA i_edidd      TYPE TABLE OF edidd.
  DATA wa_idoc_ctrl TYPE edidc.

  LOOP AT i_nast INTO wa_nast.
    CLEAR i_msgs[].
    CALL FUNCTION 'WFMC_PROTOCOL_GET'
      EXPORTING
        cps_nast        = wa_nast
      tables
        messages        = i_msgs
     EXCEPTIONS
       NOT_FOUND       = 1
       OTHERS          = 2.

    LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'E0'.
*--- Check first if there is an IDOC
      IF wa_msgs-msgv1 IS INITIAL.
        CONTINUE.
      ENDIF.

      v_idoc = wa_msgs-msgv1.

      CLEAR i_edidd[].
      CLEAR wa_idoc_ctrl.

      CALL FUNCTION 'IDOC_READ_COMPLETELY'
        EXPORTING
          document_number                = v_idoc
        IMPORTING
          IDOC_CONTROL                   = wa_idoc_ctrl
*         NUMBER_OF_DATA_RECORDS         =
*         NUMBER_OF_STATUS_RECORDS       =
        TABLES
*         INT_EDIDS                      =
          INT_EDIDD                      = i_edidd
        EXCEPTIONS
*         DOCUMENT_NOT_EXIST             = 1
*         DOCUMENT_NUMBER_INVALID        = 2
          OTHERS                         = 3.

      BREAK CAFL1EXT.
      CALL FUNCTION 'IDOC_OUTPUT_ORDERS'
        EXPORTING
          object                              = wa_nast
          control_record_in                   = wa_idoc_ctrl
*       IMPORTING
*         OBJECT_TYPE                         =
*         CONTROL_RECORD_OUT                  =
        tables
          int_edidd                           = i_edidd
        EXCEPTIONS
          ERROR_MESSAGE_RECEIVED              = 1
          DATA_NOT_RELEVANT_FOR_SENDING       = 2
          OTHERS                              = 3
                .
      IF sy-subrc &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      COMMIT WORK.

    ENDLOOP.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem I keep encountering is that when I finally pass the necessary data to IDOC_OUTPUT_ORDERS, it keeps checking the sales document I passed against table EKKO, which is the table for PO's.  Is this the correct fm to use?  If yes, is there some additional data that I should change or watch, like the message type, etc.?  Points for every useful answer.  Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 07:42:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745537#M638169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T07:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IDOC_OUTPUT_ORDERS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745538#M638170</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;already i have suggested to change the code,did u chek that..anyways once again do like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'V1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of  'E0' use V1  for sales,as V1 is the application area for sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 07:46:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745538#M638170</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-09-11T07:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IDOC_OUTPUT_ORDERS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745539#M638171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagaraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this actually, but I'm not getting anything.  In my testing data I have around 130 possible entries, but all of them only have E0, no V1. &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other thoughts on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 07:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745539#M638171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-11T07:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IDOC_OUTPUT_ORDERS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745540#M638172</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;since u want sales order ....u have to specify the application area,then only it will recognise whetehr its related to sales or purchase.Usually we for purchase it starts with E&lt;STRONG&gt;,but for sales it is V&lt;/STRONG&gt;..thats why i told u to go for V1 forsales,V2 for shipping and V3 for invoice like this.also check what are the messages u r getting in the internal table i_msgs..whether u r getting V1 or not..If u get V1 then i think u can change the code and change the test data by changing from 'E0' to 'V1' and then can check....i hope u might get some idea on this..please try my friend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2007 08:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-idoc-output-orders/m-p/2745540#M638172</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-09-11T08:03:16Z</dc:date>
    </item>
  </channel>
</rss>

