cancel
Showing results for 
Search instead for 
Did you mean: 

BADI BBP_SCREENVARIANT - Removing the delete source of supply button

Former Member
0 Kudos

Hi,

has anyone used BADI BBP_SCREENVARIANT for removing the delete source of supply button in BBPSC02?

I can create the screen variant via SHD0 and set the field to invisible no problem.

I want to call the screen variant only if the the shopping cart has been added from a catalogue, i.e. only if field CATALOGID is populated (not blank).

Is this possible and has anyone done this?

Regards

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

use the following code in your badi 'BBP_SCREENVARIANT'

DATA: es_header TYPE bbp_pds_sc_header_d.

DATA: et_item TYPE TABLE OF bbp_pds_sc_item_d,

wa_item TYPE bbp_pds_sc_item_d.

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

i_guid = iv_guid

IMPORTING

e_header = es_header

TABLES

e_item = et_item.

IF sy-subrc = 0.

LOOP AT et_item INTO wa_item.

IF wa_item-catalogid IS INITIAL.

iv_scvariant = 'ZZSCREENVARIANT'. " your Z screenvariant name

ENDIF.

ENDLOOP.

ENDIF.

<b>Reward points for helpful answer</b>

regards,

Andy

Former Member
0 Kudos

Hi Andy,

thanks for this, however when I syntax check I get the following error

Class ZCL_IM_BBP_SCREENVARIANT, Method IF_EX_BBP_SCREENVARIANT~GET_SCREENVARIANT_SC "ET_ITEM" is not expected.

Any ideas?

Thanks

Chris

Former Member
0 Kudos

Hi

<u>For which filter type (Business object type) you created the Customer BADI Implementation using SE19 Transaction.</u>

<b>Choose the filter type as BUS2121 'Shopping cart'.</b>

<u>Here is the final syntax error/free code...</u>

METHOD if_ex_bbp_screenvariant~get_screenvariant_sc.

  DATA: es_header TYPE bbp_pds_sc_header_d.
  DATA: et_item TYPE TABLE OF bbp_pds_sc_item_d,
  wa_item TYPE bbp_pds_sc_item_d.

  CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
    EXPORTING
      i_guid   = iv_guid
    IMPORTING
      e_header = es_header
    TABLES
      e_item   = et_item.

  IF sy-subrc = 0.
    LOOP AT et_item INTO wa_item.
      IF wa_item-catalogid IS INITIAL.
        iv_scvariant = 'ZZSCREENVARIANT'. " your Z screenvariant name
      ENDIF.
    ENDLOOP.
  ENDIF.

ENDMETHOD.

Hope this will help. Do let me know.

Regards

- Atul

Former Member
0 Kudos

Hi Atul,

thanks for the repose, a quick question for clarification should line

iv_scvariant = 'ZZSCREENVARIANT'.

read

ev_scvariant = 'ZZSCREENVARIANT'.

as I want to set my variant as the new screen variant?

also I only want to do this if the catalogue ID is not blank so should this be

IF wa_item-catalogid NOT INITIAL. ????????????????

Thanks in advance

Chris

Former Member
0 Kudos

Hi Chris,

Yes you have to use EV_SCVARIANT = 'ZZSCREENVARIANT'.

and yes the condition is also correct.

If not wa_item-catalog_id is initial.

ev_scvariant = 'ZZSCREENVARIANT'.

endif.

Note : I dont see any changes in my code and atul's code.

Reward points useful answers.

Regards,

Andy

Former Member
0 Kudos

Hi

<b>Of course, you need to use ev_scvariant here</b>

<u>Assign ev_scvariant as per you custom screen variant created in SHD0 Transaction.</u>

Use this code..

IF NOT wa_item-CATALOGID INITIAL.
...
...
ENDIF.

Hope this will help.

<b>Related links -></b>

Regards

- Atul

Former Member
0 Kudos

Andy, Atul,

