‎2010 Jan 11 5:09 AM
Hi,
I have to select certain field from table. The field which I have to select I do not know.
It will come dynamically from program.
Plz help me what is correct statement to execute.
Thanks.
S Sahoo
‎2010 Jan 11 5:17 AM
SELECT (FIELD_NAME) FROM <dbtab>
INTO CORRESPONDING FIELDS OF TABLE itab.
REGARDS,
SUMIT NENE
‎2010 Jan 11 5:20 AM
Hi Sahoo,
Pllease follow below steps.
1, Create internal table with field Fieldname TYPE FIELDNAME (Say ITAB)
2. Append Fields (thats you want to select) to internal table [at run time]
3. Use
SELECT (ITAB)
into table <table>
from <DB>
where <cond>
Hope this helps,
Nag
‎2010 Jan 11 5:24 AM
You can use fm FREE_SELECTIONS_DIALOG,RKD_SEL_BUILD_WHERE_CLAUSE,RH_DYNAMIC_WHERE_BUILD , for more details search in SCN.
Refer link:[http://www.sap-img.com/abap/how-can-we-give-dynamic-table-name-in-select-statement.htm]
‎2010 Jan 11 5:26 AM