cancel
Showing results for 
Search instead for 
Did you mean: 

RFC data not refreshed

Former Member
0 Kudos

Hi all,

I have following problem:

In the default view I render data out of a R/3 system in a table. This data is received when the view is loaded (so the BAPI execution takes place in the wdDoInit() method)

Below the table I have a button from which I can create a new entry for the table. Clicking this button will lead the user to a new view where he can enter the required data.

When he then clicks the "Save" button on the second view he is redirected to the initial view.

-> The problem now is that the new entry is not visible in the table unless the user refreshes the browser itself.

Follwoing happens when the user saves the data:

The BAPI for saving the data is executed

The BAPI for showing the table data is executed.

The output of the BAPI showing the table data is invalidated.

I also tried to invalidate the output before executing the showing BAPI and I also tried to invalidate the input of the showing BAPI and execute the wdDoInit method again. That all does not help.

Any idea how to fix this?

regards

René

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

within SDN they are lots of threads to this topic but none of them helps in my case. No correction of this problem I get from:

- calling wdDoInit()

- resetting view view view.reset()

- resetting context via wdContext.getContext().reset(false)

- invalidating node

- ...

So how to fix this bug?

Is there a possibility to refresh the complete browser out of WebDynpro - so simulating a F5?

regards

René

Former Member
0 Kudos

Hi jurmann,

I think you have made mistakes in your coding. because both the refreshing the browser and calling DoInit() will be having the same action. please check it out again.

regards

karthik

Former Member
0 Kudos

Hi

After created New record.

Check This

1.Invalidate the list BAPI node

2.Bind the Input for the List BAPI

3.Invalidate the output node

4. Execute the List Bapi

You can check that the list bapi executeion is take place or not by give the message

wdComponentAPI.getMessageManager().reportSuccess("Inside ListBAPI Execution");

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

that does not help either.

I even put the whole wdDoInit() method of the CutomController to the onPlugFromOtherView() method (here exactly the scenario you described is executed)

regards

René

Former Member
0 Kudos

Hi

If you use the Custom Controler call the execute method only.

Can you get the message of execution?

Check that you bind the result screen in the firePlug

in side the onPlugFromOtherView check the action takes place with the message

wdComponentAPI.getMessageManager().reportSuccess("In side onPlugFromOtherView ");

Check the result screen's inplug(onPlugFromOtherView) is bind with the correct out plug from record inserted.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

Only calling the execute method of the Custom Controller was my first try.

The message I get. And when I refresh the browser via F5 I also see the newly created record! It's not visible when the first view is called again from inbound plug.

What you mean with "bind the result screen in firePlug" exactly?

In the fireplug I call another BAPI than in the first view. This other BAPI just creates a new entry and has no output. On the first view the list of entries is received from an own BAPI.

regards

René

Former Member
0 Kudos

Hi

You can easily track the error .

remove the unwanted code.

1.After the Create BAPI Executed do you got the message?

2.Inside the onPlugFromOtherView are you got the message?

3.Is the outplug bind with onPlugFromOtherView ?

4.Try to print the list bapi size.(wdContext.node<ListBapiOutput>().size())

Kind Regards

Mukesh

Former Member
0 Kudos

Hi jurmann,

can you put your DoInit() code of the first view and the code used in save button in second view?.

Former Member
0 Kudos

Hi,

the messages I receive and the outplug is bound with onPlugFromOtherView.

The size is after creating the new entry the same but as soon as I refresh the browser the entry is displayed in the table and the size increased.

So why I can see the updated table only when I refresh the page but not when the view is loaded? When refreshing the page no data is created!

regards

René

Former Member
0 Kudos

Hi

