on 03-21-2014 9:59 AM
Hi all,
I need used in my webdynpro Java a FM that I created in R3. Exactly I need load in a combo box the results of my function module.
I do it this but not works correctly. I think thats my code is not correctly..Anybody can help me?
public void inicializarPrimerAprobadorTarea( ) {
//@@begin inicializarPrimerAprobadorTarea()
//Creamos variable para transformar el login en nombre
String nombre;
IModifiableSimpleValueSet valueSet = wdContext.nodeCONTAINER().getNodeInfo().getAttribute("AGENT_APPROVAL").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
// Obtenemos la primera tarea asociada al los aprobadores
PP4Model2 pp4model2 = new PP4Model2();
Z_Hsp_Wf_Gbs_Apro_Pva_Input rfcPrimerAprob = new Z_Hsp_Wf_Gbs_Apro_Pva_Input(pp4model2);
//wdContext.nodeZ_Hsp_Wf_Gbs_Apro_Pva_Output().bind(rfcPrimerAprob);
try {
rfcPrimerAprob.execute();
wdContext.nodeOutput_1().invalidate();
if(rfcPrimerAprob.getOutput().getEx_Subrc()!= 0){
msgmgr.reportException(rfcPrimerAprob.getOutput().getEx_Mensaje());
}else{
for( int i=0;i<wdContext.nodeLt_Tabla_Pva().size();i++){
//Transformamos el login en nombre
nombre = getNombreUsuario(wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id());
//Imprimimos mensajes para ver si está correcto.
msgmgr.reportSuccess(nombre);
//Metemos el valor en la variable del container.
valueSet.put(wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id(),wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id()); }
}
}catch (Exception e) {
msgmgr.reportException("Error. "+e.getMessage());
}
//@@end
}
Any body knows the main steps from call correctly to my FM?
Regards,
C. Castillo
What is the exact error? Is the data null? Do elaborate on the issue which you are facing currently.
Also, try to invalidate the node before execution ex: wdContext.nodeOutput_1().invalidate(); before the execute method.
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, now my method works correctly:
//@@begin inicializarPrimerAprobadorTarea()
//Variable para transformar el login en nombre
String nombre;
IModifiableSimpleValueSet valueSet = wdContext.nodeCONTAINER().getNodeInfo().getAttribute("AGENT_APPROVAL").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
// Obtenemos la primera tarea asociada al los aprobadores mediante la función de PPA Z_Hsp_Wf_Gbs_Apro_Pva
PP4Model2 pp4model2 = new PP4Model2();
Z_Hsp_Wf_Gbs_Apro_Pva_Input rfcPrimerAprob = new Z_Hsp_Wf_Gbs_Apro_Pva_Input(pp4model2);
try {
rfcPrimerAprob.execute();
wdContext.nodeOutput_1().invalidate();
if(rfcPrimerAprob.getOutput().getEx_Subrc()!= 0){
msgmgr.reportException(rfcPrimerAprob.getOutput().getEx_Mensaje());
}else{
if (rfcPrimerAprob.getOutput().getLt_Tabla_Pva().size()== 0){
msgmgr.reportException("No existen primeros aprobadores responsables para esta tarea, por favor póngase en contacto con el Administrador de la aplicación");
}else{
for(int i=0;i<rfcPrimerAprob.getOutput().getLt_Tabla_Pva().size();i++){
//Transformamos el login en nombre
nombre = getNombreUsuario(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id());
if(formInfo.getValue().equals("Inicio")|| formInfo.getValue().equals("Modif")){
if (nombre.equals(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id())){
msgmgr.reportException("El login: "+rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id()+"es eliminado de los valores del primer aprobador por no existir en SAP Portal");
}else{
//Metemos el valor en la variable del container.
valueSet.put(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id(),nombre);
}
}
}
}
}
}catch (Exception e) {
msgmgr.reportException("Error. "+e.getMessage());
}
//@@end
}
If anybody can be improve please let me know,
Regards all,
C. Castillo
Dear Castillo,
Can you please try to initialize the value set like this & check.
IModifiableSimpleValueSet valueSet = wdContext.getNodeInfo().getAttribute("AGENT_APPROVAL").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
Thanks & Regards,
Patralekha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
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.