<?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: flat file -bdc in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571867#M859758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create flat file by the structure of internal table&lt;/P&gt;&lt;P&gt;                     or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the recording which is already done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example in the following example flat file can be prepared by seeing the recording as well&lt;/P&gt;&lt;P&gt;report zbdctest . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bdcdata. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: tbdcdata like bdcdata occurs 0 with header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of record occurs 0, &lt;/P&gt;&lt;P&gt;acctg(4) type c, &lt;/P&gt;&lt;P&gt;name(20) type c, &lt;/P&gt;&lt;P&gt;search(10) type c, &lt;/P&gt;&lt;P&gt;street(20) type c, &lt;/P&gt;&lt;P&gt;postalcd(4) type c, &lt;/P&gt;&lt;P&gt;postcd(4) type c, &lt;/P&gt;&lt;P&gt;postdesc(20) type c, &lt;/P&gt;&lt;P&gt;country(2) type c, &lt;/P&gt;&lt;P&gt;taxcd(10) type c, &lt;/P&gt;&lt;P&gt;end of record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tb_text occurs 0, &lt;/P&gt;&lt;P&gt;description(40) type c, &lt;/P&gt;&lt;P&gt;count type i, &lt;/P&gt;&lt;P&gt;line(50) type c, &lt;/P&gt;&lt;P&gt;end of tb_text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: dataset(132) lower case default &lt;/P&gt;&lt;P&gt;'c:\test01.txt'. &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for dataset. &lt;/P&gt;&lt;P&gt;data: xfile like ibipparms-path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xfile = dataset. &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 = sy-repid &lt;/P&gt;&lt;P&gt;dynpro_number = sy-dynnr &lt;/P&gt;&lt;P&gt;field_name = 'dataset' &lt;/P&gt;&lt;P&gt;importing &lt;/P&gt;&lt;P&gt;file_name = xfile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset = xfile. &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;data: pfile like rlgrap-filename. &lt;/P&gt;&lt;P&gt;pfile = dataset. &lt;/P&gt;&lt;P&gt;call function 'WS_UPLOAD' &lt;/P&gt;&lt;P&gt;exporting &lt;/P&gt;&lt;P&gt;filename = pfile &lt;/P&gt;&lt;P&gt;filetype = 'DAT' &lt;/P&gt;&lt;P&gt;tables &lt;/P&gt;&lt;P&gt;data_tab = record &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;call function 'BDC_OPEN_GROUP' &lt;/P&gt;&lt;P&gt;exporting client = sy-mandt &lt;/P&gt;&lt;P&gt;group = 'Test' &lt;/P&gt;&lt;P&gt;user = sy-uname. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at record. &lt;/P&gt;&lt;P&gt;refresh tbdcdata. &lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0107'. &lt;/P&gt;&lt;P&gt;perform new_field using 'RF02K-KTOKK' record-acctg. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '/00'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0110'. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-NAME1' record-name. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-SORTL' record-search. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-STRAS' record-street. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-ORT01' record-postdesc. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-PSTLZ' record-postalcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-PFACH' record-postcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-LAND1' record-country. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-SPRAS' sy-langu. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '/00'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0120'. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-STCD1' record-taxcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '=UPDA'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_transaction2 using 'MK01'. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call transaction 'MK01' &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;using Tbdcdata &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;mode 'A' &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;update 'A'. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at tb_text. &lt;/P&gt;&lt;P&gt;write / tb_text-line . &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'BDC_CLOSE_GROUP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran,Award points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ravee indra on Mar 28, 2008 5:24 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Mar 2008 16:23:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-28T16:23:43Z</dc:date>
    <item>
      <title>flat file -bdc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571866#M859757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have to prepare a flat file for an bdc which is already existing in Production.I had just prepared one based on the internal table fields in the program,bt it is not working.Do anyone have an idea on how to prepare based on an existing program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2008 16:09:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571866#M859757</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-03-28T16:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: flat file -bdc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571867#M859758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create flat file by the structure of internal table&lt;/P&gt;&lt;P&gt;                     or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the recording which is already done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example in the following example flat file can be prepared by seeing the recording as well&lt;/P&gt;&lt;P&gt;report zbdctest . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bdcdata. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: tbdcdata like bdcdata occurs 0 with header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of record occurs 0, &lt;/P&gt;&lt;P&gt;acctg(4) type c, &lt;/P&gt;&lt;P&gt;name(20) type c, &lt;/P&gt;&lt;P&gt;search(10) type c, &lt;/P&gt;&lt;P&gt;street(20) type c, &lt;/P&gt;&lt;P&gt;postalcd(4) type c, &lt;/P&gt;&lt;P&gt;postcd(4) type c, &lt;/P&gt;&lt;P&gt;postdesc(20) type c, &lt;/P&gt;&lt;P&gt;country(2) type c, &lt;/P&gt;&lt;P&gt;taxcd(10) type c, &lt;/P&gt;&lt;P&gt;end of record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tb_text occurs 0, &lt;/P&gt;&lt;P&gt;description(40) type c, &lt;/P&gt;&lt;P&gt;count type i, &lt;/P&gt;&lt;P&gt;line(50) type c, &lt;/P&gt;&lt;P&gt;end of tb_text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: dataset(132) lower case default &lt;/P&gt;&lt;P&gt;'c:\test01.txt'. &lt;/P&gt;&lt;P&gt;at selection-screen on value-request for dataset. &lt;/P&gt;&lt;P&gt;data: xfile like ibipparms-path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xfile = dataset. &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 = sy-repid &lt;/P&gt;&lt;P&gt;dynpro_number = sy-dynnr &lt;/P&gt;&lt;P&gt;field_name = 'dataset' &lt;/P&gt;&lt;P&gt;importing &lt;/P&gt;&lt;P&gt;file_name = xfile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset = xfile. &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;data: pfile like rlgrap-filename. &lt;/P&gt;&lt;P&gt;pfile = dataset. &lt;/P&gt;&lt;P&gt;call function 'WS_UPLOAD' &lt;/P&gt;&lt;P&gt;exporting &lt;/P&gt;&lt;P&gt;filename = pfile &lt;/P&gt;&lt;P&gt;filetype = 'DAT' &lt;/P&gt;&lt;P&gt;tables &lt;/P&gt;&lt;P&gt;data_tab = record &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;call function 'BDC_OPEN_GROUP' &lt;/P&gt;&lt;P&gt;exporting client = sy-mandt &lt;/P&gt;&lt;P&gt;group = 'Test' &lt;/P&gt;&lt;P&gt;user = sy-uname. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at record. &lt;/P&gt;&lt;P&gt;refresh tbdcdata. &lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0107'. &lt;/P&gt;&lt;P&gt;perform new_field using 'RF02K-KTOKK' record-acctg. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '/00'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0110'. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-NAME1' record-name. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-SORTL' record-search. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-STRAS' record-street. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-ORT01' record-postdesc. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-PSTLZ' record-postalcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-PFACH' record-postcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-LAND1' record-country. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-SPRAS' sy-langu. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '/00'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform new_dynpro using 'SAPMF02K' '0120'. &lt;/P&gt;&lt;P&gt;perform new_field using 'LFA1-STCD1' record-taxcd. &lt;/P&gt;&lt;P&gt;perform new_field using 'BDC_OKCODE' '=UPDA'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_transaction2 using 'MK01'. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call transaction 'MK01' &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;using Tbdcdata &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;mode 'A' &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;update 'A'. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at tb_text. &lt;/P&gt;&lt;P&gt;write / tb_text-line . &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'BDC_CLOSE_GROUP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran,Award points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ravee indra on Mar 28, 2008 5:24 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2008 16:23:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571867#M859758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-28T16:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: flat file -bdc</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571868#M859759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think the information provided by you is not sufficient. Is the program showing any errors ?&lt;/P&gt;&lt;P&gt;If so then only we can get an idea. if not please give the description in brief.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the program working in background or foreground ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2008 16:25:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/flat-file-bdc/m-p/3571868#M859759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-28T16:25:22Z</dc:date>
    </item>
  </channel>
</rss>