Check the inplug(bind From the onPlugFromOtherView)in the result view(Table's view)that you call the wdDoInit() method inside it.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

I call the wdDoInit() method but it does not help.

regards

René

Former Member
0 Kudos

Hi,

could you post your DoInit() code of the first view and the code used in save button action of second view?.

Former Member
0 Kudos

Hi,

here the code of the wdDoInit() of the first View:

wdThis.wdGetOrgDataCTRLController().executeOrgData();

String objectId = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getObject_Id();

String shortText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getShort_Text();

String longText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getLong_Text();

if (objectId == null) objectId = "";

if (shortText == null) shortText = "";

if (longText == null) longText = "";

wdContext.currentContextElement().setObjectId(objectId);

wdContext.currentContextElement().setShortText(shortText);

wdContext.currentContextElement().setLongText(longText);

wdThis.wdGetOrgDataCTRLController().wdGetContext().currentContextElement().setSobid(objectId);

IWDNodeElement element = wdContext.nodeObjectsdata().getElementAt(0);

wdContext.nodeObjectsdata().removeElement(element);

Here the code of the wdDoInit() of the Custom Controller "OrgDataCTRL":

IWDClientUser clientUser = WDClientUser.forceLoggedInClientUser();

String userId = "";

try{

IUser user = clientUser.getSAPUser();

userId = user.getUniqueID();

}catch(Exception e){

userId = clientUser.getClientUserID();

}

Z_Bapi_Orgunitext_Data_Get_Input bapiInput = new Z_Bapi_Orgunitext_Data_Get_Input();

wdContext.nodeZ_Bapi_Orgunitext_Data_Get_Input().bind(bapiInput);

Date date = new Date(106, 8, 22);

bapiInput.setKeydate(date);

bapiInput.setBname(userId);

Here the code of the save button action in the second view:

Z_Bapi_Rh_Object_Create_Input bapiInput = new Z_Bapi_Rh_Object_Create_Input();

wdThis.wdGetCreateObjectCTRLController().wdGetContext().nodeZ_Bapi_Rh_Object_Create_Input().bind(bapiInput);

String shortText = wdContext.currentContextElement().getShort();

String stext = wdContext.currentContextElement().getStext();

bapiInput.setSobid(wdContext.currentContextElement().getSobid());

bapiInput.setShort(shortText);

bapiInput.setStext(stext);

bapiInput.setBegda(wdContext.currentContextElement().getBegda());

bapiInput.setEndda(wdContext.currentContextElement().getEndda());

wdThis.wdGetCreateObjectCTRLController().executeCreateObject();

wdThis.wdFirePlugSaveObject();

Here the code of the inbound plug in the first view:

wdThis.wdGetOrgDataCTRLController().executeOrgData();

wdDoInit();

Here the code of the execute method within the Custom Controller:

wdContext.nodeOutput().invalidate();

wdDoInit();

try{

wdContext.currentZ_Bapi_Orgunitext_Data_Get_InputElement().modelObject().execute();

}catch(Exception e){

e.printStackTrace();

}

wdContext.nodeOutput().invalidate();

regards

René

Former Member
0 Kudos

Hi

Try this

here the code of the wdDoInit() of the first View:

String objectId = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getObject_Id();

String shortText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getShort_Text();

String longText = (String) wdContext.nodeObjectsdata().getObjectsdataElementAt(0).getLong_Text();

if (objectId == null) objectId = "";

if (shortText == null) shortText = "";

if (longText == null) longText = "";

wdContext.currentContextElement().setObjectId(objectId);

wdContext.currentContextElement().setShortText(shortText);

wdContext.currentContextElement().setLongText(longText);

wdThis.wdGetOrgDataCTRLController().wdGetContext().currentContextElement().setSobid(objectId);

wdThis.wdGetOrgDataCTRLController().executeOrgData();

Here the code of the inbound plug in the first view:

//wdThis.wdGetOrgDataCTRLController().executeOrgData();

wdDoInit();

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

that does not help!

Furhtermore I get an OutOfBounds Exception when initially loading the first view. This is caused as the node "Objectsdata" is only filled when executing the BAPI as it's part of the BAPI output.

regards

René

Former Member
0 Kudos

Hi Rene,

Try executing the same RFC in the inbound plug of the first view.

While doing this clear the table node values that were present earlier.

- Nagarajan.

Former Member
0 Kudos

Hi

Try the change only in inbound plug in the first view:

//wdThis.wdGetOrgDataCTRLController().executeOrgData();

wdDoInit();

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh and Nagarajan,

both did not help (and as I wrote I already tried this out)

Perhaps I should go another way: Is there any possibility to add custom JavaScript to the view?

regards

René

Former Member
0 Kudos

Rene,

U cannot use javascript inside webdynpro.

If u r using this in portal as iView then u can try Eventing to refresh the page.

Fire event in the second view.

WDPortalEventing.fire("<namespace>","Save","");

Subscribe event in the first view.

WDPortalEventing.subscribe("<namespace>","Save",<Define an action in the view and call it>);

Hope this would help,

Regards,

Nagarajan.

Former Member
0 Kudos

Hi Nagarajan,

unfortunately I will not use this WebDynpro inside a portal.

Is there also an API for standard J2EE WebDynpro on how to refresh the browser page?

regards

René

Former Member
0 Kudos

Hi All,

Why dont you call method which is in the child view that gets latest data from R/3.

Regards,

hemant

Former Member
0 Kudos

HI Rene;

Make method bapiIntialize():

in this method do this:

1.Create a new Instance of the Input node

2.Bind the Input for the List BAPI

Means whatever you do in your wdInit() method write that code in this method:

Now call this method in your wdInit()method and then call it after invalidating your node.

If not solved give me your BapiNode and its attribute.

Regards

Nidhideep

Former Member
0 Kudos

Hi Jurmann,

Are you using "plug" to redirect the view from the second.

then you should call the wdDoInit() method in the onPlugFrom<Outboundplugname>() method which is in the first view.

regards

karthik

Former Member
0 Kudos

Hi Karthik,

as I wrote I have already tried this and it does not help!

Any other suggestions?

regards

René