Skip to Content

udf for rfc lookup

hi, by using grafic rfc lookup it is possible to have more than on value as the result

so one lookup can return the value for n target fields.

but there is no way to prefent the lookup call even if it is part of an if/else .

i will execute the lookup only if source field has the right value, so i try to use the lookup api in a udf function.

but the problem is that there could by only on return?

Any idea how to fix this?

Is there a way to set the total Inputstream of the lookup to the return string?

regards

ralf

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 13, 2011 at 01:19 PM

    You can use if without else and check the source element has right value? if so then use rfc graphic lookup function. And output RFC map to various target fields. I feel assigning the multiple return values to many target field is possible. similarly in case of uDF, the output of API colllect it in the list object and parse the objects to assign to diff target fields.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 14, 2011 at 02:36 AM

    Hello,

    but there is no way to prefent the lookup call even if it is part of an if/else .

    Quoting from SAP Note 1090369, ifElse behaves like "value = if (<condition>, <expression1>, <expression2>)". Which means that the three statements are executed and either expression1 or 2 is returned. Since you are using the if/else as a statement, you should use ifS and ifSWithoutElse, in that way, the UDF call is not executed when the input to the UDF is a false.

    but the problem is that there could by only on return?

    Well you could loop your lookup but this is not best practice. Can you design the RFC such that it would accept multiple values and then return the needed values in one go?

    Hope this helps,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 14, 2011 at 04:03 PM

    > but the problem is that there could by only on return?

    >

    > Any idea how to fix this?

    I assume that you work with PI 7.0, as PI 7.1 allows several output parameters of an UDF.

    In PI 7.0 you store the return values in an array or hashtable (which you declare in Java section of the mapping) and define another UDF to read them.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.