<?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 programing-help needed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052145#M89490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you need to get the data from excel into your program.  Convert it to a comma delimited text file.  Then use this sample to get the data in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.

types: begin of ttab,
       rec(1000) type c,
       end of ttab.

types: begin of tdat,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of tdat.

data: itab type table of ttab with header line.
data: idat type table of tdat with header line.

data: file_str type string.

parameters: p_file type localfile.

at selection-screen on value-request for p_file.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file.

start-of-selection.

  file_str = p_file.

  call function 'GUI_UPLOAD'
       exporting
            filename                = file_str
       tables
            data_tab                = itab
       exceptions
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            others                  = 17.


  loop at itab.
    clear idat.
    split itab-rec at ',' into idat-fld1
                               idat-fld2
                               idat-fld3.
    append idat.

  endloop.


  loop at idat.
    write:/ idat-fld1, idat-fld2, idat-fld3.
  endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice now that you have an internal table with all the records of the file and split up into different fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next part, you need to record the FK01 transaction using the transaction code SHDB.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click new recording, enter a name of your recording,(example TEST),  then put FK01 in the transaction code box. click start recording.  You will now see the transaction FK01,  do the transaction as normal and click save.  Now you will see, a screen that says EDIT recording TEST, there is some code there, click save, then back.  Select your recording in the table, and click program, enter another program name and click transfer from recording.  Now you have a program with all of the code in it.  This is you BDC code.  You will want to copy and past most of that code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Dec 2005 18:13:32 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-12-14T18:13:32Z</dc:date>
    <item>
      <title>bdc programing-help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052142#M89487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;              Thank you so much for a lot of replies for my previous thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The exercise is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.  Create a BDC program for the following&lt;/P&gt;&lt;P&gt;  - Read a flat file containing Vendor Master details (keep the record structure as simple as possible).  The file should contain a list of Vendors to be created in the SAP system.&lt;/P&gt;&lt;P&gt;  - Using BDC technique, create the Vendor master using FK01 transaction&lt;/P&gt;&lt;P&gt;  - Repeat the steps for creating all Vendors listed in the file.  For each transaction, print out if the BDC was successful or not, and if successful print out the Vendor Number that was created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i dont know how to start with it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what should be my first step.&lt;/P&gt;&lt;P&gt;I have created a Excel sheet file with all those data's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what should be my next step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me... i entered in to shdb transaction code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dint know how to procedd further.&lt;/P&gt;&lt;P&gt;Plz help me to learn this process...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;Regards&lt;/P&gt;&lt;P&gt;rinky123&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2005 17:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052142#M89487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-14T17:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: bdc programing-help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052143#M89488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rinky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well ,to get data from excel sheet use &lt;/P&gt;&lt;P&gt;ALSM_EXCEL_TO_INTERNAL_TABLE. Watch out for the strucutre of the internal table u get from this function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in shdb, do a recording of your transaction with actual data which will create a vendor for sure. Convert it to a program by saving the recording and then clicking on "Program" button. study the BDC program it genreates carefully. pass your data whereever the hardcoded values are present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Printing messages can be done from the messtab you get in call transaction statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more piece of advice : be patient. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shiv&lt;/P&gt;&lt;P&gt;(Give points depending upon the the clearity of the answer)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2005 18:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052143#M89488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-14T18:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: bdc programing-help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052144#M89489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to upload the file into an internal table where you can analyze it. So first, convert it to a text file that you can easily parse (comma delimited or fixed length fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not familiar with the vendor master transactions (FK01 and FK02), have someone walk you through them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, you'll have to loop through the internal table of vendor data and do a transaction for each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2005 18:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052144#M89489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-14T18:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: bdc programing-help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052145#M89490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you need to get the data from excel into your program.  Convert it to a comma delimited text file.  Then use this sample to get the data in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.

types: begin of ttab,
       rec(1000) type c,
       end of ttab.

types: begin of tdat,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of tdat.

data: itab type table of ttab with header line.
data: idat type table of tdat with header line.

data: file_str type string.

parameters: p_file type localfile.

at selection-screen on value-request for p_file.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file.

start-of-selection.

  file_str = p_file.

  call function 'GUI_UPLOAD'
       exporting
            filename                = file_str
       tables
            data_tab                = itab
       exceptions
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            others                  = 17.


  loop at itab.
    clear idat.
    split itab-rec at ',' into idat-fld1
                               idat-fld2
                               idat-fld3.
    append idat.

  endloop.


  loop at idat.
    write:/ idat-fld1, idat-fld2, idat-fld3.
  endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice now that you have an internal table with all the records of the file and split up into different fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next part, you need to record the FK01 transaction using the transaction code SHDB.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Click new recording, enter a name of your recording,(example TEST),  then put FK01 in the transaction code box. click start recording.  You will now see the transaction FK01,  do the transaction as normal and click save.  Now you will see, a screen that says EDIT recording TEST, there is some code there, click save, then back.  Select your recording in the table, and click program, enter another program name and click transfer from recording.  Now you have a program with all of the code in it.  This is you BDC code.  You will want to copy and past most of that code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2005 18:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-programing-help-needed/m-p/1052145#M89490</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-14T18:13:32Z</dc:date>
    </item>
  </channel>
</rss>

