<?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: what is wrong with my code..... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688044#M621707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nitesha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess problem might be your select query :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_sldata like it_sdata occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_ldata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_ldata-kunnr &amp;lt;&amp;gt; ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh : it_sdata.&lt;/P&gt;&lt;P&gt;clear : it_sdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select kunnr &lt;/P&gt;&lt;P&gt;         vkorg &lt;/P&gt;&lt;P&gt;         vtweg &lt;/P&gt;&lt;P&gt;        spart from knvv &lt;/P&gt;&lt;P&gt;        into table it_sdata &lt;/P&gt;&lt;P&gt;        where kunnr = it_ldata-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_sdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move it_sdata to it_sldata.&lt;/P&gt;&lt;P&gt;append it_sldata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see every record of it_ldata ,your select query getting and after second record previous record of it_sdata is refreshing,so keep one more internal table and move the data into internal table..&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=NEWL'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-AUART(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=SAVE'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-KUNNR(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-kunnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-LIFNR(01)'&lt;/P&gt;&lt;P&gt;'it_ldata-lifnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-VKORG(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-vkorg'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-VTWEG(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-vtweg'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-SPART(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-spart'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-AUART(01)'&lt;/P&gt;&lt;P&gt;'ZOR'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VOE2'.&lt;/P&gt;&lt;P&gt;&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;endloop.&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>Sun, 12 Aug 2007 22:23:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-12T22:23:45Z</dc:date>
    <item>
      <title>what is wrong with my code.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688042#M621705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone guide me ... what is wrong with my code... y i am not getting the data into it_sdata intenal table.... y all those performs r not assigning the data....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y the select statement is not working... I am getting the data into it_ldata internal table but after select statement i am not getting the data into IT_SDATA....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZCUSTTEST&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;*include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: knvv, lfa1.&lt;/P&gt;&lt;P&gt;data: begin of it_ldata occurs 0,&lt;/P&gt;&lt;P&gt;      kunnr like knvv-kunnr,&lt;/P&gt;&lt;P&gt;      lifnr like lfa1-lifnr,&lt;/P&gt;&lt;P&gt;      end of it_ldata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_sdata occurs 0,&lt;/P&gt;&lt;P&gt;      kunnr like knvv-kunnr,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     lifnr like knvv-lifnr,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      vkorg like knvv-vkorg,&lt;/P&gt;&lt;P&gt;      vtweg like knvv-vtweg,&lt;/P&gt;&lt;P&gt;      spart like knvv-spart,&lt;/P&gt;&lt;P&gt;      end of it_sdata.&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;&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:\Documents and Settings\Administrator\Desktop\cust.txt'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   FILETYPE                      = 'ASC'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HAS_FIELD_SEPARATOR           = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER_LENGTH                 = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  READ_BY_LINE                  = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DAT_MODE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CODEPAGE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  IGNORE_CERR                   = ABAP_TRUE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  REPLACEMENT                   = '#'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CHECK_BOM                     = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VIRUS_SCAN_PROFILE            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NO_AUTH_CHECK                 = ' '&lt;/P&gt;&lt;/LI&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;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER                        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    DATA_TAB                      = it_ldata&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILE_OPEN_ERROR               = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FILE_READ_ERROR               = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NO_BATCH                      = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  GUI_REFUSE_FILETRANSFER       = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INVALID_TYPE                  = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  NO_AUTHORITY                  = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  UNKNOWN_ERROR                 = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  BAD_DATA_FORMAT               = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER_NOT_ALLOWED            = 9&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  SEPARATOR_NOT_ALLOWED         = 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER_TOO_LONG               = 11&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  UNKNOWN_DP_ERROR              = 12&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ACCESS_DENIED                 = 13&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DP_OUT_OF_MEMORY              = 14&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DISK_FULL                     = 15&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DP_TIMEOUT                    = 16&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                        = 17&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&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;loop at it_ldata.&lt;/P&gt;&lt;P&gt;if it_ldata-kunnr &amp;lt;&amp;gt; ' '.&lt;/P&gt;&lt;P&gt;select kunnr vkorg vtweg spart from knvv into table it_sdata where kunnr = it_ldata-kunnr.&lt;/P&gt;&lt;P&gt;append it_sdata.&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;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'V_EDSDC-KUNNR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=NEWL'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'V_EDSDC-AUART(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SAVE'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-KUNNR(01)'&lt;/P&gt;&lt;P&gt;                              'it_sdata-kunnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-LIFNR(01)'&lt;/P&gt;&lt;P&gt;                              'it_ldata-lifnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-VKORG(01)'&lt;/P&gt;&lt;P&gt;                              'it_sdata-vkorg'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-VTWEG(01)'&lt;/P&gt;&lt;P&gt;                              'it_sdata-vtweg'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-SPART(01)'&lt;/P&gt;&lt;P&gt;                              'it_sdata-spart'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'V_EDSDC-AUART(01)'&lt;/P&gt;&lt;P&gt;                              'ZOR'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VOE2'.&lt;/P&gt;&lt;P&gt;&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your anticipation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 20:58:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688042#M621705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-12T20:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: what is wrong with my code.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688043#M621706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I see you're populating it_ldata from file cust.txt which has customer numbers, then you're trying to retrieve customer related data from table KNVV into it_sdata...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some items to check&lt;/P&gt;&lt;P&gt;1) about the file cust.txt...it has exactly 20 chars per line?&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;11111111112222222222&lt;/P&gt;&lt;P&gt;If yes, your program would load it_ldata with '1111111111' as kunnr and '2222222222' as lifnr.&lt;/P&gt;&lt;P&gt;If not, maybe you need to complete with zeros using for example CONVERSION_EXIT_ALPHA_INPUT function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Does the kunnr '1111111111' (following this example) exist in table KNA1? Are there any records in KNVV table with this key (check in SE16).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, a couple of suggestions (once you solve the problem):&lt;/P&gt;&lt;P&gt;1) If possible, use SELECT...FOR ALL ENTRIES instead of SELECT inside loop. Then loop it_sdata processing different kunnr's.&lt;/P&gt;&lt;P&gt;2) Remove append it_sdata, it's not necessary since you're selecting directly inside the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, post again if you need further help.&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 22:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688043#M621706</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-08-12T22:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: what is wrong with my code.....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688044#M621707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nitesha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess problem might be your select query :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : it_sldata like it_sdata occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_ldata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_ldata-kunnr &amp;lt;&amp;gt; ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh : it_sdata.&lt;/P&gt;&lt;P&gt;clear : it_sdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select kunnr &lt;/P&gt;&lt;P&gt;         vkorg &lt;/P&gt;&lt;P&gt;         vtweg &lt;/P&gt;&lt;P&gt;        spart from knvv &lt;/P&gt;&lt;P&gt;        into table it_sdata &lt;/P&gt;&lt;P&gt;        where kunnr = it_ldata-kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_sdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move it_sdata to it_sldata.&lt;/P&gt;&lt;P&gt;append it_sldata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see every record of it_ldata ,your select query getting and after second record previous record of it_sdata is refreshing,so keep one more internal table and move the data into internal table..&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=NEWL'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-AUART(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=SAVE'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-KUNNR(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-kunnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-LIFNR(01)'&lt;/P&gt;&lt;P&gt;'it_ldata-lifnr'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-VKORG(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-vkorg'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-VTWEG(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-vtweg'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-SPART(01)'&lt;/P&gt;&lt;P&gt;'it_sdata-spart'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'V_EDSDC-AUART(01)'&lt;/P&gt;&lt;P&gt;'ZOR'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPL0VED' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'V_EDSDC-KUNNR(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=BACK'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VOE2'.&lt;/P&gt;&lt;P&gt;&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;endloop.&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>Sun, 12 Aug 2007 22:23:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-wrong-with-my-code/m-p/2688044#M621707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-12T22:23:45Z</dc:date>
    </item>
  </channel>
</rss>

