cancel
Showing results for 
Search instead for 
Did you mean: 

Value nodes creation error

Former Member
0 Kudos

Hi,

is there a way to create dynamic value nodes and attributes?

I have a bapi which gives me a table in the back-end. At this moment i need to create te nodes manually. I was wondering if it is also possible not create the dynamicly.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I hope there is a Output node from a bapi which carries the Table Structure. You can use that

Regards

Saravanan K

Former Member
0 Kudos

any example code?

Former Member
0 Kudos

Hi

Bind the output node to the tableUI element.

In the Layout right click the RootUIElement and select the Apply template and select the Table from the menu and click the next button and select the output node.

IPrivate<ViewName>.I<BapiName>Node nodeWeb=wdContext.node<BapiName>();

IPrivate<ViewName>.I<Name>Node nodeCC=wdContext.node<Name>();

nodeCC.invalidate();

int size=nodeWeb.size();

for(int i=0;i<size;i++){

IPrivate<ViewName>.I<BapiName>Element elementWeb=nodeWeb.get<BapiName>ElementAt(i);

IPrivate<ViewName>.I<Name>Element elementCC=wdContext.create<Name>Element();

elementCC.set<Param>(elementWeb.get<Param>());

nodeCC.addElement(elementCC);

}

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

Consider the OutputNode

--TableNode

First find the size of the TableNode as wdContext.nodeTableNode().size();

for(int i=0;i<size;i++)

{

//You can assign this string to the table element

wdContext.nodeTableNode().getTableNodeElement(i).get<Attribute>);

}

I just presented the code. Change this code according to your structure

Regards

Saravanan K

Former Member
0 Kudos

is it possible to let value attributes be imported (from that table) dirtectly into the context nodes. what kind of code do i need to use then?

Former Member
0 Kudos

Hi,

You can bind those output attributes of the BAPI to the Table UIelement node directly or Using Customcontroller

Regards

Saravanan K

Former Member
0 Kudos

You can use a custom controller

Former Member
0 Kudos

I am very new at this. what do you mean??

Former Member
0 Kudos

HI,

Try this thread

[original link is broken]

1.First import the BAPI,

