cancel
Showing results for 
Search instead for 
Did you mean: 

Record not getting inserted into R/3 table.

Former Member
0 Kudos

Hi Experts,

I am trying to save some information in R/3 using BAPI. I have written codes like as shown below:

Code in View

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

{

//@@begin onActionInsertRecord(ServerEvent)

try { wdThis.wdGetTimesheetCompController().executeBapi_Catimesheetmgr_Insert_Input();

wdThis.wdGetTimesheetCompController().executeBapi_Transaction_Commit_Input();

} catch (Exception ex)

{wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);

}

//@@end

}

Code in Component Controller

public void executeBapi_Catimesheetmgr_Insert_Input( )

{

//@@begin executeBapi_Catimesheetmgr_Insert_Input()

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{ Bapicats1 xx = new Bapicats1();

xx.setWbs_Element(wdContext.currentWorklistElement().getRec_Wbs());

xx.setEmployeenumber(wdContext.currentZbapi_Cat_Stech00_Getdetail_InputElement().getEmployeenumber());

xx.setCatshours(new BigDecimal ("1"));

xx.setWorkdate(wdContext.currentOutputElement().getDate_From());

wdContext.currentBapi_Catimesheetmgr_Insert_InputElement().setProfile(wdContext.currentZbapi_Cat_Stech00_Getdetail_InputElement().getProfile());

wdContext.currentBapi_Catimesheetmgr_Insert_InputElement().modelObject().execute();

wdContext.nodeOutputnew().invalidate();

}

catch(WDDynamicRFCExecuteException e)

{

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

}

//@@end

My records are not getting saved in R/3 tables. Can you please let me know what is going wrong here. The BAPI input parameters values are correctly getting populated in Component Controller.

I have also created error message table in View. This error message table is mapped to output of Bapi_Catimesheetmgr_Insert. This table is not getting populated.

Due to this reason, I believe that the values of input parameters of BAPI are not getting passed to R/3. However, I am not sure where the problem lies. Can you please help me in resolving the issue?

Regards,

Brian

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Brian,

Are u getting any exception ??If not then try to check the BAPI in R/3 system.Go to transaction SE37 & execute ur bapi with same input parameters (What u r passing from ur code) .Check whether it works or not?

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

I am not getting any exception. Using SE37, I can save the transaction. Can you please let me know what is going wrong here.

Regards,

Sumit

Former Member
0 Kudos

Hi Brian,

Ur code seems to be ok...If u r not getting any exception also,i m not sure what can be wrong.

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

Can we take the help of debugger of R/3 to know the values of input parameters passed by me into R/3?

Regards,

Brian

Former Member
0 Kudos

Hi Brian,

Obviously u can try using debugger..

regards

Sumit

Former Member
0 Kudos

Hi,

Further to the above query, I am able to save the record using R/3. However using the WD Form I am unable to insert record.

Regards,

Brian