cancel
Showing results for 
Search instead for 
Did you mean: 

problems to fill a node

Former Member
0 Kudos

Hi everybody!

Im new in web dynpro and im making a application where i need to call a rfc named bapi_mddatasestcreate_object.

the structure i have in the custom controll is:

Bapimddataset_Create_Object_Input

---Command_Text2

-


line

---OutputcreateObject

-


CommandText

-


DatasetId

Im filling the commandText as below:

<i>public void executemodelcreateobject( )

{

//@@begin executemodelcreateobject()

Bapi_Mddataset_Create_Object_Input input2 = new Bapi_Mddataset_Create_Object_Input();

wdContext.nodeBapi_Mddataset_Create_Object_Input().bind(input2);

Bapi6111Mdx bapimdx1 = new Bapi6111Mdx();

Bapi6111Mdx bapimdx2 = new Bapi6111Mdx();

Bapi6111Mdx bapimdx3 = new Bapi6111Mdx();

Bapi6111Mdx bapimdx4 = new Bapi6111Mdx();

bapimdx1.setLine("SELECT [Measures].MEMBERS ON AXIS(O)");

bapimdx2.setLine("NON EMPTY [0D_SHIPTO].[LEVEL01].MEMBERS");

bapimdx3.setLine("* [0D_MATERIAL].[LEVEL01].MEMBERS ON AXIS(1)");

bapimdx4.setLine("FROM [0D_SD_C03/0D_SD_C03_Q0021]");

wdThis.wdGetContext().currentBapi_Mddataset_Create_Object_InputElement().modelObject().addCommand_Text(bapimdx1);

wdThis.wdGetContext().currentBapi_Mddataset_Create_Object_InputElement().modelObject().addCommand_Text(bapimdx2);

wdThis.wdGetContext().currentBapi_Mddataset_Create_Object_InputElement().modelObject().addCommand_Text(bapimdx3);

wdThis.wdGetContext().currentBapi_Mddataset_Create_Object_InputElement().modelObject().addCommand_Text(bapimdx4);

try{

wdContext.currentBapi_Mddataset_Create_Object_InputElement().modelObject().execute();</i>

I dont know if im doing right, because when i ask to draw a table with the command_text2 i am able to see the 4 input ive typed, but when i ask to draw a table with the command_text nothing is shown...

But i should be able to see the four entries... =(

Could anyone help me please?

Thanks! 😃

Message was edited by: luiza frota

Message was edited by: luiza frota

Message was edited by: luiza frota

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!Thanks for the answers!

the invalidade was missing! thanks

I have another problem now...

i have a value node in my view, and i need to add valueattributes on it at runtime...

do you have any idea how can i fill this node and its attributes at runtime?

thanks everybody!=)

Former Member
0 Kudos

Hi Luiza,

Let us call your node 'test' and the new attribute's name be 'attr'. Then the following lines of code will help you to create a new attribute and populate the node with values:

IWDNodeInfo nodeInfo = wdContext.nodeTest().getNodeInfo();

IWDAttributeInfo attrInfo = nodeInfo.addAttribute("attr" , "ddic:com.sap.dictionary.string");

IPrivate<your view name>.ITestElement elmt;

// <i>creating five elements for the node</i>

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

{

elmt = wdContext.createTestElement();

elmt.setAttributeValue("attr","Test Value"+i);

wdContext.nodeTest().addElement(elmt);

}

// <i>Printing the set values</i>

for(int i=0;i<wdContext.nodeTest().size();i++)

{

wdComponentAPI.getMessageManager().reportSuccess

(wdContext.nodeTest().getTestElementAt(i).getAttributeAsText("attr"));

}

Hope this helps,

Best Regards,

Nibu.

Luiza, a small suggestion: In future, please take care to close the thread if you have got the solution for your original query and incase you have a new query, please open a new thread for the same

Yashpal
Active Contributor

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi everybody!!

All you have helped me a lot!!!

thanks very much!! 😃

regards

Luíza

Former Member
0 Kudos

Luiza,

welcome to WD world.Since you say you are new here,i would suggest you to read a book written by Chris whealy.It gives a good basics for webDynpro.

In your coding after execute ,invalidate is missing.

wdContext.nodeBapi_Mddataset_Create_Object_Input().invalidate();

Former Member
0 Kudos

Hi Luiza,

May be you need to invalidate the node Bapi_Mddataset_Create_Object_Input after execution ?

(e.g. wdContext.nodeBapi_Mddataset_Create_Object_Input().invalidate();)

Regards,

Mike