BAPI_CTRACDOCUMENT_CREATE

Hi,
I am creating Doc 1 using this BAPI.
Now , I am creating Doc 2 using the same BAPI with reverse values(+ to -). It is creating both the documents.
Now, I want to clear Doc 1 with Doc 2 and I want to clear Doc 1 at the same time , when I am creating Doc 2.
I am passing all the values in Clearing date , clearing doc - doc 1 & clearing amt.
Though It is creating Doc 2 succesfuly and no errors. It is still not clearing Doc 1 - item.
Is it possible to do that ?
Thanks In advance.

Hi,
I'm also interested in exactly this scenario. I would be very happy if someone could tell us the solution.
Thanks in advance.

Similar Messages

  • FI-CAX event 1102 when posting documents using BAPI_CTRACDOCUMENT_CREATE

    The event 1102 in FI-CAX has been implemented to copy "Alternative business partner for payments" to the document, when posting a document using transaction FPE1.
    Will this event aslo be executed when posting documents automatically via the BAPI BAPI_CTRACDOCUMENT_CREATE?
    If not, is there any other possibility to copy "Alternative business partner for payments" to the document, when posting a document automatically via the BAPI BAPI_CTRACDOCUMENT_CREATE?

    Thank you!
    In our system this note has not been implemented yet so this is something we need to fix.
    Do you know if event 1102 is supposed to be called when running FP60M/FP60P (mass activity: revenue distribution/Revenue distribution: Create and post documents)?
    Cheers,
    Teo

  • BAPI_CTRACDOCUMENT_CREATE and COPA fields

    When trying to create a document using BAPI_CTRACDOCUMENT_CREATE, the result is a message stating "You must make an entry in field Profitab. Segmt No.".
    Is there a way to determine the profitability segment number via a F/M call?
    The BAPI is called from an outside program and the user can only pass the CO-PA values.
    Thanks,
    Bill

    I checked the CA_DOC method (RFKKBOR_DOC) and found nothing that can determine a profitability segment.
    Was there something specific you were referring to in RFKKBOR_DOC?
    Thanks,

  • Custom FM for dunning activity

    Dear All,
    I want to post a document in customer account after dunning activity. I am trying to do this through ABAP. What i did was that i made a copy of the standard dunning activity FM Z_ISU_DUNNING_EMPTY_ACTIVI_0350. In this FM i added my code which would post a simple document in a customer account.
    When i test this function module using se37 the FM works perfectly well and posts a document. However when i put this FM for my dunning activity(Using SPRO>> Configure Dunning activities) and run the dunning proposal and activity, the document does not get posted. I dont know why. Can anyone please help. Would really appreciate
    Here is how the code looks like after i added my code for posting a simple document
    FUNCTION ZISU_DUNNING_EMPTY_ACTIVI_0350.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_TFK047L) LIKE  TFK047L STRUCTURE  TFK047L
    *"  TABLES
    *"      T_FKKMAZE STRUCTURE  FKKMAZE
    *"      T_FKKMAKT STRUCTURE  FKKMAKT
    *"      T_FKKOP STRUCTURE  FKKOP
    *"      T_FKKOPK STRUCTURE  FKKOPK
    *"      T_FIMSG STRUCTURE  FIMSG
    *"  CHANGING
    *"     VALUE(C_FKKMAKO) LIKE  FKKMAKO STRUCTURE  FKKMAKO
    *"     VALUE(C_FKKKO) LIKE  FKKKO STRUCTURE  FKKKO
    only write success message into job log
      DATA:
        documentheader like bapidfkkko,
    partnerpositions type standard table of bapidfkkop with header line,
    genledgerpositions type standard table of bapidfkkopk with header line,
    documentnumber like bapidfkkko-doc_no,
    return type standard table of bapiret2 with header line.
      documentheader-fikey                = '100915-001'.
      documentheader-appl_area            = 'R'.
      documentheader-doc_type             = 'AB'.
      documentheader-doc_source_key       = '01'.
      documentheader-currency             = 'UNI'.
      documentheader-doc_date             =  sy-datum.
      documentheader-post_date            =  sy-datum.
      partnerpositions-item                = '0001'.
      partnerpositions-comp_code           = 'UNI'.
      partnerpositions-buspartner          = '0000014044'.
      partnerpositions-cont_acct           = '10000416133X'.
      partnerpositions-main_trans          = '6000'.
      partnerpositions-sub_trans           = 'AD01'.
      partnerpositions-g_l_acct            = '0000140000'.
      partnerpositions-doc_date            = sy-datum.
      partnerpositions-post_date           = sy-datum.
      partnerpositions-net_date            = sy-datum.
      partnerpositions-currency            = 'UNI'.
      partnerpositions-amount              = '99'.
      APPEND partnerpositions.
      genledgerpositions-item = '0001'.
      genledgerpositions-comp_code = 'UNI'.
      genledgerpositions-g_l_acct  = '0000299000'.
      genledgerpositions-amount = '-99'.
      genledgerpositions-profit_ctr = 'IBC'.
       APPEND genledgerpositions.
        CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'
        EXPORTING
          testrun            = ''
          documentheader     = documentheader
        IMPORTING
          documentnumber     = documentnumber
          return             = return
        TABLES
          partnerpositions   = partnerpositions
          genledgerpositions = genledgerpositions.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
        CALL FUNCTION 'FKK_DUNNING_MESSAGE_APPEND'
             EXPORTING
                  MSGID   = 'EK'
                  MSGNO   = '345'
                  MSGPR   = '2'
             TABLES
                  T_FIMSG = T_FIMSG.
        IF 1 = 0. MESSAGE S345(EK). ENDIF.
    ENDFUNCTION.

    The log displays the same message as the one it showed when i had not changed the code.
    I also tried to do the same thing with the dunning activity that deactivates the installment plan. i made a copy of the function module ISU_DUNNING_DEACT_INSTPL_0350. In that new func module i copied my code that posts a simple document. then i assigned the new ZISU_DUNNING_DEACT_INSTPL_0350 activity to the dunning procedure in SPRO. I created an installment plan for a business partner and ran the dunning activity. The installment got de activated but no document was posted!
    for your help i am providing the code of the ZISU_DUNNING_DEACT_INSTPL_0350
    FUNCTION ZISU_DUNNING_DEACT_INSTPL_0350.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_TFK047L) LIKE  TFK047L STRUCTURE  TFK047L
    *"  EXPORTING
    *"     VALUE(TEMP) TYPE  OPTXT
    *"  TABLES
    *"      T_FKKMAZE STRUCTURE  FKKMAZE
    *"      T_FKKMAKT STRUCTURE  FKKMAKT
    *"      T_FKKOP STRUCTURE  FKKOP
    *"      T_FKKOPK STRUCTURE  FKKOPK
    *"      T_FIMSG STRUCTURE  FIMSG
    *"  CHANGING
    *"     VALUE(C_FKKMAKO) LIKE  FKKMAKO STRUCTURE  FKKMAKO
    *"     VALUE(C_FKKKO) LIKE  FKKKO STRUCTURE  FKKKO
    DATA: BEGIN OF T_OPBEL OCCURS 1,
              OPBEL LIKE FKKOP-OPBEL,
            END OF T_OPBEL.
      DATA: H_ATEXT(100).
      DATA: OPBEL_C(12).
      DATA: H_UPDATE.
      DATA: H_FKKMAHNV LIKE FKKMAHNV.
      DATA: H_TFK033D LIKE TFK033D.
      DATA: H_DEAGD LIKE RFKN1-DEAGD,
    documentheader like bapidfkkko,
    partnerpositions type standard table of bapidfkkop with header line,
    genledgerpositions type standard table of bapidfkkopk with header line,
    documentnumber like bapidfkkko-doc_no,
    return type standard table of bapiret2 with header line.
    documentheader-fikey                = '100915-001'.
    documentheader-appl_area            = 'R'.
    documentheader-doc_type             = 'AB'.
    documentheader-doc_source_key       = '01'.
    documentheader-currency             = 'UNI'.
    documentheader-doc_date             =  sy-datum.
    documentheader-post_date            =  sy-datum.
    partnerpositions-item                = '0001'.
    partnerpositions-comp_code           = 'UNI'.
    partnerpositions-buspartner          = '0000014030'.
    partnerpositions-cont_acct           = '10000416119X'.
    partnerpositions-main_trans          = '6000'.
    partnerpositions-sub_trans           = 'AD01'.
    partnerpositions-g_l_acct            = '0000140000'.
    partnerpositions-doc_date            = sy-datum.
    partnerpositions-post_date           = sy-datum.
    partnerpositions-net_date            = sy-datum.
    partnerpositions-currency            = 'UNI'.
    partnerpositions-amount              = '66'.
    APPEND partnerpositions.
    genledgerpositions-item = '0001'.
    genledgerpositions-comp_code = 'UNI'.
    genledgerpositions-g_l_acct  = '0000299000'.
    genledgerpositions-amount = '-66'.
    genledgerpositions-profit_ctr = 'IBC'.
    APPEND genledgerpositions.
    CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'
    EXPORTING
    testrun            = ''
    documentheader     = documentheader
    IMPORTING
    documentnumber     = documentnumber
    return             = return
    TABLES
    partnerpositions   = partnerpositions
    genledgerpositions = genledgerpositions.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    temp = return-message.
    temp = documentnumber.
      CALL FUNCTION 'ISU_DUNNING_DEACT_INSTPL_LOAN'
           EXPORTING
                I_LOAN    = space
           TABLES
                T_FKKMAZE = T_FKKMAZE
                T_FKKMAKT = T_FKKMAKT
                T_FIMSG   = T_FIMSG
           CHANGING
                C_FKKMAKO = C_FKKMAKO.
      exit.
    get update flag from global memory
    Parameter, ob Testdruck vorgesehen ist, aus dem globalen Memory holen
      CALL FUNCTION 'FKK_DUNNING_PARAMETER_GET'
           IMPORTING
                E_UPDATE   = H_UPDATE
                E_FKKMAHNV = H_FKKMAHNV.
    new: reason for deactivation of installment plan in
    business area 1102
      CALL FUNCTION 'FKK_ACCOUNT_DETERMINE_1102'
           EXPORTING
                I_APPLK   = H_FKKMAHNV-APPLK
           IMPORTING
                E_TFK033D = H_TFK033D
           EXCEPTIONS
                OTHERS    = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      H_DEAGD = H_TFK033D-FUN01.
    inside the dunned items, look if there installments in the highest
    dunning level
    innerhalb der gemahnten Forderungen nach Raten suchen, die die
    höchste Mahnstufe erreicht haben
      LOOP AT T_FKKMAZE
        WHERE STAKZ = 'R'
        and xinfo   = ' '.
         AND MAHNS = C_FKKMAKO-MAHNS.                  "Note 182489
        READ TABLE T_OPBEL WITH KEY OPBEL = T_FKKMAZE-OPBEL.
    if the document number is new, go on
    Nur weitermachen, wenn die Nummer noch nicht geprüft wurde
        CHECK SY-SUBRC NE 0.
        T_OPBEL-OPBEL = T_FKKMAZE-OPBEL.
        APPEND T_OPBEL.
        WRITE T_OPBEL-OPBEL TO OPBEL_C NO-ZERO.
    deactivate installment plan only in update mode
    Ratenplan nur im UPDATE-Modus deaktivieren
        IF H_UPDATE = 'X'.
          CALL FUNCTION 'FKK_S_INSTPLAN_DEACTIVATE'
               EXPORTING
                    I_OPBEL = T_OPBEL-OPBEL
                    I_DEAGD = H_DEAGD
                    I_DEADT = sy-datum
               EXCEPTIONS
                    OTHERS  = 1.
        else.
          clear sy-subrc.
        ENDIF.
        IF SY-SUBRC = 0.
    success message in job log
    Nachricht, daß Ratenplan deaktiviert wurde, ins Protokoll  :News that installment plan has been disabled, the log
          CALL FUNCTION 'FKK_DUNNING_MESSAGE_APPEND'
               EXPORTING
                    MSGID   = 'EK'
                    MSGNO   = '304'
                    MSGV1   = OPBEL_C
                    MSGPR   = '2'
               TABLES
                    T_FIMSG = t_fimsg.
          IF 1 = 0. MESSAGE S304(EK) with OPBEL_C. ENDIF.
    Create an entry in dunning history for deactivating an installmt plan
    Für das Deaktivieren des Ratenplans wird noch eine Mahnaktivität
    definiert.
          CLEAR T_FKKMAKT.
          MOVE-CORRESPONDING C_FKKMAKO TO T_FKKMAKT.
          H_ATEXT = 'Ratenplan & wurde deaktiviert'(001).
          REPLACE '&' WITH OPBEL_C INTO H_ATEXT.
          CONDENSE H_ATEXT.
          T_FKKMAKT-ATEXT = H_ATEXT.
        concatenate 'Ratenplan'(001)
                    t_opbel-opbel
                    'wurde deaktiviert'(002)
          into t_fkkmakt-atext separated by space.
          APPEND T_FKKMAKT.
        ELSE.
    Write error in job log
    Fehlermeldung aus dem Funktionsbaustein wird in Tabelle geschrieben,
    sie kommt dann nach der Abbruch-Meldung ins Protokoll.
          CALL FUNCTION 'FKK_DUNNING_SYST_MESSAGE_APP'
               TABLES
                    T_FIMSG = T_FIMSG.
    error message in case of error
    Dann wird die Abbruchmeldung direkt ausgegeben
          MESSAGE E305(EK) WITH OPBEL_C.
        ENDIF.
      ENDLOOP.
    ENDFUNCTION.

  • Formal error: Invalid calling sequence for function modules

    Hi All,
    I have developed a function module for FQEVENT 620 Payment: Transfer Line Items for Clearing.
    The clearing works fine.
    After clearing the open items i need to post an FI-CA Document(BAPI : BAPI_CTRACDOCUMENT_CREATE) for each open item(cleared item)
    I have used the bapi : BAPI_CTRACDOCUMENT_CREATE in the same function module that i have developed for FQEVENT 620 Payment: Transfer Line Items for Clearing.Here i am getting an error "Formal error: Invalid calling sequence for function modules".
    So please let me know where i can use this bapi to post fi-ca document.Is there a BAdi or Enhancement Spot where i can use this BAPI or tell me what should i do to overcome this error.
    Regards
    Venkat

    Venkat:
    While I am confused about your business process - creating an open item when clearing one seems strange.  Look into event 0020 which is called after documents are posted - it may present the opportunity to post process additional documents.
    regards,
    bill.

  • Idoc for Incoming Payment lot creation

    Hi Experts,
    Currently i am working on an inbound interface which  has the requirement of Incoming payment interface from a Payment Processing center  which processes payment (cheques, payment stubs for over the counter payments, etc) and sends daily to SAP.
    For the above the Details given as:
    1. Transaction is FP05.
    2. IDOC Should be used.
    Can any one of you please suggest me the suitable IDOC for the Incoming Payment Lot Creation.
    NOTE: If there is no idoc, BAPI is also Recomendable for this requirement(last option).
    This is very urgent.
    Thanks And Regards,
    Loganathan.E.

    Hello,
    If you are receiving Payment file,
    Use program RFKKZE00 to post payment lot in mass.
    But you need to hold the data in the SAP provided structure
    RFKKZEDA/RFKKZEDG and process them
    else if you are receiving Returns file,
    Use program RFKKRL00 to post Return lot in mas
    But you need to hold the data in SAP provided structure
    RFKKRLDA/RFKKRLDG
    else you can use BAPI ‘BAPI_CTRACDOCUMENT_CREATE’
    Rgds
    Rajendra

  • Add Customized fields in FICA document

    Dear all,
    We are having a requirement in which we need  to add customized fields in FICA document and need to post them .Can anyone please tell me how to meet this requirement
    susmita
    Edited by: susmitha harini on Aug 11, 2010 12:46 PM

    Hi Susmita
    You can add the fields to the customer includes
      CI_FKKOP
      CI_FKKKO
    To create/update the customer fields in automated processes you can use the standard SAP BAPI:
      BAPI_CTRACDOCUMENT_CREATE
      BAPI_CTRACDOCUMENT_CHANGE
    Check out the import table EXTENSIONIN with structure BAPIPAREX.
    To add the fields to the standard SAP transactions, have a look in IMG under
    Financial Accounting
      Contract Accounts Receivable and Payable
        Basic Functions
          Posting and Documents
            Document
              Screen Preparations
    Yep
    Jürgen
    Edited by: sattlerj on Aug 12, 2010 8:45 PM
    Edited by: sattlerj on Aug 12, 2010 8:49 PM - Added EXTENSIONIN

  • RM-CA - bapi or FM for creating RMCA document (trx FPE1)

    Hi all,
    anyone know if there is the possibility to create with bapi or FM a RMCA document, the manual transaction is FPE1.
    I know the FKK_CREATE_DOCUMENT,
    but the iusse is to simulate the creation processing open item of another document.
    any help is welcome.
    thanks
    enzo

    Hi Enzo,
    Please try with bapi  BAPI_CTRACDOCUMENT_CREATE  and next you must use  BAPI_TRANSACTION_COMMIT.
    CALL FUNCTION 'BAPI_CTRACDOCUMENT_CREATE'
      EXPORTING
        testrun                    = space
        documentheader      = documentheader
      IMPORTING
        documentnumber     = documento
        return                      = return2
      TABLES
        partnerpositions       = partnerpos
        genledgerpositions   = genledgerpositions.
    IF NOT documento IS INITIAL.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait   = 'X'
        IMPORTING
          return = return2.
    ENDIF.
    I hope to have helped you.
    Regards,
    José Luzardo

  • Reconciling in FI-CA

    Hi Experts,
    I would like to know how to do the Bank reconciliation process for incoming check payment. FPB12 we can use for outgoing check only.  Is there any transaction code for doing reconciliation for incoming check payment.? If, so Could anyone please update me the T.Code. If, Not Is there any work around for this.
    Could anyone please give some suggession on this. It would be very great help to me also it would be highly appreciatable.
    Thanks
    Ganesh

    Please continue with your posts in IS-U. You cannot create FICA items using a clearing function module. You have to use BAPI_CTRACDOCUMENT_CREATE.

  • Post of Late payment surcharge amount.

    Hi Experts,
             In my project, i am calculating the late payment surcharge amount ( LPSC Amount) through custom programme aganist the contract acccount and storing it in a custom table.
    Custom program calculates LPSC amount in  the day in which incoming payment is received against any charge (including invoice). LPSC is calculated in a time dependant slabs, depending on clearing date > net due date.
    Can anyone help me how to post the calculated amount to the contract account.
    Regards,
    Paul

    Hi,
    You can use BAPI_CTRACDOCUMENT_CREATE to post a Fi-CA document.
    Thanks,
    Amlan

  • Automatic Clearing in FI-CA 'BAPI_CTRACCONTRACTACCOUNT_CLR'

    I am using the below BAPI to clear the document:
    CALL FUNCTION 'BAPI_CTRACCONTRACTACCOUNT_CLR'
    EXPORTING
    documentheader = <clearing_doc_header>
    IMPORTING
    return = <return>
    documentnumber = <number>
    TABLES
    openitems = it_citemno.
    where 'it_citemno' internal table contains output of BAPI 'BAPI_CTRACCONTRACTACCOUNT_GOI'. However it's not working fine with the error message - 'Formal error: Document contains no items / clearing items'.
    Can you help me in using this BAPI ?

    Please continue with your posts in IS-U. You cannot create FICA items using a clearing function module. You have to use BAPI_CTRACDOCUMENT_CREATE.

  • Payment posting

    Does anybody used payment lot transfer which is payment posting from the vendor? IF so, I would like to know the name of FM or BAPI used for this payment posting.
    Appreciate it!

    Hello,
    If my understanding is right, you are looking at Automatic Payment lot transfer program. Right?
    If that is the case, you can use the program RFKKZE00. But before that you need to keep all your data in the SAP provided structures using programs RFKKZEDA & RFKKZEDG.
    After creating/modifying  the file, you can use RFKKZE00 to post payment lot
    Else if you are looking for BAPI, you can use BAPI_CTRACDOCUMENT_CREATE’ .
    Rgds
    Rajendra

  • Multiple Number Ranges for AP Document Type not getting triggered

    Hi all,
    We are posting receivables in the system using BAPI_CTRACDOCUMENT_CREATE. We have huge data of 3.9 million records for which receivables has to be posted. So multiple number ranges has been configured in the system for AP document type.
    The issue is even though multiple number ranges for mass processing are configured in the below location in SPRO, none of them are getting triggered. The number range at the first level on the screen is only getting triggered, due to this it is taking lot of time to post documents. Any help on this?
    Financial Accounting(new)
         Contracts Accounts Receivable and Payables
         BasicFunctions
         Postings and Documents
         Document
         Maintain Document Assignments
         Document Types
         Maintain Document Types and Assign Number Ranges
    Regards,
    Karthick.

    Karthick:
    Mass ranges are only used for FICA parallel mass activities.  For your situation, you can define and assign multiple ranges for individual processing in the same IMG activity.  Those would then be chosen for your mass postings.
    regards,
    bill.

  • BAPI's for FPE1

    Hello experts how are you doing? Please help me by providing me with a list of the BAPI's available for FPE1.
    Please help
    Tatenda.

    Using this 'BAPI_CTRACDOCUMENT_CREATE ' you can post document instead of FPE1

  • Bapi in fi-ca

    I must create a lot of cash and balance item in fi-ca.
    can i use the bapi_CTRACCONTRACTACCOUNT_CLR ?
    which bapi should i use?
    thank u
    E.B

    Hello EB,
    I understand that you want to post a payment and return the status. Have you already checked the BAPI BAPI_CTRACDOCUMENT_CREATE? With this BAPI you can post a document, for example, a payment. The clearing can happen in a subsequent step with the BAPI BAPI_CTRACCONTRACTACCOUNT_CLR or you can leave it to the clearing process of the nightly batch.
    I hope this helps.
    Kind regards,
    Fritz

Maybe you are looking for

  • JDBC result set from an Oracle PL/SQL stored procedure

    Could you please let us know the difference between oracleClose() and oracleCloseQuery() in sqlj.runtime.ExecutionContext.OracleContext. Since we upgraded jdbc driver jar to ojdbc5.jar with the oracleClose() we get the below exception and not with or

  • Chinese PO printout (Unicode server)

    Hi all, Need some expert advice on chinese PO output. 1)if the purchasing group, payment terms description, incoterms and unit of measure are required to be printed in chinese on the PO, does that mean I have to configure the above in chinese by logg

  • CProjects dash board fields not getting populated

    Hi Currently using cProjects 4.0 on ECC6.0 server. Facing problem for dash board data. Have created the project in cProject. Completed all the tasks, phases and project header also. I want actual start and actual finish date data to appear on the das

  • How can you have multiple, different css link styles?

    Every time I want to create a different looking link just for some copy, it always reverts to the A:link style, even if I create a new style that looks just the way I want. How can I create multiple link styles and then be able to select the one I wa

  • This comes up when I try to update Iphoto

    This update is not available for this Apple ID either because it was bought by a different user or the item was refunded or cancelled