on 09-22-2006 3:18 PM
Hi,
i have to develop a small WebDynpro-Application that consumes two BAPIs. The first one is BAPI_USER_Get_Detail and the other one is BAPI_User_Create. My goal is to get most of the details of a specific user (roles, permissions, etc.) and copy them to new user. how should i design my webdynpro app? i dont know exactly how to map the output of the first bapi to the input of the second. is it more useful to implement a controller for every model or is it better to put both of them in the same custom controller.
i'd appreciate any help, suggestions or helpful links,
thanks alot
michael
Hello Mukesh,
well Bapi_User_Get_Detail produces a huge amount of output. There should be about 300 parameters, that have to be mapped. I dont know whether its possible to map complete nodes (their structure is identical) via code. I'll try this on monday.
@Kapil:
i already did some of those tutorials so i dont have any problem to work with those BAPIs. My problem is, that i dont know how to design the application in order to be able to map the output of the first one to the input of the second one. I'm looking for a way to reach this, without being forced to map all the parameters by hand. Otherwise it would be easier to build an ABAP-wrapper, that calls those two functions in the right order. (in apa its definetly possible to map a structure to a structure)
thanks for further help, for sure i'll reward points at the end.
greetings and have nice weekend
michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Ur looking
My problem is, that i dont know how to design the application in order to be able to map the output of the first one to the input of the second one. I'm looking for a way to reach this, without being forced to map all the parameters by hand.
the above do need this.
"the output of the first one to the input of the second one."
Write the code in Custom controller Execute the second BAPI Methos u can implement the this below code.
try {
// second BAPI Execute method
Z_Vf_<BAPI2>Input output=new Z_Vf__<BAPI2>_Input();
wdContext.nodeZ_Vf__<BAPI1>_Input().bind(output);
// Calls remote function module
output.setField1(wdContext.node<BAPI1>).current<node>_ListElement().getFeild1());
output.setField2(wdContext.node<BAPI1>).current<node>_ListElement().getFeild2());
u can impl ur input from the firs BAPI
wdContext.current<BAPI2NODE>_InputElement().modelObject().execute();
// Synchronise the data in the context with the data in the model
wdContext.nodeOutput<NODE>().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this might works.
thanks
Lohi.
Context Mapping between component controller and custom controller or between two custom controllers
a) Lets say custom controller C1 corresponds to function module F1 and custom controller C2 corresponds to function module F2.
b) You can do context mapping between C1 and C2
Assuming C2 depends on C1, all you need to do is :
1) Add required components C1 in C2
2) Right click on the node in C2, and do context mapping with the corresponding structures of C1
Regards,
Subramanian V.
finally i finished my application. Subramanian Venkateswaran's answer helped me most, because this is the easiest way to map a huge amount of context elements.
thanks alot for your help people, i rewarded points to most of you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Michael
Before you actually develop your required Web Dynpro application, I ll suggest you to once go through a tutorial on creating a web dynpro application accessing ABAP functions. It will consume barely 2-3 hours of your time but ll give you fare enough knowlegde to head start your own application. Please check the following link. <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9a/368442a07b0e53e10000000a155106/frameset.htm">Creating a Web Dynpro Application Accessing ABAP Functions</a>
Regards
Kapil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can also use two different custom controller.
In the view you can bind the output of BAPI_USER_Get_Detail to the BAPI_User_Create.
Try this
//Get the parametervalues from BAPI_USER_Get_Detail
String name=wdContext.current<BAPI_USER_Get_Detail>Element().get<Name>();
:
:
//Set the parameter values for BAPI_User_Create
BAPI_User_Create input=new BAPI_User_Create();
wdCondext.node<BAPI_User_Create>().bind(input);
input.set<ParamName>(name);
:
:
//Execute the BAPI_User_Create
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.