01-20-2006 12:21 PM
Hi All,
I m using the BAPi BAPI_ACC_DOCUMENT_POST for posting in F-02.
My req is to use different posting keys based upon one indicator field(Ex: ind = 'X').
if ind = 'X'.
posting keys
debit = 11.
credit = 12.
else.
debit = 50.
credit = 40.
endif.
pl. provide info on how this can be acheived using the BAPI.
Thanks in Advance,
Avinash
01-20-2006 12:48 PM
Hi
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.
Max
01-20-2006 1:15 PM
Hello Avinash,
This BAPI uses FM FI_GET_POSTING_KEY to determine the posting keys. So not much you can do. However you can give a try by passing Blank in KTOSL in structure BAPIACGL09. This will force the program to skip the determination of keys by the above mentioned FM. Also you need to try populating them through exist which is getting called in "OPEN_FI_PERFORM_RWBAPI01_P".This customer exit is called before Save is done.
hope this helps.
05-02-2007 4:00 PM
Hello Avinash,
Im having the same matter, did you finally solve it? How did you do it?
Thanks for your cooperation,
Gabriel
05-22-2007 9:46 PM
06-25-2007 11:41 AM
Hi
You can use the table EXTENSION2 to specify your modifications. See the function module documentation.
I have acheived this in 4.70 but am now testing ECC 6.0 and it is no longer working - I have checked that the BADI is implemented and active?