on 07-22-2007 6:41 PM
Hi Experts,
I have used some logic to enter record in R/3 table using SAP supplied BAPI. The record is getting inserted. Using the same logic when I am trying to insert the data using ZBAPI, my data is not reaching R/3. What may be the possible reason.
Code for SAP Supplied BAPI - It works fine.
Bapi_Catimesheetmgr_Insert_Input Input = new Bapi_Catimesheetmgr_Insert_Input();
wdContext.nodeBapi_Catimesheetmgr_Insert_Input().bind(Input);
wdContext.currentBapi_Catimesheetmgr_Insert_InputElement().setProfile("somevalue");
Date workdate = new Date(System.currentTimeMillis());
workdate = wdContext.currentContextElement().getDate();
Bapicats1 xyz = new Bapicats1();
xyz.setCatshours(new BigDecimal ("1"));
xyz.setWbs_Element("somevalue");
xyz.setEmployeenumber("somevalue");
xyz.setWorkdate(workdate);
Input.addCatsrecords_In(xyz);
wdThis.wdGetPoCCustController().executeBapi_Catimesheetmgr_Insert_Input();
wdThis.wdGetPoCCustController().executeBapi_Transaction_Commit_Input();
Code for Z BAPI (It does not work)
Zbapi_Catimesheet_Update_Input Input = new Zbapi_Catimesheet_Update_Input();
wdContext.nodeZbapi_Catimesheet_Update_Input().bind(Input);
Date workdate = new Date(System.currentTimeMillis());
workdate = wdContext.currentContextElement().getWdate();
wdContext.currentZbapi_Catimesheet_Update_InputElement().setPersonalnumber("somevalue");
wdContext.currentZbapi_Catimesheet_Update_InputElement().setProfile("somevalue");
wdContext.currentZbapi_Catimesheet_Update_InputElement().setWork_Date(workdate);
Zbapicatsd1 AA = new Zbapicatsd1();
AA.setWbs_Element("somevalue");
AA.setDay1("1");
AA.setDay2("1");
AA.setDay3("1");
AA.setDay4("1");
AA.setDay5("1");
AA.setDay6("1");
AA.setDay7("1");
AA.setPerson_No("somevalue");
Input.addWorklist_Act(AA);
wdThis.wdGetSsCustController().executeZbapi_Catimesheet_Update_Input()
wdThis.wdGetSsCustController().executeBapi_Transaction_Commit_Input();
Can you please let me know what is going wrong with the Z BAPI code. Please note that using R/3 front end (SAP GUI), I am able to insert data for Z BAPI.
Regards,
Brian
Hi Experts,
Further to the following question, please note that table Zbapicatsd1 is a very big table and the total number of columns is around 300 (Approx). Out of this, there are 9 mandatory fields. I have set the value of these fields using following code:
AA.setWbs_Element("somevalue");
AA.setDay1("1");
AA.setDay2("1");
AA.setDay3("1");
AA.setDay4("1");
AA.setDay5("1");
AA.setDay6("1");
AA.setDay7("1");
AA.setPerson_No("somevalue");
Is there is any memory issue with Web Dynpro here? Can you please advise.
Regards,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi VLN,
In this context, I will speak to ABAPer. However, I have one concern here. Using Z BAPI, I am able to save record using R/3 front end. Does this mean that every thing is fine with Z BAPI?
If it is the case then there may be some other reason for non-insertion of record. It is possible that I may have done mistake some where else. Or the table parameter of Z BAPI is creating problem. Ae metioned above the table has around 300 fields. There might be some memory issue.
Regards,
Brian
Hi Mithu,
Thanks. I have done this as well.
The codes are:
In View
try {
wdThis.wdGetSsCustController().executeZbapi_Catimesheet_Update_Input();
wdThis.wdGetSsCustController().executeBapi_Transaction_Commit_Input();
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
}
In Controller
wdContext.currentBapi_Transaction_Commit_InputElement().modelObject().execute();
wdContext.nodeOutput1().invalidate();
Regards,
Brian
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.