cancel
Showing results for 
Search instead for 
Did you mean: 

Shopping Cart or shopping cart template is calling the BADI implemenation

Former Member
0 Kudos

Hi Gurus,

Currently, i have used an implementation of the BADI BBP_DOC_CHECK_BADI and this implementation should trigger for Shopping Cart only. The problem is that it is also being triggered foir the Template. I am planning on setting up a flag in which if the flag is populated, it will skip the codes of the implementation (meaning the Template triggerred the implementation.) Else, it will continue with the logic of the implementation (meaning the SC triggered the implementation).

How can i know if the Shopping Cart or Shopping Cart Template is callign the BADI implementation?

Thanks in advance.

shockadis.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183819
Active Contributor
0 Kudos

Hi

SY-UCOMM = 'SEL_YOUR_ITEM_SLCT'.

'SEL_YOUR_ITEM_SLCT' - you may use this field

muthu

Former Member
0 Kudos

Hi muthu,

the BADI implementation is triggered when the user presses "CHECK", deletes a line item or assigns a vendor to a line item in shopping cart/shopping cart template. hence i cannot use sy-ucomm since it is always blank. any other ideas?

thanks for the response.

shockadis

former_member183819
Active Contributor
0 Kudos

long back we used this trick to delete any vendors already assined to old template.

since we find lot of difficulty to identify the field it is ordering from old po templates . atlast we found this one only.

now i am wondering that OLD PO templates dont triger doc check badi validation too.

what are the data you are checking in the old po tempalte and not trigering your check badi.

muthu

Former Member
0 Kudos

Hi muthu,

i dont want the badi to trigger when im using the shopping cart template. the implementation checks everything in the shopping cart. what should i check?

regards,

shockadis

former_member183819
Active Contributor
0 Kudos

I am sorry even i asked SAP how to differentiate both old PO template and other shopping carts but i did not get proper reply .

why one baby offering sugar and another baby giving salt

why dont you want not to validate doc check badi for old template shopping cart.

indeed templates carried bad data in my experience rather that regualr carts.

check badi for whole business object - bus2121

Let us wait for others reply.

Muthu

Former Member
0 Kudos

thanks for the effort muthu,

the scope of the develment only includes the shopping cart, not the shopping cart template.

i have checked that business object, but to no avail, i have not found anything useful.

assigning a vendor to an item is mandatory for shopping cart, but its not applicable to shopping cart template.

thanks again and regards,

shockadis.

Former Member
0 Kudos

How about appending a customer indicator field (Something like a indicator for old SC or template SC) to table INCL_EEW_PD_HEADER_CSF_SC and INCL_EEW_PD_HEADER_CSF..

Logic

When a New SC created populate this indicator (X), This means when we use the same SC again as template with this indicator we can able to identify whether its new SC or Template SC..

Hoop this will be helpful..

Thanks!!

Bharath

Former Member
0 Kudos

i dont want the badi to trigger when im using the shopping cart template. the implementation checks everything in the shopping cart. what should i check?

I have to repeat what Masa had suggested - check the SUBTYPE field of the shopping cart header. When the implementation of BBP_DOC_CHECK_BADI is called, the iv_doc_guid would be available to you. You could use it to call BBP_PD_SC_GETDETAIL at the beginning of the routine. In the returned header structure, check the SUBTYPE value. If it is 'ST' (for SC template), skip the rest of the implementation. You can NOT avoid the BADI implementation to be triggered completely. But with the above mentioned logic, it takes barely any time to run through and get out.

former_member183819
Active Contributor
0 Kudos

subtype - sc template

Thanks jay . i understood i was refering here Old Purchase Orders and Templates

Muthu

Former Member
0 Kudos

Hi Bharath,

unfortunately, the solution cant be applied because the check for when if the item has a vendor happens while the shopping cart template is being created, not once it's created.

thanks for the reply.

regards,

shockadis

Former Member
0 Kudos

Hey Jay,

that solved it! thanks a lot.

awarding you with full points.

thanks a lot!

regards,

shockadis

closed.

Answers (1)

Answers (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Please go to transaction BBP_PD. You see "Subtype" field for document. You can check the subtype field for template in the BADI.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

the BADI implemenation needs to know the subtype before the shopping cart template is processed (while the user is making the template). the problem is, the field GUID wont be generated until the shopping cart template is processed. we will be using the GUID to select thhe subtype from table BBP_PDHGP right?

thanks for the reply.

shockadis