on 09-06-2007 4:23 AM
Hello, I am new to Web Dynpro. I am trying to insert data with table as Input parameter to BAPI. I am not getting any error, but I dont see any data inserted in the table. Can some one please help me in the code what I am doing wrong.
I really appreciate any help.
IWDMessageManager manager = wdComponentAPI.getMessageManager();
//wdComponentAPI.getMessageManager().reportWarning("Inside Save");
Z_Opts_Masterdata_Details_Input input = new Z_Opts_Masterdata_Details_Input();
wdContext.nodeZ_Opts_Masterdata_Details_Input().bind(input);
// Set Action type flag
input.setFlag("I");
// __Bic__Aot_Op00100 is the table class (Custome table)
__Bic__Aot_Op00100 tableInput = new __Bic__Aot_Op00100();
tableInput.set__Bic__Zcotsno("BA2007051");
tableInput.setCustomer("1000");
tableInput.set__Bic__Zunit("1000");
tableInput.set__Bic__Zkdkgr("CA");
tableInput.set__Bic__Ztitle("New Plants - BA - 2007");
tableInput.setCo_Area("NA01");
input.addDetails(tableInput);
//wdContext.currentZ_Opts_Masterdata_Details_InputElement().modelObject().execute();
try
{
wdContext.currentZ_Opts_Masterdata_Details_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
wdThis.executeBAPICommit();
manager.reportSuccess("Committed");
}
catch(Exception e)
{
e.printStackTrace();
}
public void executeBAPICommit( )
{
//@@begin executeBAPICommit()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
// Calls remote function module BAPI_Transaction_Commit
wdContext
.currentBapi_Transaction_Commit_InputElement()
.modelObject()
.execute();
} catch (WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
Thanks all for your input.
Murtuza, I tried the code that you included in bold. Its still not working.
Is there a way to debug in BAPI when you execute the Save button in Web Dynpro screen. I can debug if I test it from SE37.
I am going to try with some other table. This is a custom BAPI, I want to make sure that there is nothing wrong with the BAPI code.
Thanks
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghunath,
make sure that ur Z_Opts_Masterdata_Details_Input bapi & transaction commit bapi are part of same model.
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 Raghunath
Make sure both the BAPI (Z_Opts_Masterdata_Details_Input bapi & transaction commit bapi) are imported inside same Model, Then only Committing of data will take place. I hope this will solve ur problem..
Thanks
Puneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in bapi ,code is working fine?its write ........
same problem i was faceing
u had entered only single record in table
in bapi u r directly trying to accece table element without using"loopat itab" and workarea......
so first take row in workarea AND and using loop and then execute........
it has to work......
even i had given 3 days for this problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghunath,
Try adding the lines in bold in your code.
public void executeBAPICommit( )
{
//@@begin executeBAPICommit()
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
// Calls remote function module BAPI_Transaction_Commit
<b>Bapi_Transaction_Commit_Input trans = new Bapi_Transaction_Commit_Input();
wdContext.nodeBapi_Transaction_Commit_Input().bind(trans);</b>
wdContext
.currentBapi_Transaction_Commit_InputElement()
.modelObject()
.execute();
} catch (WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu
use a breakpoint near Commit's Execute statement and check what is happening
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.