‎2010 Oct 15 11:17 AM
Hi ,
Iam using field symbol in one program , the declaration is follows.
TYPES: BEGIN OF ly_fldtab,
fldval TYPE rsalc256,
END OF ly_fldtab.
FIELD-SYMBOLS <ls_fldtab> TYPE ly_fldtab.
FIELD-SYMBOLS <itab_comp> TYPE ANY.
FIELD-SYMBOLS <et_itab> TYPE ANY.
my problem is when iam assigning the value <ls_fldtab>-fldval to <itab_comp> its not assigning the total value
ex : <itab_comp> = september15, 2010
<itab_comp> = september15,201
can any one tell me how to declare <itab_comp>?.
Thanks in advane
‎2010 Oct 15 2:33 PM
Hi,
It works as is for me. Is it the code you have written or is it just an example?
TYPES: BEGIN OF ly_fldtab,
fldval TYPE rsalc256,
END OF ly_fldtab.
data : L_fldtab type ly_fldtab.
FIELD-SYMBOLS <ls_fldtab> TYPE ly_fldtab.
FIELD-SYMBOLS <itab_comp> TYPE ANY.
FIELD-SYMBOLS <et_itab> TYPE ANY.
l_fldtab = 'september15, 2010'.
assign l_fldtab TO <ls_fldtab>.
assign <ls_fldtab>-fldval TO <itab_comp>.
WRITE:/ <itab_comp>.
Output : september15, 2010
Sujay
‎2010 Oct 15 12:01 PM
Hi
can you change the declaration of <itab_comp>.
FIELD-SYMBOLS <itab_comp> TYPE ly_fldtab.
regards,
Manju
‎2010 Oct 15 2:15 PM
Hi,
Try to change the field symbol type to string.
Thanks,
Anmol.
‎2010 Oct 15 2:33 PM
Hi,
It works as is for me. Is it the code you have written or is it just an example?
TYPES: BEGIN OF ly_fldtab,
fldval TYPE rsalc256,
END OF ly_fldtab.
data : L_fldtab type ly_fldtab.
FIELD-SYMBOLS <ls_fldtab> TYPE ly_fldtab.
FIELD-SYMBOLS <itab_comp> TYPE ANY.
FIELD-SYMBOLS <et_itab> TYPE ANY.
l_fldtab = 'september15, 2010'.
assign l_fldtab TO <ls_fldtab>.
assign <ls_fldtab>-fldval TO <itab_comp>.
WRITE:/ <itab_comp>.
Output : september15, 2010
Sujay
‎2010 Oct 15 3:52 PM
Hi ,
Here is my actual code
TYPES: BEGIN OF ly_fldtab,
fldval TYPE rsalc256,
END OF ly_fldtab.
FIELD-SYMBOLS <ls_fldtab> TYPE ly_fldtab.
FIELD-SYMBOLS <itab_comp> TYPE ANY.
FIELD-SYMBOLS <et_itab> TYPE ANY.
ASSIGN COMPONENT sy-tabix OF STRUCTURE cs_itab
TO <itab_comp>.
IF sy-subrc = 0.
<itab_comp> = <ls_fldtab>-fldval.
ENDIF.
when im assigning <ls_fldtab>-fldval. to <itab_comp> the toal value im not getting in <itab_comp> in the
debugging mode i found the values like <ls_fldtab>-fldval = " september 15,2010" But in the <itab_comp> = " september 15,201" this is the problem. Please suggest me how to declare <itab_comp> ?.
Thanks
‎2010 Oct 15 4:14 PM
Hi,
Check this code.
TYPES: BEGIN OF ly_fldtab,
fldval TYPE rsalc256,
END OF ly_fldtab.
FIELD-SYMBOLS <ls_fldtab> TYPE ly_fldtab.
data : cs_itab TYPE ly_fldtab.
FIELD-SYMBOLS <itab_comp> TYPE ANY.
FIELD-SYMBOLS <et_itab> TYPE ANY.
cs_itab-fldval = 'september 15,2010'.
ASSIGN cs_itab to <ls_fldtab>.
DO 1 TIMES.
ASSIGN COMPONENT sy-tabix OF STRUCTURE cs_itab
TO <itab_comp>.
IF sy-subrc = 0.
<itab_comp> = <ls_fldtab>-fldval.
ENDIF.
ENDDO.
WRITE:/ <itab_comp>.
I don't see any problem still.
Sujay
‎2010 Oct 15 10:36 PM
Hi,
I think that you problem is at:
ASSIGN COMPONENT sy-tabix OF STRUCTURE cs_itab TO <itab_comp>.
...because cs_itab may have a component with length not equal to fldval (TYPE rsalc256).
<itab_comp> will assume the "properties" of an field of cs_itab.
Best regards,
Leandro Mengue