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

Deletion indicator not working after user exit error

Former Member
0 Likes
439

Hi Gurus,

I had one requirement in Purchase Requisition. If the number of items increase by 36 , there should be an error saying that maximum items reached but once that item is deleted that error should disappear.

I have written the coding in an Exit: EXIT_SAPLMEREQ_010.

And the coding is :

IF gs_eban-bsart = gcz902.

LOOP AT gt_eban INTO gs_eban

where loekz is initial.

LOOP AT gt_ebkn INTO gwa_ebkn WHERE banfn = gs_eban-banfn

and bnfpo IN r_bnfpo.

recherche division- ordre interne

LOOP AT ot_div into gwa_div WHERE ot = gwa_ebkn-aufnr AND div = gwa_ebkn-bnfpo.

ENDLOOP.

IF sy-subrc NE 0.

gwa_div-ot = gwa_ebkn-aufnr.

gwa_div-div = gwa_ebkn-bnfpo.

APPEND gwa_div TO ot_div.

ENDIF.

ENDLOOP.

ENDLOOP.

DESCRIBE TABLE ot_div LINES n.

IF n >= 37.

case sy-ucomm.

WHEN 'MESAVE'.

MESSAGE e111(zpfr) with n.

exit.

ENDCASE.

ENDIF.

ENDIF.

So now the exit is working fine......but when i go to delete that extra item it is not getting deleted , so while saving the information message comes that no data changed.

So ho wto delete that extra item.

Do anyone have reply....

thanks in advance.

Hi Gurus,

I had one requirement in Purchase Requisition. If the number of items increase by 36 , there should be an error saying that maximum items reached but once that item is deleted that error should disappear.

I have written the coding in an Exit: EXIT_SAPLMEREQ_010.

And the coding is :

IF gs_eban-bsart = gcz902.

LOOP AT gt_eban INTO gs_eban

where loekz is initial.

LOOP AT gt_ebkn INTO gwa_ebkn WHERE banfn = gs_eban-banfn

and bnfpo IN r_bnfpo.

recherche division- ordre interne

LOOP AT ot_div into gwa_div WHERE ot = gwa_ebkn-aufnr AND div = gwa_ebkn-bnfpo.

ENDLOOP.

IF sy-subrc NE 0.

gwa_div-ot = gwa_ebkn-aufnr.

gwa_div-div = gwa_ebkn-bnfpo.

APPEND gwa_div TO ot_div.

ENDIF.

ENDLOOP.

ENDLOOP.

DESCRIBE TABLE ot_div LINES n.

IF n >= 37.

case sy-ucomm.

WHEN 'MESAVE'.

MESSAGE e111(zpfr) with n.

exit.

ENDCASE.

ENDIF.

ENDIF.

So now the exit is working fine......but when i go to delete that extra item it is not getting deleted , so while saving the information message comes that no data changed.

So ho wto delete that extra item.

Do anyone have reply....

thanks in advance.

2 REPLIES 2
Read only

valter_oliveira
Active Contributor
0 Likes
416

Hello.

If you insert 37 lines you get your error message. But if you delete 1 row, you get error message again, right?

I think that's because you are not refreshing internal table ot_div. Shouldn't you refresh it before LOOP AT gt_eban INTO gs_eban?

Regards.

Valter Oliveira.

Read only

Former Member
0 Likes
416

Solved