cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Invalidating node in BAPI........

Former Member
0 Kudos

Hi,

Can anyone explain the code below clearly....i have doubt why first executing the model object,after that y invalidating that outputnode again.....can u explain step by step..

Bapi_Flight_Getlist_Input bap=new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(bap);

try{

wdContext.nodeBapi_Flight_Getlist_Input().currentBapi_Flight_Getlist_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

The RFM's functionality is invoked by executing the Model.

<b>wdContext.nodeBapi_Flight_Getlist_Input().currentBapi_Flight_Getlist_InputElement().modelObject().execute();</b>

After executing you need to invalidate the output note to access the actual model data i.e the data returned by the RFM will be available inthe context.

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

regards

ambicasony

Former Member
0 Kudos

That is fine and I just want to know one thing,

Once I execute the BAPI the context will loaded with the datas and why is that I need to invalidate the node after I execute the BAPI. How is that we are able to have records in the Node.

Can it be the other way round wherein we invalidate the output node first and then we execute the BAPI.

Give a clear solution for this.

Former Member
0 Kudos

Hi

After executing the model u have to invalidate the output node because the previous data in the output node context gets refreshed and is filled with the new model data.

Hope it is cleared for you.

regards

ambicasony

Former Member
0 Kudos

After executing the RFC model object, to synchronize the data in the context with the data in the model you have to use “invalidate()”

Former Member
0 Kudos

When u import an RFC, it's corresponding auxilliary java classes(Bapi_Flight_Getlist_Input) will be created.

Initially, the model node that we map from model wont have any values

and will be null.

In order to initialize this model node, we are bind the object of auxiliary java class bap to this node (wdContext.nodeBapi_Flight_Getlist_Input().bind(bap);NOw the model node can be used to pass the values.

Invalidate as it's name indicates, invalidates the contents of a node.

So we will be using invalidate to delete all elements of a node.

In case of model node, we will be calling invalidate for output node.

It's because, if we r not invalidating the output node, the values will not be reloaded after the first output.