<?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: uploading the sales order using BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995119#M405525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what if i want to  enter characteristics values? what should i put in ORDER_CFGS_VALUE? and where can i get the data? thnx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jul 2007 03:02:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-18T03:02:30Z</dc:date>
    <item>
      <title>uploading the sales order using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995116#M405522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt; i want to upload the sales order using BAPI.&lt;/P&gt;&lt;P&gt;can you provide the FM.&lt;/P&gt;&lt;P&gt;it will be much helpful if i have the sample code........&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 06:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995116#M405522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T06:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: uploading the sales order using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995117#M405523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shyam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use BAPI : BAPI_SALESORDER_CREATEFROMDAT2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZZBAPI_TEST1 .

*===========================================================
*** Start of selection
*===========================================================
START-OF-SELECTION.

* test of sales order with BAPI
PERFORM SALES_ORDER_BAPI.


*================ End of main program ======================

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form SALES_ORDER_BAPI
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM SALES_ORDER_BAPI.
DATA : SD_HEADER LIKE BAPISDHEAD.

DATA : BEGIN OF ITEMIN_IT OCCURS 1.
INCLUDE STRUCTURE BAPIITEMIN.
DATA : END OF ITEMIN_IT.

DATA : BEGIN OF PARTNR_IT OCCURS 1.
INCLUDE STRUCTURE BAPIPARTNR.
DATA : END OF PARTNR_IT.

DATA : WK_SD_DOCNO LIKE VBAK-VBELN.

DATA: WK_RETURN LIKE BAPIRETURN.

CLEAR : SD_HEADER , ITEMIN_IT , PARTNR_IT.

SD_HEADER-DOC_TYPE = 'TA'.
SD_HEADER-SALES_ORG = '1793'.
SD_HEADER-DISTR_CHAN = '01'.
SD_HEADER-DIVISION = '01'.
SD_HEADER-PURCH_NO = 'Test'.

* itemin_it-hg_lv_item = '10'.
ITEMIN_IT-MATERIAL = '000000000000001143'.
ITEMIN_IT-PLANT = '3018'.
ITEMIN_IT-REQ_QTY = '1'.
ITEMIN_IT-SALES_UNIT = 'CS'.
APPEND ITEMIN_IT.

* itemin_it-hg_lv_item = '20'.
ITEMIN_IT-MATERIAL = '000000000000000848'.
ITEMIN_IT-PLANT = '3018'.
ITEMIN_IT-REQ_QTY = '1'.
ITEMIN_IT-SALES_UNIT = 'KG'.
APPEND ITEMIN_IT.

* itemin_it-hg_lv_item = '30'.
ITEMIN_IT-MATERIAL = '000000000000000848'.
ITEMIN_IT-PLANT = '3018'.
ITEMIN_IT-REQ_QTY = '1'.
ITEMIN_IT-SALES_UNIT = 'EA'.
APPEND ITEMIN_IT.


LOOP AT ITEMIN_IT.
WRITE : / SY-TABIX , ITEMIN_IT-MATERIAL , ITEMIN_IT-PLANT
, ITEMIN_IT-REQ_QTY , ITEMIN_IT-SALES_UNIT.
ENDLOOP.


CLEAR : PARTNR_IT.
PARTNR_IT-PARTN_ROLE = TEXT-001.
PARTNR_IT-PARTN_NUMB = '0000000004'.
APPEND PARTNR_IT.
CLEAR : PARTNR_IT.

PARTNR_IT-PARTN_ROLE = 'WE'.
PARTNR_IT-PARTN_NUMB = '0000000051'.
APPEND PARTNR_IT.

LOOP AT PARTNR_IT.
WRITE : / SY-TABIX , PARTNR_IT-PARTN_ROLE , PARTNR_IT-PARTN_NUMB.
ENDLOOP.

CLEAR : ITEMIN_IT , PARTNR_IT , WK_RETURN..

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDATA'
EXPORTING
ORDER_HEADER_IN = SD_HEADER
IMPORTING
SALESDOCUMENT = WK_SD_DOCNO
* SOLD_TO_PARTY =
* SHIP_TO_PARTY =
* BILLING_PARTY =
RETURN = WK_RETURN
TABLES
ORDER_ITEMS_IN = ITEMIN_IT
ORDER_PARTNERS = PARTNR_IT
* ORDER_ITEMS_OUT =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CCARD =
EXCEPTIONS
OTHERS = 1.

WRITE : / 'sy-subrc = ' , SY-SUBRC.

IF NOT WK_SD_DOCNO IS INITIAL.
WRITE : / WK_SD_DOCNO , 'registerd'.
ELSE.
WRITE : / 'incorrect'.
WRITE : / WK_RETURN-TYPE , WK_RETURN-CODE , WK_RETURN-MESSAGE.
WRITE : / WK_RETURN-LOG_NO, WK_RETURN-LOG_MSG_NO,
WK_RETURN-MESSAGE_V1.
ENDIF.

ENDFORM. " SALES_ORDER_BAPI
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kapadia&lt;/P&gt;&lt;P&gt;***&lt;STRONG&gt;Assigning points is the way to say thanks in SDN.&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Mr Kapadia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 06:39:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995117#M405523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T06:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: uploading the sales order using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995118#M405524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for your sample code.&lt;/P&gt;&lt;P&gt;but if  i have the flat file(notepad or excel) how to upload the data using BAPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 06:58:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995118#M405524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T06:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: uploading the sales order using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995119#M405525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what if i want to  enter characteristics values? what should i put in ORDER_CFGS_VALUE? and where can i get the data? thnx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 03:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-the-sales-order-using-bapi/m-p/1995119#M405525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-18T03:02:30Z</dc:date>
    </item>
  </channel>
</rss>

