cancel
Showing results for 
Search instead for 
Did you mean: 

passing field symbol data back from an RFC

Former Member
0 Kudos

Hi,

I have an FM in a remote system. Input to the FM is a tbale name. Based on this it selects data from tables dynamically, in a dynamic internal table using field symbols, based on the table name, which I give as input to the RFC.

Now I'm puzzled on how to get this dynamic internal table data, back to the calling RFC, in the source system. Is there anyway that I can pass on dynamic internal tables as TABLES parameter in an FM. If yes, then how do I declare it in the TABLES section of the FM.

Else, is there any other way to pass on the data back to the calling RFC. I tried memory id, but doesn't work. I guess memory ids can be passed back and forth between the same system programs only.

Any pointers to this, would be helpful.

Thanks,

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

you can do like this FM : TABLE_ENTRIES_GET_VIA_RFC

table parameters declaration

TABENTRY LIKE BDI_ENTRY

BDI_ENTRY is of 2048 characters length, after reading the data

FIELD-SYMBOLS :

<lt_data> TYPE table,

lp_table TYPE REF TO data.

  • Create internal table

CREATE DATA lp_table TYPE STANDARD TABLE OF (p_tab)

WITH NON-UNIQUE DEFAULT KEY.

ASSIGN lp_table->* TO <lt_data>.

then move TABENTRY data to <lt_data> for required format.

Laxman

Answers (1)

Answers (1)

Former Member
0 Kudos

You can create one internal table with one field and this field is of type CHAR. You can decide the length of this field.

As your internal table is dynamic to popualte data and so is the output table structure, i suggest you concatenate these details in the CHARACTER string separated by comma.

Append that data to this CHAR internal table.

While using this CHAR internal table data make sure that you split data at ',' and use.

Former Member
0 Kudos

Hi ashish,

Thats a valid approach, but then I need to get back the data from the target system and compare it with data in the calling system for the same table. Now if I take it as CHAR and then it would be difficult for me to compare the two tables in the source system. Thanks for the inputs anyway.

Regards,

Vijay

Former Member
0 Kudos

My understanding is you have one internal table data from Target system which is in terms of CHAR as i suggested.

Other internal table data is from SAP database table in the source system.

Is there any way to add a line to CHAR internal table with TABLE NAME.

Then read this table in Source sytem and get the Table name.

You can declare the internal table with this tructure in source system. Pass all data from you CHAR table to this new table and then you can do your data comparision.

laxmanakumar_appana
Active Contributor
0 Kudos

Hi Vijay,

whatever i suggested , it will work , if you need any help i can send the sample code

Laxman

Former Member
0 Kudos

Hi laxman,

I Was just having a look at your logic. I'm unable to understand how this would be able to return data from a dynamic internal table back to the calling program. If would be really helpful if you could give sample code.

Regards,

Vijay