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

field symbol error

Former Member
0 Likes
684

Hi guys


FIELD-SYMBOLS : <f_list> TYPE any,

                 <lW_LIST> TYPE any.


LOOP AT CT_LIST ASSIGNING <f_list>.

lv_index = sy-index.

  ASSIGN COMPONENT 'VKBUR' OF STRUCTURE <f_list> TO <lw_list>.

if <lw_list> is ASSIGNED.

READ TABLE LT_SORT INTO LW_SORT WITH KEY yvkbur = <lw_list>.

if sy-subrc = 0.

  <F_LIST>-VKBUR = LW_SORT-yvkbur.

ENDIF.

ENDIF.

ENDLOOP.


error at this line <F_LIST>-VKBUR = LW_SORT-yvkbur.


error is <f_list> has no structure nad therefore no component called "VKBUR"



please help


thanks

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
661

Hi Prasanth,

Try.

Field VKBUR is already assigned to <lw_list>, just pass the new value to field symbols <lw_list>.

<lw_list>  =  lLW_SORT-yvkbur.

Hope it helpful,

Regards,

Venkat.V

Hi guys


FIELD-SYMBOLS : <f_list> TYPE any,

                 <lW_LIST> TYPE any.


LOOP AT CT_LIST ASSIGNING <f_list>.

lv_index = sy-index.

  ASSIGN COMPONENT 'VKBUR' OF STRUCTURE <f_list> TO <lw_list>.

if <lw_list> is ASSIGNED.

READ TABLE LT_SORT INTO LW_SORT WITH KEY yvkbur = <lw_list>.

if sy-subrc = 0.

  <F_LIST>-VKBUR = LW_SORT-yvkbur.

ENDIF.

ENDIF.

ENDLOOP.


error at this line <F_LIST>-VKBUR = LW_SORT-yvkbur.


error is <f_list> has no structure nad therefore no component called "VKBUR"



please help


thanks

3 REPLIES 3
Read only

former_member205488
Active Participant
0 Likes
661

Hello!

The type of field-symbol <f_list> is generic (ANY), so you cannot use it as a structure.

Try this to get field VKBUR:

field-symbols <lv_any> type any.

assign component 'VKBUR' of structure <f_list> to <lv_any>.

if sy-subrc = 0.

  "here <lv_any> is assigned with field VKBUR of <f_list>

endif.

Read only

Former Member
0 Likes
661

Prasanth,

Your field symbols are typed generically and that is the reason for your error.

FIELD_SYMBOLS : <F_LIST> like line of CT_LIST.

                               <LW_LIST> type VKBUR.

Thanks,

Vikram.M

Read only

VenkatRamesh_V
Active Contributor
0 Likes
662

Hi Prasanth,

Try.

Field VKBUR is already assigned to <lw_list>, just pass the new value to field symbols <lw_list>.

<lw_list>  =  lLW_SORT-yvkbur.

Hope it helpful,

Regards,

Venkat.V