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

BADI implementation for creating a reservation

geert-janklaps
SAP Mentor
SAP Mentor
0 Likes
2,476

For one of our customers we are creating a Web Dynpro application that needs to replace the default sap transaction MB21. Within the normal SAP GUI there has been added a field for the Business Area through customizing. So I'm trying to create a new implementation for MB_RES_BAPI_CREATE1 BADI which will map the field GSBER to the table.

When I test the BADI from within the Class Builder it works as it was suposed to be working. But when I call BAPI_RESERVATION_CREATE1 the BADI isn't called. (I also filled the extensionin parameter so it should be called).

Can someone give me a hint?

Thanks in advance

For one of our customers we are creating a Web Dynpro application that needs to replace the default sap transaction MB21. Within the normal SAP GUI there has been added a field for the Business Area through customizing. So I'm trying to create a new implementation for MB_RES_BAPI_CREATE1 BADI which will map the field GSBER to the table.

When I test the BADI from within the Class Builder it works as it was suposed to be working. But when I call BAPI_RESERVATION_CREATE1 the BADI isn't called. (I also filled the extensionin parameter so it should be called).

Can someone give me a hint?

Thanks in advance

3 REPLIES 3
Read only

Former Member
0 Likes
1,425

Hi

The code from BAPI_RESERVATION_CREATE1:

* get object reference for BAdI MB_RES_BAPI_CHANGE
  CALL METHOD cl_exithandler=>get_instance
    EXPORTING
      exit_name              = 'MB_RES_BAPI_CREATE1'
      null_instance_accepted = 'X'
    CHANGING
      instance               = if_mb_res_bapi_create1.

* BAdI
  IF NOT if_mb_res_bapi_create1 IS INITIAL.
    CALL METHOD if_mb_res_bapi_create1->extensionin_to_resb
      EXPORTING
        extension_in = extensionin
      CHANGING
        resb         = t_resb[]
        return       = return.
  ENDIF.

So the BADI 'MB_RES_BAPI_CREATE1 is called if there's an implementation active: so are you sure it's active?

Max

Read only

0 Likes
1,425

Yes I'm sure that everything is active, I activated the method that needed to be implemented and the BADI. (I also tried to deactivate the BADI en reactivate it but that didn't help).

Read only

0 Likes
1,425

Hi

Try to run the BAPI by SE37 in debug mode

Max