<?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: Problem in modifying the main internal table gt_data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203699#M1376531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Nov 2009 07:19:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-05T07:19:04Z</dc:date>
    <item>
      <title>Problem in modifying the main internal table gt_data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203697#M1376529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.&lt;/P&gt;&lt;P&gt;LOOP AT gt_data  INTO ls_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lt_temp-objek  =  ls_list-matnr.&lt;/P&gt;&lt;P&gt;    APPEND  lt_temp.                  " 특성값 발췌용도로 저장&lt;/P&gt;&lt;P&gt;    APPEND  ls_list  TO lt_work.      " 핵심작업용도로 저장&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE lt_temp.&lt;/P&gt;&lt;P&gt;  IF  sy-tfill  EQ  0.&lt;/P&gt;&lt;P&gt;    pv_flg  =  'X'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&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;Get 제품인증(플랜트별).....&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DESCRIBE TABLE lt_cetino_tp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        플랜트          자재번호&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        카타로그-인증   코드그룹-인증   인증코드&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Certi. No.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get 자재별 특성값..........&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          오브젝트  특성이름  내부특성   내부카운터  특성값&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SELECT    a&lt;SUB&gt;objek    b&lt;/SUB&gt;atnam   a&lt;SUB&gt;atinn    a&lt;/SUB&gt;atzhl    a~atwrt&lt;/P&gt;&lt;P&gt;        INTO CORRESPONDING FIELDS OF TABLE  lt_ausp_tp&lt;/P&gt;&lt;P&gt;        FROM ausp AS a  INNER JOIN  cabn AS b&lt;/P&gt;&lt;P&gt;          ON a&lt;SUB&gt;atinn  =  b&lt;/SUB&gt;atinn&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN  lt_temp&lt;/P&gt;&lt;P&gt;       WHERE a~objek  EQ  lt_temp-objek   " 오브젝트키(자재번호)&lt;/P&gt;&lt;P&gt;         AND a~klart  EQ  '001'           " 클래스유형&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       AND a~atzhl  EQ  '001'           " 특성값카운터(최종건만 존재)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                          자재특성 변경시 변경됨&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         AND b~adzhl  EQ  '0000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF  sy-subrc  EQ  0.&lt;/P&gt;&lt;P&gt;    DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp.&lt;/P&gt;&lt;P&gt;    lt_ausp[]     =  lt_ausp_tp[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lt_ausp_tp2[] =  lt_ausp_tp[].&lt;/P&gt;&lt;P&gt;    DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get 특성내역&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          내부특성   " 내부카운터&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          특성값       특성값내역&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SELECT    a&lt;SUB&gt;atinn  " a&lt;/SUB&gt;atzhl&lt;/P&gt;&lt;P&gt;              a&lt;SUB&gt;atwrt    b&lt;/SUB&gt;atwtb&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF TABLE  lt_cawn&lt;/P&gt;&lt;P&gt;          FROM cawn AS a  INNER JOIN  cawnt AS b&lt;/P&gt;&lt;P&gt;            ON a&lt;SUB&gt;atinn  =  b&lt;/SUB&gt;atinn  AND&lt;/P&gt;&lt;P&gt;               a&lt;SUB&gt;atzhl  =  b&lt;/SUB&gt;atzhl  AND&lt;/P&gt;&lt;P&gt;               a&lt;SUB&gt;adzhl  =  b&lt;/SUB&gt;adzhl&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN  lt_ausp_tp2&lt;/P&gt;&lt;P&gt;         WHERE a~atinn  EQ  lt_ausp_tp2-atinn  " 내부특성&lt;/P&gt;&lt;P&gt;           AND b~spras  EQ  sy-langu.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT  lt_work BY matnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  BREAK-POINT.&lt;/P&gt;&lt;P&gt;  LOOP AT lt_work  INTO ls_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  특성내역&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE  lt_ausp  WITH TABLE KEY  objek = ls_list-matnr&lt;/P&gt;&lt;P&gt;                                         atnam = 'SECTION_WIDTH'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  수출자재가 아닌 것은 제외&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.&lt;/P&gt;&lt;P&gt;MODIFY TABLE GT_DATA FROM LS_LIST  TRANSPORTING SECTION_WIDTH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 13:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203697#M1376529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-29T13:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in modifying the main internal table gt_data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203698#M1376530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question before: why dont you just use the std.API for reading the classification data?&lt;/P&gt;&lt;P&gt;e.g. "BAPI_OBJCL_GETDETAIL"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.&lt;/P&gt;&lt;P&gt;Doing this after a select will only succeed randomly depending on the buffers of your data based below.&lt;/P&gt;&lt;P&gt;( 90% chance if it is an oracle system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To your question:&lt;/P&gt;&lt;P&gt;Just replace your LOOP AT gt_data into ls_list&lt;/P&gt;&lt;P&gt;by a LOOP AT gt_data ASSIGNING &amp;lt;current_list_record&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can access the fields directly:&lt;/P&gt;&lt;P&gt;&amp;lt;current_list_record&amp;gt;-SECTION_WIDTH = LT_AUSP-ATWRT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause of your issue:&lt;/P&gt;&lt;P&gt;"MODIFY" needs a key to to find the record to be updated.&lt;/P&gt;&lt;P&gt;If your gt_data ist referencing a DDIC table type with a key or a local type with a key&lt;/P&gt;&lt;P&gt;it has no chance to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2009 09:19:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203698#M1376530</guid>
      <dc:creator>Marcel_Wahl</dc:creator>
      <dc:date>2009-09-30T09:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in modifying the main internal table gt_data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203699#M1376531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2009 07:19:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-modifying-the-main-internal-table-gt-data/m-p/6203699#M1376531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-05T07:19:04Z</dc:date>
    </item>
  </channel>
</rss>

