‎2020 Jan 02 7:35 AM
TABLES mara.
TYPE-POOLS:slis.
TYPES: BEGIN OF manoj,
client TYPE usr02-mandt,
name TYPE usr02-bname,
validfrom TYPE usr02-gltgv,
validto TYPE usr02-gltgb,
userlock TYPE usr02-uflag,
END OF manoj.
DATA : it TYPE TABLE OF manoj,
wa TYPE manoj,
it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
PARAMETERS name TYPE usr02-bname.
SELECT mandt bname gltgv gltgb uflag FROM usr02 INTO TABLE it WHERE bname = name.
wa_fcat-col_pos = '1' .
wa_fcat-fieldname = 'mandt' .
wa_fcat-tabname = 'it' .
wa_fcat-seltext_m = 'client' .
wa_fcat-key = 'X' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '2' .
wa_fcat-fieldname = 'bname' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'name' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '3' .
wa_fcat-fieldname = 'gltgv' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'validfrom' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '4' .
wa_fcat-fieldname = 'gltgb' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'validto' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '5' .
wa_fcat-fieldname = 'uflag' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'lock' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab = it.
‎2020 Jan 02 7:53 AM
*&---------------------------------------------------------------------*
*& Report Z_TEST_1
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST_VEDA1.
TABLES mara.
TYPE-POOLS:slis.
TYPES: BEGIN OF manoj,
client TYPE usr02-mandt,
name TYPE usr02-bname,
validfrom TYPE usr02-gltgv,
validto TYPE usr02-gltgb,
userlock TYPE usr02-uflag,
END OF manoj.
DATA : it TYPE TABLE OF manoj,
wa TYPE manoj,
it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
PARAMETERS name TYPE usr02-bname.
SELECT mandt bname gltgv gltgb uflag FROM usr02 INTO TABLE it WHERE bname = name.
wa_fcat-col_pos = '1' .
wa_fcat-fieldname = 'CLIENT' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'CLIENT' .
wa_fcat-key = 'X' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '2' .
wa_fcat-fieldname = 'NAME' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'NAME' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '3' .
wa_fcat-fieldname = 'VAlIDFROM' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VAlIDFROM' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '4' .
wa_fcat-fieldname = 'VALIDTO' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VALIDTO' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '5' .
wa_fcat-fieldname = 'LOCK' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'LOCK' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab = it.
‎2020 Jan 02 7:53 AM
*&---------------------------------------------------------------------*
*& Report Z_TEST_1
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST_VEDA1.
TABLES mara.
TYPE-POOLS:slis.
TYPES: BEGIN OF manoj,
client TYPE usr02-mandt,
name TYPE usr02-bname,
validfrom TYPE usr02-gltgv,
validto TYPE usr02-gltgb,
userlock TYPE usr02-uflag,
END OF manoj.
DATA : it TYPE TABLE OF manoj,
wa TYPE manoj,
it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
PARAMETERS name TYPE usr02-bname.
SELECT mandt bname gltgv gltgb uflag FROM usr02 INTO TABLE it WHERE bname = name.
wa_fcat-col_pos = '1' .
wa_fcat-fieldname = 'CLIENT' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'CLIENT' .
wa_fcat-key = 'X' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '2' .
wa_fcat-fieldname = 'NAME' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'NAME' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '3' .
wa_fcat-fieldname = 'VAlIDFROM' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VAlIDFROM' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '4' .
wa_fcat-fieldname = 'VALIDTO' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VALIDTO' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '5' .
wa_fcat-fieldname = 'LOCK' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'LOCK' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab = it.
‎2020 Jan 02 8:21 AM
‎2020 Jan 02 9:36 AM
‎2020 Jan 02 10:45 AM
for above code i am not getting output.
i have used parameters if i enter value in parameters then i will get output.
after output displayes if i click on execute above output apperies

‎2020 Jan 02 7:53 AM
Hi Manoj,
Please share the dump details also before share to correct fieldcatlog values in capital letter ( ex. fieldname, tabname etc., )
‎2020 Jan 02 7:54 AM
@manoj16393 in the columns that you were filling for your ALV , you must use fieldnames of the structure.
TYPES: BEGIN OF manoj,
client TYPE usr02-mandt,
name TYPE usr02-bname,
validfrom TYPE usr02-gltgv,
validto TYPE usr02-gltgb,
userlock TYPE usr02-uflag,
END OF manoj.
‎2020 Jan 02 7:57 AM
‎2020 Jan 02 7:59 AM
REPORT zmanoj6.
TABLES mara.
TYPE-POOLS:slis.
TYPES: BEGIN OF manoj,
serverclient TYPE usr02-mandt,
name TYPE usr02-bname,
validfrom TYPE usr02-gltgv,
validto TYPE usr02-gltgb,
userlock TYPE usr02-uflag,
END OF manoj.
DATA : it TYPE TABLE OF manoj,
wa TYPE manoj,
it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat.
PARAMETERS name TYPE usr02-bname.
SELECT mandt bname gltgv gltgb uflag FROM usr02 INTO TABLE it WHERE bname = name.
wa_fcat-col_pos = '1' .
wa_fcat-fieldname = 'MANDT' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'SERVERCLIENT' .
wa_fcat-key = 'X' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '2' .
wa_fcat-fieldname = 'BNAME' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'NAME' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '3' .
wa_fcat-fieldname = 'GLTGV' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VALIDFROM' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '4' .
wa_fcat-fieldname = 'GLTGB' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'VALIDTO' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
wa_fcat-col_pos = '5' .
wa_fcat-fieldname = 'UFLAG' .
wa_fcat-tabname = 'IT' .
wa_fcat-seltext_m = 'USERLOCK' .
wa_fcat-hotspot = 'X' .
APPEND wa_fcat TO it_fcat .
CLEAR wa_fcat .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fcat
TABLES
t_outtab
‎2020 Jan 02 8:29 AM
Enter the values of fields FIELDNAME and TABNAME in UPPER CASE (*).
(by the way you don't need to use TABNAME, and COL_POS is useless because by default the order of lines of the field catalog corresponds by default to the order of columns... and REUSE_ALV_GRID_DISPLAY has been superseded by CL_SALV_TABLE fifteen years ago).
(*) probably you had a short dump GETWA_NOT_ASSIGNED (field symbol not assigned) during the execution of REUSE_ALV_GRID_DISPLAY, but next time you ask something, please share all relevant information, like the short dump itself! (as already asked by karthikeyan.s4)
‎2020 Jan 03 2:56 AM
Hi Manoj,
As you used parameters, you will not get any data if you don't enter any value in the selection screen. If you pass the parameters in the where condition it checks for the exact match and in your case as you didn't enter any value you didn't any output.
You can use select-options with no intervals and no-extensions.
Ex: select-options name for wa-name no intervals no-extensions.
And in your select query
SELECT mandt bname gltgv gltgb uflag FROM usr02 INTO TABLE it WHERE bname IN name.
Note: In this case, this select query will fetch complete table data of usr02 if you do not pass any value in the selection screen