cancel
Showing results for 
Search instead for 
Did you mean: 

How to get previous version data in SAVE badi?

former_member184111
Active Contributor
0 Kudos

Hello Experts,

In BBP_DOC_SAVE_BADI using FM BBP_PD_SC_GETDETAIL gives the data currently entered in the UI i.e. for eg. if a SC was saved earlier with line item 1 quantity = 10 now the user is editing the SC and changed quantity to 100 so above FM returns 100 for 1st item quantity.

How can I get the previous data before it is changed i.e. how can I determine the last saved item details before the current session?

I tried to get the change version GUID for item but that does not works.

Thanks,

Anubhav

Accepted Solutions (1)

Accepted Solutions (1)

former_member208244
Active Participant
0 Kudos

Hello Anubhav,

Please use the MF BBP_PD_SC_GETDETAIL, and read E_VERSIONS table, then use the versions's GUID to search again with BBP_PD_SC_GETDETAIL.

That is the way to search information in previous versions of the document.

Regards,

SG

Former Member
0 Kudos

Hi,

I would like to highlight two points here.

1. You cannot get the version information from BBP_PD_SC_GETDETAIL. For that you'll have to go to the generic BAPI "BBP_PROCDOC_GETDETAIL".

2. A changed version of a document will not be created when you update a document in saved state.

You can get the previously saved consistent value either directly from the table BBP_PDIGP or Reset the buffer using the function module   BBP_PROCDOC_RESET_BUFFER.

Note: If you reset buffer, then any changes to the document during the transaction will not be reflected. Use it cautiously.

Regards,
Karthik

former_member184111
Active Contributor
0 Kudos

Hallo SG,

BBP_PD_SC_GETDETAIL do not have E_VERSIONS table.

Thanks,

Anubhav

Answers (0)