cancel
Showing results for 
Search instead for 
Did you mean: 

Badi to exclude items from template

Former Member
0 Kudos

Hi SRM experts,

The question I have has to do with GHX catalogs (market 4 place catalogs). When creating a personal template, you can add items in your SC and then click on the 'create personal template' icon next to the 'order ' button ( in transaction 'Shop').

I want to exclude products from the GHX/market 4 place catalogs, so that it is nog possible to add products from GHX into the 'personal template'. What I need is the Badi, in which I can exclude the GHX items from my personal template.

Thanx in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jason,

thanks for your reply but this BaDi didn't solve my problem. I'm searching for the Badi in which I can exclude GHX/market 4 place catalogs, so that it can not be added to 'personal templates' in the first place.

So after clicking on 'create personal template' it should give an error, when a product of GHX/market 4 place catalogs is added or it should exclude in immediately.

Thanks in advance.

Former Member
0 Kudos

Can't you just use the BBP_DOC_CHECK_BADI using the field catalogid in the it_item table?

So the steps would be: implement bbp_doc_check_badi for BUS2121 (shopping cart) with the following requirement:

1. Check if this SC is being saved as a template (in sy-ucomm you can find if the template button was hit if I'm not mistaken).

2. Loop over the items and check if the catalogid is set to a GHX/market 4 place

3. Throw an error if it contains such an item, the template can't be saved that way, so you don't end up with those products in a saved template.

there is also a BADI for individual items BBP_DOC_ITEM_CHECK_BADI, don't know the exact name, play around with the check and the item and you will find it. You could also use that one.

The above solution means that a user has to do some more actions to remove that item as in the check badi you can't change anything (except error messages). So an additional requirement could be that you delete the line programmatically as well. I don't know which badi is called first: the doc_check or the BBP_DOC_CHANGE_BADI.

You'd have to try it but another scenario could be:

1. Check the shopping cart for an illegal item using the doc check badi and throw a warning or information message, so you can still save the template.

2. Delete the offending line using the doc_change_badi (don't forget to delete the corresponding account & other data) Now that I think about it, you can probably just set the DEL_IND in the item, so the calling order for the badis wouldn't matter.

Regards,

Robin

Answers (1)

Answers (1)

jason_boggans
Active Contributor
0 Kudos

Hi,

There is only one Badi which can be used to manipulate catalog data before catalog call, this would be the BBP_CAT_CALL_ENRICH but in this case I am not sure how it can be used for this purpose.

Otherwise, depending on the catalog perhaps the catalog vendor can implement views to restrict the available data there.

Regards,

Jason