cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a context node mapped

Former Member
0 Kudos

hi all,

i have a problem in a WD application, when i execute a certain RFC, the model node in the controller mapped to that RFC (model), does not fill itself with the data that the RFC suppose to bring as a result. it seems to get lost in some point (the data). i check and all seems to be fine. I bind the node, then i execute it and later i invalidate it. It's not a role problem i've checked already, and the RFC in the backend when i run it, shows me data. Anyone knows what could this be?...

Regards,

Mariana

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member187990
Participant
0 Kudos

Hi Mariana,

Check the JCo to which instance of the server is Mapped(In the server where JCo is Created).

if the JCo is connected to a server instance in which the RFC has no value, the you will not get any records.

Regards

Satish Kumar SV

Former Member
0 Kudos

Hi Mariana,

recheck to see if you are invalidating the correct output node. Recheck the following line:

wdContext.nodeZbapi_Sd_Consulta_Doc_Serial_Input().invalidate();

Former Member
0 Kudos

hi Laxmi,

i've tried that and it doesnt work. What else could i do?

Former Member
0 Kudos

Hi ..

U have to excute the RFC..

For this..

Consider this example ..Write like this in init()..

Bapi_Flight_Getlist_Input bapin = new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(bapin);

try

{

wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch(Exception e)

{

}

URs GS

Former Member
0 Kudos

Hi GS,

i've already done that...its not working. What else could i do???

Former Member
0 Kudos

Maybe you have silently ignored some exception? Don't use code like

catch (Exception) {}

Armin

Former Member
0 Kudos

Hi Armin,

Its not that...because if any sentences cause an exception...the try block doesnt execute, and actually the try block its executing....

Regards

Mariana

Former Member
0 Kudos

Hi,

Check the size of the Output Node, just after executing the Bapi.

If the size is not zero then we can conclude that their is a problem in the code.

If the size is zero then the Output node is empty.

And also dont invalidate the Main node.

try invalidating the sub node of the Output

eg.

RequestNode

--Input(Sub node)

---Attri_1

.

.

.

---Atter_n

--Output (Sub node)

---SubNodeA

-


SubNodeB

-


Attr_1

.

.

-


Attr_n

wdContext.nodeSubNodeA.invalidate();

Former Member
0 Kudos

Hi,

Give your context structure and the code for executing the RFC.

Former Member
0 Kudos

Well my context structure its like this

+ Zbapi_XYZ

+ OutputY

+ ReturnY

+ Table_XYZ (custom structure)

-attribute_1

.

.

-attribute_n

+ Return_IN ( bapireturn structure)

-attribute_1

.

.

-attribute_n

+Table_XYZ_IN (custom structure)

-attribute_1

.

.

-attribute_n

- attribute1

This is a model node, all the attribute are model attribute and both Table_XYZ_IN and Table_XYZ are from the same type of structure.

The binding is implemented in WdDoInit Method as follow:

Zbapi_Sd_Consulta_Doc_Serial_Input bapiSdConsultaDocSerial =
			new Zbapi_Sd_Consulta_Doc_Serial_Input();
		wdContext.nodeZbapi_Sd_Consulta_Doc_Serial_Input().bind(
			bapiSdConsultaDocSerial);

and the execution of the RFC is in a custom method call

public void ejecutarSdConsultaDocSerial( java.lang.String serial )

inside it has the follow code:

String nombreFuncion = "ejecutarSdConsultaDocSerial: ";
		String mensaje = "";
		boolean error = false;
		wdContext.currentZbapi_Sd_Consulta_Doc_Serial_InputElement().setPsernr(
			serial);
		try {
			
			wdContext
				.currentZbapi_Sd_Consulta_Doc_Serial_InputElement()
				.modelObject()
				.execute();


			//Invalidates the output context node
			//wdContext.nodeOutputSD().invalidate();
            wdContext.nodeZbapi_Sd_Consulta_Doc_Serial_Input().invalidate();    
			
			//En la variable "mensaje" se almacena todos los mensajes de error concatenados
			for (int i = 0; i < wdContext.nodeReturnSD().size(); i = i + 1) {
				IReturnSDElement retorno =
					wdContext.nodeReturnSD().getReturnSDElementAt(i);
				if (retorno.getType().equals("E")) {
					error = true;
					mensaje = mensaje + " " + retorno.getMessage();
				}
			}

			if (error) {

				wdContext
					.currentEstatusBAPIElement()
					.setEstatusSdConsultaDocSerial(
					0);
				wdContext.currentEstatusBAPIElement().setMensajeError(
					nombreFuncion + mensaje);
			} else {

				wdContext
					.currentEstatusBAPIElement()
					.setEstatusSdConsultaDocSerial(
					1);
			}

		} catch (Exception ex) {
			wdContext
				.currentEstatusBAPIElement()
				.setEstatusSdConsultaDocSerial(
				0);
			wdContext.currentEstatusBAPIElement().setMensajeError(
				nombreFuncion + ex.getMessage());
		}