Application Development and Automation 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: 
Read only

Feild-SYMBOL Assignement Problem.

Former Member
0 Likes
466

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

3 REPLIES 3
Read only

Former Member
0 Likes
436

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.

Read only

Former Member
0 Likes
436

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

Read only

former_member194669
Active Contributor
0 Likes
436

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®