This website is not affiliated with, sponsored by, or approved by SAP AG.

Dynamic fields in Select statement

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Dynamic fields in Select statement

Postby Santosh » Sun Jan 12, 2003 5:22 am

Hi All

I have to extract data for certin fields which i m geting from another customizing table . I think it is possible using Field-Symbols. can nebody send sample code for this..
i tried ..
but it giving error "Unknown column name column name <fs0001> not determined until runtime."

if by ne toher method it is possible then pls suggest.

thanks

Santosh
Santosh
 

Postby RODRIGO » Mon Jan 13, 2003 5:52 am

I´m not sure if I understood your problem well, but if waht you want to do do is a dinamic selection to a transparent table, you can do the following:

First, declare an internal table with a single text field

example:

DATA: BEGIN OF GT_CONDITION OCCURS 0,
LINE(600),
END OF GT_CONDITION.

Then insert or concatenate in the table the conditions as a text
For example:
gt_condition-line = 'mandt eq '000''.
append gt_condition.

Note: In order to insert the quotations in the field, you'll need to do something like this:

concatenate 'mandt eq' '''' '000' '''' into gt_condition-line.

And the selection can be done as follows:

select * from table where (gt_condition).

endselect.

Hope it helps.
RODRIGO
 

Postby SY-SUBRC=0 » Mon Jan 13, 2003 9:46 am

Try these fms:
1. RFC_GET_TABLE_ENTRIES.
2. RFC_READ_TABLE.

Or, try this variant of the SELECT statement:


Code: Select all
SELECT (FIELD_TAB)
FROM    (TABLENAME)
WHERE  (WHERE_TAB)

SY-SUBRC=0
 
Posts: 505
Joined: Mon Dec 09, 2002 4:14 pm

have a look...

Postby Dr Sidewalk » Mon Jan 13, 2003 11:50 am

If you have 4.5b or above then check out tranx ABAPDOCU where you thind examples of the three types of dynamic OPEN SQL that can be used.

Dr Sidewalk :D
Dr Sidewalk
 
Posts: 3531
Joined: Mon Oct 21, 2002 11:06 am
Location: Everywhere...


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.