‎2009 Jul 24 9:10 AM
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
‎2009 Jul 24 9:43 AM
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
‎2009 Jul 24 9:48 AM
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,
‎2009 Jul 24 10:59 AM
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
‎2009 Jul 24 11:31 AM
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.
‎2009 Jul 24 11:58 AM
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
‎2009 Jul 24 12:27 PM
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.
‎2009 Jul 24 2:04 PM
hi ,
thanks for the reply....
please tell me how can i find the table type for desired database table...
thank u
harika