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

TYPE REF TO XXX in a Remote-enabled function???

Former Member
0 Likes
7,263

Hi,

I wrote an FM which collects table contents of given table name in IMPORTING parameters and returns as EXPORTING paramater as a data object. It runs perfect.

When i change Processing type to "Remote-enabled module", system gives a message "You can only use LIKE and TYPE to specify types in RFC".

Is there any way to define paramaters as object. Or anything else to solve this problem.

(Note : I tried something to solve this problem but i cant reach the exact solution.

For example, i moved DATA parameter from Exporting tab to Tables tab with no TYPE or LIKE specification and system gives "You cannot use generic types in RFC".)

FUNCTION YTABLES_GET_ROWS.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(ROWS) TYPE  I DEFAULT 0
*"     VALUE(TABNAME) TYPE  TABNAME DEFAULT 'ORDCOM'
*"  EXPORTING
*"     VALUE(DATA) TYPE REF TO  DATA
*"----------------------------------------------------------------------

  field-symbols : <fs> type standard table.

  condense tabname.

  catch system-exceptions CREATE_DATA_UNKNOWN_TYPE = 5.
      CREATE DATA data TYPE STANDARD TABLE OF (tabname).
  endcatch.

  if sy-subrc is initial.
      assign data->* to <fs>.

      if rows > 0.
          select * up to rows rows from (tabname) into table <fs>.
      else.
          select * from (tabname) into table <fs>.
      endif.

  endif.

ENDFUNCTION.

8 REPLIES 8
Read only

Former Member
0 Likes
6,373

Hallo,

it is prohibited toi use a references as parameter in Remote-enabled function.

Regards

Bogdan

Read only

0 Likes
6,373

Ok, what do you think about generic types in Tables Tab ?

I need use some parameters which must not has a type or structure. Coz i will return given transparent table contents with their structure.

And also i need to use this function across-systems with RFC.

thanks in advance.

ibrahim

Read only

0 Likes
6,373

Hi,

I think generic type is allowed in table types with RFC, but reference types and changing parameters are not allowed in RFC...

if you keep reference types then between two different system it is not possible to give the memory reference... that is the reason why reference type does not work, but generic types does not give reference to memory it only transfers the data of table from one place to another....

Regards,

Siddarth

Read only

0 Likes
6,373

Hi,

it is not allowed too i'm afreid:(

Bogdan

Read only

0 Likes
6,373

Yeah you right. They all are prohibited.

I'm still staying unresolved.

Thanks anyway.

Read only

0 Likes
6,373

Hi,

i suppose you have to try wrap your results in "defined" structure (b.e. name - value pair)

Regards

Bogdan

Read only

0 Likes
6,373

Yeah i know it will work if i specify table type or structure.

But this time, FM will loose its table indepency.

up....

Read only

0 Likes
6,373

Hi,

I have sugested an univesal stucture not a special structuire for a particular DB Table

Regards Bogdan