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

RFC enabled FM which does same work as FM ARCHIVOBJECT_GET_URI does

amangarg1
Contributor
0 Likes
1,796

Greetings!

I need to fetch the latest attachment linked to a notification number from one SAP system into another. The FM 'ARCHIVOBJECT_GET_URI' helps me with the URI of the document, but the problem is that this is Normal FM, and not Remote FM. Can anyone please help me with anyother FM for this purpose?

Please let me know if you need further inputs or if I was unclear anywhere.

Thanks!

1 ACCEPTED SOLUTION
Read only

PeterJonker
Active Contributor
0 Likes
1,608

If you need an RFC function module and there is only a non RFC version of it then I usually copy the non RFC function module to a z version, make this one RFC enabled. Delete the sourcecode and then call the original Function module within this new Z function module. Maybe you need to change some datatypes if they are not allowed for RFC (in your case location need to be changed to char1.)

Greetings!

I need to fetch the latest attachment linked to a notification number from one SAP system into another. The FM 'ARCHIVOBJECT_GET_URI' helps me with the URI of the document, but the problem is that this is Normal FM, and not Remote FM. Can anyone please help me with anyother FM for this purpose?

Please let me know if you need further inputs or if I was unclear anywhere.

Thanks!

6 REPLIES 6
Read only

PeterJonker
Active Contributor
0 Likes
1,609

If you need an RFC function module and there is only a non RFC version of it then I usually copy the non RFC function module to a z version, make this one RFC enabled. Delete the sourcecode and then call the original Function module within this new Z function module. Maybe you need to change some datatypes if they are not allowed for RFC (in your case location need to be changed to char1.)

Read only

0 Likes
1,608

Hi Peter,

Thanks for your reply! But the problem is even if I make the original FM RFC by calling it in a Z FM, the original FM calls other FMs, which in turn, further calls other FMs, and in the process, some of them are Normal, and some are RFC. So do I need to do the same for other Normal FMs too? i

Read only

0 Likes
1,608

Hi Aman,

You do not need to worry about what other functionalities the FM is calling. Just this wrapper FM to make the function RFC enabled is enough.

You might want to add a return table (type bapiret2) to handle your exceptions since this FM will be called from another system.

Read only

0 Likes
1,608

Yes Peter, I have implemented as you suggested, but still not returning values, I debugged step by step in both systems parallel and found that the difference starts from FM 'ARCHIV_GET_CONNECTIONS_INT', because in one system, this FM returns 2 rows in Connections tables, and it is returning 0 rows in my Z FM. I suspect this could also be due to connections not established between two systems. I do not know how to check if two systems are connected. Please guide me if you have any idea about this.

Read only

0 Likes
1,608

Hi Aman,

I am sorry, but I am not familiar with this function module. I was trying to point out to you a general approach which you can use to make a non RFC function module RFC enabled by using a wrapper function which is RFC enbaled.

Read only

0 Likes
1,608

Hi Peter,

Issue resolved. The mistake I was doing was I did not make the same RFC enabled Z FM in the system2. I made the same FM in system2 also and now its working as expected.

Thanks!

Closing the thread.

Cheers,

Aman