<?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 BDC problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-problem/m-p/1936262#M387227</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;I am using the following program to update the BOMs.&lt;/P&gt;&lt;P&gt;The program works fine and updates the BOMs if the components for a particular material are 10 or less&lt;/P&gt;&lt;P&gt;If they are more than that the result is still the 'BOM updated successfully' whereas when I go check in CS02 only the ten componenets are changed and the rest are not changed.&lt;/P&gt;&lt;P&gt;Can anyone suggest me what to do?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zbom_update&lt;/P&gt;&lt;P&gt;       no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: mard.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_bdcdata like bdcdata occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_bom occurs 0,&lt;/P&gt;&lt;P&gt;      matnr like rc29n-matnr,&lt;/P&gt;&lt;P&gt;      werks like rc29n-werks,&lt;/P&gt;&lt;P&gt;      stlan like rc29n-stlan,&lt;/P&gt;&lt;P&gt;      end of it_bom.&lt;/P&gt;&lt;P&gt;data: begin of it_tab occurs 0,&lt;/P&gt;&lt;P&gt;      matnr like mast-matnr,&lt;/P&gt;&lt;P&gt;      stlal like mast-stlal,&lt;/P&gt;&lt;P&gt;      idnrk like stpo-idnrk,&lt;/P&gt;&lt;P&gt;      menge(16),&lt;/P&gt;&lt;P&gt;      meins(4),&lt;/P&gt;&lt;P&gt;      end of it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_stb occurs 0.&lt;/P&gt;&lt;P&gt;        include structure stpox.&lt;/P&gt;&lt;P&gt;data: end of it_stb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: v_count(3) type n value '01',&lt;/P&gt;&lt;P&gt;      v_count1(3) type c,&lt;/P&gt;&lt;P&gt;      v_string type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to open the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform file_open.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to read the data from input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform read_dataset.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* Perform to close the opened input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform file_close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from it_tab comparing matnr stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-100.&lt;/P&gt;&lt;P&gt;parameters: p_infile type rlgrap-filename default '/tmp/bom_extract'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&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;  perform open_group.&lt;/P&gt;&lt;P&gt;  loop at it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear it_stb.&lt;/P&gt;&lt;P&gt;    refresh it_stb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'CS_BOM_EXPL_MAT_V2'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;             aufsw                 = 'X'&lt;/P&gt;&lt;P&gt;             aumgb                 = 'X'&lt;/P&gt;&lt;P&gt;             capid                 = ' '&lt;/P&gt;&lt;P&gt;             mdmps                 = 'X'&lt;/P&gt;&lt;P&gt;             datuv                 = sy-datum&lt;/P&gt;&lt;P&gt;             mbwls                 = 'X'&lt;/P&gt;&lt;P&gt;             mktls                 = 'X'&lt;/P&gt;&lt;P&gt;             mtnrv                 = it_tab-matnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           mehrs                 = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             mehrs                 = ' '&lt;/P&gt;&lt;P&gt;             stlal                 = it_tab-stlal&lt;/P&gt;&lt;P&gt;             stlan                 = '3'&lt;/P&gt;&lt;P&gt;             werks                 = '1353'&lt;/P&gt;&lt;P&gt;             mdnot                 = 'X'&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;             stb                   = it_stb&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;             alt_not_found         = 1&lt;/P&gt;&lt;P&gt;             call_invalid          = 2&lt;/P&gt;&lt;P&gt;             material_not_found    = 3&lt;/P&gt;&lt;P&gt;             missing_authorization = 4&lt;/P&gt;&lt;P&gt;             no_bom_found          = 5&lt;/P&gt;&lt;P&gt;             no_plant_data         = 6&lt;/P&gt;&lt;P&gt;             no_suitable_bom_found = 7&lt;/P&gt;&lt;P&gt;             others                = 8.&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;Count the number of components for a BOM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    describe  table it_stb lines v_count1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh it_bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLCSDI' '0100'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RC29N-STLAN'.&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 'RC29N-MATNR'&lt;/P&gt;&lt;P&gt;                                  it_tab-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-WERKS'&lt;/P&gt;&lt;P&gt;                                  '1353'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-STLAN'&lt;/P&gt;&lt;P&gt;                                  '3'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-STLAl'&lt;/P&gt;&lt;P&gt;                                  it_tab-stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_stb where stlal = it_tab-stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;      concatenate 'RC29P-AUSKZ' '(' v_count ')' into v_string.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                     v_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'RC29P-AUSKZ(01)'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=PALL'.&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'RC29P-AUSKZ(01)'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      clear v_string.&lt;/P&gt;&lt;P&gt;      concatenate  'RC29P-AUSKZ' '(' v_count ')' into v_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_field       using v_string&lt;/P&gt;&lt;P&gt;                                          'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '2130'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=PDAT'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'RC29P-POSNR'.&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '2130'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '/EBACK'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'RC29P-PRVBE'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'RC29P-LGORT'&lt;/P&gt;&lt;P&gt;                                    '7001'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'RC29P-PRVBE'&lt;/P&gt;&lt;P&gt;                                    'REPACK'.&lt;/P&gt;&lt;P&gt;      v_count = v_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if v_count eq '006'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                      '=P+'.&lt;/P&gt;&lt;P&gt;        v_count = '001'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RC29P-POSNR(01)'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=FCBU'.&lt;/P&gt;&lt;P&gt;    perform bdc_transaction using 'CS02'.&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;STRONG&gt;----&lt;/STRONG&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;     Form  file_open&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to open the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form file_open .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset p_infile for input in text mode encoding default.&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 'Error in opening the file' type 'E'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " file_open&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;     Form  read_dataset&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to transfer the data from input file to the internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form read_dataset .&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    read dataset p_infile into it_tab.&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;    endif.&lt;/P&gt;&lt;P&gt;    append it_tab.&lt;/P&gt;&lt;P&gt;    clear it_tab.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;endform.                    " read_dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;     Form  file_close&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to close the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form file_close .&lt;/P&gt;&lt;P&gt;  close dataset p_infile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " file_close&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Feb 2007 17:39:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-08T17:39:47Z</dc:date>
    <item>
      <title>BDC problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-problem/m-p/1936262#M387227</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;I am using the following program to update the BOMs.&lt;/P&gt;&lt;P&gt;The program works fine and updates the BOMs if the components for a particular material are 10 or less&lt;/P&gt;&lt;P&gt;If they are more than that the result is still the 'BOM updated successfully' whereas when I go check in CS02 only the ten componenets are changed and the rest are not changed.&lt;/P&gt;&lt;P&gt;Can anyone suggest me what to do?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zbom_update&lt;/P&gt;&lt;P&gt;       no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: mard.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal table declarations&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_bdcdata like bdcdata occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_bom occurs 0,&lt;/P&gt;&lt;P&gt;      matnr like rc29n-matnr,&lt;/P&gt;&lt;P&gt;      werks like rc29n-werks,&lt;/P&gt;&lt;P&gt;      stlan like rc29n-stlan,&lt;/P&gt;&lt;P&gt;      end of it_bom.&lt;/P&gt;&lt;P&gt;data: begin of it_tab occurs 0,&lt;/P&gt;&lt;P&gt;      matnr like mast-matnr,&lt;/P&gt;&lt;P&gt;      stlal like mast-stlal,&lt;/P&gt;&lt;P&gt;      idnrk like stpo-idnrk,&lt;/P&gt;&lt;P&gt;      menge(16),&lt;/P&gt;&lt;P&gt;      meins(4),&lt;/P&gt;&lt;P&gt;      end of it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_stb occurs 0.&lt;/P&gt;&lt;P&gt;        include structure stpox.&lt;/P&gt;&lt;P&gt;data: end of it_stb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: v_count(3) type n value '01',&lt;/P&gt;&lt;P&gt;      v_count1(3) type c,&lt;/P&gt;&lt;P&gt;      v_string type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to open the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform file_open.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to read the data from input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform read_dataset.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* Perform to close the opened input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform file_close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from it_tab comparing matnr stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-100.&lt;/P&gt;&lt;P&gt;parameters: p_infile type rlgrap-filename default '/tmp/bom_extract'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&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;  perform open_group.&lt;/P&gt;&lt;P&gt;  loop at it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear it_stb.&lt;/P&gt;&lt;P&gt;    refresh it_stb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call function 'CS_BOM_EXPL_MAT_V2'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;             aufsw                 = 'X'&lt;/P&gt;&lt;P&gt;             aumgb                 = 'X'&lt;/P&gt;&lt;P&gt;             capid                 = ' '&lt;/P&gt;&lt;P&gt;             mdmps                 = 'X'&lt;/P&gt;&lt;P&gt;             datuv                 = sy-datum&lt;/P&gt;&lt;P&gt;             mbwls                 = 'X'&lt;/P&gt;&lt;P&gt;             mktls                 = 'X'&lt;/P&gt;&lt;P&gt;             mtnrv                 = it_tab-matnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           mehrs                 = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;             mehrs                 = ' '&lt;/P&gt;&lt;P&gt;             stlal                 = it_tab-stlal&lt;/P&gt;&lt;P&gt;             stlan                 = '3'&lt;/P&gt;&lt;P&gt;             werks                 = '1353'&lt;/P&gt;&lt;P&gt;             mdnot                 = 'X'&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;             stb                   = it_stb&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;             alt_not_found         = 1&lt;/P&gt;&lt;P&gt;             call_invalid          = 2&lt;/P&gt;&lt;P&gt;             material_not_found    = 3&lt;/P&gt;&lt;P&gt;             missing_authorization = 4&lt;/P&gt;&lt;P&gt;             no_bom_found          = 5&lt;/P&gt;&lt;P&gt;             no_plant_data         = 6&lt;/P&gt;&lt;P&gt;             no_suitable_bom_found = 7&lt;/P&gt;&lt;P&gt;             others                = 8.&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;Count the number of components for a BOM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    describe  table it_stb lines v_count1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh it_bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLCSDI' '0100'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RC29N-STLAN'.&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 'RC29N-MATNR'&lt;/P&gt;&lt;P&gt;                                  it_tab-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-WERKS'&lt;/P&gt;&lt;P&gt;                                  '1353'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-STLAN'&lt;/P&gt;&lt;P&gt;                                  '3'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RC29N-STLAl'&lt;/P&gt;&lt;P&gt;                                  it_tab-stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at it_stb where stlal = it_tab-stlal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;      concatenate 'RC29P-AUSKZ' '(' v_count ')' into v_string.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                     v_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'RC29P-AUSKZ(01)'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=PALL'.&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'RC29P-AUSKZ(01)'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      clear v_string.&lt;/P&gt;&lt;P&gt;      concatenate  'RC29P-AUSKZ' '(' v_count ')' into v_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_field       using v_string&lt;/P&gt;&lt;P&gt;                                          'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '2130'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=PDAT'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'RC29P-POSNR'.&lt;/P&gt;&lt;P&gt;      perform bdc_dynpro      using 'SAPLCSDI' '2130'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '/EBACK'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'RC29P-PRVBE'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'RC29P-LGORT'&lt;/P&gt;&lt;P&gt;                                    '7001'.&lt;/P&gt;&lt;P&gt;      perform bdc_field       using 'RC29P-PRVBE'&lt;/P&gt;&lt;P&gt;                                    'REPACK'.&lt;/P&gt;&lt;P&gt;      v_count = v_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if v_count eq '006'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                      '=P+'.&lt;/P&gt;&lt;P&gt;        v_count = '001'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLCSDI' '0150'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RC29P-POSNR(01)'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=FCBU'.&lt;/P&gt;&lt;P&gt;    perform bdc_transaction using 'CS02'.&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;STRONG&gt;----&lt;/STRONG&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;     Form  file_open&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to open the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form file_open .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  open dataset p_infile for input in text mode encoding default.&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 'Error in opening the file' type 'E'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " file_open&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;     Form  read_dataset&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to transfer the data from input file to the internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form read_dataset .&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    read dataset p_infile into it_tab.&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;    endif.&lt;/P&gt;&lt;P&gt;    append it_tab.&lt;/P&gt;&lt;P&gt;    clear it_tab.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;endform.                    " read_dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;     Form  file_close&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&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;Form to close the input file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form file_close .&lt;/P&gt;&lt;P&gt;  close dataset p_infile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " file_close&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 17:39:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-problem/m-p/1936262#M387227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T17:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: BDC problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-problem/m-p/1936263#M387228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;        When you are calling the perform bdc_transaction and within that there you will have a call transaction modify that call transaction as in following example marked in bold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: bdcdata_wa  TYPE bdcdata, &lt;/P&gt;&lt;P&gt;      bdcdata_tab TYPE TABLE OF bdcdata. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA opt TYPE ctu_params. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR bdcdata_wa. &lt;/P&gt;&lt;P&gt;bdcdata_wa-program  = 'SAPLSEOD'. &lt;/P&gt;&lt;P&gt;bdcdata_wa-dynpro   = '1000'. &lt;/P&gt;&lt;P&gt;bdcdata_wa-dynbegin = 'X'. &lt;/P&gt;&lt;P&gt;APPEND bdcdata_wa TO bdcdata_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR bdcdata_wa. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fnam = 'BDC_CURSOR'. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fval = 'SEOCLASS-CLSNAME'. &lt;/P&gt;&lt;P&gt;APPEND bdcdata_wa TO bdcdata_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR bdcdata_wa. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fval = class_name. &lt;/P&gt;&lt;P&gt;APPEND bdcdata_wa TO bdcdata_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR bdcdata_wa. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fnam = 'BDC_OKCODE'. &lt;/P&gt;&lt;P&gt;bdcdata_wa-fval = '=CIDI'. &lt;/P&gt;&lt;P&gt;APPEND bdcdata_wa TO bdcdata_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;opt-dismode = 'E'. &lt;/P&gt;&lt;P&gt;opt-defsize = 'X'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 06:29:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc-problem/m-p/1936263#M387228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T06:29:56Z</dc:date>
    </item>
  </channel>
</rss>

