cancel
Showing results for 
Search instead for 
Did you mean: 

Show field in New BP and Hide Field in Update BP

Former Member
0 Kudos

Hi,

I need to hide the field STRUC.BP_GROUP only when the bp is gonna be updated.

Do you know how can I do this?

Thanx in advanced.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create two configuration for your bp. Call configuration with this code. This will work.

Best regards

PAnkaj kumar

METHOD do_config_determination.

**********************************************************************

  • Switch configuration that is used based on field value.

**********************************************************************

DATA:

lv_value TYPE char2,

lv_object_type TYPE bsp_dlc_object_type VALUE '<DEFAULT>',

lv_object_subtype TYPE BSP_DLC_OBJECT_SUB_TYPE value '<DEFAULT>',

lr_node TYPE REF TO if_bol_bo_property_access.

CALL METHOD super->do_config_determination

EXPORTING

iv_first_time = abap_false.

lr_node = typed_context->some_node->collection_wrapper->get_current( ).

CHECK lr_node IS BOUND.

lr_node->get_property_as_value(

EXPORTING

iv_attr_name = 'SOME_ATTRIBUTE'

IMPORTING

ev_result = lv_value ).

*

lv_object_type = 'MY_UI_OBJECT_TYPE'.

CASE lv_value .

WHEN 'SOME_VALUE1'.

lv_object_subtype = 'JIMBOB'.

WHEN 'SOME_VALUE2'.

lv_object_subtype = 'BUBBA'.

ENDCASE.

me->set_config_keys( iv_object_type = lv_object_type

iv_object_sub_type = lv_object_subtype

iv_propagate_2_children = abap_true ).

ENDMETHOD.

CarstenKasper
Active Contributor
0 Kudos

hehe, seems I created a code template

cheers Carsten

Answers (3)

Answers (3)

Former Member
0 Kudos

Don't ask me why (hehe). The story is...

The first time you create a BP instead of choosing a Role you select a Group.

There is a validation that depending of the Group the Role is atached to the BP.

The point is... When you update the BP you can change the Role but you can't change the Group.

To avoid confusing they want to hide the Group onlye when you are updating the BP because the Group may not correspond to the Role.

Thanx in advanced.

Regards

Arno-Meyer
Advisor
Advisor
0 Kudos

Hello!

Two useful notes in this context:

[Note 1257009 - Role-dependent field modification not supported|https://service.sap.com/sap/support/notes/1257009]

[Note 999092 - CRM WebClient: Field & screen modification|https://service.sap.com/sap/support/notes/999092]

Best regards

Arno

Former Member
0 Kudos

hi,

You can do the same by checking bp id field. Check for the condition if bp id is equal to null(BP not yet saved). if bp id not equal to null(BP saved) then make rv_disable= ' TRUE' in get_I_ method of your field name.

Hope your pbm is solved.

Best regards

Pankaj Kumar

Former Member
0 Kudos

Hello,

The solution mentioned by Pankaj will only enable or disable the field based on the condition. But the requiremetn here is to hide/unhide the field.

I would say that this can be achieved by multiple configuration, but this would be a little risky as it is always recommended to use the sap delivered configurations.

Probably please explain the requirement with more details, it would be helpful.

Regards,

Vinay