2.Using Component Controller(Bind the Inputof BAPI tothe Custom controller and do the steps in previous reply(bind to the Table)

3.Using Custom Controller. Here Create a node Say Master Create Two Nodes Input And Output. And Create attributes according to the Input and Out Parameters of BAPI.Bind the Input and Out Parameters.Then Bind the node Master to the Component Controller and then to view

4.Then Write a code to populate the Table with the BAPI o/p

Rergards

Saravanan K

Former Member
0 Kudos

I want to create automaticly value nodes in the NWDS. I have from the bapi the value nodes field name, -index and value. But this table provides me fields which i need to use in an adobe form. It are about 400 fields and i want to seee if it is possible to at least create the value nodes or in the component or in the view.

Former Member
0 Kudos

Hi,

Then you bind the required parameters of the Bapi O/P to the table

Regards

Saravanan K

Former Member
0 Kudos

The fields in the table I need to create a form. Is it possible to import these fields in the NWDS so i can create an adobe form.

Former Member
0 Kudos

Hi,

You can decide it in the view at select the attributes which are need to the Table UIelement.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi

To make use of these fields in the adobe form you will have to set the dataSource property of InteractiveForm UI element to this node.

Then when you go to Data view in Adobe designer you can drag these fields and drop them on the form and thus use them.

To display the content in the form of a table you can use Subform adobe ui element.

Regards,

Ajay

Former Member
0 Kudos

I need to make the forms manually. I know how to get a table on a form. So i need the attributes so i can drag and drop.

Sumarry:

I have a bapi, which gives me a table. in the table there are field. is there a way to import the table fields into the NWDS so i can create mannually a form?

Former Member
0 Kudos

Sumarry:

I have a bapi, which gives me a table. in the table there are field. is there a way to import the table fields into the NWDS so i can create mannually a form?

--> Do i understand it correctly you want to create automaticly the value attributs with as source the bapi table?

Former Member
0 Kudos

<b>IPublicProcess_Status_Cust.I</b><NodeNametoview>Node nodeoutputview=wdContext.node<NodeNametoview>(); bold is an invalid expression

Former Member
0 Kudos

Hi

IPublic<Nameofthecustomcontroleror the view name where you write the code>.I<NodeNametoview>Node nodeoutputview=wdContext.node<NodeNametoview>(); bold is an invalid expression

Kind Regards

Mukesh

Former Member
0 Kudos

hi,

<b>PublicProcess_Status_Cust</b> is the name of your current view, in which you are writing the code.

Former Member
0 Kudos

Context structure:

Y_Tf_Process_Status_Input

outputPros

Ytf_Process_LogPros

<atribute> Isr_Number

Yisr_Special_Data_Get_Input

OutputSDG

Special_DataOutputSDG

<atribute>Fieldname

<atribute>FieldValue

<atribute>FieldIndex

___________________________________________

this is the code i have now... what am i doing wrong (sorry)

try {

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr = wdContext.currentYisr_Special_Data_Get_InputElement();

String isrNr = wdContext.currentYtf_Process_LogProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

inputIsr.execute();

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGNode nodeoutput=wdContext.nodeSpecial_DataOutputSDG();

int size=nodeoutput.size();

IPublicProcess_Status_Cust.IMappedFieldsNode nodeoutputview=wdContext.nodeMappedFields();

for(int j=0;j<size;j++){

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput=nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPublicProcess_Status_Cust.IMappedFieldsElement elementoutputview=wdContext.createMappedFieldsElement();

elementoutputview.setFieldname(elementoutput.getFieldname());

elementoutputview.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Former Member
0 Kudos

Hi

try {

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr = wdContext.currentYisr_Special_Data_Get_InputElement();

<b>//You have to create the <CreatedInputNode> and bind it to the View to get Input From Client</b> String isrNr = wdContext.current<CreatedInputNode>Element().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

<b>//<Yisr_Special_Data> bind the base node to execute</b> wdContext.current<Yisr_Special_Data>Element().modelObject().execute();

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGNode nodeoutput=wdContext.nodeSpecial_DataOutputSDG();

int size=nodeoutput.size();

IPublicProcess_Status_Cust.IMappedFieldsNode nodeoutputview=wdContext.nodeMappedFields();

for(int j=0;j<size;j++){

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput=nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPublicProcess_Status_Cust.IMappedFieldsElement elementoutputview=wdContext.createMappedFieldsElement();

elementoutputview.setFieldname(elementoutput.getFieldname());

elementoutputview.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Kind Regards

Mukesh<b></b><b></b><b></b><b></b>

Former Member
0 Kudos

THe Yisr_Special_Data_input needs to fill an adobe form. now i get a message the form must not be empty. what do i need to adjust.

try {

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr = wdContext.currentYisr_Special_Data_Get_InputElement();

//You have to create the <CreatedInputNode> and bind it to the View to get Input From Client</b>

String isrNr = wdContext.currentYtf_Process_LogElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

//<Yisr_Special_Data> bind the base node to execute

wdContext.currentYisr_Special_Data_Get_InputElement().modelObject().execute();

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGNode nodeoutput=wdContext.nodeSpecial_DataOutputSDG();

int size=nodeoutput.size();

IPublicProcess_Status_Cust.IMappedFieldsNode nodeoutputview=wdContext.nodeMappedFields();

for(int j=0;j<size;j++){

IPublicProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput=nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPublicProcess_Status_Cust.IMappedFieldsElement elementoutputview=wdContext.createMappedFieldsElement();

elementoutput.setFieldname(elementoutput.getFieldname());

elementoutput.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Message was edited by: Eoin Cronan

Former Member
0 Kudos

Hi

Can you explain that . I couldn't understand.

Kind Regards

Mukesh

Former Member
0 Kudos

the bapi Y_Tf_Process_Status_Input i use as an search engine by clicking on the table. the lead selects triggers (input isr_number) the Yisr_Special_Data_Get_Input and opens a new view with an adobe form.

Yisr_Special_Data_Get_Input gives me a table (attributes fieldname, value and index) the fieldnames i now manually created and binded to the form so the fieldvalue gives me the data I need. Now I don't want to create de attributes manually but want it to be created in NWDS in noded mappedfields while running the bapi

Former Member
0 Kudos

Hi

try to execute this code

try {

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr = wdContext.currentYisr_Special_Data_Get_InputElement();

//get the value from earliar BAPI lead selection

String isrNr = wdContext.currentOutputProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

//Execute the modelnode

wdContext.currentYisr_Special_Data_Get_InputElement().modelObject().execute();

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_OutputNode nodeoutput=wdContext.nodeYisr_Special_Data_Get_Output();

int size=nodeoutput.size();

//get the output node size to check the sucessful of BAPI execution

wdComponentAPI.getMessageManager().reportSuccess(String.valueOf(size));

IPublicProcess_Status_Cust.IMappedFieldsNode nodeoutputview=wdContext.nodeMappedFields();

for(int j=0;j<size;j++){

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_OutputElement elementoutput=nodeoutput.getYisr_Special_Data_Get_OutputElementAt(j);

IPublicProcess_Status_Cust.IMappedFieldsElement elementoutputview=wdContext.createMappedFieldsElement();

elementoutputview.setFieldname(elementoutput.getFieldname());

elementoutputview.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Kind Regards

Mukesh

Former Member
0 Kudos

still the same. I checked with the old code to make sur the form was not empty.

old code:

try {

IPublicProcess_Status_Cust.IMappedFieldsElement field =

wdContext.createMappedFieldsElement();

Yisr_Special_Data_Get_Input inputIsr =

new Yisr_Special_Data_Get_Input();

String isrNr =

wdContext.currentYtf_Process_LogProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

inputIsr.execute();

Iterator it = inputIsr.getResult().iterator();

while (it.hasNext()) {

Yisr_Special_Data_Get_Output output =

(Yisr_Special_Data_Get_Output) it.next();

Iterator records = output.getSpecial_Data().iterator();

while (records.hasNext()) {

Object obj = records.next();

System.out.println(obj);

com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param record =

(com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param) obj;

// Qisrsspecial_Param record = (Qisrsspecial_Param )records.next();

String fieldname = record.getFieldname();

String fieldvalue = record.getFieldvalue();

try {

Method method =

field.getClass().getMethod(

"set" + fieldname,

new Class[] { String.class });

method.invoke(field, new Object[] );

} catch (SecurityException e) {

logger.catching(e);

} catch (IllegalArgumentException e) {

logger.catching(e);

} catch (NoSuchMethodException e) {

logger.catching(e);

} catch (IllegalAccessException e) {

logger.catching(e);

} catch (InvocationTargetException e) {

logger.catching(e);

}

}

}

this.wdContext.nodeMappedFields().bind(field);

} catch (Exception e) {

logger.catching(e);

}

Former Member
0 Kudos

Hi

Change the I<b>Public</b>Process... to

I<b>Private</b>Process..

for all the code and execute it.

Kind Regards

Mukesh

Former Member
0 Kudos

still the same>

code i have now is:

try {

IPrivateProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr =

wdContext.currentYisr_Special_Data_Get_InputElement();

//get the value from earliar BAPI lead selection

String isrNr = wdContext.currentYtf_Process_LogProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

//Execute the modelnode

wdContext.currentYisr_Special_Data_Get_InputElement().modelObject().execute();

IPrivateProcess_Status_Cust.ISpecial_DataOutputSDGNode nodeoutput =

wdContext.nodeSpecial_DataOutputSDG();

int size = nodeoutput.size();

//get the output node size to check the sucessful of BAPI execution

wdComponentAPI.getMessageManager().reportSuccess(String.valueOf(size));

IPrivateProcess_Status_Cust.IMappedFieldsNode nodeoutputview =

wdContext.nodeMappedFields();

for (int j = 0; j < size; j++) {

IPrivateProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput =

nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPrivateProcess_Status_Cust.IMappedFieldsElement elementoutputview =

wdContext.createMappedFieldsElement();

elementoutput.setFieldname(elementoutput.getFieldname());

elementoutput.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Former Member
0 Kudos

Hi,

elementoutput.setFieldname(elementoutput.getFieldname());

elementoutput.setFieldvalue(elementoutput.getFieldvalue());

change it to

elementoutputview.setFieldname(elementoutput.getFieldname());

elementoutputview.setFieldvalue(elementoutput.getFieldvalue());

Former Member
0 Kudos

it says then that fieldname and fieldvalue are an undefined type IPublicProcess_Status_Cust ImappedfieldsElement

I mapped fields is not connected to any Bapi. the fieldname is found in context of

Yisr_Special_Data_Get_Input

OutputSDG

Special_DataOutputSDG

Message was edited by: Eoin Cronan

Former Member
0 Kudos

Hi

1.do you got the BAPI output size?//if it size>0 means bapi executed well.

2. Is the MappedFieldsNode contains 2 parameters like Fieldname , Fieldvalue. otherwise create it.and Bind it.

IPrivateProcess_Status_Cust.IMappedFieldsNode nodeoutputview =

wdContext.nodeMappedFields();

for (int j = 0; j < size; j++) {

IPrivateProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput =

nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPrivateProcess_Status_Cust.IMappedFieldsElement elementoutputview =

wdContext.createMappedFieldsElement();

elementoutputview .setFieldname(elementoutput.getFieldname());

elementoutputview .setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Kind Regards

Mukesh

Former Member
0 Kudos

the size is bigger then 0 could be up to 400 fields...

I created two value attributes called fieldname and field value (type string)

where do i need to bind them.

Former Member
0 Kudos

Hi

In the MappedFields(Node)create the 2 attribute and bind them in custom controller.

IPrivateProcess_Status_Cust.IMappedFieldsNode nodeoutputview =

wdContext.nodeMappedFields();

for (int j = 0; j < size; j++) {

IPrivateProcess_Status_Cust.ISpecial_DataOutputSDGElement elementoutput =

nodeoutput.getSpecial_DataOutputSDGElementAt(j);

IPrivateProcess_Status_Cust.IMappedFieldsElement elementoutputview =

wdContext.createMappedFieldsElement();

elementoutputview .setFieldname(elementoutput.getFieldname());

elementoutputview .setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

2. Bind the node MappedFields to the Component Controler.

3. Bind it to the view from componenet controler

Kind Regards

Mukesh

Former Member
0 Kudos

still the same...

The component has now 1 node mapped field which is bind to the views and to the custom controler.

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Bound data node Node(WD_Form.MappedFields) of InteractiveForm must not be empty!

at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.renderLeadSelectedElement(XfdRenderer.java:176)

at com.sap.tc.webdynpro.clientimpl.xdp.renderer.data.XfdRenderer.render(XfdRenderer.java:76)

at com.sap.tc.webdynpro.clientserver.renderer.AbstractRenderManager.render(AbstractRenderManager.java:62)

at com.sap.tc.webdynpro.clientserver.adobe.AdobeFormHelper.getDataStream(AdobeFormHelper.java:706)

at com.sap.tc.webdynpro.clientserver.adobe.AdobeFormHelper.createPDFDocumentForUIElement(AdobeFormHelper.java:398)

at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.InteractiveForm.afterHandleActionEvent(InteractiveForm.java:185)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.afterHandleActionEvent(ClientApplication.java:1154)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:402)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)

Former Member
0 Kudos

Hi Eoin,

Kindly look at the link,this will help you to getout of the problem

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/761eba66-0401-0010-b982-d5f...

Regards

Saravanan K

Former Member
0 Kudos

one way or an other it doesn't want to work. I don't see what I am doing wrong

Former Member
0 Kudos

Hi

Check All of the view UIElement's Property is not empty(With red color).Bind all necesary fields for the Views UIElements.

Kind Regards

Mukesh

Former Member
0 Kudos

the fields are binded. In the back-end I can see the form is not empty. UI-elements are not empty. But one way or an other I don't get the value attributes in NWDS

Former Member
0 Kudos

Hi

1. Are you checked that the BAPI execution is completed Successfully.

2.Check other than BAPI execution are working fine(By comment the execution part).

3. Make sure at which part brings the error message.

Kind Regards

Mukesh

Former Member
0 Kudos

Everything is working.

the coding for integrating the fieldnames from the table into the NWDS. Should beintegrated in the already working code:

try {

IPublicProcess_Status_Cust.IMappedFieldsElement field =

wdContext.createMappedFieldsElement();

Yisr_Special_Data_Get_Input inputIsr = new Yisr_Special_Data_Get_Input();

String isrNr =

wdContext.currentYtf_Process_LogProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

inputIsr.execute();

Iterator it = inputIsr.getResult().iterator();

while (it.hasNext()) {

Yisr_Special_Data_Get_Output output =

(Yisr_Special_Data_Get_Output) it.next();

Iterator records = output.getSpecial_Data().iterator();

while (records.hasNext()) {

Object obj = records.next();

System.out.println(obj);

com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param record =

(com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param) obj;

// Qisrsspecial_Param record = (Qisrsspecial_Param )records.next();

String fieldname = record.getFieldname();

String fieldvalue = record.getFieldvalue();

try {

Method method =

field.getClass().getMethod(

"set" + fieldname,

new Class[] { String.class });

method.invoke(field, new Object[] );

} catch (SecurityException e) {

logger.catching(e);

} catch (IllegalArgumentException e) {

logger.catching(e);

} catch (NoSuchMethodException e) {

logger.catching(e);

} catch (IllegalAccessException e) {

logger.catching(e);

} catch (InvocationTargetException e) {

logger.catching(e);

}

}

}

this.wdContext.nodeMappedFields().bind(field);

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportException(e.toString(), false);

}

Former Member
0 Kudos

Hi

Is this code working well? or any other error message occur?.If already working means what is the need to change it?.

Kind Regards

Mukesh

Former Member
0 Kudos

this code is working. The only thing I want now is that this code need to update the fields in NWDS. so the mappedfields node should be filled with the output fioelds from the bapi

Former Member
0 Kudos

Hi

To bind the Bapi result and mappedfields you can use the loop as mentioned.

IPrivateProcess_Status_Cust.IMappedFieldsNode node = Context.nodeMappedFields();

IPrivateProcess_Status_Cust.IYisr_Special_Data_Get_Outputnode outputNode=context.nodeIPublicProcess_Status_Cust();

int size=outputNode.size();

for(int j=0;j<size;j++){

IPrivateProcess_Status_Cust.IYisr_Special_Data_Get_OutputElement element = outputNode.getYisr_Special_Data_Get_OutputElementAt(j);

IPrivateProcess_Status_Cust.IMappedFieldsElement field = Context.createMappedFieldsElement();

field.setFieldname(element.getFieldName());

field.setFieldvalue(element.getFieldvalue());

node.addElement(field);

}

While you bind and execute the Code Are you get the error as com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Bound data node Node(WD_Form.MappedFields) of InteractiveForm must not be empty!

Kind Regards

Mukesh

Former Member
0 Kudos

I get some type can not resolve errors on context

Former Member
0 Kudos

hi

set the Fieldname,Fieldvalue in mappedfields node field's type as same as the BAPI Yisr_Special_Data_Get_Output node's Fieldname,Fieldvalue .

Kind Regards

Mukesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

You use Adaptive RFC model.In this you can create the model for your BAPI.

After the model is created you map this model to the Custom/Component Controlleror Directly to the View.When you do this mapping in the Data Modeller by creating the Data Link between Model and Custom/Component/view controller you can select the Model Nodes of your BAPI.This will create the Model Nodes for the BAPI in the context.

Now you can execute the BAPI by setting the import parameters.

And then you can use the *_Output node as dataSource for your form.And thus you can use it to create form.

Regards,

Ajay

Former Member
0 Kudos

I know but the model attributes are the field value, -index and names. I need the field names to be created as value nodes in the NWDS so i can make a form of it.

Former Member
0 Kudos

Is there a way to create or import dynamic value attributes into a predefined valuenode with a bapi as source. The Bapi provides me the table and the fields in the table need to be imported into a predifine value node in NWDS

Former Member
0 Kudos

I want to create dynamic value nodes in the node mappedfields, but doesn't seem to work.

code in the view

IPrivateProcessStatusView.ISpecial_DataOutputSDGNode nodeWeb=wdContext.nodeYisr_Special_Data_Get_Input();

IPrivateProcessStatusView.IYisr_Special_Data_Get_InputNode nodeCC=wdContext.nodeMappedFields();

nodeCC.invalidate();

int size=nodeWeb.size();

for(int i=0;i<size;i++){

IPrivateProcessStatusView.ISpecial_DataOutputSDGElement elementWeb=nodeWeb.getSpecial_DataOutputSDGElementAt(i);

IPrivateProcessStatusView.IMappedFieldsElement elementCC=wdContext.createMappedFieldsElement();

elementCC.set<Param>((elementWeb.getFieldname());

nodeCC.addElement(elementCC);

}

wdThis.wdFirePlugToWD_Form();

wdThis.wdGetProcess_Status_CustController().executeYIsr_Special_Data_Get_Input(Notification_No, Do_Not_Read_Linked);

Former Member
0 Kudos

HI,

I think problem lies in

IPrivateProcessStatusView.ISpecial_DataOutputSDGNode nodeWeb=wdContext.nodeYisr_Special_Data_Get_Input();

Have a look at it

Regards

Saravanan K

Former Member
0 Kudos

what should it be then?

Former Member
0 Kudos

Hi,

I think it would be

IPrivateProcessStatusView.ISpecial_DataOutputSDGNode nodeWeb=wdContext.nodeSpecial_DataOutputSDG();

Regards

Saravanan K

Former Member
0 Kudos

Hi,

that is what the node you have given in left side should come in right side.

check it out.

regards

karthik

Former Member
0 Kudos

karthik, what do you mean

the bapi Yisr_Special_Data_Get

has the parameter notification_No.

Thee output of this parameter Special_DataOutputSDG provides me with 3 model attributes the field value,

-name- and -index

The field name should fill my contextnode mappedfields with attributes... I used the code:

IPrivateProcessStatusView.ISpecial_DataOutputSDGNode nodeWeb=wdContext.nodeISpecial_DataOutputSDG();

IPrivateProcessStatusView.IYisr_Special_Data_Get_InputNode nodeCC=wdContext.nodeMappedFields();

nodeCC.invalidate();

int size=nodeWeb.size();

for(int i=0;i<size;i++){

IPrivateProcessStatusView.ISpecial_DataOutputSDGElement elementWeb=nodeWeb.getSpecial_DataOutputSDGElementAt(i);

IPrivateProcessStatusView.IMappedFieldsElement elementCC=wdContext.createMappedFieldsElement();

elementCC.set<Param>((elementWeb.getFieldname());

nodeCC.addElement(elementCC);

}

wdThis.wdFirePlugToWD_Form();

wdThis.wdGetProcess_Status_CustController().executeYIsr_Special_Data_Get_Input(Notification_No, Do_Not_Read_Linked);

Message was edited by: Eoin Cronan

Former Member
0 Kudos

Hi,

that is what saravanan said.

ex:

IPriavate<ViewName>.I<ContextNode>Node node=wdContext.node<ContextNode>();

here the ContextNode would placed in both sides.

regards

karthik

Former Member
0 Kudos

Hi

What are all the steps you did?

now what you want to do?

Are you execute the BAPI or not?

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Cronan,

IPrivateProcessStatusView.IYisr_Special_Data_Get_InputNode

nodeCC=wdContext.nodeMappedFields();

is it correct?

i think it would be like this

IPrivateProcessStatusView.IMappedFieldsNode nodeCC=wdContext.nodeMappedFields();

check it out.

Former Member
0 Kudos

The parameter notification no is extracted from a table.

I want to execute the bapi YIsr_Special_Data_Get and the fieldnames from the r3 system are in a table. I want to extract them and create with the fieldnames value attributes automaticly in NWDS. s i can make a form of it

the cust. controler will execute the bapi

//@@begin executeYIsr_Special_Data_Get_Input()

try {

IPublicProcess_Status_Cust.IMappedFieldsElement field =

wdContext.createMappedFieldsElement();

Yisr_Special_Data_Get_Input inputIsr =

new Yisr_Special_Data_Get_Input();

String isrNr =

wdContext.currentYtf_Process_LogProsElement().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

inputIsr.execute();

Iterator it = inputIsr.getResult().iterator();

while (it.hasNext()) {

Yisr_Special_Data_Get_Output output =

(Yisr_Special_Data_Get_Output) it.next();

Iterator records = output.getSpecial_Data().iterator();

while (records.hasNext()) {

Object obj = records.next();

System.out.println(obj);

com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param record =

(com.shell.shellpeople.wd.teamflow.processstatus.model.sdg.Qisrsspecial_Param) obj;

// Qisrsspecial_Param record = (Qisrsspecial_Param )records.next();

String fieldname = record.getFieldname();

String fieldvalue = record.getFieldvalue();

try {

Method method =

field.getClass().getMethod(

"set" + fieldname,

new Class[] { String.class });

method.invoke(field, new Object[] );

} catch (SecurityException e) {

logger.catching(e);

} catch (IllegalArgumentException e) {

logger.catching(e);

} catch (NoSuchMethodException e) {

logger.catching(e);

} catch (IllegalAccessException e) {

logger.catching(e);

} catch (InvocationTargetException e) {

logger.catching(e);

}

}

}

this.wdContext.nodeMappedFields().bind(field);

} catch (Exception e) {

logger.catching(e);

}

Message was edited by: Eoin Cronan

Former Member
0 Kudos

Hi

Try this

try {

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_InputElement inputIsr = wdContext.currentYisr_Special_Data_Get_InputElement();

String isrNr = wdContext.current<NodeNameFromViewInput>Element().getIsr_Number();

inputIsr.setNotification_No(isrNr);

inputIsr.setDo_Not_Read_Linked(true);

wdContext.currentYisr_Special_Data_Get_InputElement().modelObject().execute();

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_OutputNode nodeoutput=wdContext.nodeYisr_Special_Data_Get_Output();

int size=nodeoutput.size();

IPublicProcess_Status_Cust.I<NodeNametoview>Node nodeoutputview=wdContext.node<NodeNametoview>();

for(int j=0;j<size;j++){

IPublicProcess_Status_Cust.IYisr_Special_Data_Get_OutputElement elementoutput=nodeoutput.getYisr_Special_Data_Get_OutputElementAt(j);

IPublicProcess_Status_Cust.I<NodeNametoview>Element elementoutputview=wdContext.create<NodeNametoview>Element();

elementoutputview.setFieldname(elementoutput.getFieldname());

elementoutputview.setFieldvalue(elementoutput.getFieldvalue());

nodeoutputview.addElement(elementoutputview);

}

} catch (Exception e) {

logger.catching(e);

}

Kind Regards

Mukesh

Former Member
0 Kudos

in the custom controler?

Former Member
0 Kudos

Yes in custom controler

Former Member
0 Kudos

what do yiou exactly mean with nodeName to view

Former Member
0 Kudos

HI,

This is the name of the node

Regards

Saravanan K

Former Member
0 Kudos

1.Create a element for the input in custom controler

2. Creat a node in custom controler and bind the node to the view via Component controler.

3. Set the Value to the View

Kind Regards

Mukesh

Former Member
0 Kudos

Hi

If you requirement is just to display the data coming from BAPI in the table in webdynpro, then create a table in the view.Right click on this table and select create binding.Now from he context structure select the BAPI node which gives you the data.

Regards,

Ajay

Former Member
0 Kudos

Eoin,

Take a look at this tutorial:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b3f6e990-0201-0010-c087-c865f2c738b3">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b3f6e990-0201-0010-c087-c865f2c738b3</a>

Regards

Sebastian