thanks for all your help. The code is correct from a syntax point of view however the screen variant is not 'hiding' the Remove Assigned Vendor button (BUTTON_SOS_RESET).

My screen variant ZBBP_SC_0330 has the field Remove Assigned Vendor marked as Invisible but this is either not being called or is not making a diffierence.

Any ideas at all?

Cheers

Chris

Former Member
0 Kudos

Hi Chris,

Check whether your screen variant is working fine in SAP GUI.

Let me know whether it is working fine or not in SAP GUI.

Regards,

Andy

Former Member
0 Kudos

Hi Andy,

nope in the GUI I can still see the button.

Regards

Chris

Former Member
0 Kudos

Hi Chris,

Can you give the screen variant details that you are using.

You can also do the following

Create a transaction variant and put your screen variant in it.

now in the standard variant, give the transaction code and your transaction variant and activate it.

Now check in SAP GUI, if you have created your screen variant correctly then the field will not be visible in GUI and in WEB.

Test thie and Let me know.

Regards,

Andy

Former Member
0 Kudos

Hi Andy,

I created by screen variant from scratch by doing the following

1. In SHD0 for transaction code I created Transaction variant ZBBP_SC.

2. This took me into transaction BBPSC02 in the GUI.

3. From here i processed a shopping cart up to the point where I could select the Source of Supply screen (SAPLBBP_SC_UI_ITS 0330) and the field for 'Remove Assigned Vendor' was visible.

4. I set the flag for Invisible for this field and then clicked the Exit and Save button which created my screen variant ZBBP_SC_0330.

I'm unsure what you mean when you say "now in the standard variant, give the transaction code and your transaction variant and activate it. " can you claify.

Thanks

Chris

Former Member
0 Kudos

in the tcode SHD0, you can see three tab strips.

first one is standard variants

second one is transaction variants

third one is screen variants

create a screen variant -


which u did

create a transaction variant -


give some name and add your screen variant

create a standard variant -


give the transaction variant name here and activate it.

regards,

Andy

Former Member
0 Kudos

Hi Andy,

I've activated the transaction variant as the standard variant and the delete assigned vendor is now removed!

However, the logic in the BAdi to remove the button only if the Catalogue ID is not blank does not seem to be taken into account. The button is remvoed for describe requirement items with vendor lists and for catalogue items.

Any ideas?

Thanks for all your help.

Chris

Former Member
0 Kudos

Hi Chris,

This shows that your screen variant is working fine.

Check the following

1) Deactivate the Standard variant in Tcode SHD0

2) In the badi 'BBP_SCREENVARIANT' comment the catalogid condition and just pass your screen variant name. Check whether 'Delete assigned vendor' button is invisible.

3) If this is happening put a external break point in the badi near 'BBP_PD_SC_GETDEATIL' and check whether data is getting passed to the FM or not.

Regards,

Andy

Former Member
0 Kudos

Hi Andy,

again thanks for your help.

1. If I remove my screen variant from the transaction variant or deactivate the transaction varaint and debug the BAdi I can see the following.

a. The BAdi is called and the code is cycled through.

b. If I change the statement from IF NOT wa_item-catalogid is INITIAL to IF wa_item-catalogid is INITIAL to allow me to create a shopping cart in the Gui for a product category with an associated evdnor list then I can see that the screen variant is correctly passed to parameter ev_scvariant. However this doesn't seem to have any impact on the display of the button.

The info coming back from function module BBP_PD_SC_GETDETAIL appears to be correct.

I'm at a bit of a lose.

Regards

Chris

Former Member
0 Kudos

Hi Chris,

Which SRM version are you using.

If you are in SRM 5.0, try using badi 'BBP_UI_CONTROL_BADI'.

Let me know if you require any help with this badi.

I am not sure this will help your requirement.

Regards,

Andy

Message was edited by:

Andy V

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes this can be done. Just set the ev_scvariant in the shopping cart method equal to the name of the screen variant.