i have a report in alv. my alv is very basic and i wont to decrease the size of two coulman in my alv . i copy the code from se 83 basic alv grid in the main program. i copy ,pbo ,pai screen 100 ,gui status ,in the pbo i give the name of the structre and changinig i write itab ,my table with fields . i build a structre with all the fields i wont to display . please write my detailed solution becouse i new with alv.
thanks.
Hi,
Declare following :
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_event TYPE slis_t_event,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid,
lt_report_header TYPE slis_t_listheader,
lt_fieldcat TYPE slis_t_fieldcat_alv.
Write following perform in the right place:
PERFORM build_fieldcatalog.
PERFORM alv_output TABLES t_output[].
FORM build_fieldcatalog.
*eg,
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Article'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 07."HEREINSTEAD of 18 I PUT 7
fieldcatalog-emphasize = ' '.
fieldcatalog-key = 'X'.
fieldcatalog-no_zero = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'ZBDESC'.
fieldcatalog-seltext_m = 'Article Description'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 28.
fieldcatalog-emphasize = ' '.
fieldcatalog-key = 'X'.
fieldcatalog-no_zero = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. "build_fieldcatalog.
FORM alv_output TABLES pi_gi_data LIKE t_output[].
gd_repid = sy-repid.
SORT t_output BY matnr .
pi_gi_data[] = t_output[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_events = gd_event
i_save = 'X'
TABLES
t_outtab = pi_gi_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "alv_output
If helpful pl reward.
Cheers...
Add a comment