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

Interesting - Fetching data

Former Member
0 Likes
456

Hi Abapers,

My requirement is .

User will provide table name as parameter . And I have to compare data in that table in two systems. I can use RFC . But my problem is how do I declare table and write select query . Table name at run time is not known to me.

Is above scenario posiible to code.

Please revert with ur suggestions.

Thanks in advance

Madhu

4 REPLIES 4
Read only

madan_ullasa
Contributor
0 Likes
436

Hi,

use ,

select from (parameter) .....into ......

this will be a dynamic selection with the table name coming at the runtime.

Regards,

Madan..

<removed_by_moderator>

Edited by: Julius Bussche on Jul 10, 2008 11:57 AM

Read only

0 Likes
436

more info...

once you know the table name... u have a function module by which you can build an internal table. This will be a dynamic internal table. then in your select statement you can use that table. The select statement should be as in my earlier reply...

I belive a bit of refinement on your part for this soln. may solve your issue...

Regards,

Madan...

Read only

Former Member
0 Likes
436

Hi,

if with of table (or width of all fields to compare) <= 512 just use FM RFC_READ_TABLE.

If you need more space - here's how to declare workarea and table:

data: gs_wa type ref to data.
   data: gt_tab type ref to data.
   field-symbols <tab> type standard table.
   field-symbols <wa> type any.


     create data gs_wa type (p_table).
     create data gt_tab type standard table of (p_table).
     assign gs_wa ->* to <wa>.
     assign gt_tab ->* to <tab>.

Kind regards,

HP

Edited by: Holger Pakirnus on Jul 10, 2008 10:54 AM

Edited by: Holger Pakirnus on Jul 10, 2008 10:58 AM

Read only

0 Likes
436

Hi,

Create one RFC Enabled Function module with the importing parameter as the selection screen parameter and in the source code write the select statment to fetch the data and use this FM in the program.I hope Your Problem will solve.

Warm regards,

Surendar Reddy.