cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Problem in WebDynpro

Former Member
0 Kudos

Hi gurus!!

I created a WD project:

- created a model with reference to a ZBAPI

- created a Component

- created a Custom Controller with 2 nodes: one to the INPUT class of the model, and the other to the OUTPUT class of the model

- created a View Main

- created a View Result

- bind the context of view Main to the INPUT node of the custom controller

- bind the context of view Result to the OUTPUT node of the custom controller

- At the end I have 2 views of the same component related to the same custom controller, and this custom controller related to both the INPUT and OUTPUT classes of the main model

- added the fields to the corresponding views

- on the view Main:

public void wdDoInit()

{

//@@begin wdDoInit()

Bapi_header_getdetail = new Zbapi_Wty_Header_Getdetail_Input();

wdContext.nodeInput().bind(Bapi_header_getdetail);

//@@end

}

- added a button to the view Main, and on the action:

public void onActionBuscar(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionBuscar(ServerEvent)

try {

Bapi_header_getdetail.execute();

wdThis.wdFirePlugToResult();

} catch (Exception ex) {

ex.printStackTrace();

}

//@@end

}

- added a viewset to the Main window, and embedded both views to the viewset.

- created the inbound and outbound plugs to the corresponding views

- created a project, deploy and run

I execute the app, push the button, but no values are displayed on the results view.

I verified the bapi, it's getting executed and is returning the values correctly, but still they're not getting displayed. I made sure of that, because I have the bapi create a text file on the server with the values it found, so I know for sure it's getting executed correctly.

I wonder if there's some step I might have missed.

The BAPI has 2 import parameters, and a Z structure as an export parameter.

Does anyone have a clue what might be the error!?

Thanx

Jesus

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member751941
Active Contributor
0 Kudos

Hi Jesus,

I think BAPI is not executing properly. Check the size of Output Node.

Try this.

public void onActionBuscar(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionBuscar(ServerEvent)

try {

wdContext.currentZbapi_Wty_Header_Getdetail_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

wdComponentAPI.getMessageManager().reportSuccess("Output Node Size : "+wdContext. nodeOutput().size());

wdThis.wdFirePlugToResult();

} catch (Exception ex) {

ex.printStackTrace();

}

//@@end

}

Regards,

Mithu

Former Member
0 Kudos

Hi Jesus,

You created 2 nodes in the custom controller - bound 1 to the input and 1 to the output.

Is the output node created inside the input node?

I have always seen, that 1 node Input is created and inside that the output node is created.

But the way you have written, it appears that you have created 2 root nodes - for input and output.

Thanks

Former Member
0 Kudos

Hi

Check whether u have set the cardinality property of the attributes and nodes correctly

Regards

Krishna

Former Member
0 Kudos

Hi Krishna!

The cardinality is set to 0..n on the Output node, but it contains another node called Header (the name of the structure on the Exporting parameters of the BAPI), and that Header node has cardinality 0..1.

I'm not allowed to change either cardinality.

Thanx.

Jesus