<?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: BDC for Sales order using multiple line items in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381931#M528776</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'd suggest to consider of using BAPI FM BAPI_SALESORDER_CREATEFROMDAT2, where you can handle multiple line items easily and it has a better performance and control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jun 2007 12:14:07 GMT</pubDate>
    <dc:creator>Peter_Inotai</dc:creator>
    <dc:date>2007-06-07T12:14:07Z</dc:date>
    <item>
      <title>BDC for Sales order using multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381930#M528775</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;I am working on BDC for sales order creation using VA01.&lt;/P&gt;&lt;P&gt;how to manage Header level and Item level in program?&lt;/P&gt;&lt;P&gt;how to write a code for multiple line item for single or multiple sales oder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 12:11:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381930#M528775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-07T12:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: BDC for Sales order using multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381931#M528776</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'd suggest to consider of using BAPI FM BAPI_SALESORDER_CREATEFROMDAT2, where you can handle multiple line items easily and it has a better performance and control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 12:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381931#M528776</guid>
      <dc:creator>Peter_Inotai</dc:creator>
      <dc:date>2007-06-07T12:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: BDC for Sales order using multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381932#M528777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the example program and i did for purchase order change and it has multiple line items..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zpochange.&lt;/P&gt;&lt;P&gt;data : i_error like bdcmsgcoll occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data : i_bdcdata like bdcdata occurs 0 with header line.&lt;/P&gt;&lt;P&gt;tables : ekko, ekpo.&lt;/P&gt;&lt;P&gt;data :c1(10) value 'ME22',&lt;/P&gt;&lt;P&gt;      c2(1) value ',',c3(10).&lt;/P&gt;&lt;P&gt;data : var1(20). " LIKE EKKO-EBELN.&lt;/P&gt;&lt;P&gt;data : var2 like ekko-ebeln.&lt;/P&gt;&lt;P&gt; data : begin of i_ekko occurs 0,&lt;/P&gt;&lt;P&gt;          header(2),&lt;/P&gt;&lt;P&gt;          ebeln like ekko-ebeln,&lt;/P&gt;&lt;P&gt;          end of i_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of i_ekpo occurs 0,&lt;/P&gt;&lt;P&gt;item(2),&lt;/P&gt;&lt;P&gt;        ebeln like ekpo-ebeln,&lt;/P&gt;&lt;P&gt;        ebelp like ekpo-ebelp,&lt;/P&gt;&lt;P&gt;        menge(10), " LIKE EKPO-MENGE,&lt;/P&gt;&lt;P&gt;       end of i_ekpo.&lt;/P&gt;&lt;P&gt;data : v like ekpo-ebelp.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         text(300),&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;parameters: p_file like ibipparms-path.&lt;/P&gt;&lt;P&gt;*PARAMETERS: PONUMBER LIKE EKPO-EBELN.&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_file.&lt;/P&gt;&lt;P&gt; call function 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;    program_name        = syst-cprog&lt;/P&gt;&lt;P&gt;    dynpro_number       = syst-dynnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   FIELD_NAME          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  importing&lt;/P&gt;&lt;P&gt;    file_name           = p_file&lt;/P&gt;&lt;P&gt;           .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      SELECT EBELN EBELP MENGE FROM EKPO INTO TABLE I_EKPO WHERE EBELN&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*= PONUMBER.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;perform get_data.&lt;/P&gt;&lt;P&gt;*LOOP AT ITAB.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; ITAB.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;var1 = itab-text+0(1).&lt;/P&gt;&lt;P&gt;if var1 = 'H'.&lt;/P&gt;&lt;P&gt;*I_EKKO-EBELN = ITAB-TEXT.&lt;/P&gt;&lt;P&gt;split itab at c2 into i_ekko-header&lt;/P&gt;&lt;P&gt;                       i_ekko-ebeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SPLIT  ITAB AT ',' INTO I_EKKO-EBELN.&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;                    " I_EKPO-EBELP&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;                    " I_EKPO-MENGE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;                    " var1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;append i_ekko.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt; split itab at c2 into i_ekpo-item&lt;/P&gt;&lt;P&gt;                        i_ekpo-ebeln&lt;/P&gt;&lt;P&gt;                        i_ekpo-ebelp&lt;/P&gt;&lt;P&gt;                        i_ekpo-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append i_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*var2 = i_ekpo-ebeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MOVE VAR1 TO I_EKPO-EBELN.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MOVE VAR1 TO I_EKKO-EBELN.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;APPEND: I_EKPO.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*if not var1 is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    split var1 at ',' into i_ekpo-ebelp&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                           i_ekpo-menge.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  i_ekpo-ebeln = var2.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; append i_ekpo.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_ekpo.&lt;/P&gt;&lt;P&gt; write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; i_ekpo.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;loop at i_ekko.&lt;/P&gt;&lt;P&gt;perform fill_data. " TABLES I_EKPO.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOOP AT I_EKPO.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; I_EKPO.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  GET_DATA&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LOOP AT I_ERROR.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; I_ERROR.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form get_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'WS_UPLOAD'&lt;/P&gt;&lt;P&gt; exporting&lt;/P&gt;&lt;P&gt;   codepage                      = ' '&lt;/P&gt;&lt;P&gt;   filename                      = p_file&lt;/P&gt;&lt;P&gt;   filetype                      = 'ASC'&lt;/P&gt;&lt;P&gt;   headlen                       = ' '&lt;/P&gt;&lt;P&gt;   line_exit                     = ' '&lt;/P&gt;&lt;P&gt;   trunclen                      = ' '&lt;/P&gt;&lt;P&gt;   user_form                     = ' '&lt;/P&gt;&lt;P&gt;   user_prog                     = ' '&lt;/P&gt;&lt;P&gt;   dat_d_format                  = ' '&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILELENGTH                    =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    data_tab                      = itab&lt;/P&gt;&lt;P&gt; exceptions&lt;/P&gt;&lt;P&gt;   conversion_error              = 1&lt;/P&gt;&lt;P&gt;   file_open_error               = 2&lt;/P&gt;&lt;P&gt;   file_read_error               = 3&lt;/P&gt;&lt;P&gt;   invalid_type                  = 4&lt;/P&gt;&lt;P&gt;   no_batch                      = 5&lt;/P&gt;&lt;P&gt;   unknown_error                 = 6&lt;/P&gt;&lt;P&gt;   invalid_table_width           = 7&lt;/P&gt;&lt;P&gt;   gui_refuse_filetransfer       = 8&lt;/P&gt;&lt;P&gt;   customer_error                = 9&lt;/P&gt;&lt;P&gt;   others                        = 10&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " GET_DATA&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  FILL_DATA&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_I_EKPO  text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form fill_data. " tables   i_ekpo .&lt;/P&gt;&lt;P&gt;perform bdcscreen using 'SAPMM06E' '0105'.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'RM06E-BSTNR' i_ekko-ebeln.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_OKCODE' '/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_ekpo where ebeln = i_ekko-ebeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  V = I_EKPO-EBELP.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform bdcscreen using 'SAPMM06E' 0120.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_CURSOR' 'RM06E-EBELP'.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_OKCODE' '/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdcscreen using 'SAPMM06E' 0120.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_CURSOR' 'EKPO-MENGE(01)'.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'RM06E-EBELP' i_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'EKPO-MENGE(01)' i_ekpo-menge.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_OKCODE' '/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*PERFORM BDCSCREEN USING 'SAPMM06E' 0120.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*PERFORM BDCFIELD USING 'BDC_CURSOR'  'RMO6E-EBELP'.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CLEAR V.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;perform bdcfield using 'BDC_OKCODE' '=BU'.&lt;/P&gt;&lt;P&gt; call transaction  c1 using i_bdcdata mode 'A'&lt;/P&gt;&lt;P&gt;                                   messages into i_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh i_bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " FILL_DATA&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BDCSCREEN&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_0140   text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_0120   text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form bdcscreen using    p_program p_screen.&lt;/P&gt;&lt;P&gt;i_bdcdata-program = p_program.&lt;/P&gt;&lt;P&gt;i_bdcdata-dynpro = p_screen.&lt;/P&gt;&lt;P&gt;i_bdcdata-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;append i_bdcdata.&lt;/P&gt;&lt;P&gt;clear i_bdcdata.&lt;/P&gt;&lt;P&gt;endform.                    " BDCSCREEN&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BDCFIELD&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_0145   text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     --&amp;gt;P_I_EKPO_EBELN  text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form bdcfield using    fnam fval.&lt;/P&gt;&lt;P&gt;i_bdcdata-fnam = fnam.&lt;/P&gt;&lt;P&gt;i_bdcdata-fval = fval.&lt;/P&gt;&lt;P&gt;append i_bdcdata.&lt;/P&gt;&lt;P&gt;clear i_bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " BDCFIELD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even va01 is also same logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if it is helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2007 12:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381932#M528777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-07T12:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: BDC for Sales order using multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381933#M528778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Seshu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did my BDC Program for Sales Order Creation.&lt;/P&gt;&lt;P&gt;i used two Inernal tables &amp;amp; loops . one for  Header and another for Item level.&lt;/P&gt;&lt;P&gt;when i try to upload file , it upload Header data but it gives an error while uploading file for item level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  /ZSALESORDER_BDC                .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;        AUART LIKE VBAK-AUART,&lt;/P&gt;&lt;P&gt;        VKORG LIKE VBAK-VKORG,&lt;/P&gt;&lt;P&gt;        VTWEG LIKE VBAK-VTWEG,&lt;/P&gt;&lt;P&gt;        SPART LIKE VBAK-SPART,&lt;/P&gt;&lt;P&gt;        BSTKD LIKE VBKD-BSTKD,&lt;/P&gt;&lt;P&gt;        BSTDK LIKE VBAK-BSTDK,&lt;/P&gt;&lt;P&gt;        KUNNR LIKE KUAGV-KUNNR,&lt;/P&gt;&lt;P&gt;        KUNNR1 LIKE KUWEV-KUNNR,&lt;/P&gt;&lt;P&gt;        KETDAT LIKE RV45A-KETDAT,&lt;/P&gt;&lt;P&gt;        KPRGBZ LIKE RV45A-KPRGBZ,&lt;/P&gt;&lt;P&gt;        DWERK LIKE T001W-WERKS,&lt;/P&gt;&lt;P&gt;        PRSDT LIKE VBKD-PRSDT,&lt;/P&gt;&lt;P&gt;       END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB_ITEM OCCURS 0,&lt;/P&gt;&lt;P&gt;        COUNT(5) TYPE P,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MABNR LIKE RV45A-MABNR,&lt;/P&gt;&lt;P&gt;        KWMENG LIKE RV45A-KWMENG,&lt;/P&gt;&lt;P&gt;      END OF ITAB_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CALLING FUNCTION FOR UPLOADING HEADER DATA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    FILENAME                      = 'C:\SALESORDER\HEADER.TXT'&lt;/P&gt;&lt;P&gt;   FILETYPE                      = 'ASC'&lt;/P&gt;&lt;P&gt;   HAS_FIELD_SEPARATOR           = '#'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    DATA_TAB                      = ITAB.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FUNCTION FOR UPLOADING DATA FOR ITEMS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    FILENAME                      = 'C:\SALESORDER\ITEM.TXT'&lt;/P&gt;&lt;P&gt;   FILETYPE                      = 'ASC'&lt;/P&gt;&lt;P&gt;   HAS_FIELD_SEPARATOR           = '#'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    DATA_TAB                      = ITAB_ITEM.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPMV45A' '0101'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'VBAK-SPART'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBAK-AUART'&lt;/P&gt;&lt;P&gt;                               ITAB-AUART.   "'zosd'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBAK-VKORG'&lt;/P&gt;&lt;P&gt;                              ITAB-VKORG.   "'expo'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBAK-VTWEG'&lt;/P&gt;&lt;P&gt;                               ITAB-VTWEG.   "'si'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBAK-SPART'&lt;/P&gt;&lt;P&gt;                               ITAB-SPART.   "'em'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPMV45A' '4001'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-BSTKD'&lt;/P&gt;&lt;P&gt;                              ITAB-BSTKD.  "'4500000100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-BSTDK'&lt;/P&gt;&lt;P&gt;                              ITAB-BSTDK.  "'01.04.2007'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'KUAGV-KUNNR'&lt;/P&gt;&lt;P&gt;                              ITAB-KUNNR.  "'300161'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'KUWEV-KUNNR'&lt;/P&gt;&lt;P&gt;                              ITAB-KUNNR1.  "'TV(TEVA)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KETDAT'&lt;/P&gt;&lt;P&gt;                              ITAB-KETDAT.  "'08.06.2007'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KPRGBZ'&lt;/P&gt;&lt;P&gt;                              ITAB-KPRGBZ.  "'D'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-DWERK'&lt;/P&gt;&lt;P&gt;                              ITAB-DWERK.  "'ep04'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-PRSDT'&lt;/P&gt;&lt;P&gt;                              ITAB-PRSDT.  "'08.06.2007'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RV45A-KWMENG(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-MABNR(01)'&lt;/P&gt;&lt;P&gt;                              ITAB_ITEM-MABNR.  "'420001245'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-MABNR(02)'&lt;/P&gt;&lt;P&gt;                              '420001252'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KWMENG(01)'&lt;/P&gt;&lt;P&gt;                              ITAB_ITEM-KWMENG.  "'               1000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KWMENG(02)'&lt;/P&gt;&lt;P&gt;                              '             10,000'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPMV45A' '4001'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SICH'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-BSTKD'&lt;/P&gt;&lt;P&gt;                              '4500000100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-BSTDK'&lt;/P&gt;&lt;P&gt;                              '01.04.2007'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'KUAGV-KUNNR'&lt;/P&gt;&lt;P&gt;                              '300161'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'KUWEV-KUNNR'&lt;/P&gt;&lt;P&gt;                              'TV(TEVA)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KETDAT'&lt;/P&gt;&lt;P&gt;                              '08.06.2007'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-KPRGBZ'&lt;/P&gt;&lt;P&gt;                              'D'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RV45A-DWERK'&lt;/P&gt;&lt;P&gt;                              'EP04'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-PRSDT'&lt;/P&gt;&lt;P&gt;                              '08.06.2007'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-ZTERM'&lt;/P&gt;&lt;P&gt;                              'Z002'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-INCO1'&lt;/P&gt;&lt;P&gt;                              'FOR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'VBKD-INCO2'&lt;/P&gt;&lt;P&gt;                              'Pune'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RV45A-MABNR(02)'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VA01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Archana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2007 09:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-for-sales-order-using-multiple-line-items/m-p/2381933#M528778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-08T09:23:46Z</dc:date>
    </item>
  </channel>
</rss>

