cancel
Showing results for 
Search instead for 
Did you mean: 

Customising ess pdata - adding new fields and connection to custom model

Former Member
0 Kudos

Hi

I am new to webdynpro java, and i very much need some help with customising ESS MSS SP11 webdynpro erp 2005. Portal is on EP7 SP14

I have installed NWDI SP14 and have imported the sca's.

I need to add a dropdown on Personal Information -> Personal data - DetailView. I will be getting the values of this dropdown from an RFC. I am having trouble displaying these values - the dropdownbox appears disabled.

Model & Binding

1. I have imported the model(Z_ESS_AddFields) and added it to Used Models for component vcPerPersonalZaDetail.

2. On VcPerPersonalZaDetail component controller context - I have added 2 Model Nodes(Z_ESS_AddFieldsInput & Z_ESS_AddFields_Output) -> then Edit Model Binding, added the relevant input and output fields.

3.On The DetailView, I have added 2 Model Nodes(Z_ESS_AddFieldsInput & Z_ESS_AddFields_Output) -> then Edit Context Mapping, and selected the fields from the Detail Component.

On Detail View Layout I have added a dropdown.

For connection to this model this is the code I have added to the VcPerPersonalZaDetail component controller

I have added this code to the onInit() method:

try{
 this.fpm = fpm;
 zgetmodel = (Z_ESS_GET_PERSONAL_DATA_XX) WDModelFactory.getModelInstance(Z_ESS_GET_PERSONAL_DATA_XX.class, WDModelScopeType.APPLICATION_SCOPE);
fpm.connectModel(zgetmodel);
Z_Ess_Get_Personal_Data_Xx_Input rfcin = (Z_Ess_Get_Personal_Data_Xx_Input) zgetmodel.createModelObject(Z_Ess_Get_Personal_Data_Xx_Input.class);
wdContext.nodeZPDataGetInput().bind(new Z_Ess_Get_Personal_Data_Xx_Input());
wdContext.currentZPDataGetInputElement().setPernr("70000001");
wdContext.currentZPDataGetInputElement().modelObject().execute();
//error handling will be done by international Fc in method check()
  
} catch (Exception ex) {
fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), ex);
}

To display the values of the dropdown from the RFC, on the VcPerPersonalZaDetail component controller, I have added thw following code on the wdDoInit() method.

//	Ethnic Origin Dropdown
IWDAttributeInfo ainfo = wdContext.nodeZPDataGetOutput().nodeAll_Origins().getNodeInfo().getAttribute("Ltext");
ISimpleTypeModifiable st = ainfo.getModifiableSimpleType();
IModifiableSimpleValueSet vs = st.getSVServices().getModifiableSimpleValueSet();
for(int i=0;i<wdContext.nodeZPDataGetOutput().nodeAll_Origins().size();i++){
vs.put(wdContext.currentAll_OriginsElement().getRacky(),wdContext.currentAll_OriginsElement().getLtext());	  	
}
//@@end

The context for VcPerPersonalZaDetail component controller looks like this:

ZPDataGetInput

-Pernr

ZPDataGetOutput

- All_Orgins

-Ltext //is the value

-Racky //is the key

-Molga

Please help with 2 things:

1. How do I get connection to RFC. I have imported the model - and then what are the further steps?

2. How do I display values from an RFC in a dropdown?

Thank you

RD

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks!

I have simplified it as you suggested.

RD

Former Member
0 Kudos

Hi RD,

you seem to be calling your RFC in a very diffciult manner

instead of


try{
 this.fpm = fpm;
 zgetmodel = (Z_ESS_GET_PERSONAL_DATA_XX) WDModelFactory.getModelInstance(Z_ESS_GET_PERSONAL_DATA_XX.class, WDModelScopeType.APPLICATION_SCOPE);
fpm.connectModel(zgetmodel);
Z_Ess_Get_Personal_Data_Xx_Input rfcin = (Z_Ess_Get_Personal_Data_Xx_Input) zgetmodel.createModelObject(Z_Ess_Get_Personal_Data_Xx_Input.class);
wdContext.nodeZPDataGetInput().bind(new Z_Ess_Get_Personal_Data_Xx_Input());
wdContext.currentZPDataGetInputElement().setPernr("70000001");
wdContext.currentZPDataGetInputElement().modelObject().execute();
//error handling will be done by international Fc in method check()
  
} catch (Exception ex) {
fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), ex);
} 

try something more simple like


try{
Z_Ess_Get_Personal_Data_Xx_Input rfcin =  new Z_Ess_Get_Personal_Data_Xx_Input();
wdContext.nodeZPDataGetInput().bind(rfcin);
rfcin.setPernr("70000001");
rfcin.execute();  
} catch (Exception ex) {
wdThis.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), ex);
} 

I'm wondering how you got that (way over the top) amount of code. How is the onInit() method called?

To show elements in the dropdown don't code anything just.

1. Keep the output in a node inside the input node (it will be filled outmatically because you did bind the input node to the model)

2. Link the LText field of the node to the textfield of the dropdown.

Please get some help about webdynpro or/and read the tutorials because getting the basics rights is very important. (for example wdDoInit() is used for initialization of the component not for other things as it is the first method called of the component by the Webdynpro Environment.)