cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module

Former Member
0 Kudos

Hi Friends,

Please help me in finding a Function Module which should bring the data from multiple tables in R/3 server. I need to update this data to the CRM server. So the FM should be remote enabled. I am able do it for single table. But i need to fetch data from multiple tables and then i have to update it in the CRM server.

your help is appreciable.

Thanks

Radhika.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Radhika,

Create a Function Module.

1. Tab "Tables" .

Here you declare all the tables which have to be populated. In the column "Type spec" enter "Like".

2. Source code tab

Write select querys to populate all the tables declared before.

3. Attribute tab

There is a radio button Remote-enabled module select it

After activating you can call this FM from CRM

Hope this is helpful.

Former Member
0 Kudos

Hi Sameena,

Thanks. I have tried it for 2 tables. its working fine.

But I think I may face performance issues if i use the same for 100 tables. can u suggest me alternative for this.

Thanks,

Radhika

Former Member
0 Kudos

Radhika,

It doesn't make any sense to retrieve data for 100 tables at a time, Probably you can divide into groups logically and get the data. Again it depends on how much data each of these tables have.

For a moderate amount of data, I don't suggest more than 10 tables.

Regards,

Ravi

Note : Please mark the helpful answers

Answers (5)

Answers (5)

Former Member
0 Kudos

aa

Former Member
0 Kudos

Hi Radhika

Try this out RFC_READ_TABLE, not sure this is for multiple table ...

regards

Alok Pathak

Former Member
0 Kudos

Hi Radhika,

Check this out ... hope it seems to be a similar question as this

Regards,

Santosh

Former Member
0 Kudos

Rahika,

I think you are referring to the same question that Jak Kumar has posted.

Do you want to get all the tables in the same function module, then you can do something like this.

Declare as many paramters as the no. of tables you want to retrieve in one SHOT. This parameter can refer to DD02L-TABNAME. Now, also declare as many TABLE paramters by referring to TYPE REF TO DATA so that you are not tied to a specific table.

Now, the code for your FM

Parameter - TABLE_NAME

Table - TABLE TYPE REF TO DATA.

SELECT * FROM (table_name) INTO TABLE table.

This statement will have to be repeated for all the tables you want to retrieve.

Hope this helps you.

Regards,

Ravi

Note : Please mark the helpful posts.

Former Member
0 Kudos

Thank You Ravi,

I'll check it out and get back to you.

Former Member
0 Kudos

Hi Ravi,

Iam new to ABAP.

Can u explain me in detail what is type ref to data.

do i need to create a table type of this kind.I have declared parameters and they r referring to DD02L-TABNAME.

What should I do next.

Thanks.

Former Member
0 Kudos

Radhika,

By referring to DATA, it can take any internal table. I am sure you would have REUSE_ALV_gRID_DISPLAY. Look at the way the data table parameter has been declared in this function.

You should do exactly the same way. Only thing you will multiple parameters of that type.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hi Radhika,

DD02l id the table which contains all the tables name and their attributes.

when you get the name of the tables you need to declare you can do the following

DATA: tab TYPE REF TO DATA 
* para1 is one of the importing parameter of type dd02l-tabname.
parameters : para1 type dd02l-tabname.
DATA tabref TYPE ref to data.
FIELD-SYMBOLS <fs_table> type  TABLE.
tabref = para1.
  ASSIGN tabref->* TO <fs_table>.

SELECT * FROM (tabname) INTO TABlE <fs_table>  .

but i feel this approach will work only when the data in you tables in the remote system is less, when the data is huge you will have a problem of RFC timeout.

regards,

Kinshuk Saxena

Former Member
0 Kudos

Is this a one time deal or you need this to be an ongoing interface? If it is one time deal and if you have similar Z tables on the CRM side defined, then take help from your basis team to transport the entries. If it is an ongoing one, then I strongly recommend you to design it very carefully. Transferring 100 tables at one time is not a simple task and also not a recommended one. May be if you have table name as one of the parameters to your function module, then it is possible.

Former Member
0 Kudos

Which tables? What data? Without knowing that it is impossible to tell you which function module can do that for you.

Former Member
0 Kudos

Hi,

It is Z table data. I have aroud 100 Z tables in R/3. I have to pull this data to the CRM system.