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: 

dump in text for a field

kiran_k8
Active Contributor
0 Kudos
1,012

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.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
929

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:

  • "A text symbol has the data type c and the length defined in the text elements by mlen."
  • (NB: mlen is not explained, it's the maximum length defined for the text symbols, as shown below)

Below, I defined a maximum length of 100, the parameter length of SET_LONG_TEXT is 40, so it will raise the exception.

6 REPLIES 6

Sandra_Rossi
Active Contributor
0 Kudos
929

If you have a dump, attach the dump file, people can't guess.

raymond_giuseppi
Active Contributor
929

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 ).

0 Kudos
929

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' ).

929

All this to remove the words "or best-before date" from the standard text

Sandra_Rossi
Active Contributor
0 Kudos
930

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:

  • "A text symbol has the data type c and the length defined in the text elements by mlen."
  • (NB: mlen is not explained, it's the maximum length defined for the text symbols, as shown below)

Below, I defined a maximum length of 100, the parameter length of SET_LONG_TEXT is 40, so it will raise the exception.

0 Kudos
929

Thanks a ton Sandra. You nailed it. Thanks once again.

K.Kiran.