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 ; posting key issue; Urgent !!!

Former Member
0 Likes
2,002

Hi all,

I am using BAPI_ACC_DOCUMENT_POST for posting of my invoices.

It is posting the document but in the posting key column "PK" it is displaying number "11" instead of "01".

11 is used for credit memo's.

01 is used for Invoices.

Is there any way i could handle this change in my program?

i saw few psoting in forum but it is not clear.

what should i do? Any help with really appreciated.

7 REPLIES 7
Read only

Former Member
0 Likes
1,187

I think it depends on the business transaction you pass in the header. What are you passing?

Rob

Read only

Former Member
0 Likes
1,187

HI,

Maintain the t030b table with the required posting keys.

System determines the posting based on the transaction key whatever you pass it from BAPIACGL09-kTOSL.

FYI .. please Check the program LACC9F20 line 951, this is the place where it fills the posting key

Regards

Sudheer

Read only

0 Likes
1,187

hi,

how do i go about filling the table 't030b'?

Read only

0 Likes
1,187

HI Sudhir,

The table is already maintained. So, there are couple of entries -

Transaction Debit Credit

AGD 01 11

HRD 01 11

so which one should i be using?

mine should be credit entry = 01

debit entry = 40.

how can i reference them?

thanks and regards,

Vasu.

Read only

Former Member
0 Likes
1,187

u may not be able to make the change from your program as the BAPI implicitly call a FM to determine the posting key.

There is some BTE/ EXIT that has to be implemented.

If its urgent and all the records have the same posting then better do a BDC as i had the same problem. Cause the BAPI messes up the CREDITS AND DEBIT MEMO'S with invoices.

Read only

Former Member
0 Likes
1,187

Hi,

Check the amounts that are you passing..Make sure the negative/positive sign is correct in the CURRENCYAMOUNT parameter...

Thanks,

Naren

Read only

former_member279310
Discoverer
0 Likes
1,187

Create a implemtention of BADI ACC_DOCUMENT, set the value directly in method if_ex_acc_document~change. Table T030B is not needed.

METHOD if_ex_acc_document~change.

DATA:

ls_extension2 TYPE bapiparex,

lv_posnr TYPE posnr.

FIELD-SYMBOLS:

<fs_accit> TYPE accit.

LOOP AT c_extension2 INTO ls_extension2.

CASE ls_extension2-STRUCTURE.

WHEN 'BSCHL'. "posting key

lv_posnr = ls_extension2-valuepart1+0(3).

READ TABLE c_accit ASSIGNING <fs_accit> WITH KEY posnr = lv_posnr.

IF sy-subrc = 0.

<fs_accit>-bschl = ls_extension2-valuepart1+3(2).

ENDIF.

WHEN OTHERS.

ENDCASE.

ENDLOOP.

ENDMETHOD.