cancel
Showing results for 
Search instead for 
Did you mean: 

FM/BADI SC approved then PO created in SRM

Former Member
0 Kudos

Hello,

I need to add some controls on PO creattion in SRM. Could you please let me know which FM/BADI is used when SC is approved and PO is created in SRM side:

SC approved in SRM --> FM/BADI --> PO created automatically in SRM

Thanks,

Hazem.

Accepted Solutions (1)

Accepted Solutions (1)

former_member208675
Active Contributor
0 Kudos

Hi,

If you are looking to update data of PO you can use FM: BBP_PD_PO_UPDATE.

You can also look for BAdi BBP_ECS_PO_OUT_BADI to decide data that supposed to send to backend. It only works for extended classic scenario.

I hope it helps.

Regards,

Former Member
0 Kudos

Thanks for the reply,

We are using extended classic scenario. What i want is to modify some data in the PO at SRM side when it is created after SC approval. My question is not related to PO creation in the backend.

Thanks,

Hazem.

Former Member
0 Kudos

Hello Hazem,

You can use BADI BBP_DOC_CHANGE which gets call after shopping cart approval. That way you can make changes before it converts the PO.

Thank you

Ritesh

Former Member
0 Kudos

Thanks a lot,

Here are more details about the modification i want to do:

When SC is approved, PO is created in SRM. At the PO creation i want to uncheck check boxes highlighted in red in the following image.

If my understanding is correct, i can use BADI BBP_DOC_CHANGE for this purpose, right?

Thanks,

Hazem.

Former Member
0 Kudos

Can i use FM BBP_PD_PO_CREATE?

Former Member
0 Kudos

Hi Hazem,

DOC_CHANGE_BADI gets call whenever approver approve the Shopping cart before it is going to convert the PO. The fields Confirmation - based Invoice verification and Goods Receipt which you have specified are related to PO and it get pull from Vendor master.

If per your business process those fields are not required for certain vendor then just update the vendor master data accordingly so that it will be un-checked rather then going through Development work.

DOC_CHANGE_BADI calls for SC via BBP_SC_CHANGE and for PO via BBP_PO_CHANGE intefaces. During approval it will be called Interface BBP_SC_CHANGE and it will modify the SC data. You can how ever try passing those information into BBP_PO_CHANGE to modify the PO fields which you want to.

FM BBP_PD_PO_CREATE will not be useful in your case as system will automatically create PO based on your configuration once SC approved. i.e. If all the data is complete including vendor then PO will be created else it will go in Sourcing cockpit.

Hope this helps.


Thank you

Ritesh

laurent_burtaire
Active Contributor
0 Kudos

Hello Hazem,

in standard, follow-on document flags are copied from SRM vendor master to SRM PO.

In order to know in which conditions BBP_DOC_CHANGE_BADI BAdI can be used, check OSS note 1260486 - BBP_DOC_CHANGE_BADI: vendor and follow-on document flags

You can also have a look at include LBBP_PDIGPF0B.

Regards.

Laurent.

Former Member
0 Kudos

Hello Ritesh and Laurent,

I tried to debug the code in order to check where to modify the code in order to uncheck GR_IND and GR_BASEDIV check boxes. I set external breakpoints in the Include LBBP_PDIGPF0B but when approving the SC, the system creates the PO but does not stop in the breakpoint.

I check also several notes from SAP and i think that the modification should be done in the include LBBP_PDIGPF0B.

Any ideas?

Thanks a lot for your support,

Hazem.

laurent_burtaire
Active Contributor
0 Kudos

Hello Hazem,

of course break-point does not work: PO is created in background by WF-BATCH...

So, put WF-BATCH user in dialog mode then put a break-point with this user.

Regards.

Laurent.

Former Member
0 Kudos

Hello Laurent,

Do you mean that i have to log into the system with user WF-BATCH and set the breakpoint? If yes, i have first to know the password. Then when i approve the SC with user XXX how can i debug since the breakpoint was set for different user (WF-BATCH) in our case?

Sorry if i am asking a lot of questions but i am quite new to SRM

Many thanks in advance,

Hazem.

Former Member
0 Kudos

I think i got it:

Change in SU01 WF-BATCH to dialog

go to se38-->settings-->debugging and set WF-BATCH in external debugging

Right?

Thanks,

Hazem.

Former Member
0 Kudos

Hello,

So finally i think that i have to modify the coding in the Include LBBP_PDIGPF75 in order to uncheck

GR_IND and GR_BASEDIV for a special company code.For this i think that the only way to proceed is to use implicit enhancement.

What do you think?

Thanks,

Hazem.

Former Member
0 Kudos

Hello,

I added a code into the BBP_PO_CHANGE method in the BADI BBP_PO_CHANGE_BADI to uncheck GR_IND and GR_BASED_IV. It is working when creating a free text shopping cart but when creating a shopping cart from catalog, GR_IND and GR_BASED_IV are always checked.

Do you have an idea about this?

Thanks,

Hazem.

Former Member
0 Kudos

Hi Hazem,

I think your code shouldn't work even for free text items. May be you didnot assign a supplier for the free text item, and because there is no supplier, no flags were set for that particular PO. But otherwise, those flags should be set based on the supplier master data.

Even I'm working on this customization. Can you tell me how did you achieve this.? Is it via implicit enhancement only ? I found that there is no BADI being called except some Price updation badis and BBP_DOC_CHECK_BADI and I cannot update in DOC_CHECK_BADI, if because if one tries to, it'll end up in infinite loop.

Thanks,

Karthik

Answers (0)