‎2010 Sep 15 5:08 PM
Hi all,
I need to delete the idoc segments for some condition based on the table KNVV value. It is basic type is DEBMAS05.
I have used a wrapper FM ZIDOC_INPUT_DEBITOR as i could not find a user exit in IDOC_INPUT_DEBITOR.
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.
Note : I have tried in BD59 to reduce the idoc segment, but the condition for our requirnment cannot be possible in BD59.
LOOP AT idoc_data.
CASE idoc_data-segnam.
WHEN 'E1KNA1M'.
gwa_deb_hdr = idoc_data-sdata.
WHEN 'E1KNVVM'.
gwa_deb_sale = idoc_data-sdata.
WHEN 'E1KNMB1'.
gwa_deb_comp = idoc_data-sdata.
APPEND gwa_aex_item TO gt_aex_item.
ENDCASE.
IF gwa_deb_hdr+0(3) = '004'.
IF sy-tabix > 1.
SELECT SINGLE kunnr vkorg vtweg INTO (lv_kunnr, lv_vkorg, lv_vtweg)
FROM knvv
WHERE kunnr = gwa_deb_hdr+3(10)
AND vkorg = gwa_deb_sale+3(4)
AND vtweg = gwa_deb_sale+6(2).
IF sy-subrc NE 0.
DELETE idoc_data INDEX sy-tabix.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP
Thanks,
Senthil
‎2010 Sep 15 7:01 PM
Just want to know.
If the standard idoc segmets cannot be deleted through code or this doesnot work as i ran in test run we19?