cancel
Showing results for 
Search instead for 
Did you mean: 

Check and changes to the shopping cart via BADI's

Former Member
0 Kudos

Dear All

The customer I'm currently working for have a request to make some changes to the standard behaviour in SRM when it comes to the required on date and approval. We are on SRM Server 5.5.

1.

Logic: For text items: If required on date = todays date a warning should be given.

Question: Best to use BBP_DOC_CHECK_BADI - or BBP_DOC_CHANGE_BADI?

2.

Logic: During approval for both text items and catalogue items: If required on date is in the past or < todays date + leadtime (catalogue) required on date should be changed.

Now - the above is both to be triqqered from the inbox (approval tab) and from the detail view.

To change the dates from the detail view I would assume I should use the BBP_DOC_CHANGE_BADI - but can I use any of the BADI's stated above from the inbox and get the requested change? I'm not sure if any of the BADI's are beeing called from the inbox (approval tab).

Thanks for your great help in advance

;o)

Maria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Pls see these related threads for more pointers:

BR,

Disha.

Former Member
0 Kudos

Dear Disha

Thanks for your threads. I'm considering making the error into a warning when approving.

It does however have some business consequenses that we need to clarify (ordering something in the past...) - but could be a solution.

;o)

Former Member
0 Kudos

Hi. You will not order things in the past, the date will move itself foward when the PO is created.

Regards,

Dave.

Former Member
0 Kudos

Hi Dave (and all other experts)

As I have not changed the error to a warning yet in SRM, I'm not able to prove if the date will move to todays date during the RFC creation of the PO - but it does not happen in the backend system (PO can be created with delivery date in the past - just created one manually).

Anyway - do any of you know, if it's possible to control when the message is a warning, and when it is an error? I think the business might want to differientiate between a catalogue and a text item.

Looking at the table BBPV_PDMSG_CUS I suspect it will be reflected in all items, unless I can differientiate in the CHECK_BADI.

Thanks for your help once again.

;o)

Maria

Former Member
0 Kudos

Hi. You can only change the message to warning or error globally using config.

If you want to customise it based on other parameters the way to do it is to turn it off in config, then use the BBP_DOC_CHECK_BADI to issue it as a warning or error based on whatever criterea you want.

Regards,

Dave.

Answers (4)

Answers (4)

imthiaz_ahmed
Active Contributor
0 Kudos

I have seen this question quite often: Which to use : BBP_DOC_CHECK_BADI - or BBP_DOC_CHANGE_BADI. And seen replies not really up to mark. ( I don't mean to hurt or devalue the valuable answers from any experts )

Answer is clear:

BBP_DOC_CHECK_BADI : This BADI is solely created for the purpose of verifying the data on the screen and raising any error messages and no changes are allowed and in fact you cannot.

BBP_DOC_CHANGE_BADI - To modify the screen data.

Now based on your requirement please select the appropriate BADI. Ask yourself: Do I need to change or verify the data? Get the appropriate BADI.

Regards, IA

Former Member
0 Kudos

Dear Dave and Armin

Thanks for your answers.

The reason why we need this change to the required on date (especially in regards to the catalogue items) is that the approval is not always done the same day as the shopping cart has been created. If the user has not changed required on date to something else than the one defined by system date and leadtime, the approver cannot approve the shopping cart from the inbox - but has to enter the detail view and change the required on date to match the leadtime.

Now, this would maybe be ok if only the error message from the inbox made sence (today: document contains errors --> Approval not possible). We want to enhance the error message, but at the same time for catalogue items add the right amount of days in order to enclose the leadtime specified for this specific item (todays date + leadtime). The last automatically - and without having the manager go into the detail view to do the changes him/herself.

So just to cut it out in carton for me: can you tell me if the BADI BBP_DOC_CHANGE_BADI is called at the time of approval from the inbox screen (not going into the detail screen)?

Thanks for your help in advance

;o)

Maria

ahofius
Explorer
0 Kudos

Hi Maria,

detailed question, i just checked in our test environment (SRM 5.5).

The first time the CHANGE BADI is called is when the user clicks on the detail screen, not at the inbox screen (but i had no test scenario where the approval was not possible due to a wrong delivery date).

So the improvement would be an automatic change of the date by clicking the detail screen.

You can check this on your system by setting an external breakpoint in the BADI implementation (remember to set it for the appropriate user).

Regards,

Armin

Former Member
0 Kudos

Hi. You are getting the backend error message ME 039 about delivery date in the past I think.

What exactly is the text, is it "Delivery date is in the past"?

If so, just go to the config in the backend and make it a warning, or turn it off, then the users will not have to change the dates during approval.

Then, when the PO is finally created the date will move forward using the logic I explained initially.

If you want it off in SRM but on for backend POs it is possible, let me know and I can tell you how.

Regards,

Dave.

Former Member
0 Kudos

Hi again

Armin - I have just made an external debugging along with one of our programmers - and the change BADI is not called until I reach the detail screen. The Check BADI is however called, but cannot be used to change the document, from what I can see in the documentation.

Do you know of any other BADI's being called at the "inbox" time - which at the same time can be used to change the SC?

Dave - The exact message is "Document Contain Errors -> Approval not possible" - it's by the way during the approval of the SC (Classic Scenario). It seems to be a general message leaving it up to the user to find out whats wrong. This can however quite easily be done by going into the detail screen and press save - and a descriptive error message appears. Managers are however sometimes not that easy to agree on several click and investigations/changes before they can perform their approval. Hence I have this problem ;o)

Still I think our solution will be to enhance the standard flow with a more descriptive error message - and maybe add the logic for extra leadtime when they enter the detail view and press save or change. Do you have other suggestions?

Thanks for your help so far guys

;o)

Maria

ahofius
Explorer
0 Kudos

Hi Maria,

as David stated use the CHANGE BADI for changes and the CHECK BADI for checks.

If you are in classic scenario and your customer maintains a factory calendar in the R/3 backend, you can calculate the next business day via an RFC function call in the backend using the function module 'BUSINESS_DAY_CREATE'.

This prevents you from setting the date on a weekend for example.

Regards,

Armin

Former Member
0 Kudos

Hi. For the warning definitly use the BBP_DOC_CHECK_BADI.

For the moving of the date, BBP_DOC_CHANGE_BADI should work.

The question I would ask is what exactly do you want to see and where? As standard when the PO is created the delivery date on the PO will be the creation date + the lead time for catalog items, or for free text it will be the current date.

You could just insert a standard lead time on free text items, perhaps 7 days or something using BBP_DOC_CHANGE_BADI and let the standard behaviour sort it out.

Regards,

Dave.