2023 Jun 29 12:20 PM
Hi Friends,
Kindly find the attached code. I have tried the assign statement. all the statement gives an error.
LOOP AT t_t682z INTO DATA(lwa_varkey) WHERE qufna CS lv_qufna.
lv_fieldname = lwa_varkey-qustr.
lv_fieldname+31 = '-'.
lv_fieldname+32 = lwa_varkey-qufna.
CONDENSE lv_fieldname NO-GAPS.
CONCATENATE '''' lv_fieldname '''' INTO w_field.
lv_fld = w_field.
ASSIGN (w_field) TO <fs_qunfa>.
ASSIGN (w_field) TO <f>.
ASSIGN (lv_fld) TO <fs_qunfa>.
ASSIGN (lv_fld) TO <f>.
IF sy-subrc = 0.
<fs_qunfa> = <fs_field>.
ENDIF.
ENDLOOP.<br>
Thanks with regards,
Vallamuthu M
2023 Jun 29 1:45 PM
2023 Jun 29 1:48 PM
2023 Jun 29 6:25 PM
DATA: BEGIN OF line,
col1 TYPE i VALUE 11,
col2 TYPE i VALUE 22,
col3 TYPE i VALUE 33,
END OF line.
DATA comp(5) TYPE c VALUE 'COL3'.
FIELD-SYMBOLS: <f1> TYPE ANY, <f2> TYPE ANY, <f3> TYPE ANY.
ASSIGN line TO <f1>.
ASSIGN comp TO <f2>.
DO 3 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE <f1> TO <f3>.
WRITE <f3>.
ENDDO.
ASSIGN COMPONENT <f2> OF STRUCTURE <f1> TO <f3>.
2023 Jun 30 7:23 AM
I have assign the field to KOMK and KOMP field.
Thanks with regards,
Vallamuthu M.
2023 Jun 30 7:22 AM
Hi Sandra Rossi,
Thanks for your update.
sy-subrc = 4.
Thanks with regards,
Vallamuthu M.
2023 Jun 30 7:12 PM
If you do that:
ASSIGN (w_field) TO <fs_qunfa>.
the variable W_FIELD must contain a variable name WITHOUT QUOTES, so, instead of doing this:
CONCATENATE '''' lv_fieldname '''' INTO w_field.
you should just do that:
w_field = lv_fieldname.
ASSIGN (w_field) TO <fs_qunfa>.
2023 Jun 30 8:20 PM
Love it. Prefixing field-symbols with FS. As though < > wasn't sufficient identifier!