cancel
Showing results for 
Search instead for 
Did you mean: 

Model Node Invalidation + Remove Element

former_member187439
Active Participant
0 Kudos

Hi,

I have to treat one of my model nodes as a table and loop it to pass more than one value before i execute the function module.

For doing this, when i do just invalidate, i face a problem.

wdContext.nodeExt_Text_Tbl().invalidate();

The old value is not getting cleared from the second time.The new values are getting appended to the old values every time my code passes new values.

So, the only solution i had is to remove values through one of the below codes (every time after invalidation).

wdContext.nodeExt_Text_Tbl().invalidate();

if

(wdContext.nodeExt_Text_Tbl().size() > 0)

{for(int size=0;size<wdContext.nodeExt_Text_Tbl().size

();size++)

{wdContext.nodeExt_Text_Tbl().removeElement

(wdContext.nodeExt_Text_Tbl().getElementAt(size));}

}

OR

wdContext.nodeExt_Text_Tbl().invalidate();

while ( wdContext.nodeExt_Text_Tbl().size() > 0 ) wdContext.nodeExt_Text_Tbl().removeElement( wdContext.nodeExt_Text_Tbl().getElementAt(0) );

This solves the issue.But i face another big problem. That is, for the first time i call the method, my values are not getting added to the node. Only from the second time i call the method, the values are getting added.

I'm using the same method for another similar node and it works fine. I dont have a clue why i face this behaviour for this node alone. Please do help out..

Thanks in advance,

Kavitha

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member187439
Active Participant
0 Kudos

My problem solved with my collegue's help. All we did is, just add the values in an alternate method as shown below. Eventhough my previous method should work fine, we donot have a reason for the issue.

Bapimepotextheader LongTexts = new Bapimepotextheader();

LongTexts.setText_Line(SubstringVal);

LongTexts.setPo_Item("00000");

LongTexts.setText_Form("*");

LongTexts.setText_Id("F01");

IPublicCC_OrderReliefAid.IExt_Text_TblElement objExt_Text_TblElement = wdContext.nodeExt_Text_Tbl().createExt_Text_TblElement(LongTexts);

wdContext.nodeExt_Text_Tbl().addElement(i,objExt_Text_TblElement);

Former Member
0 Kudos

Hi Kavitha,

Use same code before executing the Function Module.

Hope this will solve your problem

Thanks

Sandy

Former Member
0 Kudos

Hi,

The link below deals with the same problem.

[]

Hope it will help you.

thanks & regards,

Manoj

former_member187439
Active Participant
0 Kudos

Hi Manoj,

Derek's issue seems to be with a WebService Node and it solved as he had 2 options say, passing values as array or list.

I dont have any such options and mine is a Function Module. Do you have a clue?

Thanks & Regards,

Kavitha