2006 Oct 24 2:55 PM
I want to post a document with multiple line items through f-01..which bapi should be used for this ...i coulnt find any field in the importing structure/table of the BAPI that holds the Posting Key on line item level ??
Pls help
Thanks ,
I want to post a document with multiple line items through f-01..which bapi should be used for this ...i coulnt find any field in the importing structure/table of the BAPI that holds the Posting Key on line item level ??
Pls help
Thanks ,
2006 Oct 24 3:08 PM
2006 Oct 24 3:12 PM
yeah i am looking at that bapi ...but i want to know where to specify the posting key(debit or credit ) at the line item level ?
2006 Oct 24 3:19 PM
Hi
It depends which kind of account you have to use.
- BAPI_ACC_GL_POSTING_POST is only GL Account
- BAPI_ACC_DOCUMENT_POST should be good for all types.
I prefer BAPI_ACC_DOCUMENT_POST
Max
2006 Oct 24 3:20 PM
it genrates the posting key when you pass the currency as +ve or -ve. Please check for the posting keys that you are particular in loading are generated after you save the document with the bapi.
2006 Oct 24 4:02 PM
Hi ,
When we manually do a post , we can specify a '*' in the amount field for the offsetting account for all the previous entries...how can i specify that when posting through bapi ?
2006 Oct 24 4:29 PM
Hi
You have to indicate the amount with sign in all items you transfer to the BAPI, the posting key is decided by the sign and the type of operation.
This is the code where BAPI get posting key:
FORM fill_acct_key.
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.
ENDFORM. " FILL_ACCT_KEY
The value of field shkzg is decide by the sign of amount.
Max
2006 Oct 24 4:05 PM
i am not sure you can pass the *. Sum the amount for the line items and offset the balance with +ve or -ve as the total balance when you post should be 0. otherwise the bapi gives the error.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |