08-06-2015 10:03 PM
Hi,
I am trying to post FI CA documents using a BAPI but getting error 'Balance in Document currency is not zero, posting not possible'.
Do you know why we are getting this error?
* call BAPI
CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'
EXPORTING
testrun = testrun
documentheader = documentheader
completedocument = 'X' "create documents, calling all events
IMPORTING
documentnumber = ev_opbel
return = lv_return
TABLES
partnerpositions = partnerpositions[]. "lt_pos_info.
* genledgerpositions = lt_gl_info.
Thanks
Govind
08-07-2015 5:51 AM
Hi Govind,
Can you check the items and see if the net of debit = credits.
Also if there are any tax or discount code put in but its line item is not populated.
Regards
Rishab
08-07-2015 6:21 PM
Hi Rishab,
My requirement is to post statistical item with Credit amt. I triedyour suggestion with 2 line items one with Cr and another with DB amt and the doc was posted.
But in my case I need one sided entry. Is this possible with this BAPI/ any FM?
Thanks
Govind Parmar
08-09-2015 12:16 AM
When we post FPE1 for posting document BAPI_CTRACDOCUMENT_CREATE is not called instead it uses FKK_CREATE_DOC to post docs.
If I compare std call during and my program :
Function module FKK_CREATE_DOC calls fqevents 1100 which fills internal table T_FKKOPK which create off setting. In my case I
08-09-2015 12:16 AM
When we post FPE1 for posting document BAPI_CTRACDOCUMENT_CREATE is not called instead it uses FKK_CREATE_DOC to post docs.
If I compare std call during and my program :
Function module FKK_CREATE_DOC calls fqevents 1100 which fills internal table T_FKKOPK which create off setting. In my case I
08-09-2015 12:23 AM
When we post FPE1 for posting document BAPI_CTRACDOCUMENT_CREATE is not called instead it uses FKK_CREATE_DOC to post docs.
If I compare std call during and my program :
1) My program calls Function module FKK_CREATE_DOC with one sided entry, internally calls fqevents 1100 which fills internal table T_FKKOPK which create off setting. In my case there is one entry the BAPI gives error
2) FPE1: Calls Function module FKK_CREATE_DOC but does not internally calls fqevents 1100 in turn T_FKKOPK does not gets filled there fore no error during the FPE1 for same postings.
Is there a way to avoid event 1100,it is used for some other enhancements. I know I can avoid technically but any other suggestion is appreciated.
Many Thanks
Govind Parmar
08-09-2015 8:26 AM
Hi Govind,
One suggestion could be just to use FPE1 directly by recording or call transaction and that can close this issue.
Else try to remove the completedocument check, the event may be called to post the adjusting entry and hence the error.
Hope this helps, Please close the thread if it does.
Regards
Rishab
08-10-2015 2:01 AM
I don't like th BDC option, but have tried with remove the 'completedocument check' whi1100 event and few otch avoids her events and it works.
But the BAPI does not populate any customer field in DFKKOP. I am adding to add the CI_FKKOP which is bascially all the Z fields in DFKKOP.
LS_EXTENSIONin-STRUCTURE = 'CI_FKKOP'.
LS_EXTENSIONin-VALUEPART1 = '50000000'.
APPEND LS_EXTENSIONin TO EXTENSIONin.
08-10-2015 2:02 AM
The extensionin for CI_FKKOP does not populate any Z feilds . Is there any different way to populate the Z fields ?
08-10-2015 4:57 AM
Hi Govind,
I am not sure if there is any other way.
I guess these are your options. Please check and then close this thread.
Regards
Rishab
08-10-2015 5:10 AM
Btw Govind, I will still go back to my suggestion of using a BDC,
If you want something to specific, your input should also be
If you are able to find an alternative, please do let all of us know.
Regards
Rishab
08-11-2015 6:20 PM
Rishab,
The BAPI cater 80% of the requirement of posting docs. Only pending thing is how to update the Z fields using the BAPI. When specifying the CI_FKKOP (with Z field values) in ExternsionIN parameter the BAPI does not update Z* fields.
This is strange as normally BAPI do provide a way to update Z fields
Thanks
Govind