<?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: Enter Document Number error with BAPI_SALESORDER_CHANGE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555159#M1430287</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
         EXPORTING
           SALESDOCUMENT                = V_SO_VBELN
           ORDER_HEADER_IN              = K_HEADER_CH
           ORDER_HEADER_INX             = K_HEADER_CH_INX
         TABLES
            RETURN                      = I_RETURN
            ORDER_ITEM_IN               = I_ITEMS
            ORDER_ITEM_INX              = I_ITEM_INX
            SCHEDULE_LINES              = I_SCHEDULES
            SCHEDULE_LINESX             = I_SCHEDULES_INX
            CONDITIONS_IN               = I_ORDER_CONDITIONS_IN
            CONDITIONS_INX              = I_ORDER_COND_IN_INX.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT   = '2'
        IMPORTING
          RETURN = K_RETURN.
  ENDIF.
  ENDIF.
 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2010 07:11:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-29T07:11:54Z</dc:date>
    <item>
      <title>Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555157#M1430285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we try to change the Sales Order using BAPI_SALESORDER_CHANGE, the return table is throwing an error called "Enter Document Number'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have validate all the entered parameters. I believe all values are correct.. Still facing this strange error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me out...???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is used as folows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*---Get Sales Order number, GL_ACCOUNT  and sequential number.
    SELECT SINGLE VBELN FROM VBAK
                INTO V_SO_VBELN
                WHERE BSTNK EQ V_PO_EBELN.

*---Get the Document type, Sales Org, Distribution chan and Division.
     SELECT SINGLE AUART VKORG VTWEG SPART
                   FROM VBAK
                  INTO (V_AUART,V_VKORG,V_VTWEG,V_SPART)
                   WHERE VBELN EQ V_SO_VBELN.
   K_HEADER_CH-COLLECT_NO = V_SO_VBELN.
      K_HEADER_CH-SALES_ORG  = V_VKORG.                           "To be decided
      K_HEADER_CH-DISTR_CHAN = V_VTWEG.                           "C_30
      K_HEADER_CH-DIVISION   = V_SPART.                           "To be decided


*---Fill Sales Order header box details.
      K_HEADER_CH_INX-COLLECT_NO     = C_X.
      K_HEADER_CH_INX-SALES_ORG      = C_X.
      K_HEADER_CH_INX-DISTR_CHAN     = C_X.
      K_HEADER_CH_INX-DIVISION       = C_X.
      K_HEADER_CH_INX-UPDATEFLAG     = C_U. "U

*---Fill Item details based on Purchase Order Items.
      LOOP AT I_VBAP.

*---Get condition number.
        CLEAR:V_KNUMV,V_KBETR, V_WAERS.
        SELECT SINGLE KNUMV FROM EKKO INTO V_KNUMV WHERE EBELN = V_PO_EBELN.

        IF SY-SUBRC EQ 0.
*---Get the Condition value from Purchanse order.
          SELECT SINGLE KBETR WAERS INTO (V_KBETR, V_WAERS)
                               FROM KONV
                              WHERE KNUMV  = V_KNUMV
                               AND  KPOSN  = I_VBAP-POSNR.
          IF SY-SUBRC NE 0.
            CLEAR :V_KBETR, V_WAERS.
          ENDIF.
        ENDIF.
*---Fill the Fields: Sales and Distribution Document Item
        I_ITEMS-ITM_NUMBER = I_VBAP-POSNR.
        I_ITEMS-MATERIAL   = I_VBAP-MATNR.
        I_ITEMS-PLANT      = C_H003.                        "H003
        I_ITEMS-TARGET_QTY = I_VBAP-KWMENG.
        I_ITEMS-PROFIT_CTR = I_VBAP-PRCTR.
        APPEND I_ITEMS.
        CLEAR I_ITEMS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pavan Sanganal on Jan 29, 2010 12:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 06:57:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555157#M1430285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T06:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555158#M1430286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;I_ITEM_INX-ITM_NUMBER = I_VBAP-POSNR.
        I_ITEM_INX-MATERIAL   = C_X.
        I_ITEM_INX-PLANT      = C_X.
        I_ITEM_INX-TARGET_QTY = C_X.
        I_ITEM_INX-PROFIT_CTR = C_X.
        I_ITEM_INX-UPDATEFLAG = I_VBAP-UPDKZ.

        APPEND I_ITEM_INX.
        CLEAR I_ITEM_INX.
        I_SCHEDULES-ITM_NUMBER = I_VBAP-POSNR.
        I_SCHEDULES-SCHED_LINE = C_0001.                     "0001.
        I_SCHEDULES-REQ_QTY    = I_VBAP-KWMENG.

        APPEND I_SCHEDULES.
        CLEAR  I_SCHEDULES.

