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_Acc_Document_Post

Former Member
0 Likes
831

Hi Frds,

I have one requirement to post Customer Invoice (FB70) through PI Interface . My field values are :

BUSCS ACCNT BLDAT BUDAT XBLNR WRBTR WAERS SGTXT

Invoice 330000002 25.08.2010 25.08.2010 100 5500 INR 12345/1/123343

HKONT(01) WRBTR(01) ZUONR HKONT(02) WRBTR(02) ZUONR (02)

20001 5000 12365-00 10198 500 33456-00

with these values INVOICE is creating in FB70. But not in BAPI.

t_docheader-obj_type = 'FKKSU'.

t_docheader-obj_KEY = '$'.

t_docheader-obj_SYS = 'DEVCLNT210'.

t_docheader-BUS_ACT = 'RFBU'.

t_docheader-USERNAME = sy-uname.

t_docheader-HEADER_TXT = '1234556789'.

t_docheader-REF_DOC_NO = '100'.

t_docheader-COMP_CODE = 'SGI'.

t_docheader-DOC_DATE = sy-datum.

t_docheader-PSTNG_DATE = sy-datum.

t_docheader-username = sy-uname.

APPEND T_DOCHEADER.

t_accountgl-itemno_acc = '1'.

t_accountgl-gl_account = '0000020001'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

append t_accountgl to tt_accountgl.

clear t_accountgl.

t_accountgl-itemno_acc = '2'.

t_accountgl-gl_account = '0000010198'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

t_accrec-ITEMNO_ACC = '1' .

t_accrec-customer = '0330000002'.

append t_accrec to tt_accrec.

t_curr_amt-ITEMNO_ACC = '1'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '2'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

But how to fill Currency amount for 2 amounts means whether i have to maintain 4 line items(+ & -). I have searched many forums......didnt get the answer. Actually i am getting an error " FI/CO interface: Line items Repeated".

and where to give the header WRBTR (amount) in BAPI.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
717

The first thing is dont pass values for below 3 fileds , it will automatically populate

t_docheader-obj_type = 'FKKSU'.

t_docheader-obj_KEY = '$'.

t_docheader-obj_SYS = 'DEVCLNT210'.

and then pass the item level tables as below ( item number not repeat in accountgl and recible) you can pass below code as it is

t_accountgl-itemno_acc = '1'.

t_accountgl-gl_account = '0000020001'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

append t_accountgl to tt_accountgl.

clear t_accountgl.

t_accountgl-itemno_acc = '2'.

t_accountgl-gl_account = '0000010198'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

t_accrec-ITEMNO_ACC = '3' .

t_accrec-customer = '0330000002'.

append t_accrec to tt_accrec.

t_accrec-ITEMNO_ACC = '4' .

t_accrec-customer = '0330000002'.

append t_accrec to tt_accrec.

t_curr_amt-ITEMNO_ACC = '1'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '2'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '3'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '4'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

4 REPLIES 4
Read only

Former Member
0 Likes
717

Please go through this link especially below responses. It might help you

Read only

0 Likes
717

I have already seen that thread...nobody answered his Q....even for me also not useful...any other ways frd.....

Read only

Former Member
0 Likes
718

The first thing is dont pass values for below 3 fileds , it will automatically populate

t_docheader-obj_type = 'FKKSU'.

t_docheader-obj_KEY = '$'.

t_docheader-obj_SYS = 'DEVCLNT210'.

and then pass the item level tables as below ( item number not repeat in accountgl and recible) you can pass below code as it is

t_accountgl-itemno_acc = '1'.

t_accountgl-gl_account = '0000020001'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

append t_accountgl to tt_accountgl.

clear t_accountgl.

t_accountgl-itemno_acc = '2'.

t_accountgl-gl_account = '0000010198'.

t_accountgl-comp_code = 'SGI'.

t_accountgl-pstng_date = sy-datum.

t_accrec-ITEMNO_ACC = '3' .

t_accrec-customer = '0330000002'.

append t_accrec to tt_accrec.

t_accrec-ITEMNO_ACC = '4' .

t_accrec-customer = '0330000002'.

append t_accrec to tt_accrec.

t_curr_amt-ITEMNO_ACC = '1'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '2'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '3'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

t_curr_amt-ITEMNO_ACC = '4'.

t_curr_amt-CURRENCY = 'INR'.

t_curr_amt-amt_doccur = '2000-'.

APPEND T_CURR_AMT to tt_curr_amt.

CLEAR T_CURR_AMT.

Read only

0 Likes
717

Chenna Kesava Reddy.......Really U had done a great help to me.....I searched so many forums for this code from last one month. I found nothing. I dont know that Line item numbers has to pass like that with out duplicates...also currency amounts as 4 line items. No body said to me this one. Truly......Frankly.......Great help u had done....and So many dont know this one.......this forum definitely will help them .......Thank you very much .....Thanks a lot.