Skip to Content
0
Former Member
Jul 22, 2007 at 05:41 PM

Strange issue with Z BAPI

27 Views

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