cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Output Node invalidation

Former Member
0 Kudos

Hi,

I call a BAPI through webdynpro which delivers a huge table as a result.

Since I do not need this data later in the application I am trying to invalidate it without success. The size of this output table remains the same.

This model node is emptied and filled with new data only when I call the BAPI again. Is there anyway to empty the BAPI output table as it is memory consuming?

Regards

MK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

After calling your BAPI write this code.

wdContext.nodeBapi.modelobject.inavlidate();

Regards

Nidhideep

Former Member
0 Kudos

hi

After executing the BAPI write this code:

hi

After calling your BAPI write this code.

wdContext.nodeBapi.nodeOutput.modelobject.inavlidate();

Former Member
0 Kudos

Hi,

After execution of bapi:

<b>wdContext.nodeBapi().invalidate();</b>

This invalidates ur complete node. If u wanna execute it once again on action u need to intialize it again.

If u wanna invalidate only output node, u can do this:

<b>wdContext.nodeBapi().nodeBapiOutput().invalidate();</b>

Regards,

Aparna .P

Former Member
0 Kudos

Hi Everybody,

I have been using the command

wdContext.nodeBapi().invalidate();

but that doesnt empty the node.

It empties it only when u make a fresh call to the bapi, filling it with new data.

Contrary to model node, a context node invalidation takes place immediately.

Former Member
0 Kudos

Hi

try this.

for(int i = (wdContext.nodeBapi().size()-1);i>0; i--){ wdContext.nodeBapi().removeElement( wdContext.nodeBapi().getElementAt(i));}

Thanks

Lohi

Former Member
0 Kudos

Hi,

Can you tell where did u initialize ur bapi.

If possible please post ur code snippet. Ideally once node is invalidated there will be nothing in that node. If u can post the code, it will be easy to figure out the problem.

Regards,

Aparna .P

roberto_tagliento
Active Contributor
0 Kudos

Strange.

You can use also this:


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

Former Member
0 Kudos

Hi,

I think the invalidation of Model node Vs Context Node has been thoroughly discussed in this forum link.

Conclusion:

Model node invalidation doesnt empty the values.

Only resort is to empty individual elements as u all suggested

Thnks everbody

Former Member
0 Kudos

Invalidating model node force filling this node by data taken from model

And empting individual elements is time wasting process (you have to use loop).

you can try to adapt next code:

modelObj = wdContext.current_..>_InputElement().modelObject();

if (modelObj .getOutput() != null) {

modelObj.getOutput().getE_Elements().clear();

}

E_Elements here node which you mapped on iwdtable.

-


And in general if use Adaptive RFC model its a quite clever thing) For example if u have in R3 table with 40000 rows and execute BAPI using ARFC than ARFC will retrieve NOT ALL of 40000 rows at once but only needed to be displayed on UI.

Former Member
0 Kudos

Hi Dennis,

That was indeed an icing on the cake.

The logic here was to clear not the BAPI_Input but the BAPI_Output model.

Thank u very much.

Best Regards

MK

Answers (1)

Answers (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Meesum,

I think i understood your problem. You had binded your table directly to result node BAPI. Invalidate will always refresh the node but result data will be there always.

What is return type of result node ?. list, Abstract list, etc check in the models. when ever you want to empty the table and...if its list mean do like this

List records = new ArrayList();

wdContext.node<result node which u bind to the table>().bind(records );

Regards, Suresh KB