2023 Nov 02 1:24 PM
Folks,
I am getting a dump with the below statement. I had declared many fields like this but only for this one it is going for a dump.
lc_vfdat TYPE lvc_fname VALUE 'VFDAT'
lo_column->set_long_text( 'Shelf Life Expiry Date'(012) ).
Can anyone please throw some light on this.
TRY.
lo_column = lo_columns->get_column( lc_vfdat )."VFDAT
lo_column->set_long_text( 'Shelf Life Expiry Date'(012) ).
lo_column->set_medium_text( space ).
lo_column->set_short_text( space ).
CATCH cx_salv_not_found INTO lo_salv_not_found.
lv_msg = lo_salv_not_found->get_text( ).
MESSAGE lv_msg TYPE lc_e.
ENDTRY.<br>,
Thanks,
K.Kiran.
2023 Nov 02 5:03 PM
The issue is with text symbols, there's no type check at compile time.
There's the exception CX_SY_DYN_CALL_ILLEGAL_TYPE (short dump if you don't catch it) if the text symbol maximum length is longer than the parameter length.
ABAP documentation - Text symbols:
Below, I defined a maximum length of 100, the parameter length of SET_LONG_TEXT is 40, so it will raise the exception.
2023 Nov 02 1:33 PM
If you have a dump, attach the dump file, people can't guess.
2023 Nov 02 2:33 PM
How long is defined TEXT-012 in text elements (more than 40?)
Else if you don't like problems
DATA: long_text TYPE scrtext_l,
medium_text TYPE scrtext_m,
short_text TYPE scrtext_s.
long_text = 'Shelf Life Expiry Date'(012).
clear medium_text.
clear short_text.
lo_column = lo_columns->get_column( lc_vfdat )."VFDAT
lo_column->set_long_text( long_text ).
lo_column->set_medium_text( medium_text ).
lo_column->set_short_text( short_text ).
2023 Nov 02 3:33 PM
Or use only SET_LONG_TEXT + SET_FIXED_HEADER_TEXT (method added in 7.40 SP 05 and backported 1886515 - ALV OM: Not possible to set fixed headers - SAP for Me)
lo_column->set_long_text( long_text ).
lo_column->set_fixed_header_text( 'L' ).
2023 Nov 02 4:35 PM
All this to remove the words "or best-before date" from the standard text
2023 Nov 02 5:03 PM
The issue is with text symbols, there's no type check at compile time.
There's the exception CX_SY_DYN_CALL_ILLEGAL_TYPE (short dump if you don't catch it) if the text symbol maximum length is longer than the parameter length.
ABAP documentation - Text symbols:
Below, I defined a maximum length of 100, the parameter length of SET_LONG_TEXT is 40, so it will raise the exception.
2023 Nov 03 4:11 AM
Thanks a ton Sandra. You nailed it. Thanks once again.
K.Kiran.