cancel
Showing results for 
Search instead for 
Did you mean: 

not updating r3 data

Former Member
0 Kudos

Hi SDNers,

i need to get the education details of a employee from r3 and display it in a table and if needed i need to update that education details back to r3.

i have writen the rfc for getting and modify the education data,

i am able to get the data and displaying in the table but when i click update button its not updating

what could be the problem.

Any help

Thank you,

Regards

Vijai

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

thanks for replys

please find the code which i have wrtten in WDJ

here i will explain where i place the code

1. This code is generated default in CController

public void wdDoInit()

{

//@@begin wdDoInit()

//$$begin Service Controller(1036100810)

wdContext.nodeZrfc_Change_Education_Data_Input().bind(new Zrfc_Change_Education_Data_Input());

//$$end

//$$begin Service Controller(96206476)

wdContext.nodeZrfc_Get_Education_Data_Input().bind(new Zrfc_Get_Education_Data_Input());

//$$end

//@@end

}

2.This code is generated default to display data in table

public void executeZrfc_Get_Education_Data_Input( )

{

//@@begin executeZrfc_Get_Education_Data_Input()

//$$begin Service Controller(-1237939107)

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentZrfc_Get_Education_Data_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch(WDDynamicRFCExecuteException ce) {

manager.reportException(ce.getMessage(), false);

}

//$$end

//@@end

}

3.This code is generated default to modify r3 data

public void executeZrfc_Change_Education_Data_Input( )

{

//@@begin executeZrfc_Change_Education_Data_Input()

//$$begin Service Controller(-270265608)

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentZrfc_Change_Education_Data_InputElement().modelObject().execute();

} catch(WDDynamicRFCExecuteException ce) {

manager.reportException(ce.getMessage(), false);

}

//$$end

//@@end

}

4. *Vcontroller

Code written by me in the view controller*

public void wdDoInit()

{

//@@begin wdDoInit()

wdThis.wdGetEducationCompController().executeZrfc_Get_Education_Data_Input();

//@@end

}

5.

Code written by me in the view controller to update, this action i have assign to button

public void onActionUpdate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionUpdate(ServerEvent)

wdThis.wdGetEducationCompController().executeZrfc_Change_Education_Data_Input();

//@@end

}

please any help

thankyou,

regards

Vijai

Former Member
0 Kudos

Hi Vijay,

You have to copy the data from elements under the node Zrfc_Get_Education_Data_Input to new elements under Zrfc_Change_Education_Data_Input.

Regards,

Gopal

Former Member
0 Kudos

Hi Gopal,

Is it binding u r saying,

i did not get this statment

copy the data from elements under the node Zrfc_Get_Education_Data_Input to new elements under Zrfc_Change_Education_Data_Input.

is it context mapping or context binding.

let me correct if i go wrong.

Former Member
0 Kudos

Hi Vijai,

Can you tell what are all the import,export and table parameters in Zrfc_Change_Education_Data RFC? May be after that SDN guys can help you more in solving your problem?

Regards,

Gopal

Former Member
0 Kudos

Hi Gopal,

Import and export parameters are table structure it self in r3

in Zrfc_Change_Education_Data RFC.

Please help me on this.

Thanks,

Regards

Vijai

Former Member
0 Kudos

Hi Vijai,

Can you tell us about your logic you have used in Change RFC? Is it that you are accepting all records which are to be updated in table structure and updating the required table? Correct me if I am wrong:

You get all the records which are under Output node of Get RFC. Now you want to update all records which you get using modify RFC.

One more thing I want is can you specify whole node structure of both Zrfc_Change_Education_Data_Input and Zrfc_Get_Education_Data_Input.

Regards,

Gopal

Former Member
0 Kudos

Hi Gopal,

i send screen shots for whole node structure of both Zrfc_Change_Education_Data_Input and Zrfc_Get_Education_Data_Input.

to your id which given in sdn.

please have a look and let me know the problem.

help me on this regard

thanks

Vijai

Former Member
0 Kudos

Hi Vijai,

Don't know whether this will solve problem. But you can try following:

In wdDoInit of Service Controller method add following code:

Instead of

wdContext.nodeZrfc_Change_Education_Data_Input().bind(new Zrfc_Change_Education_Data_Input());

write following code

executeZrfc_Get_Education_Data_Input();
 
        Zrfc_Change_Education_Data_Input input = new Zrfc_Change_Education_Data_Input();
        for (int i=0;i<wdContext.nodeItPa0022().size();i++){
              IPublicEducationCompController.IItPa0022Element ele = wdContext.nodeItPa0022().getItPa0022ElemntAt(i);
             ItPa0022_Chg changeEle = new  ItPa0022_Chg();

             //Copy all values from ItPa002 to ItPa022_Chg - You can try with WDCopy Service also. I don't have 
             //any idea how to use it
             changeEle.setAedtm(ele.getAedtm());
             changeEle.setAnzeh(ele.getAnzeh());
             //////////////////////////////////////////////////Do for all fields of Table ItPa022//////////

            input.addItPa022_Chg(changeEle);

        }
        wdContext.nodeZrfc_Change_Education_Data_Input().bind(input);

Comment code written in wdDoinit of View

//Commented line - wdThis.wdGetEducationCompController().executeZrfc_Get_Education_Data_Input();

I hope you are showing all data in view which are mapped to attributes of ItPa0022 node.

Regards,

Gopal

Edited by: Gopal on May 16, 2008 8:12 PM

Sm1tje
Active Contributor
0 Kudos

what exactly is not working:

Your button,

Calling of RFC

Updating the db table?

Is RFC correctly filled, can you check this at R/3 side by debugging?

Do you have any exceptions, return codes, are you using return structure BAPIRET2 for messages?

Try and be a bit more clear...

Former Member
0 Kudos

Hi Micky,

Thanks for reply,

Updating the db table

i have checked the rfc from r3 side its working.

any help

thanks

regards

Vijai

Sm1tje
Active Contributor
0 Kudos

So, if this RFC is working in R/3, and the db table get updated, then I would say that the problem is not with R/3 (or RFC for that matter), but the problem lies in Web Dynpro. What I'm trying to say it that, updating is not the actual problem. Correct me if I'm wrong.

Former Member
0 Kudos

Hi,

If the DB table is updated from the R/3 side, u need to check for the Data that is being sent to R/3. Checked whether the data is being set in the proper way, means check whether all the mandatory parameters are being passed to the R/3 from frontend. Put a print message at the Model Execution and check whether the RFC is being executed or not from frontend.

regards,

Lakshmi.