Hi,
I have made some webdynpro examples with easy functionality: execute 1 bapi and show results in a table.
Now I need to do real things: execute the first bapi, read a value from a field and put it in a variable, then execute the 2nd. bapi with that parameter (variable), and so forth.. =(
Anybody could give me a clue ? some general steps, or code,etc.
I really appreciate your help !!!!
Thanks and regards from Mexico ! =)
Diego
Hi Diego,
as far as I understand you problem, you can just execute the first BAPI, then you will have the result values in the according context elements. From there you can retrieve them and use them to call the next BAPI.
Is this what you mean?
BR
Daniel
Hi
To pass an input to a BAPI you need to do the following
If the proxies generated while importing your Model are say "Bapi_Input" and "Bapi_Output"
Code Snippet :
Bapi_Input inp = new Bapi_Input();
//Bind input to the model
wdContext.nodeBapi_InputElement.bind(inp);
//Set Parameter Name
inp.set<ParameterName>
After binding the Input to the Model we need to use the instance object "inp" in our case and then use the set<Parameter> method.
II . Passing input to a BAPI containing a Structure
If your Import Parameters to the BAPI are in the form of a Structure then you will have a separate proxy class generated for that Structure when you import the model.
In that case we need to instantiate that class and then set the Parameter values.
Say if the Structure name is "ZStruct", the proxy class generated would be "ZStruct".We can then instantiate the structure as shown.
ZStruct s = new ZStruct();
//Set the Parameter name
s.set<ParameterName>
Then add the Structure back to the input instance that was bound.
inp.add(s);
Hope that gives you some understanding on how to pass values to the BAPI.
regards
Ravi
Add a comment