1

I did the following:

  • Created two configurations C1 and C2.
  • Enhanced the View and Classes of a standard Web UI component, added a ComboBox field.

What should I do to select dynamically the configuration? - Example:

  • If the user chooses "A" in ComboBox then C1 should be shown.
  • If the user chooses "B" in ComboBox then C2 should be shown.

My Config for ZLOY BRole

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
dkolodin
  • 23
  • 7
  • Did you try implementing the BAdI described in the [documentation](https://help.sap.com/saphelp_crm70/helpdata/en/d3/dda2cab51243d8ab9f33df67330673/frameset.htm)? – Sandra Rossi Jun 21 '19 at 11:20
  • Thanks a lot for your answer, Sandra. Yes. Here's my configuration. UCCPGMain is for "A" value in ComboBox. UCCPGMain is for "B" value in ComboBox. Both config is for ZLOY Business role. – dkolodin Jun 21 '19 at 11:33
  • Can you tell more about how you implemented the BAdI then, or do you think it doesn't apply to your question (and why)? – Sandra Rossi Jun 21 '19 at 11:37
  • Honestly I didn't implemented anything. I just enhanced standard Component, that's all. I was thinking, when I enhancing component the BAdy would be implemented automatically. – dkolodin Jun 21 '19 at 12:04
  • I won't be able to help more (moreover, I don't have a CRM system), but you may find some answers in [SCN](https://answers.sap.com/questions/12317384/badi-or-enhancement-spot-to-set-config-keys-dynami.html) (I searched `web ui dynamic configuration BAdI site:sap.com`), especially one possibillity (no BAdI) which is to redefine the method `DO_CONFIG_DETERMINATION` of the class of the concerned view. – Sandra Rossi Jun 21 '19 at 12:35
  • `when I enhancing component the BAdy would be implemented automatically` of course no – Suncatcher Jun 22 '19 at 20:31

1 Answers1

2

Use DO_CONFIG_DETERMINATION event of your view, and place something like this:

    IF <ComboBox.Value> EQ "A".
      CALL METHOD me->set_config_keys
        EXPORTING
          iv_object_type          = 'your_object_type'
          iv_object_sub_type      = 'your_sub_obj_type'
          iv_propagate_2_children = abap_false.
    ELSE.
      ...config B
    ENDIF.

Here object and subobject types are the ones you were prompted while creating custom configuration.

The sample implementation of this method one can find in BP_HEAD/AccountDetails standard WebUI component.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90