Skip to Content
avatar image
Former Member

BAPI_PRODORD_CHECK_MAT_AVAIL is reseting to my previous screen!


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.


scope_avail = 'A'


return = gs_return

TABLES orders = lt_aufnr

detail_return = gt_detail.

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



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 07, 2018 at 12:33 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 09, 2018 at 01:45 PM


    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?

    Add comment
    10|10000 characters needed characters exceeded