cancel
Showing results for 
Search instead for 
Did you mean: 

Catalog items visible to everyone, purchaseable only for some users

Former Member
0 Kudos

Hello everybody

Me again trying to find a solution to the following problem:

We need to have some items in our catalog that are visible for every user but only purchaseable via shopping cart / SRM for some authorized users. I couldn't find any possibility in the customizing. So my attempt would be to add an additional attribute in CCM where I can put some kind of flag and then to construct an authorization check based on that flag and on a authorization profile. In case the authorization check fails, the catalog item may not be put in the shopping cart. Preferabily the shopping cart icon should be disabled for such items.

Did somebody out there already think about something similar or already implemented something like that?

It would also be a good basis for offering a publicly viewable, browseable catalog for "window shopping", because I also didn't find a way until now to publish the catalog as a standalone web application without shopping cart functionality.

What do you out there think about it?

Kind regards,

Renaud

Accepted Solutions (1)

Accepted Solutions (1)

yann_bouillut
Active Contributor
0 Kudos

Hi Renaud,

For the standalone scenario, you can create a zmenu that contain the catalogue url link for catalogue display.

This way, you do not have any SC functionnality.

Kind regards,

Yann

Former Member
0 Kudos

Hi Yann & Renaud,

Yann, have you already tried to call CCM 2.0 CSE directly, without calling it from SRM or PM ?

You should... and you will see that CCM CSE is not designed to be called directly (like Requisite BugsEye), and expect an inbound calling structure.

Renaud,

in Requisite, there was an attribute "Not Procurable". I don't think there is a similar attribute in CCM, but you can create one and pass it via OCI, and in SRM catalog BADI get rid of those items if the user is not allowed for them.