*---Fill Checkbox List for Maintaining Sales Document Schedule Line.
        I_SCHEDULES_INX-ITM_NUMBER  = I_VBAP-POSNR.
        I_SCHEDULES_INX-SCHED_LINE  = C_0001.
        I_SCHEDULES_INX-REQ_QTY     = C_X.
        I_SCHEDULES_INX-UPDATEFLAG  = I_VBAP-UPDKZ.

      APPEND I_SCHEDULES_INX.
      CLEAR  I_SCHEDULES_INX.

        I_ORDER_CONDITIONS_IN-ITM_NUMBER = I_VBAP-POSNR.
        I_ORDER_CONDITIONS_IN-COND_TYPE  = C_ZPR0.
        I_ORDER_CONDITIONS_IN-COND_VALUE = V_KBETR * C_DEC9.     "Make the 2 decimals
        I_ORDER_CONDITIONS_IN-CURRENCY  =  V_WAERS.
*        I_ORDER_CONDITIONS_IN-CURRENCY_2 = V_WAERS.

        APPEND I_ORDER_CONDITIONS_IN.
        CLEAR I_ORDER_CONDITIONS_IN.

*---Fill the Communication Fields for Maintaining Conditions in the Order.
        I_ORDER_COND_IN_INX-ITM_NUMBER = I_VBAP-POSNR.
        I_ORDER_COND_IN_INX-COND_ST_NO = C_010.
        I_ORDER_COND_IN_INX-COND_COUNT = C_01.
        I_ORDER_COND_IN_INX-COND_TYPE  = C_ZPR0.
        I_ORDER_COND_IN_INX-COND_VALUE = C_X.
        I_ORDER_COND_IN_INX-CURRENCY   = C_X.
        I_ORDER_COND_IN_INX-UPDATEFLAG = I_VBAP-UPDKZ.

        APPEND I_ORDER_COND_IN_INX .
        CLEAR I_ORDER_COND_IN_INX.

      ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 07:11:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555158#M1430286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T07:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555159#M1430287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
         EXPORTING
           SALESDOCUMENT                = V_SO_VBELN
           ORDER_HEADER_IN              = K_HEADER_CH
           ORDER_HEADER_INX             = K_HEADER_CH_INX
         TABLES
            RETURN                      = I_RETURN
            ORDER_ITEM_IN               = I_ITEMS
            ORDER_ITEM_INX              = I_ITEM_INX
            SCHEDULE_LINES              = I_SCHEDULES
            SCHEDULE_LINESX             = I_SCHEDULES_INX
            CONDITIONS_IN               = I_ORDER_CONDITIONS_IN
            CONDITIONS_INX              = I_ORDER_COND_IN_INX.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT   = '2'
        IMPORTING
          RETURN = K_RETURN.
  ENDIF.
  ENDIF.
 ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 07:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555159#M1430287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T07:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555160#M1430288</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;  Try to debug the BAPI_SALESORDER_CHANGE. In the BAPI return table u ll get the message class. Go to se91 enter the message class and display. Select ur message and do where used list on the message. U ll get the exact location. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 07:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555160#M1430288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T07:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555161#M1430289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if this helps :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="7736626"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 07:31:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555161#M1430289</guid>
      <dc:creator>former_member206377</dc:creator>
      <dc:date>2010-01-29T07:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555162#M1430290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 08:45:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555162#M1430290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-19T08:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555163#M1430291</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;Please refer to post &lt;A _jive_internal="true" href="https://answers.sap.com/message/14101351#14101351"&gt;http://scn.sap.com/message/14101351#14101351&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joseph M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 03:22:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555163#M1430291</guid>
      <dc:creator>joseph_manjiyil</dc:creator>
      <dc:date>2013-06-05T03:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Enter Document Number error with BAPI_SALESORDER_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555164#M1430292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 18:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-document-number-error-with-bapi-salesorder-change/m-p/6555164#M1430292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-02-27T18:53:39Z</dc:date>
    </item>
  </channel>
</rss>

