Hello everyone,
I am relatively new to ABAP programming, and I need some help with a certain requirement.
I currently have a task where I need to make select-options mandatory/optional based on which radio button is checked. Seeing as I cannot define select-options in screen painter, I decided to create a subscreen containing them, and inserting it into a subscreen area.
Unfortunately, I cannot figure out a way to change the 'required' attribute for the select-options programmatically. How can I achieve this requirement?
*-Group1 'REQ' contains the select-*options. If r_manage/r_display radio button is checked, the select-*options should be made optional
LOOP AT SCREEN INTO wa_screen.
CASE 'X'.
WHEN r_entry.
IF wa_screen-group1 EQ 'ENT'.
wa_screen-active = '0'.
ENDIF.
WHEN r_manage.
CASE wa_screen-group1.
WHEN'ENT'.
wa_screen-active = '1'.
WHEN 'REQ'.
vl_req_flag = 'X'.
ENDCASE.
WHEN r_display.
CASE wa_screen-group1.
WHEN'ENT'.
wa_screen-active = '1'.
WHEN 'REQ'.
vl_req_flag = 'X'.
ENDCASE.
ENDCASE.
MODIFY SCREEN FROM wa_screen.
ENDLOOP.
*-Preparing values in listbox
vl_vrm_id = 'P_STATUS'.
wa_vrm-key = '1'.
wa_vrm-text = 'Available'.
APPEND wa_vrm TO it_vrm.
wa_vrm-key = '2'.
wa_vrm-text = 'Out'.
APPEND wa_vrm TO it_vrm.
wa_vrm-key = '3'.
wa_vrm-text = 'Both'.
APPEND wa_vrm TO it_vrm.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = vl_vrm_id
VALUES = it_vrm.
ENDFORM.
The above subroutine is called whenever the PBO module is called. I am using 'vl_req_flag' as a global variable to determine whether the select-options should be mandatory or optional. I am just stuck on how to access the attributes for the inputs to modify the 'required' attribute.
Any help would be greatly appreciated.