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

REG : New function module with type any

Former Member
0 Likes
1,545

Hi Experts ,

I want to develop a new function module , the ouput table sholud be type any .

Example function module is 'SCMS_XSTRING_TO_BINARY', here output table binary_tab is type any.

when iam trying to do that post me error 'You can only use LIKE and TYPE to specify types in RFC' , explain how to do this .

regards

goudham

10 REPLIES 10
Read only

gouravkumar64
Active Contributor
0 Likes
1,287

Hi,

Is there any option of type ref to?

Gourav.

Read only

0 Likes
1,287

hi gaurav ,

type ref to is there as option , giving same error.

regards

goudham

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,287

The error message is pretty much clear - "You cannot use generic types in RFM"

May be you can elaborate on your business requirement a lil' bit so that we can propose some genuine alternatives.

BR,

Suhas

Read only

Former Member
0 Likes
1,287

hi saha ,

Requirement is :

Input : table name ( can be ekko,ekpo,vbap,any).

output : i have to fetch 5000 records from the input table, output type has to be assigned as runtime, for that i have to declare table as any .

regards

goudham

Read only

0 Likes
1,287

Do you really need this FM as RFC enabled? If so, you cannot use generic types (the system needs to generate proper interfaces internally).

You have to use ie. 3 different output parameters.

Regards, Uwe

Read only

Former Member
0 Likes
1,287

hi Uwe ,

I have developed the code inside BAPI, so FM should be an RFC, Example function module is 'SCMS_XSTRING_TO_BINARY', is also an remote enabled .

can you make clear regarding 3 output parameters .

regards

goudham

Read only

0 Likes
1,287

Is the Function Module a BAPI or is it called within a BAPI?

If the FM is just called within the system itself, it doesn't have to be an RFC (you are not calling it from outside SAP) and you can use generic parameters.

Read only

0 Likes
1,287

Hi Goudham,

I tried creating the RFC FM with table parameters as any. I'm facing the error as you.

Now I copied the SCMS_XSTRING_TO_BINARY to ZFM and commeneted the Perform in the source code. I face no errors.

So you could copy the any existing RFC FM with tables parameter as TYPE  ANY to Z FM and change other parameter name to your desired name.

I know this is not the correct approach but this is the only solution at this momment.

regards,

Ashwin.

Read only

0 Likes
1,287

Hi Goudham,

And also not to forget all the parameters should be declared as 'Pass by value'.

regards,

Ashwin.

Read only

Former Member
0 Likes
1,287

Hi all ,

Thanks to Uwe, when FM is not remote enabled, i can able to give type any in output table, but having small problem in that.

Input parameter : EKPO

Output parameter : ET_TAB

requirement : 5000 rows

rows are getting fetched, when entries are xplored, nothing is showing, only blank field is displaying.

any more to be done in coding or anyother area .

regards

goudham