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 for F-02 transaction code in FI module

Former Member
0 Likes
556

Can anyone suggest how to go about with BAPI for F-02 posting. The BAPI doesnt seem to have the posting key. How will the document get posted without the debt/credit indicator(posting key)

Can anyone suggest how to go about with BAPI for F-02 posting. The BAPI doesnt seem to have the posting key. How will the document get posted without the debt/credit indicator(posting key)

2 REPLIES 2
Read only

Former Member
0 Likes
496

Hi

The posting key it depends on the action type (field BAPIACHE09-BUS_ACT)

Here there's code to decide which posting key has to be used:

DATA: ld_bschh LIKE accit-bschl,

ld_bschs LIKE accit-bschl,

ld_umskz LIKE accit-umskz.

IF NOT gs_accit-ktosl IS INITIAL AND

gs_accit-kstat IS INITIAL.

CALL FUNCTION 'FI_GET_POSTING_KEY'

EXPORTING

i_ktosl = gs_accit-ktosl

IMPORTING

e_bschs = ld_bschs

e_bschh = ld_bschh

e_umskz = ld_umskz

EXCEPTIONS

error_message = 1.

IF sy-subrc IS INITIAL.

IF gs_accit-shkzg = 'S'.

gs_accit-bschl = ld_bschs.

ELSE.

gs_accit-bschl = ld_bschh.

ENDIF.

    • SHB-Vorgänge HR-Travel mit Ktosl 'HRV'

  • IF NOT ld_umskz IS INITIAL.

  • gs_accit-umskz = ld_umskz.

    • keine Ableitung Zahlungsbedingung für SHB-Vorgänge

  • CLEAR gs_accit-zterm.

  • ENDIF.

ELSE.

PERFORM error_from_system

USING gs_bapi_accit-parameter

gs_bapi_accit-tabix

'ACCT_KEY'.

ENDIF.

ENDIF.

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.

IF NOT gs_accit-umskz IS INITIAL.

IF gs_accit-bschl+1 = '1'.

gs_accit-bschl+1 = '9'.

ENDIF.

ENDIF.

Max

Read only

Former Member
0 Likes
496

Which bapi are you referring to?

Check the bapi BAPI_ACC_DOCUMENT_POST

table-field: ACCOUNTGL-DE_CRE_IND

Regards,

ravi