Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Per thread:

https://www.sdn.sap.com/irj/scn/thread?forumID=292&threadID=1203517

We would like to create some Z-fields on CUSTOMER_H as radio buttons:

Solution:
We need to use the P_GETTER method of the EEWB ZZ field to define:
i) the field type as radio button,
ii) the radio button group,
iii) The way radio buttons should be arranged (horizontally or vertically). If we put no. of cols = 1, then these will be arranged vertically.

We need to use V_GETTER of the same ZZ field to:
Assign the key & value to the radio buttons (coding is similar as for dropdowns).

Following is the code:
*method GET_P_ZZCUSTOMER_H0101.*

CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_radio.
WHEN if_bsp_wd_model_setter_getter=>fp_radio_cols.
rv_value = 3.
WHEN if_bsp_wd_model_setter_getter=>fp_group.
rv_value = 'R1'.

ENDCASE.

endmethod.
*method GET_V_ZZCUSTOMER_H0101.*
DATA: lt_ddlb TYPE bsp_wd_dropdown_table,
ls_ddlb TYPE bsp_wd_dropdown_line.


IF GR_DDLB_FIELD0101 IS NOT BOUND.
CREATE OBJECT GR_DDLB_FIELD0101
EXPORTING
iv_source_type = 'T'.

clear : ls_ddlb.
ls_ddlb-key = '1'.
ls_ddlb-value = 'P1'.
append ls_ddlb to lt_ddlb.

clear : ls_ddlb.
ls_ddlb-key = '2'.
ls_ddlb-value = 'P2'.
append ls_ddlb to lt_ddlb.

clear : ls_ddlb.
ls_ddlb-key = '3'.
ls_ddlb-value = 'P3'.
append ls_ddlb to lt_ddlb.

GR_DDLB_FIELD0101->set_selection_table( lt_ddlb ).

ENDIF.

rv_valuehelp_descriptor = GR_DDLB_FIELD0101.

endmethod.

Say the field label of the field ZZCUSTOMER_H0101 is "Grade", then it will show in the UI as below:

Grade () P1 () P2 () P3
() = radio button.

  • No labels

3 Comments

  1. Guest

    Very Nice Wiki.

    What is the datatype for GR_DDLB_FIELD0101? Where do u define this variable? I am getting compilation error in this portion of code.

    Thanks,

    Ritesh

  2. Guest

    Got it its CL_CRM_UIU_DDLB. Then there is an attribute gets created for every field we add, but for me it dint get added in my Z class for context. Is it because I have not defined valuehelp for my field in EEWB. If so, Please let me know how to add the valuehelp from EEWB.

    For now, I just created variable GR_DDLB_ZZORDERADM_H0202 type ref to CL_CRM_UIU_DDLB in the class attribute, exactly the place it should be.

    Thanks,

    Ritesh

  3. Former Member

    thanks for the wiki. that helped me out and clarified my doubts.

    Thorsten