cancel
Showing results for 
Search instead for 
Did you mean: 

Disable OCI catalogue links in specific situation.

former_member184111
Active Contributor
0 Kudos

Hi All,

We are implementing SRM 5 .0 EBP .From the home screen when link "SHOP" is clicked , we can see the links for OCI catalogs .Say there are 5 OCI links --> link1 , link2 , link3 , linkn4 and link5 .

Now the requirement is such that the user should be able to add materials/services only from one kind of OCI application ie. if the user clicks link1 , add some materials to the shopping cart and goes back to the previous step1(Select Goods/Services) using road map , only link1 sholud be clickable , rest all OCI application links should be disabled.

OR

When the user goes back to step1 using the roadmap , there should be no OCI catalog links but only a message saying "You can add materials only from one catalogue type in one shopping cart" , in that part of the screen where links are displayed.

We dont have the option to remove or disable the roadmap.

How can we achieve this?

Thanks & Regards,

Anubhav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Why not just remove the links that are not allowed? That's a lot more user friendly and quite an elegant solution. In the rest of this post I'll describe the steps necessary to achieve this. This depends on the WAS version though!

1. Go to SE80

2. Function Group: BBP_SC_UI_ITS

3. Open Include LBBP_SC_UI_ITSF73

4. Press Shift+F4 (Enhancement)

5. In the menu: Edit->Enhancement Operations->Show Implicit Enhancement Options

6. Right click on the first enhancement option (just below the FORM - line 13 in my system) and select Enhancement Implementation->Create

7. Select "Code" in the popup screen

8. in the following popup give it a name (Z_HIDE_OCI_LINKS) and description (Hide OCI links), leave the last input field empty and continue

9. Select a package (as with normal developments)

10. Enter the wanted code between the 2 enhancement tags:


  DATA: ls_item TYPE t_scr_itmovr_i.
  CLEAR ls_item.
  
* check if the item table is not initial
  IF gt_scr_itmovr_i IS NOT INITIAL.
*   select the first item
    READ TABLE GT_SCR_ITMOVR_I INTO ls_item INDEX 1.
*   delete all the catalogs that are not the same as from the 1st item
    DELETE gt_catalogs_sorted WHERE service_id NE ls_item-catalogid.
  ENDIF.

11. Save and activate the enhancement.

12. Test it to see that all other OCI links have disappeared

Regards,

Robin

former_member184111
Active Contributor
0 Kudos

Hi Robin,

The solution looks perfect as i checked gt_scr_itmovr_i in debuging but i am getting the following dump while trying to create the enhancment..

Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_MESSAGE_ILLEGAL_TEXT', was not
     caught in
    procedure "ACTION" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    The text parameter in MESSAGE  cannot be an initial reference

Is this (as you mentioned) because of the WAS version?

Got it ..need to implement the note no.1098603

fot this exception...

Thanks & Regards,

Anubhav

Edited by: Anubhav Jain on Feb 4, 2009 6:13 AM

former_member184111
Active Contributor
0 Kudos

Hi Robin,

The solution is perfect ....thanks a lot.

Anubhav

Answers (1)

Answers (1)

former_member206968
Active Contributor
0 Kudos

Hi

One of the easiest way to do is to use BBP_DOC_CHECK badi. Get all the items of the shopping cart, compare the catalog_id value for all items. If they are not matching, then throw an error.

However this would be triggered only after user has added multiple items from the catalogues. If you would like to hide the links of the catalog after first item is added, then you can think of using BBP_UI_CTRL_badi or bbp_sc_ui_modify badi. Once an item has been added and the user is in step one, then you can hide the links of other catalogues. You might have to use Sy-ucomm variables to achieve this.

Regards,

Sanjeev

former_member184111
Active Contributor
0 Kudos

Hi Sanjeev,

BBP_DOC_CHECK BADI can not be used because of the reason mentioned by you,

BBP_SC_MODIFY_UI BADI has a structure GS_SCR_ITMCHOICE-CATALOG which if set will show all catalog lins and if reset will hide all catalog links , i cant see how can i control individual links in this BADI..

In BADI BBP_UI_CONTROL BADI i could not find the screen number 110(screen where catalog links are dispayed ) in debuing mode and still trying to figure it out .

Please explaing in more detail or you have any other pointers on this..or we need to modify the ITS service?

Thanks a lot for the help.

Regards,

Anubhav

Former Member
0 Kudos

Hi. Are these internal catalogues (CCM or MDM) that you are using?

If so, you could create a new view (or named search / mask) with no items in.

Create a new catalogue user that has this view, so no items can be found.

Then use BADI BBP_CAT_CALL_ENRICH to override the catalogue call structure and send this user if the user is trying to order from an incorrect catalogue. Also use BBP_DOC_CHECK_BADI to issue a warning when the user goes back to SRM, something like "catalogue blank due to incorrect catalogue used".

This way the user can not use the wrong catalogue. They will be able to open the catalogue, but they will get no items so they will not waste their time trying to order, then they will get a message telling them why they could not find any items.

You could actually create a dummy item in the users view called "DO NOT USE THIS CATALOGUE" or something, that would tell them what they were doing wrong.

Regards,

Dave.

former_member184111
Active Contributor
0 Kudos

Hi David,

Let me try the solution , i ll get back in case any help is needed.

Thanks a lot for the help.

Regards,

Anubhav

former_member184111
Active Contributor
0 Kudos

Hi David,

The BADI BBP_CAT_CALL_ENRICH is trigered whenever the catalog link is clicked , we get the catalog id in the structure IS_CAT_ENTITY , now two conditions need to be checked

1)Number of items in the SC

2)The catalog id of the catalog from which the item was added into the SC.

Somehow even if i manage to check these two things , how will i redirect the link (URL of catalog which is clicked when thers already one or more items in SC) , to show another page or BSP application with the error message?

Please explain how is it possible?

Thanks a lot,

Anubhav

Former Member
0 Kudos

Hi. I wasn't thinking about changing the URL, but that is a good idea.

Can you not change it in structure CT_POST_VALUES?

I was thinking just change the user ID that is sent in the call structure to be a user that has no items available in the catalogue.

Regards,

Dave.

former_member184111
Active Contributor
0 Kudos

Hi David,

The structure CT_POST_VALUES is always empty ...

I was thinking just change the user ID that is sent in the call structure to be a user that has no items available in the catalogue.

It would be a great help , If you can give step by step procedure about this .

Thanks a lot,

Anubhav

Former Member
0 Kudos

Hi. Sorry, I have never actually used this BADI, but thought as it was a changing parameter it would have all the values in.

In that case, it must be for additional values you can add.

So, just take the user name and password out of the call structure in the IMG.

Then in the BADI, pass the normal user name and password when you want the user to see all the items, and pass the other user name and password when you want the user to see blank.

Does Robin's idea work dynamically though? If it does that sounds like a neater solution, if used alongside the BBP_DOC_CHECK BADI. You would have to issuie a warning saying "catalogues disabled as you have used one already" or else you will get users complaining that the links have dissapeared.

Regards,

Dave.

former_member184111
Active Contributor
0 Kudos

Hi David,

Thanks a lot for your time.

Regards,

Anubhav