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: 

Problem FIELD-SYMBOL

Former Member
0 Kudos

I've the following code (thx Dani )

tables: rsrd1.

DATA: LineType TYPE string,

ItabRef TYPE REF TO DATA,

lineRef TYPE REF TO DATA.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE,

<fs1> type any.

parameter tbl like RSRD1-TBMA_VAL.

linetype = tbl.

CREATE DATA ItabRef TYPE STANDARD TABLE OF (LineType).

ASSIGN ItabRef->* to <fs> .

create data lineref like line of <fs>.

assign lineref->* to <fs1>.

SELECT * FROM (tbl) INTO <fs1>.

write <fs1>.

endselect.

tbl is a table and fs1 his structure. Imagine that tbl had the value 'HRP1002' i know there is a field BEGDA and i want to display it but i can't write this : write <fs1>-BEGDA.

How can i do please.

Regards

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try this.

tables: rsrd1.
DATA: LineType TYPE string,
ItabRef TYPE REF TO DATA,
lineRef TYPE REF TO DATA.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE,
<fs1> type any,
<b><fs2>.</b>

parameter tbl like RSRD1-TBMA_VAL.

linetype = tbl.
CREATE DATA ItabRef TYPE STANDARD TABLE OF (LineType).
ASSIGN ItabRef->* to <fs> .
create data lineref like line of <fs>.
assign lineref->* to <fs1>.
SELECT * FROM (tbl) INTO <fs1>.
<b>assign component 'BEGDA' of structure <fs1> to <fs2>.
write <fs2>.</b>
endselect.

Regards,

RIch Heilman

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Try this.

tables: rsrd1.
DATA: LineType TYPE string,
ItabRef TYPE REF TO DATA,
lineRef TYPE REF TO DATA.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE,
<fs1> type any,
<b><fs2>.</b>

parameter tbl like RSRD1-TBMA_VAL.

linetype = tbl.
CREATE DATA ItabRef TYPE STANDARD TABLE OF (LineType).
ASSIGN ItabRef->* to <fs> .
create data lineref like line of <fs>.
assign lineref->* to <fs1>.
SELECT * FROM (tbl) INTO <fs1>.
<b>assign component 'BEGDA' of structure <fs1> to <fs2>.
write <fs2>.</b>
endselect.

Regards,

RIch Heilman

Former Member
0 Kudos

Hello,

If you check your the field you need.

I´ve didnt test it but it could work.

Greettings

Gabriel P.

0 Kudos

Rich is the winner

Thanks.