<?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 Delete idoc segments in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-idoc-segments/m-p/7264534#M1529347</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;&lt;/P&gt;&lt;P&gt;I need to delete the idoc segments for some condition based on the table KNVV value. It is basic type is DEBMAS05.&lt;/P&gt;&lt;P&gt;I have used a wrapper FM ZIDOC_INPUT_DEBITOR as i could not find a user exit in IDOC_INPUT_DEBITOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In test run we19, in debuggin i see the incorrect records/segments are getting deleted from IDOC_DATA which is the way i have coded. However when i see the generated idoc number i can see all the segments and the incorrect segments are not getting deleted. Let me know how to delete idoc segments through code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I have tried in BD59 to reduce the idoc segment, but the condition for our requirnment cannot be possible in BD59.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE idoc_data-segnam.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNA1M'.&lt;/P&gt;&lt;P&gt;        gwa_deb_hdr = idoc_data-sdata.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNVVM'.&lt;/P&gt;&lt;P&gt;        gwa_deb_sale = idoc_data-sdata.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNMB1'.&lt;/P&gt;&lt;P&gt;        gwa_deb_comp = idoc_data-sdata.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       APPEND gwa_aex_item TO gt_aex_item.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF gwa_deb_hdr+0(3) = '004'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      IF sy-tabix &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE kunnr vkorg vtweg INTO (lv_kunnr, lv_vkorg, lv_vtweg)&lt;/P&gt;&lt;P&gt;            FROM knvv&lt;/P&gt;&lt;P&gt;            WHERE kunnr = gwa_deb_hdr+3(10)&lt;/P&gt;&lt;P&gt;               AND vkorg = gwa_deb_sale+3(4)&lt;/P&gt;&lt;P&gt;               AND vtweg = gwa_deb_sale+6(2).&lt;/P&gt;&lt;P&gt;        IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;          DELETE idoc_data INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDLOOP&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Senthil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Sep 2010 16:08:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-15T16:08:31Z</dc:date>
    <item>
      <title>Delete idoc segments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-idoc-segments/m-p/7264534#M1529347</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;&lt;/P&gt;&lt;P&gt;I need to delete the idoc segments for some condition based on the table KNVV value. It is basic type is DEBMAS05.&lt;/P&gt;&lt;P&gt;I have used a wrapper FM ZIDOC_INPUT_DEBITOR as i could not find a user exit in IDOC_INPUT_DEBITOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In test run we19, in debuggin i see the incorrect records/segments are getting deleted from IDOC_DATA which is the way i have coded. However when i see the generated idoc number i can see all the segments and the incorrect segments are not getting deleted. Let me know how to delete idoc segments through code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : I have tried in BD59 to reduce the idoc segment, but the condition for our requirnment cannot be possible in BD59.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT idoc_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE idoc_data-segnam.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNA1M'.&lt;/P&gt;&lt;P&gt;        gwa_deb_hdr = idoc_data-sdata.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNVVM'.&lt;/P&gt;&lt;P&gt;        gwa_deb_sale = idoc_data-sdata.&lt;/P&gt;&lt;P&gt;      WHEN 'E1KNMB1'.&lt;/P&gt;&lt;P&gt;        gwa_deb_comp = idoc_data-sdata.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       APPEND gwa_aex_item TO gt_aex_item.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF gwa_deb_hdr+0(3) = '004'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      IF sy-tabix &amp;gt; 1.&lt;/P&gt;&lt;P&gt;    SELECT SINGLE kunnr vkorg vtweg INTO (lv_kunnr, lv_vkorg, lv_vtweg)&lt;/P&gt;&lt;P&gt;            FROM knvv&lt;/P&gt;&lt;P&gt;            WHERE kunnr = gwa_deb_hdr+3(10)&lt;/P&gt;&lt;P&gt;               AND vkorg = gwa_deb_sale+3(4)&lt;/P&gt;&lt;P&gt;               AND vtweg = gwa_deb_sale+6(2).&lt;/P&gt;&lt;P&gt;        IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;          DELETE idoc_data INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDLOOP&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Senthil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 16:08:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-idoc-segments/m-p/7264534#M1529347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-15T16:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Delete idoc segments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-idoc-segments/m-p/7264535#M1529348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just want to know.&lt;/P&gt;&lt;P&gt;If the standard idoc segmets cannot be deleted through code or this doesnot work as i ran in test run we19?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 18:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-idoc-segments/m-p/7264535#M1529348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-15T18:01:44Z</dc:date>
    </item>
  </channel>
</rss>

