cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting an idoc segment in memory

Former Member
0 Kudos

I am using the user-exit EXIT_SAPLEINM_011 to delete a segment for materials that I do not want to send to the interface. The material is in the E1EDP19 segment. I search for all E1EDP19 segment where material is stored and get the PSGNUM for each materials that needs to be deleted and store the PSGNUM in a table (LT_PSGNUM). Then I loop throught the PSGNUM table to read each PSGNUM and delete all entries in the internal table EDIDD where PSGNUM matched PSGNUM and SEGNUM so that I can delete parent and children. The problem is somehow it deletes more than what I intend to delete. I have total 28 segments and if deleted cofrrectly I should get only 23 segments instead I get only 4 segments.

Any help is appreciated and thanks in advance.

- Vijay

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vijay,

It seems like you are having issues with your abap coding. Can you post in abap forums for faster response.

Regards,

---Satish

Former Member
0 Kudos

loop at t_edidd into ls_edidd.

IF ls_edidd-SEGNAM = 'E1EDP19' and ls_edidd-sdata+0(3) = '001'.

lv_tabix = sy-tabix.

lv_psgnum = ls_edidd-psgnum.

lv_e1edp19 = ls_edidd-sdata.

ls_matnr-matnr = lv_e1edp19-idtnr.

*--- Select the maximo relevant material from MARA

SELECT SINGLE matnr zzmaximo_relvnt INTO ls_matnr FROM mara

WHERE matnr = ls_matnr-matnr

and ( zzmaximo_relvnt = c_mxtrk OR

zzmaximo_relvnt = c_mxvw ).

if sy-subrc ne 0.

append lv_psgnum to lt_psgnum.

endif.

endif.

endloop.

loop at lt_psgnum into lv_psgnum.

loop at t_edidd into ls_edidd where segnum = lv_psgnum or psgnum = lv_psgnum.

lv_tabix = sy-index.

delete t_edidd index lv_tabix.

endloop.

endloop.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

Vijay

we don't need the code - do you know how to debug abap ?

just put the break point on : delete t_edidd index lv_tabix.

and check which indexes are being deleted

there is no easier way - honestly

Regards,

Michal Krawczyk

Former Member
0 Kudos

This runs in the background so debugging is not simple. I tried to use SM66 but could not get into debugging mode. I added code to give me more time to be able to debug but somehow SM66 did not enter into debug mode. I tried this code online (created a test program) and got the data from EDID4 and was able to delete unwanted segment but in the user exit something is not right. I want to debug it but I can't get the control.

Thanks for all replies.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

aa so you should have said that at the beginning

the debug is fairly easy:

- run the transaction which sends the idoc and specify the idoc output - as run by schedule program

and not immediately in the transaction

- then run rnast..00 and it will get stop

there is no need to use anything else and it always works

Regards,

Michal Krawczyk

Former Member
0 Kudos

This was very useful. It helped me understand the internal structure. Without this, I don't think any solution I attempted would have worked.

Thanks a lot.

Vijay

MichalKrawczyk
Active Contributor
0 Kudos

hi,

I know

Regards,

Michal Krawczyk

Former Member
0 Kudos

U can also find transactions that issues output. We had a similar problem with Billing output. We issued output from transaction VF31 after which it was hitting the user-exit and we were able to debug the process.

regards

rajeev

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>I have total 28 segments and if deleted cofrrectly I should get only 23 segments instead I get only 4 segments.

is there a problem to do the debug and check why the delete statement does not work ?

there is no magic with it right ?

Regards,

Michal Krawczyk