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

Hi

Former Member
0 Likes
606

Hi experts,

i have to get a field name from query result.

data:i_field_name type ref_table-field_name.

select single field_name from ref_table into i_field_name.

suppose i_field_name containes "matnr".

i have to write mara-matnr = '001'.

how can i achieve it.

rgds,

bharat.

8 REPLIES 8
Read only

alex_m
Active Contributor
0 Likes
587

Pls explain in clear!

Read only

Former Member
0 Likes
587

Hi,

Try this..

data: itab like standard table of mara.

SELECT field_name from <b>mara into corresponding fields of table itab </b>

WHERE conditions.

Thanks & Regards

Santhosh

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
587

Hi

Have a look on the below query:

data: itab like standard table of mara.

SELECT field_name from mara into corresponding fields of table itab

WHERE conditions

Regards,

Sreeram

Read only

Former Member
0 Likes
587

Hi,

I understand your query.

Consider this :

DATA mara TYPE mara. " Mara structure.

DATA field TYPE char10.

SELECT SINGLE xxx FROM yyy INTO field WHERE zzz.

Now you want to fill a value in mara-field , right ?

Use this :

FIELD-SYMBOLS : <FS> TYPE ANY.

DATA : fieldname TYPE char20.

CONCATENATE 'mara-' field INTO fieldname.

ASSIGN <fs> TO fieldname. " <fs> now points to mara-field

<fs> = '0001'.

Hope this helps you.

Read only

Former Member
0 Likes
587

i think u need to print the frield with respect to table name.. mean sincluding table name u want to prnt it..

if ref_tabname is ur table name then create a field symbol n concate it with the field name then u get ur resulted output.. n this also changes automatically when u change ur table name...

regards,

Read only

Former Member
0 Likes
587

Hai,

You can not select field name(s) of a table from that table name.

But you can get them from DD03L table like below.

DATA:

F_NAME(15) TYPE C.

SELECT SINGLE FIELDNAME

FROM DDO3L

INTO ITAB(OR FIELDNAME )

WHERE TABNAME EQ 'REFRENCE_TABLE'.

Then

loop at itab.

"*do your operations here...

endloop.

regds,

Rama chary.

Read only

Former Member
0 Likes
587

i have solved it on my own.thanx for the replies.

Read only

Former Member
0 Likes
587

i have solved it on my own.thanx for the replies.