on 07-15-2007 12:38 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.