Application Development 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: 

internal table and field symbols problem..

Former Member
0 Kudos

"Create ITAB_DISPLAY structure as; CARRID, TOTAL, <FS-W1>, <FS-W2>, etc.

<FS-W1> is value from SFLIGHT-PLANETYPE.

Use field-symbols in this case."

Does anyone know how to code the above statement? I totally don't have any idea about it. I meet difficulties when code the internal table along with the using of field symbols also.

Thanks in advance.

1 ACCEPTED SOLUTION

peter_ruiz2
Active Contributor
0 Kudos

hi jiansi,

you cannot use a field symbol as part of a structure for an internal table.

although you can assign values of an internal table into a field symbol.

here is an example


LOOP AT itab_display INTO wa_display.
  ASSIGN wa_display-carrid TO <fs-w1>.

  ASSIGN wa_display-total TO <fs-w2>.
ENDLOOP.

regards,

Peter

4 REPLIES 4

peter_ruiz2
Active Contributor
0 Kudos

hi jiansi,

you cannot use a field symbol as part of a structure for an internal table.

although you can assign values of an internal table into a field symbol.

here is an example


LOOP AT itab_display INTO wa_display.
  ASSIGN wa_display-carrid TO <fs-w1>.

  ASSIGN wa_display-total TO <fs-w2>.
ENDLOOP.

regards,

Peter

0 Kudos

tnx Peter Ruiz .

erm......my statement here is to display some fields :- carrid, total and a list of plantype. Bcz of the number of plane type is dynamic one.

so, what should i do??

0 Kudos

hi,

you can loop through your internal table that contains the plantype.

here is an example on how to use a field symbol


data:
  itab1 type standard table of sflight.
field-symbol:
  <wa_fs> type any.

loop at itab1 assigning <wa_fs>.
  write <wa_fs>-plantype.
endloop.

hope it helps.

peter

Former Member
0 Kudos

Hi, does anybody can help me to solve the difficulties ?!? tq