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

function module to derive data from table

Former Member
0 Likes
800

hi friends,

I need to display the contents of a database table using a fucntion module.

Can any one please share the source code ...i have never created fnction modules before ...please help me achieving this ..

Thank u

harika

7 REPLIES 7
Read only

Former Member
0 Likes
749

Hi Harika,

for creating a function module go through d given link.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm

thanks,

Archana

Edited by: Archana Kumari on Jul 24, 2009 10:43 AM

Read only

Former Member
0 Likes
749

Hello,

Please specify, you need to have FM to fetch values from any table ( generic ) or some specific table.

Chk out this standard FM 'CATT_GET_TABLE_ENTRIES' using SE37. and you can modulate the code as per your requirement.

Regards,

Read only

0 Likes
749

hi anuradha,

Iam working on Virtual Cube in BI ,for tht i need to have a FM to derive the contents of a database table.The table is a Ztable.

If i get the source code for deriving the data from a database table using FM ,i can use the same code in BI side making some modifications

Thanky ou

Harika

Read only

0 Likes
749

Hello,

Not Very clear requirements. If you know the table name you can simply use select query in your code.

IF FM is a mandatory requirement then,

*" CHANGING

*" REFERENCE(T_OUTTAB) TYPE TY_CONNECTIONS

*"----


SELECT * FROM SPFLI INTO

TABLE t_outtab.

you can replace table name SPFLI with your Z table.

Read only

0 Likes
749

hi,

thanks for the reply ,i have replaced the SPFLI to required Ztable..iam getting an error with the T_OUTTAB stating tht it is not convertible.

This is the code iam using

FUNCTION ZTAB_DISPLAY.

*"----


""Local Interface:

*" EXPORTING

*" REFERENCE(E_T_DATA) TYPE /BI0/MGL_ACCOUNT

*" REFERENCE(E_END_OF_DATA) TYPE RSBOOL

*" REFERENCE(E_T_MSG) TYPE RS_T_MSG

*" TABLES

*" TABLE

*" CHANGING

*" REFERENCE(T_OUTTAB) TYPE TY_CONNECTIONS

*" REFERENCE(OUTPUT) TYPE TCURR

*"----


data:itab type standard table of /BI0/MGL_ACCOUNT.

SELECT * FROM /BI0/MGL_ACCOUNT INTO

TABLE itab.

im not knwing how to display the itab data in output ..

when i use this code

SELECT * FROM /BI0/MGL_ACCOUNT INTO E_T_DATA.

as E_T_DATA is a WA it is displaying only one record.

please tell me how can i display all the contents of ITAB in output.

thanks

harika

Read only

0 Likes
749

Hello,

You need to pass output in a TABLE TYPE parameter.

TY_CONNECTIONS ( it is table type for SPFLI ), Hence the SPFLI table data is fetched in this.

DO REPLACE IT with your desired table type.

Read only

0 Likes
749

hi ,

thanks for the reply....

please tell me how can i find the table type for desired database table...

thank u

harika