SAP for Insurance Discussions
Engage in conversations about risk management, customer experience, and digital transformation using SAP in the insurance industry. Join the discussion!
cancel
Showing results for 
Search instead for 
Did you mean: 

Error posting FICA document using BAPI BAPI_CTRACDOCUMENT_CREATE

govind_parmar
Participant
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

The extensionin for CI_FKKOP does not populate any Z feilds . Is there any different way to populate the Z fields ?

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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