Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer the value of field on selection screen to ALV?

0 Kudos
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 1(33) TEXT-S01(ANALYZE PERIOD)
PARAMETERS:P_YEAR_L TYPE ZYEAR_MONTH. 
SELECTION-SCREEN: COMMENT 54(5) TEXT-02(to).
PARAMETERS: P_YEAR_H TYPE ZYEAR_MONTH.
SELECTION-SCREEN END OF LINE. 

IF P_YEAR_L IS NOT INITIAL. 
  AND P_YEAR_H IS NOT INITIAL.
  LDS_ALV-ZYEAR_MONTH_LOW = P_YEAR_L. 
  LDS_ALV-ZYEAR_MONTH_HIGH = P_YEAR_H. 
 APPEND LDS_ALV TO LDT_ALV. 
ENDIF.

This is the coding.
But by this way,the field could not be showed on ALV. 
How to solve it?
Thanks a lot!
2 REPLIES 2

FredericGirod
Active Contributor

How did you display the ALV ?

0 Kudos
Call function 'LVC_FIELDCATALOG_MERGE'. 
  EXPORTING
    I_STRUCTURE_NAME = 'ZMM0021K'
   CHANGING
    GT_FIELDCAT = LDT_FIELDCAT
   EXCEPTION
    ~
CALL FUNCTION 'Z_ALV_FIELDCAT_TEXT_SET_LVC'
  
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'. 
  EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'FRM_SET_STATUS'
    I_GRID_SETTINGS = LDS_GLAY
    IS_LAYOUT_LVC = LDS_LAYOUT
    IT_FIELDCAT_LVC = LDT_FIELDCAT
  TABLES
    T_OUTTAB = GDT_ALV