on 03-24-2010 3:03 PM
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
Hi Vijay,
It seems like you are having issues with your abap coding. Can you post in abap forums for faster response.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.