cancel
Showing results for 
Search instead for 
Did you mean: 

BADI that is called when we create shopping cart

Former Member
0 Kudos

Hi all,

Can any one tell me the BADI that is called when we order a shopping cart.

Thanks&Regards,

Hari

Accepted Solutions (1)

Accepted Solutions (1)

yann_bouillut
Active Contributor
0 Kudos

Hi,

bbp_doc_check badi

bbp_doc_change badi

bbp_item_check badi

....

Tell us what you want to do ...as there are plenty of badis

kind regards,

Yann

Edited by: Yann Bouillut on Dec 20, 2007 2:48 PM

Former Member
0 Kudos

Hi yann,

I need to trigger a workflow when the shopping cart is created...i have created a customise workflow ..so it has to be done in BADI i suppose( if i am wrong correct me) so i need the BADI name..

Thanks&Regards,

Hari

Former Member
0 Kudos

Hi

For Business Object type - BUS2121, the SAVED event is triggered, once shopping cart is saved, using Standard SRM Workflow.

Refer to SAP transaction - SWETYPV (for Event linkages)

When a user orders a shopping cart. This triggers the SAVED event, which starts the approval workflow. The system analyzes the start conditions in Customizing.

There is information here on which workflow the system should start under which conditions. Each workflow represents an approval process (single-level or multi-level) or is defined in such a way that no approval is necessary.

If approval is required, the system goes through the corresponding approval procedure. The user can meanwhile change or delete the shopping cart. The shopping cart can take on the following statuses:

Not accepted

Approved

Deleted

Changed

You can further process a request via a subworkflow.

If approval is not required, the system sets the status to Approved and immediately starts the subworkflow.

Users receive a work item. Before the shopping cart can be further processed, they have to accept the rejection of items (or not, as the case may be).

After the shopping cart is released, the system calls the spooler. This transfers the shopping cart to the backend system or creates a purchase order locally in the Enterprise Buyer system.

This is how a workflow triggers.

You want to start several Wf for one event ? Technically this is possible, but not recommended as you will loose some functionalities like the approval preview and maybe some related to the workflow restart: In SRM the system consider that only one workflow instance can be active at a time.

For the approval preview, it get the last active version.

For the worklow restart, the same.

Select BOR object BUS2121 using SWO1 transaction.

The whole list of shopping cart approval WF will be displayed.

Please go through the related links as well ->

Hope this will help. Do let me know.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

Thanks for your immediate reply...my problem is that i have in herited the std Business object bus2121 to zbus2121 and added several attributes(since it was required) and created my own work flow..(I deactivated the std wf's)...now this work flow is not getting triggered..

I activated the event linkage and also given the start conditions...(they said u have to trigger the workflow using a function module and you need to call it in BADI)

Pls help me..

Thanks&Regards,

Hari

Former Member
0 Kudos

Hi

Please go through the complete solution below ->

Create your own Business Object based on your table and define the events (txn SWO1). Have a common routine/function module to update the table. You can trigger your event from within this function module using standard SAP functions like SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT depending on your release. You should not allow any direct updates to your table other than by calling the common routine. Even if you create your own change document object for the table, remember that you need to write the documents yourself every time the table is updated. It is lot easier to have a simple update routine.

Events are created when the relevant status change occurs. The event creation must be implemented by SAP or yourself, or catered for by appropriate table settings. Usually, the event creation is implemented in the application programs for the events supplied by SAP. Event creation by calling function module SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT

SAP Related link ->

http://help.sap.com/saphelp_46c/helpdata/en/c5/e4aec8453d11d189430000e829fbbd/content.htm

Inside the BADI, you can call the above function module and get the job done...

Hope this will help. Do let me know.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

yes thats what i need to know the exact BADI name in which i have to call that function module..

Thanks&Regards,

Hari

Former Member
0 Kudos

Hi

As specified earlier, please use BBP_DOC_CHANGE_BADI (create implementation using SE19 transaction) in this case.

Do let me know.

Regards

- Atul

pvanhoove
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Hari,

You are in the good way and you don't need any badi to trigger your workflow.

You created a subobject zbus2121, fine.

Now you need to delegate bus2121 to your subobject zbus2121 (done in the first screen os swo1, settings --> delegate).

With this delegation the standard object can use the new attributes defined in the subobject.

In your custom workflow make reference only to bus2121 and activate the link between your workflow and the event saved of the object bus2121.

Rgds,

Pierre

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

As Yann told, there are several BADIs..

Please go through the relevant SAP documentation of these BADIs using SE18 Transaction.

However, incase you are looking for the BADI - once shopping cart is created is the

BBP_ITEM_CHANGE_BADI

BBP_APPEND_ITEM

BBP_DOC_CHANGE_BADI

BBP_DOC_CHECK_BADI..

(By implementing the same using SE19 transaction, You can issue custome messages in this case)..

Hope this will help. Do let me know.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

Which BADI should i use to trigger my workflow...(is this right way to do or else some other way is there)...

Note: i am using customised work flow not a std one

Thanks&Regards,

Hari

yann_bouillut
Active Contributor
0 Kudos

Hi,

Did you use one of the following WF ?

- Spending limit for SC with BAdI

(n-step (dynamic)

WS14000133

N-step approval workflow for shopping cart (alternative to all SC workflows)

Determination of approver occurs dynamically via a BAdI.

- Item-based approval for SC

WS14500015

Multi-step approval of individual SC items by responsible approver

Kind regards

Yann