cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding WebDynpro: Design when using RFC

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Look at the options of context-mapping.

Regards,

Subramanian V.

Former Member
0 Kudos

> Look at the options of context-mapping.

could you give me any further details?

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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