cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a function module in a File to IDOC Scenario

Former Member
0 Kudos

Hi experts,

I'm developing a File-->XI-->IDOC scenario in which I have to populate some IDOC fields calling a custom FunctionModule that resides in ECC.

The input parameters of FM call are fields of the file (i.e. the supplier ID), output value will be put in IDOC field.

Which is the best to call a function module and integrate it in my scenario? I'm new to that.

Thanks!!

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi experts,

I'm a bit confused about your responses.

My request was to call an ECC FunctionModule with XI under a message mapping File-->IDOC, but as I can see RFCLookup is used to lookup directly an ECC table, do you agree?

So you mean that I don't need the FunctionModule that ABAB developers have done for the scenario, but only the name of the table to lookup?

Is it correct?

Thanks

Fabio

PeterJonker
Active Contributor
0 Kudos

Because of performance in your scenario it would be best to use an user exit in ECC when processing the IDoc since it is already sent to ECC. No need for RFC lookup. Since you are delivering the IDoc to the system where the values that you need are residing it makes sense to do this lookup in this target system when the IDOc has arrived. If you need values from another system then the RFC lookup makes more sense.

Most IDocs have user exits and otherwise a custom function module an be assigned to the IDOc processing in which the functionality is added.

Former Member
0 Kudos

Hi Peter,

thank for your reply.

I will propose your solution to the business analyst.

But if they won't accept this solution, you think is possible to call a RFC function module in my mapping to retrieve some values to populate the IDOC?

I have to write an UDF?

I think that RFClookup doesn't work for me, because I need to call a FM not to read a table. Do you agree?

PeterJonker
Active Contributor
0 Kudos

If the solution is not accepted you can still use an RFC function module in ECC to get the values you need. This can be a custom FM as well.

I am sure you can find plenty of discussions and blogs about this subject.

Former Member
0 Kudos

Hello,

I am not sure why u got confused...

Since the table from where u have to fetch reocrds are already there in ECC, so instead of populating idoc fields in PI using lookup u (ABAP developer) can directly do the same in Idoc's user exit and populate the corresponding fields. And as already stated, this solution is better in terms of preformance and can also avoid connectivity issues (if any).

>>So you mean that I don't need the FunctionModule that ABAB developers have done for the scenario, but only the name of the table to lookup?

If you are not doing any lookup in PI then u don't need and FM or table name. But in case, if PI is doing any RFCLookup then u need only FM name.

Thanks

Amit Srivastava

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

>>Which is the best to call a function module and integrate it in my scenario? I'm new to that.

If i were you then i would have done a small enhancement in a Idoc - Much simpler and better approach in terms of performace.

Thanks

Amit Srivastava

Former Member
0 Kudos

Could you explain?

I'm also new to IDoc...

thank you

Fabio

Former Member
0 Kudos

Hello,

Check with ur ABAP developer. Search for a user exit and then write a code to populate idoc field by calling a FM which is already there in ECC.

Thanks

Amit Srivastava

Muniyappan
Active Contributor
0 Kudos
Former Member
0 Kudos

Thank you Muniyappan,

I'll read the documentation and let you know if I have problems

Fabio

Former Member
0 Kudos

Hi Muni,

unfortunatly i'm in PI 7.0, I don't have RFClookup mapping in message mapping.

What I have to do in PI 7.0?

azharshaikh
Active Contributor
0 Kudos

Hi Fabio,

You can use the conventional way of doing RFC lookup via a UDF in Message Mapping.

You need to pass the Lookup Query in XML format in the UDF alongwith the RFC channel and System details.

Please check the following for details:

http://wiki.scn.sap.com/wiki/display/Snippets/User-defined+Mapping+Function+for+RFC+Lookup

Regards,

Azhar