Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI external execution error;FI/CO interface: Inconsistent FI/CO line item

Former Member
0 Likes
389

Hi All

I am having this error: FI/CO interface: Inconsistent FI/CO line item data for updating

1.BAPI_ACC_DOCUMENT_POST

2.BAPI_ACC_GL_POSTING_POST

3.BAPI_ACC_BILLING_POST

I am using ECC 6.0.

Strange thing is that I can execute BAPI's through SE37 with the same parameters, but not through my C#.Net code.

Steps i do is

1. I add web reference of BAPI in my project.

2. I add parameters to BAPI Tables in code.

3..Execute code.

I am not adding any SAP Library for this.

Below is the sample of my code for BAPI_ACC_GL_POSTING_POST :-

BAPI_ACC_GL_POSTING_POSTService service = new BAPI_ACC_GL_POSTING_POSTService();

NetworkCredential credential = new NetworkCredential("XXXXXX", "XXXXXX");

service.Credentials = credential;

BAPIACGL08[] accountGl = new BAPIACGL08[2];

BAPIACCR08[] currencyAmount = new BAPIACCR08[3];

BAPIACHE08 documentHeader = new BAPIACHE08();

BAPIEXTC[] extension = new BAPIEXTC[1];

FacilityManagement.BAPI_ACC_GL_POSTING_POST.BAPIRET2[] returnBAPI = new FacilityManagement.BAPI_ACC_GL_POSTING_POST.BAPIRET2[]{};

string objSys = "";

string objType = "";

documentHeader.USERNAME = "xxxxxx";

documentHeader.HEADER_TXT = "Test GL BAPI";

documentHeader.COMP_CODE = "2000";

documentHeader.DOC_DATE = "20090325";

documentHeader.PSTNG_DATE = "20090325";

documentHeader.DOC_TYPE = "DR";

documentHeader.FIS_PERIOD = "00";

accountGl[0] = new BAPIACGL08();

accountGl[0].ITEMNO_ACC = "0000000001";

accountGl[0].COMP_CODE = "2000";

accountGl[0].GL_ACCOUNT = "0000051230";

accountGl[0].ITEM_TEXT = "Test BAPI";

accountGl[0].ORDERID = "000004001462";

accountGl[0].PSTNG_DATE = "20090325";

accountGl[0].FISC_YEAR = "00";

accountGl[0].ROUTING_NO = "0000000000";

accountGl[0].ORDER_ITNO = "0000";

accountGl[0].S_ORD_ITEM = "000000";

accountGl[1] = new BAPIACGL08();

accountGl[1].ITEMNO_ACC = "0000000002";

accountGl[1].COMP_CODE = "2000";

accountGl[1].GL_ACCOUNT = "0000051230";

accountGl[1].ITEM_TEXT = "Test BAPI";

accountGl[1].ORDERID = "000004001462";

accountGl[1].PSTNG_DATE = "20090325";

accountGl[1].FISC_YEAR = "00";

currencyAmount[0] = new BAPIACCR08();

currencyAmount[0].ITEMNO_ACC = accountGl[0].ITEMNO_ACC;

currencyAmount[0].CURRENCY_ISO = "AUD";

currencyAmount[0].AMT_DOCCUR = Convert.ToDecimal("100");

currencyAmount[0].EXCH_RATE_V = Convert.ToDecimal("0.00000");

currencyAmount[1] = new BAPIACCR08();

currencyAmount[1].ITEMNO_ACC = accountGl[1].ITEMNO_ACC;

currencyAmount[1].CURRENCY_ISO = "AUD";

currencyAmount[1].AMT_DOCCUR = Convert.ToDecimal("-100");

currencyAmount[1].EXCH_RATE_V = Convert.ToDecimal("0.00000");

string result = service.BAPI_ACC_GL_POSTING_POST(ref accountGl, ref currencyAmount, documentHeader, ref extension, ref returnBAPI, out objSys, out objType);

string WAIT = "";

BAPICOMMIT.BAPI_TRANSACTION_COMMITService commit = new BAPICOMMIT.BAPI_TRANSACTION_COMMITService();

commit.Credentials = credential;

BAPICOMMIT.BAPIRET2 returnBAPI2 = commit.BAPI_TRANSACTION_COMMIT(WAIT);

I have posted two questions for this, reply to anyone will be fine.

Thanks in advance.

1 REPLY 1
Read only

Former Member
0 Likes
300

currencyAmount[0].AMT_DOCCURSpecified = true;

currencyAmount[1].AMT_DOCCURSpecified = true;

currencyAmount[2].AMT_DOCCURSpecified = true;

currencyAmount[2].AMT_BASESpecified = true;

These values needs to be set.