Skip to Content
0
Former Member
Jul 29, 2011 at 02:49 PM

How can I use a field symbol in a Concatenate

1757 Views

Hi to all,

I would like to use the value of a <FS> in a CONCATENATE command.

To use the CONCATENATE all fields must be type Characters. How can I transfer the content of my <FS> into a Character field without knowing the length?

At this time my coding looks like this but I am getting a dump during the execution at the CONCATENATE:

ASSIGN COMPONENT sy-index OF STRUCTURE <fs_dyn_wa> TO <fs_dyn_field1>.

CHECK sy-subrc EQ 0.

DESCRIBE FIELD <fs_dyn_field1> TYPE w_fld_typ LENGTH w_fld_len IN BYTE MODE.

IF w_fld_typ NE c_fld_typ_p.

DESCRIBE FIELD <fs_dyn_field1> TYPE w_fld_typ LENGTH w_fld_len IN CHARACTER MODE.

ENDIF.

IF w_pos EQ 1.

CONCATENATE wa_print_dta-ylinedta <fs_dyn_field1> INTO wa_print_dta-ylinedta.

ELSE.

CONCATENATE wa_print_dta-ylinedta(w_pos) <fs_dyn_field1> INTO wa_print_dta-ylinedta RESPECTING BLANKS.

ENDIF.

Thank you for your help.

BR,

Sylvain