Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delete idoc segments

Former Member
0 Likes
1,056

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

1 REPLY 1
Read only

Former Member
0 Likes
498

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?