01-24-2014 8:02 PM
We have a Z function module that calls
CALL FUNCTION 'BAPI_RESERVATION_CREATE'
to create a reservation per Material, Quantity, SoldTo, etc.
Some time ago, someone modified table RESB for the reservation with a custom column called ZCRTIME, which is supposed to hold the time stamp that the reservation gets created. This will be used later in comparing how old the reservation is. That person never added the functionality to actually UPDATE the new column, however.
The custom field has been added to RESB, but in what way can I add the timestamp to when RESB gets updated? Is this a function and perhaps userexit in MB21?
Thanks
Jeremy H.
01-25-2014 5:37 AM
Hello Jeremy Hilden.
You could use BAPI_RESERVATION_CHANGE.
Pass required Z data via EXTENSIONIN parameter.
Regards.
01-25-2014 6:23 AM
Hi,
No need to use the user-exits to update your requirement.
- You have already appended the field in the table. So SAP provided the functionality to update the values via BAPI thru EXTENSION IN AND EXTENSION OUT.
- already you are calling the BAPI FM through the customized program. You can fill the field in extension in strucure and pass to the BAPI, it will update the value automatically in RESB table.
please check the link!
Appending Customer Fields (SAP Library - Customer Enhancement and Modification of BAPIs (CA-BFA))
01-28-2014 2:22 PM
Thank you both for these valuable suggestions.
I'm in the process of trying to make this work with the Z_FUNCTION that I have right now that calls the BAPI_RESERVATION_CREATE.
As I read through the documentation above, it appears I have to modify the BAPI itself, in terms of adding the ExtensionIn paramter to the BAPI (when I tried this the system prompted me for an Access Key, which I didn't expect I was going to need for this process.
Do I need to modify the BAPI by adding the parameter? Can you help identify the specific changes I would make in my Z_FUNCTION?
It also appears in the documentation that I need to add BAPI_TE_RESB and BAPI_TE_RESBX to the data/tables area of my Z_FUNCTION. Do I also need to define these two in SE11, as new structures? That also prompts for an access key.
Thanks
Jeremy H.
01-28-2014 4:28 PM
Hi, have a look at the BAPI_RESERVATION_CREATE1. There is no extensionin parameter in BAPI_RESERVATION_CREATE.
However, you may have problems that arose with our implementation, when we wanted to fill a table in the extensionin, the call inside the bapi ( if_mb_res_bapi_create1->extensionin_to_resb) is passing only the header-line of the extensionin structure. I tried to find out the workaround and had to implement an implicit enhancement for this (as extensionin is a table for RESB). This looks like a bug in standard program.