Skip to Content
0

BAPI_PRODORD_CHECK_MAT_AVAIL is reseting to my previous screen!

Feb 07 at 11:20 AM

39

avatar image
Former Member

Hello,

So i am doing a report, with a ALV SALV class. I have two buttons, and in one button it should call the bapi BAPI_PRODORD_CHECK_MAT_AVAIL.

But as soon as i press the button it takes me to my previous selection screen.

I am using the lr_alv->refresh( refresh_mode = 2 ) to refresh the values of ALV. I tried removing the BAPI, and when i do so it works fine. As soon as i insert the bapi code, the button kicks me out of the alv screen to the selection screen.

CALL FUNCTION 'BAPI_PRODORD_CHECK_MAT_AVAIL' EXPORTING reset_avail_data = gv_reset

scope_avail = 'A'

IMPORTING

return = gs_return

TABLES orders = lt_aufnr

detail_return = gt_detail.

IF gs_return-type NE 'E' OR gs_return-type NE 'A'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDIF.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raymond Giuseppi
Feb 07 at 12:33 PM
0

If the BAPI (or any custom development in it) is 'guilty', then try to execute it and the BAPI_TRANSACTION_COMMIT/ROLLBACK in DESTINATION NONE.

Share
10 |10000 characters needed characters left characters exceeded
Iftah Peretz
Feb 09 at 01:45 PM
0

Hi,

Not sure how the two are connected (are there any GUI calls inside that BAPI? - not in front of an SAP system). In addition, why are you saying you are using lr_alv->refresh( refresh_mode = 2 ), if all you do is on the button press is to call the BAPI?

Another workaround is to have this flagged (have some indicator) and on your selection screen see if it is on and act accordingly (rest that flag) and bring the user back to the ALV screen.

Another question that comes to mind, how are you handling this button? Have you tried turning this into an event handler - do you get the same behavior?

Share
10 |10000 characters needed characters left characters exceeded