Skip to content

Dynamic resolution of Fields returned from an RFC #256

Answered by fw2568
qswizzlejr asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

Since you know the signatures in all cases, I would suggest to create different mapping methods for all cases, e.g.

(pseudo code):

CallFunction($"Z_READ_{model}", 
  f => f.SetField("I_ROWGD", <Row>), 
  f =>MapModelOutput(f, model)

MapModelOutput(IFunction function, string model)
{
    switch(model){
       "EMPLOYEE" => MapEmployeeOutput(function)
    }
}

MapEmployeeOutput(IFunction function)
{
    return f.GetField<string>("E_NACHN") 
              select <Return Type>
}

f you prefer a fully dynamic method, you could also create some kind of dynamic evaluation of the fields. You already referred to the ToDictionary comment from here #114 (comment)

The IRfcRuntime also contains…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@fw2568
Comment options

Answer selected by qswizzlejr
@qswizzlejr
Comment options

@qswizzlejr
Comment options

@fw2568
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants