‎2008 Sep 12 7:23 PM
Hi Experts,
I am facing some problem with the feild symbol.
I had created a Dynamic internal Table Using class
cl_alv_table_create=>create_dynamic_table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_lvc_cat
IMPORTING
ep_table = w_dyntable.
ASSIGN w_dyntable->* TO <final>.
and I had Created a work are using the feild symbol
CREATE DATA w_structure LIKE LINE OF <final>.
ASSIGN w_structure->* TO <wa_final>.
here in this table I have one feild called OBJNR.
when I try to pass some value in to this OBJNR I am getting and error .
<wa_final>-objnr = l_objnr.
Error : The data <wa_final> has no structure and therefore no component 'OBJNR.
How to avoid this.??
‎2008 Sep 12 7:35 PM
using assign component you can do that.
field-symbols: <fs> type any.
CREATE DATA w_structure LIKE LINE OF <final>.
ASSIGN w_structure->* TO <wa_final>.
...
...
...assign component 'OBJNR' of structure <wa_final> into <fs>.
<fs> = l_objnr.
‎2008 Sep 12 7:37 PM
Hi,
You have to use assign component to assign the value to the field-symbols...
Ex..
FIELD-SYMBOLS: <FS>.
ASSIGN COMPONENT 'OBJNR' OF STRUCTURE <wa_final> TO <FS>.
IF sy-subrc = 0.
<fs> = l_objnr. " This will move the value to <WA_FINAL>-OBJNR.
ENDIF.Thanks
Naren
‎2008 Sep 12 7:46 PM
Try this way
FIELD-SYMBOLS: <FS> TYPE ANY.
" * ASSIGN w_structure->* TO <wa_final>. "Comment
ASSIGN COMPONENT 'OBJNR' OF STRUCTURE <WA_FINAL> TO <FS>.
<FS> = L_OBJNR.
a®