<?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: Sample BDC  Program to upload any Transaction using Data sets i.e.from App in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877349#M368809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin of ty_input,&lt;/P&gt;&lt;P&gt;  line(100),&lt;/P&gt;&lt;P&gt;end of ty_input,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of ty_mat,&lt;/P&gt;&lt;P&gt;  mtart type mara-mtart,&lt;/P&gt;&lt;P&gt;  mbrsh type mara-mbrsh,&lt;/P&gt;&lt;P&gt;  maktx type makt-maktx,&lt;/P&gt;&lt;P&gt;  meins type mara-meins,&lt;/P&gt;&lt;P&gt;end of ty_mat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  it_input type standard table of ty_input with header line,&lt;/P&gt;&lt;P&gt;  it_mat type standard table of ty_mat with header line,&lt;/P&gt;&lt;P&gt; it_bdcdata type standard table of bdcdata with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  v_file type string value '/usr/tmp/a.txt'.&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;open dataset v_file for input in text mode default encoding.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;   exit.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;  read dataset v_file into it_input.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    append it_input.&lt;/P&gt;&lt;P&gt;    clear it_input.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;close dataset v_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******&lt;/P&gt;&lt;P&gt;Loop at it_input.&lt;/P&gt;&lt;P&gt;split it_input-line at ',' into it_mat-mbrsh it_mat-mtart it_mat-maktx it_mat-meins&lt;/P&gt;&lt;P&gt;            into it_mat.&lt;/P&gt;&lt;P&gt;append it_mat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;********&lt;/P&gt;&lt;P&gt;loop at it_mat.&lt;/P&gt;&lt;P&gt;   Perform mapping.&lt;/P&gt;&lt;P&gt;  call transaction 'MM01' using it_bdcdata&lt;/P&gt;&lt;P&gt;                   mode &amp;lt;A/E/N&amp;gt;&lt;/P&gt;&lt;P&gt;                   update &amp;lt;S/A/L&amp;gt;.&lt;/P&gt;&lt;P&gt;  refresh it_bdcdata.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jan 2007 10:06:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-30T10:06:03Z</dc:date>
    <item>
      <title>Sample BDC  Program to upload any Transaction using Data sets i.e.from App</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877348#M368808</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;     Could you please help out me for a sample BDC (Upload  Program)&lt;/P&gt;&lt;P&gt;using DATA SETS i.e. the data should be retrieved from the Application Server for any one Transaction&lt;/P&gt;&lt;P&gt;Note: not through the Uploads from Desktop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt; Rajesh.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 10:00:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877348#M368808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T10:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sample BDC  Program to upload any Transaction using Data sets i.e.from App</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877349#M368809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin of ty_input,&lt;/P&gt;&lt;P&gt;  line(100),&lt;/P&gt;&lt;P&gt;end of ty_input,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of ty_mat,&lt;/P&gt;&lt;P&gt;  mtart type mara-mtart,&lt;/P&gt;&lt;P&gt;  mbrsh type mara-mbrsh,&lt;/P&gt;&lt;P&gt;  maktx type makt-maktx,&lt;/P&gt;&lt;P&gt;  meins type mara-meins,&lt;/P&gt;&lt;P&gt;end of ty_mat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  it_input type standard table of ty_input with header line,&lt;/P&gt;&lt;P&gt;  it_mat type standard table of ty_mat with header line,&lt;/P&gt;&lt;P&gt; it_bdcdata type standard table of bdcdata with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  v_file type string value '/usr/tmp/a.txt'.&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;open dataset v_file for input in text mode default encoding.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;   exit.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;  read dataset v_file into it_input.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    append it_input.&lt;/P&gt;&lt;P&gt;    clear it_input.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;close dataset v_file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;******&lt;/P&gt;&lt;P&gt;Loop at it_input.&lt;/P&gt;&lt;P&gt;split it_input-line at ',' into it_mat-mbrsh it_mat-mtart it_mat-maktx it_mat-meins&lt;/P&gt;&lt;P&gt;            into it_mat.&lt;/P&gt;&lt;P&gt;append it_mat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;********&lt;/P&gt;&lt;P&gt;loop at it_mat.&lt;/P&gt;&lt;P&gt;   Perform mapping.&lt;/P&gt;&lt;P&gt;  call transaction 'MM01' using it_bdcdata&lt;/P&gt;&lt;P&gt;                   mode &amp;lt;A/E/N&amp;gt;&lt;/P&gt;&lt;P&gt;                   update &amp;lt;S/A/L&amp;gt;.&lt;/P&gt;&lt;P&gt;  refresh it_bdcdata.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 10:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877349#M368809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T10:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sample BDC  Program to upload any Transaction using Data sets i.e.from App</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877350#M368810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the below thread, it will have the sample code also for MM01 BDC&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="1617808"&gt;&lt;/A&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="1582517"&gt;&lt;/A&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="1274601"&gt;&lt;/A&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="443433"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/learning-bdc-programming.htm" target="test_blank"&gt;http://www.sap-img.com/abap/learning-bdc-programming.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://myweb.dal.ca/hchinni/sap/bdc_home.htm" target="test_blank"&gt;http://myweb.dal.ca/hchinni/sap/bdc_home.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&amp;amp;" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&amp;amp;&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/learning-bdc-programming.htm" target="test_blank"&gt;http://www.sap-img.com/abap/learning-bdc-programming.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/bdc/bdchome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/bdc/bdchome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html" target="test_blank"&gt;http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 11:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877350#M368810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T11:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sample BDC  Program to upload any Transaction using Data sets i.e.from App</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877351#M368811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1)OPEN DATASET stmt is used to open a file on applicaiton server either for reading or writing.&lt;/P&gt;&lt;P&gt;2)READ DATASET - when we open a file for reading/uploading we use READ DATASET stmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: READ DATASET &amp;lt;dsn&amp;gt; INTO &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSFER - is the statement we use for writing data to a file.&lt;/P&gt;&lt;P&gt;3)Source Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a)Reading Data from Application Server:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset fname for input in text mode encoding default.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;write:/ 'Unable to open file:', fname.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;read datasset fname into &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc ne o.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;append &amp;lt;wa&amp;gt; to itab.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;close dataset fname.&lt;/P&gt;&lt;P&gt;enddo.&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;&lt;/P&gt;&lt;P&gt;b)Writing Data to Application Server:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset fname for output in text mode encoding default.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;write:/ 'Unable to open file:', fname.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;transfer itab to fname.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;close dataset fname.&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;Look at the below link, it is having the code with the use of OPEN DATA SET(Application Server)&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm&lt;/A&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="2741746"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*Transfer the data to application server&lt;/P&gt;&lt;P&gt;OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;LOOP AT IT_VENDOR INTO WA_VENDOR.&lt;/P&gt;&lt;P&gt;TRANSFER WA_VENDOR TO FNAME.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;again data is read from the application server to interna table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;OPEN DATASET FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;READ DATASET FNAME INTO STR.&lt;/P&gt;&lt;P&gt;SPLIT STR AT HORIN INTO WA_VENDOR-LIFNR WA_VENDOR-BUKRS WA_VENDOR-EKORG WA_VENDOR-KTOKK.&lt;/P&gt;&lt;P&gt;APPEND WA_VENDOR TO IT_VENDOR .&lt;/P&gt;&lt;P&gt;CLOSE DATASET FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After writing the data into application server goto transaction AL11 &amp;amp; see ur txt file there &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 11:12:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877351#M368811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T11:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sample BDC  Program to upload any Transaction using Data sets i.e.from App</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877352#M368812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajesh,&lt;/P&gt;&lt;P&gt;   YOu requirement can be split into two parts.&lt;/P&gt;&lt;P&gt;1) Get the data from the application server into an Internal table and &lt;/P&gt;&lt;P&gt;2) Do a BDC for any transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For step 1, you have to use OPEN DATASET &amp;lt;File name&amp;gt; for input in text mode.&lt;/P&gt;&lt;P&gt;then use READ dataset to get the data into the internal table and finally close the file using close dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset dsn for input in text mode.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;read dataset dsn into itab-data.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;close dataset dsn.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For 2, refer this example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 11:14:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-bdc-program-to-upload-any-transaction-using-data-sets-i-e-from-app/m-p/1877352#M368812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T11:14:45Z</dc:date>
    </item>
  </channel>
</rss>

