Posting FI documents

i want to post FI documents from old company code to new company code using these functions:POSTING_INTERFACE_START
                       POSTING_INTERFACE_DOCUMENT
                        POSTING_INTERFACE_END
Can somebody show me how i can implement it in abap code

Hi,
DATA: ftp east TYPE ftp east OCCURS 0 WITH HEADER LINE.
* Internal accounting cut place initialize
CALL FUNCTION “POSTING_INTERFACE_START”
EXPORTING
i_function = “I”
more i_user = “”
EXCEPTION
client_incorrect = 1
function_invalid = 2
group_name_missing = 3
mode_invalid = 4
update_invalid = 5
OTHERS = 6.
* Head
PERFORM fill_ftpost USING “K” “1” “BKPF BUDAT” “31102006”.
PERFORM fill_ftpost USING “K” “1” “BKPF BLDAT” “31102006”.
PERFORM fill_ftpost USING “K” “1” “BKPF BLART” “MD”.
PERFORM fill_ftpost USING “K” “1” “BKPF BKTXT” “LALELU”.
PERFORM fill_ftpost USING “K” “1” “bkpf belnr” “20808599”.
PERFORM fill_ftpost USING “K” “1” “BKPF XBLNR” “123”.
* IF EMERGENCY control identifier IS INITIAL.
PERFORM fill_ftpost USING “K” “1” “BKPF XMWST” “X”.
* ENDIF.
PERFORM fill_ftpost USING “K” “1” “BKPF BUKRS” “1000”.
* PERFORM fill_ftpost USING “K” “1” “BKPF MONTH” wa_mhnk-ausdt+4 (2).
PERFORM fill_ftpost USING “K” “1” “BKPF WAERS” “EUR”.
* Pos1 (debtor)
PERFORM fill_ftpost USING “P” “1” “BSEG BSCHL” “01”.
PERFORM fill_ftpost USING “P” “1” “BSEG KUNNR” “10926014”.
PERFORM fill_ftpost USING “P” “1” “BSEG WRBTR” “116,00”.
* IF EMERGENCY control identifier IS INITIAL.
PERFORM fill_ftpost USING “P” “1” “BKPF XMWST” “X”.
* PERFORM fill_ftpost USING “P” “1” “BSEG MWSKZ” control identifier.
* ENDIF.
PERFORM fill_ftpost USING “P” “1” “BSEG ZTERM” “1003”.
PERFORM fill_ftpost USING “P” “1” “BSEG ZFBDT” “31102006”.
PERFORM fill_ftpost USING “P” “1” “BSEG SGTXT” “LALELU”.
PERFORM fill_ftpost USING “P” “1” “BSEG ZUONR” “LALELUKOPF”.
* Pos2 (revenue account)
PERFORM fill_ftpost USING “P” “2” “BSEG BSCHL” “50”.
PERFORM fill_ftpost USING “P” “2” “BSEG HKONT” “409600”.
PERFORM fill_ftpost USING “P” “2” “BSEG WRBTR” “100,00”.
* IF EMERGENCY control identifier IS INITIAL.
PERFORM fill_ftpost USING “P” “2” “BSEG MWSKZ” “A1”.
* ENDIF.
PERFORM fill_ftpost USING “P” “2” “BSEG SGTXT” “LALELU”.
PERFORM fill_ftpost USING “P” “2” “COBL PRCTR” “NETPHONE”.
PERFORM fill_ftpost USING “P” “2” “BSEG ZUONR” “LALELU”.
PERFORM book TABLES ftp east.
FORM fill_ftpost USING p_stype
p_count
p_fnam
p_fval.
ftp east type = p_stype.
ftp east COUNT = p_count.
ftpost fnam = p_fnam.
ftpost fval = p_fval.
CONDENSE ftpost fval.
APPEND ftp east.
END FORM. “FTPOST_FIELD
*& form BEECHES
* text
* --> P1 text
* <- p2 text
TABLES ftp east books FORM.
DATA: blntab TYPE blntab OCCURS 0 WITH HEADER LINE,
fttax TYPE fttax OCCURS 0 WITH HEADER LINE.
DATA: msgid LIKE system-msgid,
msgno LIKE system-msgno,
msgty LIKE system-msgty,
msgv1 LIKE sy-msgv1,
msgv2 LIKE sy-msgv2,
msgv3 LIKE sy-msgv3,
msgv4 LIKE sy-msgv4.
CALL FUNCTION “POSTING_INTERFACE_DOCUMENT”
EXPORTING
i_tcode = “FB01”
IMPORTING
e_subrc = system-subrc
e_msgid = msgid
e_msgty = msgty
e_msgno = msgno
e_msgv1 = msgv1
e_msgv2 = msgv2
e_msgv3 = msgv3
e_msgv4 = msgv4
TABLES
t_ftpost = ftp east
t_fttax = fttax
t_blntab = blntab
EXCEPTION
account_missing = 1
company_code_missing = 2
posting_key_invalid = 3
posting_key_missing = 4
record_type_invalid = 5
transaction_code_invalid = 6
amount_format_error = 7
too_many_line_items = 8
company_code_invalid = 9
screen_not_found = 10
no_authorization = 11
OTHERS = 12.
IF system-subrc <> 0.
MESSAGE ID SYSTEM-MSGID TYPE SYSTEM-MSGTY NUMBER SYSTEM-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH ftp east.
REFRESH fttax.
END FORM. “BEECHES
Regards
Sudheer

