‎2007 Apr 30 2:46 PM
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.
‎2007 Apr 30 2:47 PM
‎2007 Apr 30 2:53 PM
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
‎2007 Apr 30 2:54 PM
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
‎2007 Apr 30 2:58 PM
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.
‎2007 May 01 6:30 AM
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,
‎2007 May 01 7:04 AM
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.
‎2007 May 01 8:16 AM
‎2007 May 01 8:17 AM