Or you could derive the minimum order qty check feature (if you don't use it already) to implement your logic : set a 99999999 value for all items in CCM, but bypass the check for wanted users.

Your solution to deactivate the basket icon in CCM for those items will require CCM BSP modifications.

Rgds

Christophe

Former Member
0 Kudos

Hi Christophe & Yann

Yes, already tried to call CCM 2.0 CSE directly some days ago. It works, somehow, however the basket icon still are there and in item detail view the button "add to cart" is also there. As soon as you click on either one, the browser window blanks out and nothing more happens. However, you still can use the browser back button.

Yann,

What do you exactly mean with ZMENU? Creating a new menu entry in the employee role containing an URL pointing to CCM 2.0 CSE? If yes (yet not tested) then I think it will act the same as in "standalone mode". But it's worth a try... will keep you informed.

Christophe,

I will try to see if our users accept your proposed solution. We already have this attribute in CCM. Just need to pass it over via OCI. The problem will be that the user will think the item is procurable and will wonder, why it doesn't appear in his/her shopping basket.

Maybe it would be an option, to additionally create/raise a warning message above the basket items that tells the user something like "not authorized to item xyz, please...".

Do you think it's possible to span those 2 things together, I mean the authorization check throwing away unwanted catalog items combined with such a warning?

Kind regards,

Renaud

yann_bouillut
Active Contributor
0 Kudos

Hi Renaud,

"What do you exactly mean with ZMENU? Creating a new menu entry in the employee role containing an URL pointing to CCM 2.0 CSE? "

---> Yes

"If yes (yet not tested) then I think it will act the same as in "standalone mode". "

---> yes (as far as i remember , it was the case with ccm v1

Christophe :

Yes, i have done it for CCM V1

Kind regards,

Yann

Former Member
0 Kudos

Renaud,

Yes you can: If you intercept the items in the SRM catalog BADI with the OCI flag, then you can call your own custom message and define a really explicit one.

How did you managed to call CCM 2.0 CSE directly ?

I tested it few weeks ago on a CCM 2.0 SP3, and I had an error returned back saying that the calling parameters were missing. I check in the BSP and saw that it was searching for usual parameters (Hook URL, catalog ID, user, password...).

Is there a way to pass those parameters directly into the URL (without submitting a form that includes all those parameters) ?

if you call CCM directly w/o SRM, then you should try to deactivate the "Add to cart", because if you don't have activated the item list (equivalent to Requisite shopping cart), CCM tries to send back selected items directly to the Hook URL (which is missing in this case).

Rgds

Christophe

Former Member
0 Kudos

Hi Christophe

I managed to call CCM 2.0 CSE directly using an URL like that:

http://<host.domain>:<port>/sap/bc/bsp/ccm/srm_cse/main.do?catalogid=/CCM/MASTER_CATALOG&sap-client=...

Do you have an idea where and how to deactivate this "Add to cart"?

What do you mean with "..., because if you don't have activated the item list..."?

Kind regards,

Renaud

P.S.

Sorry, completely forgot to mention it: we're on SRM 4.0 with SRM Server 5.0 SP08 and CCM 2.0 SP03.

Message was edited by: Renaud Desarzens

Former Member
0 Kudos

Hi Renaud,

thanks for the URL syntax.

For Button deactivation, I don't know how to do it (I never played with CCM BSP pages), but I guess you could hide it if some parameters are empty (like the HOOK URL).

When calling CSE, there is an additional parameter "use_selection_list" to set to X to activate the list of selected items. With this, the items are added in CCM, you can continue in CCM, and transfer them at the end to SRM. If you want to see your currently selected items, you can look at them in this list (equivalent to Requisite shopping cart tab). This list is available as a new entry in the drop down list box with hierarchical and index search.

If you don't use this list, you can select items and transfer thel in the same way, but you don't have an overview on which one have been selected.

Rgds

Christophe

Former Member
0 Kudos

Hi Christophe,

You wrote:

> Yes you can: If you intercept the items in the SRM

> catalog BADI with the OCI flag, then you can call your

> own custom message and define a really explicit

> one.

I have some difficulties to understand how to do this exactly. I have specified a new attribute in my CCM catalog carrying this flag and have mapped it to one of the already available customer fields in order to have it transported between CCM -> SRM SC. In the BAdI I can intercept it but am stuck in where to define an own custom message and how to call it in order to make it appear on the screen.

Could you give me some more direction on it? That would be great!

Kind regards,

Renaud

Former Member
0 Kudos

Hi Renaud,

you can create your custom message class in transaction SE91, and create new messahe numbers (don't forget to translate them in used languages).

You can then call them in any ABAP code, for instance in BADI BBP_CATALOG_TRANSFER where you can add messages in table ET_SC_MESSAGES, after deleting forbidden items from ET_SC_ITEM_DATA.

In ET_SC_MESSAGES, create a new entry with

TYPE = W

ID = your custom message class (ZXXX)

NUMBER = your new message number (001)

MESSAGE_V1 to V4 = the parameters used in your message (replace &)

Rgds

Christophe

Former Member
0 Kudos

Hi Christophe

Great info! Thank you very much... will give it a try next week.

Kind regards,

Renaud

Former Member
0 Kudos

Hi Christophe

Finally found the time to try this out. It principally works but not as expected. I created a custom message class with SE91 (ZXXX) and added a message number (000) with two variables in it (&1 and &2). It is activated!

In the BAdI BBP_CATALOG_TRANSFER I coded this:

  ...
  ls_message-type       = 'E'.
  ls_message-id         = 'ZXXX'.
  ls_message-number     = '000'.
  ls_message-message_v1 = wa_catalog_content-cust_field5.
  ls_message-message_v2 = wa_et_sc_item_data-ordered_prod.
  APPEND ls_message TO et_sc_messages.
  ...

When testing it, I only get the standard message in BBPSC03 telling me (translation from german, wording in english is probably not correct): "Incomplete items in catalog; only complete ones were tranferred".

The message only appears if I set the message type to "E". If it is "W" (warning) or "I" (info) it does not appear at all.

But worst of all: the message text and variables (e.g. message_v1) are not taken into account at all. Any idea what's wrong here? Everything works except that I can't make the correct message text to appear...

Kind regards,

Renaud

Former Member
0 Kudos

Hi Renaud,

Can you try to populate the complete message by yourself, in ls_message-message, with something like:

move wa_catalog_content-cust_field5 to LV_MESSAGE_V1.

move wa_et_sc_item_data-ordered_prod to LV_MESSAGE_V2.

CALL FUNCTION 'RPY_MESSAGE_COMPOSE'

EXPORTING

LANGUAGE = SY-LANGU

MESSAGE_ID = 'ZXXX'

MESSAGE_NUMBER = '000'

MESSAGE_VAR1 = LV_MESSAGE_V1

MESSAGE_VAR2 = LV_MESSAGE_V2

MESSAGE_VAR3 = LV_MESSAGE_V3

MESSAGE_VAR4 = LV_mESSAGE_V4

IMPORTING

MESSAGE_TEXT = ls_message-message

EXCEPTIONS

MESSAGE_NOT_FOUND = 1

OTHERS = 2.

ls_message-type = 'E'.

ls_message-id = 'ZXXX'.

ls_message-number = '000'.

ls_message-message_v1 = wa_catalog_content-cust_field5.

ls_message-message_v2 = wa_et_sc_item_data-ordered_prod.

APPEND ls_message TO et_sc_messages.

If it does not work, then you can use directly the ABAP instruction:

<i>message id 'ZXXX' type 'E' number '000' with wa_catalog_content-cust_field5 wa_et_sc_item_data-ordered_prod.</i>

instead of trying to pass it in the return table.

This will generate a popup, and not a message in the check list.

Rgds

Christophe

PS: please reward points for helpfull answers

Former Member
0 Kudos

Hi Christophe

Thanks a bunch for your great help! I could solved the problem and am now able to have some catalog items visible but only purchaseable for authorized users. This is what I've done:

1. Create a new authorization class (SU21)

2. Create a new authorization object within this class

3. Create a new authorization field within this object

Don't forget to save and quit the SU21 transaction and then reenter it (/nsu21) because only then you'll see your changes / additions... seems to be a "refresh-bug" in SU21.

4. Create a new role (PFCG) and an authorization profile containing the new authorization object. Assign the values needed.

5. Create a new attribute in CCM and assigned it to OCI cust_field5 (because this one is of type TEXT50)

6. Implemented some code in BAdI BBP_CATALOG_TRANSFER:

DATA: wa_et_sc_item_data  TYPE BBP_PDS_SC_ITEM_D.
DATA: wa_catalog_content  TYPE BBP_WS_OCI_ITEM_S.
DATA: lv_authorized       TYPE c.
DATA: lt_limtab           TYPE TABLE OF string.
DATA: wa_limtab(10)       TYPE C.
DATA: lv_message_v1       LIKE SY-MSGV1.
DATA: lv_message_v2       LIKE SY-MSGV2.
DATA: lv_message_v3       LIKE SY-MSGV3.
DATA: lv_message_v4       LIKE SY-MSGV4.

LOOP AT et_sc_item_data INTO wa_et_sc_item_data.
* Get corresponding line from transferred catalog data
  READ TABLE catalog_content INTO wa_catalog_content
                             WITH KEY line = wa_et_sc_item_data-number_int
                             BINARY SEARCH.
  IF sy-subrc = 0.
*   If field content for checking authority against is not empty...
    IF NOT wa_catalog_content-cust_field5 IS INITIAL.
*     Perform authority check
      AUTHORITY-CHECK OBJECT '<your auth.object here>'
                      ID     '<your auth.field here>' 
                      FIELD  wa_tab.
      IF sy-subrc <> 0.
        MOVE wa_catalog_content-cust_field5  TO lv_message_v1.
        MOVE wa_et_sc_item_data-ordered_prod TO lv_message_v2.
*       Eliminate leading zeroes from product number
        WHILE lv_message_v2+0(1) = '0'.
          SHIFT lv_message_v2.
        ENDWHILE.
*       Output message
        MESSAGE ID     'ZXXX'
                TYPE   'W'
                NUMBER '000'
                WITH   lv_message_v1
                       lv_message_v2.
*       Remove item from SC
        DELETE et_sc_item_data.
      ENDIF.
    ENDIF.
  ENDIF.
ENDLOOP.

Interesting observation is, that when issueing the message with type = 'I' it does not condense the message text. With type = 'W' it does...

I also found out the reason, why the way via ET_SC_MESSAGES will not work: SAP <b>has hard coded</b> somewhere after the BAdI call the message id and message number... so no way to bypass this without a modification.

Kind regards,

Renaud

Former Member
0 Kudos

Thanks Renaud for your complete feedback !!!

Answers (0)