on 08-11-2006 5:41 AM
I have developed an WD (java) application for IR create, i am getting an IR number after running application.But the data is not updating in to R/3, as a check all the input data is passing to bapi if i chk from WD application.
The folloing steps i have folowed
1) get the data from Zbapi_Get_Grir1 bapi such as po number, item data , account data etc..
2) Pass this data to Bapi_Incominginvoice_Create bapi and execute (IR number get created)
3) Execute Bapi_Transaction_Commit bapi (No data is updated in R/3 backend)
<u>Check</u>
Bapi_Incinv_Create_Item itemDetails = new Bapi_Incinv_Create_Item();
for (int i = 0; i < n; i++) {
if (wdContext.nodeCtx_invoiceReceipt().isMultiSelected(i)
|| leadSelected == i) {
item = wdContext.nodeCtx_invoiceReceipt().getCtx_invoiceReceiptElementAt(i);
itemDetails.setInvoice_Doc_Item(item.getCtx_Invoice_Doc_Item());
itemDetails.setPo_Number(item.getCtx_PONumber());
itemDetails.setPo_Item(item.getCtx_POItem());
itemDetails.setRef_Doc(item.getCtx_Ref_DocNumber());itemDetails.setRef_Doc_Year(item.getCtx_Ref_Doc_Year());
itemDetails.setRef_Doc_It(item.getCtx_Ref_Doc_It());
itemDetails.setTax_Code(item.getCtx_Tax_Code());
itemDetails.setTaxjurcode(item.getCtx_TaxJurCode());
itemDetails.setItem_Amount(item.getCtx_Item_Amount());
itemDetails.setQuantity(item.getCtx_Quantity());
itemDetails.setPo_Unit(item.getCtx_PO_Unit());
itemDetails.setPo_Unit_Iso(item.getCtx_PO_Unit_ISO());
itemDetails.setItem_Text(item.getCtx_Item_Text());
msgMgr.reportSuccess(
" Item Details = "
+ itemDetails.getPo_Number()
+ " - "
+ itemDetails.getTaxjurcode());
}
}
// Setting Item Data
inputIRCreate.addItemdata(itemDetails);
<u>Result</u>
Item Details = 5000000037 - CA0015000
What are the possible reasons why data is not updating to R/3
Hi
Try to bind the wdContext and Bapinode
Bapi_Incinv_Create_Item itemDetails = new Bapi_Incinv_Create_Item();
wdContext.node<Bapi_Incinv_Create_Item>.bind(itemDetails);
// and then execute the BAPI
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murali,
Where you are calling executeXXX() method in your code ??
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil
here is the bapi execution
public void executeIRCreateBapi( )
{
//@@begin executeIRCreateBapi()
//pass the header,item etc data values
boolean table_data_valid = setTableValues();
if (table_data_valid) {
try {
inputIRCreate.execute();
String year = inputIRCreate.getOutput().getFiscalyear();
String invoiceNumber = inputIRCreate.getOutput().getInvoicedocnumber(); wdContext.currentContextElement().setCtx_InvoiceNumber(invoiceNumber);
} catch (Exception e) {
handelModelException(
null,
e,
"Failed to retrieve IR Bapi list!");
}
wdContext.nodeOutput().invalidate();
}
Mukesh
Here is the binding
inputIRCreate.setHeaderdata(header);
inputIRCreate.addGlaccountdata(glacntDetails);
ETC..
inputIRCreate.addGlaccountdata(glacntDetails);
wdContext.nodeBapi_Incinv_Create_Header().bind(header);
wdContext.nodeBapi_Incinv_Create_Account().bind(accountDetails);
ETC.....
after bining i am executing the Create BAPI
Hi
Try to get the BAPI return message.if some required fields are bind with the empty value the Bapi will give some BAPIerror message.
try this
try {
inputIRCreate.execute();
//Receive the message from the BAPI
String msg=inputIRCreate.get<ReturnNode>().getMessage();
String year = inputIRCreate.getOutput().getFiscalyear();
String invoiceNumber = inputIRCreate.getOutput().getInvoicedocnumber(); wdContext.currentContextElement().setCtx_InvoiceNumber(invoiceNumber);
} catch (Exception e) {
handelModelException(
null,
e,
"Failed to retrieve IR Bapi list!");
}
wdContext.nodeOutput().invalidate();
}
with message you can find if there any input parameter problem or some other required fields.
Kind Regards
Mukesh
Mukhesh this is what i did
String msg = wdContext.nodeBapi_Incominginvoice_Create_Input().nodeOutput().nodeReturn().currentReturnElement().getMessage();
msgMgr.reportSuccess(msg);
No errors and Creates an IR, if i purposly don't enter some header data it throws error
Anil, Mukesh any suggestions
Hi
try this
//only bind the Input node with the context as
Bapi_Incinv_Create_Item itemDetails = new Bapi_Incinv_Create_Item();
wdContext.node<Bapi_Incinv_Create_Item>.bind(itemDetails);
//for the structure inputs
Header header=new Header();
header.set<Param>("<value>");
itemDetails.add<Header>(inputzs);
//execute the BAPI
Kind Regards
Mukesh
Hi,
Mukesh since i am reading inputs from table and passing to create BAPI
//for the structure inputs
1)Header header=new Header();
2)header.set<Param>("<value>");
3)itemDetails.add<Header>(inputzs);
any how first two are required third one i can replace with.
Bapi_Incinv_Create_Item itemDetails = new Bapi_Incinv_Create_Item();
wdContext.node<Bapi_Incinv_Create_Item>.bind(itemDetails);
let me try this an get back to you
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.