How to Give Dropdown in alv report in sap abap programming Language
IF p_fieldname = 'REASONS'.
wa_fcat-f4availabl = 'X'.
ENDIF.
PERFORM dropdown_table CHANGING g_grid.
FORM dropdown_table CHANGING g_grid TYPE REF TO cl_gui_alv_grid.
DATA :lt_dropdown TYPE lvc_t_drop WITH HEADER LINE.
DATA: gs_f4 TYPE lvc_s_f4,
gt_f4 TYPE lvc_t_f4.
LOOP AT it_fcat INTO wa_fcat.
IF wa_fcat-fieldname = 'REASONS'.
wa_fcat-drdn_hndl = '1'.
wa_fcat-outputlen = 20.
MODIFY it_fcat FROM wa_fcat.
ENDIF.
ENDLOOP.
*CLEAR GT_F4.
* GS_F4-FIELDNAME = 'REMARK'.
* GS_F4-REGISTER = 'X'.
* GS_F4-GETBEFORE = 'X'.
* GS_F4-CHNGEAFTER = 'X'.
* APPEND GS_F4 to GT_F4.
CALL METHOD g_grid->register_f4_for_fields
EXPORTING
it_f4 = gt_f4.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Loadability Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Material Non Availability'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Vehicle Non Availability'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Payment Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Party Vehicle'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Commercial Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Operational Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'FTL/ Clubbing'.
APPEND lt_dropdown.
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown[].
ENDFORM.
wa_fcat-f4availabl = 'X'.
ENDIF.
PERFORM dropdown_table CHANGING g_grid.
FORM dropdown_table CHANGING g_grid TYPE REF TO cl_gui_alv_grid.
DATA :lt_dropdown TYPE lvc_t_drop WITH HEADER LINE.
DATA: gs_f4 TYPE lvc_s_f4,
gt_f4 TYPE lvc_t_f4.
LOOP AT it_fcat INTO wa_fcat.
IF wa_fcat-fieldname = 'REASONS'.
wa_fcat-drdn_hndl = '1'.
wa_fcat-outputlen = 20.
MODIFY it_fcat FROM wa_fcat.
ENDIF.
ENDLOOP.
*CLEAR GT_F4.
* GS_F4-FIELDNAME = 'REMARK'.
* GS_F4-REGISTER = 'X'.
* GS_F4-GETBEFORE = 'X'.
* GS_F4-CHNGEAFTER = 'X'.
* APPEND GS_F4 to GT_F4.
CALL METHOD g_grid->register_f4_for_fields
EXPORTING
it_f4 = gt_f4.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Loadability Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Material Non Availability'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Vehicle Non Availability'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Payment Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Party Vehicle'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Commercial Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'Operational Issue'.
APPEND lt_dropdown.
lt_dropdown-handle = '1'.
lt_dropdown-value = 'FTL/ Clubbing'.
APPEND lt_dropdown.
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown[].
ENDFORM.
Comments
Post a Comment