Application Development 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: 

BAPI_ACC_DOCUMENT_POST

Former Member
0 Kudos

hi

in f-02 transaction the requirement is the first buzei to be triggered based on Receipt/Paid indicator. Receipt indicator is ‘A’ and Paid indicator is ‘B’.

If indicator is ‘A’ select SHKZG as ‘S’ and if indicator is ‘B’ select SHKZG as ‘H’.

The second buzei to be triggered based on 1st BUZEI item SHKZG. If first BUZEI, SHKZG is H, the 2nd BUZEI SHKZG should be S for KOART, D and if first BUZEI, SHKZG is S, the 2nd BUZEI SHKZG should be H for KOART, D.

how to resolve using bapi BAPI_ACC_DOCUMENT_POST .

thanks in advance

2 REPLIES 2

Former Member
0 Kudos

Hi,

What is the issue? you can achieve this by coding the logic in your program and passing the data in the way you required.

Regards,

Atish

Former Member
0 Kudos

You can't assign the posting key, because it's automatically setted by BAPI.

The BAPI use fm FI_GET_POSTING_KEY and find out the key in order transaction key (field KTOSL).

If that fm can't give the key, it's setted by program, this is the code:

if gs_accit-bschl is initial.

case gs_accit-koart.

when 'D' or 'V'.

if gs_accit-shkzg = 'S'.

gs_accit-bschl = '01'.

else.

gs_accit-bschl = '11'.

endif.

when 'K'.

if gs_accit-shkzg = 'S'.

gs_accit-bschl = '21'.

else.

gs_accit-bschl = '31'.

endif.

when 'S'.

if gs_accit-shkzg = 'S'.

gs_accit-bschl = '40'.

else.

gs_accit-bschl = '50'.

endif.

when 'A'.

if gs_accit-shkzg = 'S'.

gs_accit-bschl = '70'.

else.

gs_accit-bschl = '75'.

endif.

when 'M'.

if gs_accit-shkzg = 'S'.

gs_accit-bschl = '40'.

else.

gs_accit-bschl = '50'.

endif.

endcase.

endif.

for more information:

Please give me reward points...