on 12-18-2007 1:59 PM
Hi,
I have three screens, two fetches the data from Backend and one writes back the changed data to Backend. The two display screens are working fine but I have problem updating the Backend in the write screen.
I am using Bapi_Customer_Changefromdata1 to update the Customer details using a ARFC model application. I have made all the mappings correctly and also executed the Transaction_Commit Bapi after executing the Bapi_Customer_Changefromdata1, but still I have trouble updating the Backend.
I have also checked the mandatory fields by executing the same BAPI in SE37.
Can someone help me with the code here?
(All the mandatory inputs are used)
Bapikna101_1 persdata = new Bapikna101_1();
Bapikna101_1X persdatax = new Bapikna101_1X();
persdatax.setCity(true);
persdatax.setPostl_Cod1(true);
persdatax.setFirstname(true);
persdatax.setLastname(true);
persdatax.setCurrency(true);
persdatax.setLangu_P(true);
persdatax.setTel1_Numbr(true);
persdatax.setCountry(true);
persdatax.setFax_Number(true);
persdatax.setStreet(true);
persdatax.setE_Mail(true);
persdata.setCity(wdContext.currentContextElement().getCity());
persdata.setCountry(wdContext.currentContextElement().getCountry());
persdata.setCurrency(wdContext.currentContextElement().getCurrency());
persdata.setFirstname(wdContext.currentContextElement().getFirstName());
persdata.setLangu_P(wdContext.currentContextElement().getLanguage());
persdata.setLangup_Iso("EN");
persdata.setLastname(wdContext.currentContextElement().getLastName());
persdata.setPostl_Cod1(wdContext.currentContextElement().getPostal_Code());
persdata.setTel1_Numbr(wdContext.currentContextElement().getTelephone());
persdata.setE_Mail(wdContext.currentContextElement().getEmail());
persdata.setFax_Number(wdContext.currentContextElement().getFax());
persdata.setStreet(wdContext.currentContextElement().getStreet());
Customer_changeDetails.setPi_Personaldatax(persdatax);
Customer_changeDetails.setPi_Personaldata(persdata);
Customer_changeDetails.setCustomerno("0000000002");
Customer_changeDetails.setPi_Salesorg("0001");
Customer_changeDetails.setPi_Distr_Chan("01");
Customer_changeDetails.setPi_Division("01");
msgMgr.reportSuccess(" "+persdata.getFirstname());
// wdContext.nodePi_Personaldata().bind(persdata);
// wdContext.nodeBapi_Customer_Changefromdata1_Input().bind(Customer_changeDetails);
wdContext.currentBapi_Customer_Getdetail1_InputElement().modelObject().execute();
wdThis.executeBAPI_TRANSACTION_COMMIT();
wdContext.nodePi_Personaldata().invalidate();
Thanks,
Vamshi
Hi Vamsi,
Try this one:
After setting persdata (your structure)
// wdContext.nodePi_Personaldata().bind(persdata); instead of this
wdContext.currentBapi_Customer_Getdetail1_InputElement().modelObject().Pi_Personaldata(persdata);
Like this you can setXX() all your structures.
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vamsi,
Sorry, I missed it in copy and paste. You need to add or set to model oblect. Like this
wdContext.currentBapi_Customer_Getdetail1_InputElement().modelObject().add Pi_Personaldata(persdata);
OR
wdContext.currentBapi_Customer_Getdetail1_InputElement().modelObject().setPi_Personaldata(persdata);
If it is a structure you can only set it to modelObject
Feel free get back in case there is any issue, if solved please close this by mentioning the solution
regards,
Siva
Edited by: Siva Rama Krushna on Dec 19, 2007 6:25 PM
Hello Vamshi,
// wdContext.nodeBapi_Customer_Changefromdata1_Input().bind(Customer_changeDetails);
Have you tried after removing this comment in your code?
Edited by: Mayuresh Kanvinde on Dec 18, 2007 5:18 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vamshi,
have u tried debugging?? Check whether all the values are getting passed to backend or not.
Apart from that just check whether ur transaction commit bapi is the part of the same model , what u r using for Bapi_Customer_Changefromda or not. If there are 2 models, 1 for transaction comit & 1 for ur bapi, it will not work.
In case u r getting any error, send the stack trace.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sumit,
I do not have the option of debugging the code as the SDM is going into disable mode when I switch on the Debug mode. Next I have all the (four) Bapis in the same model. I am not getting any dump or error while I execute the application. Any idea as how I can check if the data is passed into the Backend.
Thanks,
Vamshi
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.