cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi_Transaction_Commit is not updating Values to R/3

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Murali,

Where you are calling executeXXX() method in your code ??

Regards, Anilkumar

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

try this

1. Execute the BAPI in R/3 SE37 if it sucessful

2. Try the Dynpro with the sucessful parameters by directly.(ie input.setPram("value");)

3. then try to bind from screen output

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

Mukesh,

IR is getting created means all the madatory data is geting passed to bapi,why this data is no updating in R/3.

i don't know where i am going wrong, its bit urgent

Former Member
0 Kudos

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

Former Member
0 Kudos

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