2024 Aug 23 11:08 AM - edited 2024 Aug 28 7:59 AM
Hello Everyone,
Any idea on the reason why this is not working. I can't get the custom column name in the report display.
TYPES: BEGIN OF gty_data,
matnr TYPE matnr, " Material Number
sernr TYPE gernr, " Serial Number
pin TYPE string, " PIN (Assuming PIN as a string)
END OF gty_data,
gty_tab_data TYPE STANDARD TABLE OF gty_data.
METHOD display_data.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(lr_alv)
CHANGING t_table = ct_data ).
CATCH cx_salv_msg.
ENDTRY.
TRY.
lr_alv->get_layout( )->set_key( VALUE #( report = sy-repid ) ).
lr_alv->get_layout( )->set_default( abap_true ).
lr_alv->get_layout( )->set_save_restriction( if_salv_c_layout=>restrict_none ).
lr_alv->get_functions( )->set_all( abap_true ).
lr_alv->get_columns( )->get_column( 'pin' )->set_long_text( 'PIN' ).
lr_alv->get_columns( )->get_column( 'pin' )->set_medium_text( 'PIN' ).
lr_alv->get_columns( )->get_column( 'pin' )->set_short_text( 'PIN' ).
CATCH cx_salv_not_found.
ENDTRY.
CALL METHOD lr_alv->display.
ENDMETHOD.
Thanks in advance.
Request clarification before answering.
First, do yourself and us a favour, and use the insert code feature in the editor (</>).
Second, try to write the column names in uppercase ('PIN') when you call the get_column method
lr_alv->get_columns( )->get_column( 'PIN' )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
10 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.