‎2007 Jun 23 8:39 AM
hello sap gurus,
i am a beginner in sap and still trying to get a hang of all the syntax..
i am trying to write a program which would display first 10 rows of any table choosen by the user at selection screen.selection screen will have a parameter field to contain name of database table.
‎2007 Jun 23 8:57 AM
see this blog by rich heilman
<a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap:///people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
regards
shiba dutta
‎2007 Jun 23 8:52 AM
Below is the generic program for ur requirement.
PARAMETER : p_table like dd02l-tabname.
Field-symbols : <fs_tab> type table, <wa> type any.
DATA : v_ref type ref to data, v_ref2 type ref to dat, str type sting.
create data v_ref type table of ( p_table ).
Assign v_ref->* <fs_tab>.
Create data v_ref2 type ( p_table ).
Assign v_ref2->* <wa>.
Select * into <fs_tab> from ( p_table ) up to 10 rows.
Loop at <fs_tab> into <wa>.
MOVE <wa> to str.
Write 😕 str.
Endloop.
Please check the syntax
<b>Reward if its useful.</b>
Regards,
Sail
‎2007 Jun 23 9:50 AM
hai aarun,
i tried with your code...no it doesnt help..i think there is type conflict when u r assaigning the parameter the field symbol of type table .
pls let me know if i am wrong..
thanks
‎2007 Jun 23 9:53 AM
Just look at the blog by Rich, suggested by Shiba. it will solve your problem.
Regards,
Atish
‎2007 Jun 23 8:57 AM
see this blog by rich heilman
<a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap:///people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
regards
shiba dutta
‎2007 Jun 23 9:51 AM
sheeba thanks so much..i am trying to follow the code in the blog...looks like i have to make some minor changes for getting values of any table(eg mara)..
anyway thanks a ton