on 02-15-2007 3:40 PM
Hi experts!
I've a little problem with one bapi. I will tray explain the issue:
I've one bapi with one input variable and with one table.
If this input is "S" the bapi returns on table the result of one query.
If the input is "U" the bapi update the abap table.
From webdynpro I've associate the table to my context. And all calls to bapi using "S" work's fine. I can see the table results.
This table results contain InputFields to change the values, and I call again the bapi using "U" method.
But no update doesn't work.
any ideas?
david
check whether table parameter is properly passed to the BAPI.
Collection <var>=wdContext.current<Model Node>Element().modelObject().get<table Parameter>();
Iterator it= <var>.iterator();
while(it.hasNext())
{
<table Parameter's model class> line= (Bapimatram)it.next();
wdComponentAPI.getMessageManager().reportSuccess(line.get<fieldname>());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Check whether you BAPI has COMMIT WORK. Since when you pass S it is fetching the data. When you Pass U it is not updating the data in the backend. To update the data in the backend the BAPI should be using COMMIT WORK, other wise you have to commit the work explicilty by calling another BAPI i,e
BAPI_TRANSACTION_COMMIT.
Btn you can loop at the BAPIRETURN table and print it to find out what is the error what you are getting when you Pass U.
u can do that by this code
int size = wdContext.node<bapireturn>.size();
for(int i =0;i<size;i++)
{
wdComponentAPI.getMessageManager.reportSucess(wdContext.node<bapireturn>.get<bapireturn>elementat(i).getType();
}
//Print the type and message field data and check.
Regards,
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.
How can I do it?
thanks,
david
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
To print the values you should use the code some thing like this:
If you have action on Update button then:
onAction(...){
for(int i=0; i<wdContext.node<nodeName>.size().i++{
//Printing the elements:
<b>wdComponentAPI.getMessageManager.ReportSuccess(
wdContext.node<nodeName>.getElementAt(i).get<attributeName()>);
</b>
In the same way try printing all the elements
//Passing the elements:
Pass the values from output node to input node in order to pass the whole table values.
wdContext.CurrentNodeElement.set<Update>("U");
wdContext.node<nodeName>.Current<NodeElement>.set<AttributeName>(
wdContext.node<nodeName>.getElementAt(i).get<attributeName()>);
}
}
If it not clear then post your Node structure.
Regards,
Jhansi
Hi,
I use the binding method.
I think that the problem is, if I change any value on the inputfield this value is not refreshed into the context values that execute the bapi.
thanks
david
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Does your BAPI functionality has been implemented such that?
if yes
Before executing ur function module
U can seperate the input value like this.
if(inputfield.equals("S"))
inuput.set<BAPIInputFiled>("S");
else
inuput.set<BAPIInputFiled>("U");
Next execute the BAPI();
Are you using the one variable for the both functinalitis or two variables.
If Two, then binding such that other wise bind only one.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.