Application Development 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: 

FM for extracting data

Former Member
0 Kudos

Hi Friends,

Can any body tell me is there any FM avilable to extract the data from any datbase table? Or shall we have to create a new FM..?

Thanks in Advance.

23 REPLIES 23

rainer_hbenthal
Active Contributor
0 Kudos

The name of this FM is SELECT.

vinod_gunaware2
Active Contributor
0 Kudos

It all depend upon requrement, For standard like material,sales orders there are functon modules and BAPI.

Otherwise u have to use select statement in that funcion module.

regards

vinod

Former Member
0 Kudos

Hello Jak,

Usually SAP has developed FM for extracting data from the data bas tables like MARA_SINGLE_READ and so on.. U need to find them. If however they are not there then alternatively u can use SELECT stmt.

former_member188685
Active Contributor
0 Kudos

Hi,

you can do it with the help of FM <b>RFC_READ_TABLE</b>

Regards

vijay

0 Kudos

you can use the following FMs as well

RFC_GET_TABLE_ENTRIES

TABLE_ENTRIES_GET_VIA_RFC

Regards

Raja

0 Kudos

Jak,

I think you are asking related to the custom tables in CRM question.

You can use RFC_READ_TABLE and specify the table name.

Regards,

Ravi

0 Kudos

Hi all,

Thank You very much.

Points are given.

0 Kudos

Hi jak,

did you check my post,

don't forget to reward for helpful answers.

Regards

vijay

0 Kudos

Hi Vijay,

I checked your post .Thank You.

I al ready given reward points.

0 Kudos

Hi Frineds,

I am little confuse in the FM RFC_CREATE_TABLE.

How to give the import paramaters?..Can any body give example..for those parameters..

QUERY_TABLE:

DELIMITER :

NO_DATA :

ROWSKIPS :

ROWCOUNT :

Thanks in Advance

0 Kudos
   call function 'RFC_READ_TABLE'
         destination                rfc_sys
         exporting
              query_table          = 'DOKHL'
*             DELIMITER            = ' '
*             NO_DATA              = ' '
*             ROWSKIPS             = 0
*             ROWCOUNT             = 0
         tables
              options              = options1
              fields               = nametab1
              data                 = stmp_dokhl
         exceptions
              table_not_available  = 1
              table_without_data   = 2
              option_not_valid     = 3
              field_not_valid      = 4
              not_authorized       = 5
              data_buffer_exceeded = 6
              others               = 7 .

Check it...

0 Kudos

Hi,

check this report<b> GETSU22TRACEDATA</b>, and in this it is used to read the data of table.

Regards

vijay

0 Kudos

check out this code sample, it may be of interest to you

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/abap-code-sam... code sample using rfc_read_table for webas.pdf

Regards

Raja

0 Kudos

HI,

in FM RFC_READ_TABLE can i give a z-table in the query_table parameter?

Actually my requirement is reading data from z-tables.

whn given MARA table in query_table parameter it showing structure i mean fields of table but not showing data of table.can any body give solution?If i want to fetch data from morethan 30 or 40 z-tables , how ths FM will be help full?

Thanks in Advance.

0 Kudos

Jak,

I think you can read only one table at one time using this. So, you will have to call this function so many times.

Rather, write a RFC on the CRM side, get all the data you want and call that from the R/3 side.

Regards,

Ravi

0 Kudos

Hi Ravi,

Can you give some hints for writing RFC.

Bcoz..I don't know how to write RFC's

My requirement is: i have to fetch all the data from 40 z-tables in R/3 and i have to send to CRM system.

For this whre i have to wrire RFC , in R/3 or CRM?

Thanks in Advance.

0 Kudos

Jak,

Depends on where you want to fetch the data from and where do you want to call it from. Please refer to the yesterday's thread where we discussed the same thing.

Here I am assuming that the data is in CRM and you want to pull that into R/3. If that is the case, code your RFC in CRM and call that from R/3.

However, given that we are talking about 40 Z tables, performance might be a concern here.

Writing a RFC is nothing but writing a function module with apprporiate parameters of tables that you want to fetch. SELECT the data and dump into the internal tables defined as parameters of the RFC.

Regards,

Ravi

0 Kudos

Hi Jak,

there will not be much difference in FM and RFC.

you can do the it similar to FM. and if you want more tables then you should call so many times.

you need to check the option Remote enable.

Regards

vijay

0 Kudos

Hi Ravi Kumar,

As per my uderstanding..the scenario is like this:

I have to fetch the data from z-tables in R/3 only.And i have create RFC in R/3 only.and i have to call that RFC from CRM.So i have to ftech the data from all z-tables and put in 40 internal tables separately and i have to pass all these internal tables in tables parameter of RFC.After that i have to call this RFC from CRM.

Am i right?...If any thig wrong in this pls clarify me..

Becoz..this solution i need little urgent.

Thanks & Regards

0 Kudos

Hi,

Yes you can pass Z tables also to FM

RFC_READ_TABLE.

Regards,

Shashank

0 Kudos

Jak,

Yes, I guess you are in the right direction.

But fetching 40 tables in one shot if you are expecting log of data in each of these tables, take a decision depending on the data. You might want to split this into two or more RFC and logically separate the tables.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Hi Ravi,

Yes ..first i will try with 4 or 5 tables.But i what i want to know is it the right way ..ie writting select queries and storing into work areas and ppasing to tables parameters?..Or shall i write code in the source code block of FM?..

Points al ready given,I don't find any radio button enable.

Thanks in Advance.

0 Kudos

Jak,

Assume ZTABLE1 is one of the parameters of the functions.

Then your code inside the function could be as simple as

SELECT * FROM ZTABLE1 INTO TABLE ZTABLE1 WHERE .....

similarly for the other tables.

Regards,

Ravi