cancel
Showing results for 
Search instead for 
Did you mean: 

Changed value is not captured in BBP_DOC_CHECK_BADI

Former Member
0 Kudos

Hello,

When I change a PO field on the portal and hit 'check' button, the changed value is not captured in the doc check badi. We have the guid of the po and when I call get detail FM, it doesn't return the changed value for the first time. But, it does when I save and check or hit check twice. I see that the badi is called multiple times, but the error messages table is populated first time and doesn't get cleared after the badi called for the second ( or subsequent ) times. My question is how do I check against the changed value on portal without saving/ clicking check twice/ refreshing.

Hope this is clear and any help is truly appreciated.

Thanks,

Shekar

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Chandra ,

In the code what you can do is make sure you always get the chnage version guid when you use the FM BBP_PD_PO_GETDETAIL. for that first time use the FM BBP_PD_PO_GETDETAIL with the GUID in the badi and read the table ET_VERSION. if the table ET_VERSION has any open change version GUID take that and now use the FM BBP_PD_PO_GETDETAIL and then you will be able to get the change detail

Cheers

Iftekhar Alam

Former Member
0 Kudos

An alternative is to populate your custom error message in the implementation of BBP_DOC_CHANGE_BADI.

Former Member
0 Kudos

Hello Jay,

How do I populate errors in BBP_DOC_CHANGE_BADI as there is no messages table in this BAdi parameters.

Former Member
0 Kudos

When I change a PO field on the portal and hit 'check' button, the changed value is not captured in the doc check badi.

I took a second look at your original requirement. This can be validated with BBP_DOC_CHECK_BADI. You can get the document information by calling BBP_PROCDOC_GETDETAIL given iv_doc_guid as a previous post suggested. Yes, it might not be the first round of call that gives you the changed value, but a later round of call to CHECK BADI would, without you having to click "check" more than once. So implement your BBP_DOC_CHECK_BADI for the field value check and it would eventually catch that changed value. And as long as one round of call catches that value, your message would be raised. You don't need to implement BBP_DOC_CHANGE_BADI for validating field values.

Former Member
0 Kudos

I guess I am missing the point here. I have a field on PO that can only edited by user 'A', the user 'A' saves the PO with some value on that field. Now user B goes and changes the field, then I need to compare the current value on portal against the the value saved by user 'A'. ' If the value is different then I need to throw error message.

Hope I am clear now. Thanks you very much for your suggestions.

Thanks,

Shekar

Former Member
0 Kudos

There are two scenarios here :

1) User A saves the PO. Value filled by A is saved and stored. User B is changing the PO and not yet clicking on "Save".

2) User A saves the PO. Value filled by A is saved and stored. User B is changing the PO and saves the PO as well.

Now if you want to compare the two values by user A and B,

Scenario 1) You can compare the value in the buffer (by calling BBP_PROCDOC_GETDETAIL) with that same field value in DB table (search the DB). This can be done in implementation of BBP_DOC_CHECK_BADI.

Scenario 2) You can get the field value changes by reading CDHDR / CDPOS tables where the change document is stored.

Another option for you is to turn the field to display-only AFTER user A enters a valid value, to prevent any further changes to this field. This can be done through configuration in IMG ("Extensions and field controls") and implementing your own dynamic class and method.

Former Member
0 Kudos

Hi,

The reason you do not see the data first time is because the buffer tables have not been modified till that point in time. When you save/check the second time, you are able to see the data because the buffers were updated during first time.

In order to see the buffer data the first time itself, you might have to use BORF related code. I dont have access to system so I cannot provide the exact code but you can go to function module BBP_PD_PO_GETDETAIL and check the code there. It is the code that is used just before called bbp_procdoc_getdetail.

Hope this helps. If not then let me know and I will try to find out the exact code.

Best regards,

Sandeep