cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle internal table returned in UDF using RFC

che_eky
Active Contributor
0 Kudos

Hi All,

I currently have a UDF that takes several fields as input, calls an RFC and returns several fields as output. Now I would like to enhance the UDF so that the RFC will return a (simple?) internal table with the following row structure:

FIELD_NAME

VALUE

FIELD_NAME

VALUE

| FIELD_NAME | VALUE |

So for example the RFC may return the following data in the internal table:

FIELD_NAME

VALUE

-


MATNR

000000000000000001

WERKS

0100

The UDF should loop over the contents of the returned table and move the returned values to the corresponding UDF output parameters.

Any pointers on what the code in the UDF should look like to achieve the above?

Che.

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

When you want the UDF to loop over, you need to write the logic in the UDF itself. As long as you are able t capture the table returned by UDF in to string arrays.. looping should be a piece of cake..!!

VJ

che_eky
Active Contributor
0 Kudos

Vijaya, Sudhir,

Ok ok I will try to code the loop and substring.

If anyone wants to post a code snippet be my guest, oh go on you know you want to.

Che.

Former Member
0 Kudos

Hi Che

Getting the response from RFC internal table. it can be handled easily with String array. Loop it to capture the input.

Whats the requirement. Just curious.

ya and is it a UDF or RFC lookup

Thanks

Gaurav

Answers (1)

Answers (1)

SudhirT
Active Contributor
0 Kudos

If i got you,all context will be containing the 3 field and their values. if this is the case then your UDF will contain a loop of total table length and use substring function to get the output.

thanks.