Similar Messages

  • Possible to clear vendor open item against already posted payment document?

    Hi
    Can you advise if it is possible to clear an open item against already posted payment/clearing doc? Here is the background to the scenario:
    An invoice was posted with transaction FB60. This was subsequently picked up in the payment run F110 and cleared by payment document number 200005678. The item went to the bank on the paymnet file and was paid out to the vendor. The transaction reference, which appeared on the incoming bank statemnet was the payment document number 200005678.
    Subsequently it was discovered that the original invoice should have been posted with reference to a PO using MIRO. The requirement now is to reverse the paymnet documnet 200005678 in SAP, then reverse the document that was posted using FB60. After this the invoice will be posted using MIRO. This will create an open item on the vendor account.
    This item will not be piad out again. Therefore the requirement is to try clear that open item against the previously posted payment document 200005678.
    Is there any way to clear this vendor open item against the originally posted payment document 200005678?? Or any other advice on how this scenario can be handled in SAP?
    Thank for your help.
    Mike

    Hi,
    I tried that option in our test system. I ran FBRA and entered Paymnet Documnet Number (+Clearing Doc Number), Company Code, Fiscal Year.
    Then chose menu option Clearing -> Reset Cleared Items.
    The system pops up a window asking for a reversal reason and reversal date.  I use 01 and posting date of today.
    The system now posts another cleared document. That document places the invoice as an open item on the vendor account. It does not place the Payment Document as an open item on the account.
    When I go to F-44 only the open vendor invoice is showing there. There is no open paymnet document.
    Is there perhaps some configuration setting that stops the placement of the paymnet document as an open item when reset?
    Thanks for your help again.

  • F110 : program name of posting cleared document during F110

    Dear all,
    I need to figure out the "PAYMENT DOCUMENT SPLITTING" issue after F110 via debugging.
    I believe the main program for F110 is SAPF110V and SAPF110S is the program handle the posting. However, after I put the break point in  SUBMIT SAPF110S AND RETURN in SAPF110V, then do step by step debug. Debugging doesn't go to SAPF110S. I am not sure what's wrong.
    Can anyone tell me the program name that post cleared document during F110 processing?
    Thank you very much for help in advance!!
    Molly
    Edited by: Molly Li on Jan 26, 2008 2:41 PM

    Hi Sruthy
      I guess you have missed populating field STYPE in each of the records which identifies the actual structure.
      Below is how you have to pass for them:
    <b>Struc --> Value
    BGR00 --> 0
    BBKPF --> 1
    BBSEG --> 2</b>
    Kind Regards
    Eswar

  • Error while posting parked document

    Hi  all,
      We are in ECC 5.0.  While posting a parked invoice document, (created
    through MIRO), the system is giving an error saying, 'Account XXXXXX
    requires an assignment to a CO object . Msg. No. KI235) for Rounding off
    account. 
      This G/L account has a cost center assigned in OKB9 and there is no
    problem in the validity of the cost center and it is being displayed
    when the document is simulated.
      We are facing this problem only when posting a parked document. 
    While directly posting a document, there is no problem.
      Any suggestions?
    Regards,
    Sundar Rao

    Hi Paul,
    The error is occuring when I am posting a parked invoice document.  When I try and post it directly through MIRO, there is no problem.
    I am unable to understand your reply.  Can you please elaborate?
    Regards,
    Sundar Rao

  • Posting period 011 2013 is not open while posting the document using F-02 getting the error

    Hi SAP Captains,
    Pls help me here.
    While posting the document using T-code F-02 getting the error "Posting period 011 2013 is not open.
    Please help me how to do, can you provide step by step.
    Rgds..Suresh

    Hi Suresh,
    You can search google and will get number of posts on this. This will lead to duplication of similar posts on forum.
    The message says "FI posting period is closed for 11th period of 2013". In which period you are trying to post the transaction?
    If it is past, open the FI posting periods in OB52.
    BR, Srinivas Salpala

  • Runtime error while posting a document (FB70/FBS1)

    Hi
    I am getting a runtime error while posting a document through FB70 or FBS1 .
    The erro description tells The type "CL_BCS_OBJHEAD" is unknown.
    And the program dumps in Function module SO_KPRO_DECIDE.
    Has any one faced this problem?

    Hi,
    Please check the psoting date and also the reversal  date in FBS1. Please check when you have posted the document and when you want ot reverse the same.
    Thank you,
    Shilpa.

  • FA Retirement- 21151: error while posting asset document: '100000039'

    Hello Experts,
    I have a client who encountered this error during fixed asset retirement - scrapping.
    After selecting the asset to be retired, sap did not assign an account in the account column, but the user
    was able to save the document.  After saving it, the user needs to retire again another asset - scrapping, but the document would not be saved because of this error: 21151: error while posting asset document '100000039'.  The document number the systems is referring to is the last document saved but sap did not assign an account code.
    Please help. My client is using sap b1 8.81 patch5.
    Regards,
    Luz

    Hi Too Mui Hwee,
    What we did is to put letters on the number so the series will continue example there is already 100333, 100334, 100335 since the error is encountered from 100333. We add 100333A, 100334A, 100335A.
    Thanks

  • FBV0 - Error while posting prked document..

    Hi Team,
    I am getting the below error while trying to post a Parked Document in FBV0*
    Field BSEG-SECCO. does not exist in the screen SAPMF05A 0302
    Message no. 00349
    Diagnosis
    The specified field does not exist on the screen.
    Procedure
    Check your batch input data.
    Kindly assist on this...
    Thanks in Advance !!!!!!

    Hi,
    If you park a document using transaction FB01 or a relevant ENJOY transaction, all substitutions are run - in contrast to transaction FBV1, which is a parking transaction only. It is possible in this case to use substitution to fill fields that are not ready for input in the line item or that are not available.
    When you post the parked document using transaction FBV0, FBV0 with a list, or FIPP.POST, the posting is executed using CALL TRANSACTION. The system collects all data from the parked document and reprocesses the data for CALL TRANSACTION. A batch input runs in the background. This transfers all field contents from the parked document to the relevant screen fields. If a field that does not exist on the screen is to be filled, the system issues error message 00349.  You cannot post the document.
    Check your substitutions. Make sure that you never substitute fields in the parking that are not ready for input.
    Regards,
    Jigar

  • Validation when posting a document using T. Code FB50 or F-02

    Dear Experts
    Please let me know on how to validate when posting a Cross Company Transaction using T. Codes FB50 or F-02.  The requirement is to restrict Branches (each Branch is a Company Code in SAP) to post any Cross Company documents by selecting HO Company Code in Line Item, system has to stop the User by giving Error Message.
    We can't control this using User level Authorizations because, here the Authorization is provided to the Users to post the Transactions using T. Codes FB50 and F-02.
    To restrict this, I created a Validation as below:
    Prerequisite:
    BKPF-TCODE = 'FB50' OR BKPF-TCODE = 'F-02' AND
    BKPF-BUKRS = 'Br. Company Code' AND
    BSEG-BUKRS = 'HO Company Code'
    Check:
    FALSE
    Message:
    You Can't post Cross Company Transactions using T.Code FB50 or F-02
    And I activated the above Validation in OB28 for HO and Branch Company Codes.  But the Validation is not working properly.  Can anybody help me on how to proceed further in this regard please.

    Hi,
    I haven't tried to use a transaction code for Validation purpose. Instead, I have used document type as prerequisite and then check:
    BKPF-BUKRS = 'Br. Company Code' AND
    BSEG-BUKRS = 'HO Company Code'
    If the condition is met, it displays an error (per the message in validation) while completing the line item details on posting a document.
    Please let me know if that helps. If not, I can try to replicate your scenario and let you know if there is anything missing.
    Thanks,
    Ashish

  • Problem in Posting a document using BAPI_ACC_DOCUMENT_POST

    Hi,,
    I am using the function module "BAPI_ACC_DOCUMENT_POST" to post a vendor Invoice (KR). i think the t-code to post this is FV60.when i post the document, the document number is getting generated but amount is missing  in t-code fbv3 but bseg table is getting updated properly. Can any one help the actual input to be given to create a document and tax
    Regards

    I have a suggestion:
    Try to post this kind of document (KR) with transaction code FB01. If you can see the document correctly with FBV3 transaction, then you can use BAPI you mention.
    The following function modules may be useful for calculating taxes:
    CALCULATE_TAX_FROM_NET_AMOUNT
    CALCULATE_TAX_FROM_GROSSAMOUNT
    Regards.
    Rafael Rojas.

  • Error while posting billing document to Accounting

    Hi,
    We are getting an error when posting Billing document to Accounting .Eror "The document type is relevant for VAT.Please inset a VAT code in postings.
    Thanks in advance.

    Dear Ravinder
    Go to VF02, input the billing document and execute.  Now from the top menubar, click on Goto <> Header <> Header.   There check what pricing procedure is flowing.
    Now go to V/08, select that pricing procedure and check whether you have maintained the condition type for VAT.  I believe you have not maintained and hence, the error. Include the VAT condition type and create a fresh sale order.
    Meanwhile, you have to reverse the billing document via VF11, reverse PGI via VL09 and delete the delivery document. 
    thanks
    G. Lakshmipathi

  • Posting a document using FM PRELIMINARY_POSTING_FB01

    Hello Experts,
    I know we can FM PRELIMINARY_POSTING_FB01 to PARK a Document. But I think we can also use this FM to Post the Document. The reason I want to use this FM, not other BAPI's, is I have all the structures (BSEG, BKPF, BSET etc) that I needed to populate. So I passed I_XCMPL = 'X'. However, it still Parked the Document not Posted.
    Can anybody please let me know what I missed?
    Thanks a lot. Sadly this FM does not have any documentation.
    Here's my code:
    w_bkpf-bukrs = p_bukrs.
       w_bkpf-gjahr = p_gjahr.
       w_bkpf-blart = p_blart.
       w_bkpf-bldat = p_dat.
       w_bkpf-budat = p_dat.
       w_bkpf-monat = '01'.
       w_bkpf-cpudt = p_dat.
       w_bkpf-cputm = sy-uzeit.
       w_bkpf-wwert = p_dat.
       w_bkpf-usnam = sy-uname.
       w_bkpf-tcode = 'FB01'.
       w_bkpf-xblnr = 'ZTEST1'.
       w_bkpf-waers = p_waers.
       w_bkpf-glvor = 'RFBV'.
       w_bkpf-ausbk = p_bukrs.
       w_bkpf-bktxt = 'TEST'.
      append w_bkpf to t_bkpf.
      w_bseg-bukrs = p_bukrs.
      w_bseg-gjahr = '2010'.
      w_bseg-bschl = '40'.
      w_bseg-koart = 'S'.
      w_bseg-shkzg = 'S'.
      w_bseg-dmbtr = '2000.00'.
      w_bseg-wrbtr = '2000.00'.
      w_bseg-pswsl = p_waers.
      w_bseg-altkt = '0001298232'.
      w_bseg-vorgn = 'RFBU'.
      w_bseg-kokrs = 'ABC'.
      w_bseg-xkres = 'X'.
      w_bseg-hkont = '0001298232'.
      w_bseg-saknr = '0001298232'.
      w_bseg-lifnr = '0000100000'.
      w_bseg-zterm = 'CN30'.
      w_bseg-projk = '00001111'.
      append w_bseg to t_bseg.
       CALL FUNCTION 'PRELIMINARY_POSTING_FB01'
       EXPORTING
    *     TEXT_UPDATE            = ' '
    *     TEXT_ITEM_UPDATE       = ' '
    *     I_UF05A                =
          I_XCMPL                = 'X'
    *     FS006_FB01             =
          I_TCODE                = 'FB01'
    *     I_PARGB                =
    *     I_TCODE_INT            =
    *   IMPORTING
    *     XEPBBP                 =
        TABLES
          T_BKPF                 = t_bkpf
          T_BSEG                 = t_bseg
          T_BSEC                 = t_bsec
          T_BSET                 = t_bset
          T_BSEZ                 = t_bsez
    *     T_BKORM                =
    *     T_THEAD                =
    *     T_SPLTTAB              =
    *     T_SPLTWT               =
        EXCEPTIONS
         ERROR_MESSAGE           = 1.

    Hi,
    Thanks for the response. I wanted to check the FM which gets triggered in the BTE. However I could find one in FIBF.
    Can you please let me know if you have any documentation on FM PRELIMINARY_POSTING_FB01? That would help me understanding its functionality.
    Thanks a lot.
    Should I use "IN UPDATE TASK" when calling this FM? Thanks.
    Edited by: lope jie on Apr 28, 2010 8:10 PM

  • FI error while posting one document

    While posting the document(501 - gr w/o PO), i'm getting the error:
    "Account determination requires an CO object"
    I've maintained the material master with costing view and also assigned profit center.
    I Belive in  Obyc t-code, -- in GBB -- in general modification column.. key needs to be enabled with g/l account.
    Pls explain what is the general modification and what is the key for 501 - gr w/o po
    Thankyou

    hi
    Go to FS00
    enter GL account no & Comp Code.
    Click Change button
    You might have to seek help of an FI consultant to do so.
    Also in KA01 create this G/L account as a cost element against your controlling area assigned to your Chart of Accounts, you can do so by clicking on Extra's tab in transaction KA01
    Regards

  • Posting Parked Documents

    Hi Gurus,
    I am FM PRELIMINARY_POSTING_POST for posting parked documents.Even though FM not throwing any error but documents are not posted.Please let me know any clues how to proceed.

    This is the workflow forum.

  • Error while posting billing documents

    Hi,
    I am trying to post billing documents for accounting , but I am getting some error related to number range.
    I have checked number range assignments, where else I can check to find out error.
    Regards
    Nidhi

    If you are getting error while creating billing document -
    Check your number range status assignment in T-Code - VN01
    If any userexit is used then check in Userexit MV60AFZZ. There could be a Z-table where the number range may not be properly defined for the Billing Type/ plsnt/etc. as per the settings.
    If Billing document is created and you get this error while posting-
    Then it would be error with the number range for Accounting Document. Pls. ask the FI person to fix this.
    If the above does not solve - pls. mention the exact error with error code.
    Thanks

  • Problem while posting FI document through BAPI - Multiple Exchange Rates

    I am able to post FI document with multiple exchange rates for the same currency using FB01. But, when I try to post the same document details using BAPI_ACC_DOCUMENT_POST , it throws an error F5 701 - Inconsistent Rate for Currency XXX .
    How can we avoid this error while posting through BAPI ?
    Thanks & Regards,
    Nidhi

    Hi Nidhi,
    Value range
        The field CURR_TYPE (currency type) describes the role played by a
        currency in the SAP System.
        The currency type can take on the following values, for example:
        o   00      Transaction currency
        o   10      Company code currency
        o   20      Controlling area currency
        o   30      Group currency
        o   40      Hard currency
        o   50      Index-based currency
        o   60      Global company currency
        If an entry is not made in the field CURR_TYPE, the default value "00"
        is retained.
        If only one data record is transferred in transaction currency for each
        line item, the field CURR_TYPE does not need to be filled out. If
        several data records are transferred for each line item, the currency
        type must be entered for each record.
    If the parameter CurrencyAmount is filled with the currency fields,
    a complete document check including characteristics and value
    components of profitability analysis (CO-PA). Otherwise, the account
    assignment objects are checked.
    Check the BAPI documentation SE37.
    Regards,
    Boobalan Suburaj

Maybe you are looking for