PRELIMINARY_POSTING_FB01

I can use the function 'PRELIMINARY_POSTING_FB01' to generate parked account document, it need to be posted by transaction 'FBV0' manually, but how can it be posted automatically thru this function or other one, please advise, thanks!!!

If you don't find any FM, try with this little BDC:
  PERFORM comptabiliser-annuler
          USING '=STER'.
  modus = 'N'.
  CALL TRANSACTION 'FBV0'
       USING bdcdata
       MODE  modus.
  IF sy-subrc EQ 0.
*&      Form  COMPTABILISER-ANNULER
      text
     -->BDC_OKCODE   text
FORM comptabiliser-annuler
     USING p_okcode TYPE okcode.
  REFRESH bdcdata.
Dynpro 0100
  PERFORM bdc-dynpro
          USING 'SAPMF05V'             "Program SAPMF05V
                '0100'.                "Dynpro 0100
  PERFORM bdc-field
          USING 'BDC_OKCODE'           "Okcode - ENTER
                '/00' '' ''.
  PERFORM bdc-field
          USING 'RF05V-BUKRS'         
                t9fac_h-bukrs '' ''.
  PERFORM bdc-field
          USING 'RF05V-BELNR'          
                t9fac_h-belnr '' ''.
  PERFORM bdc-field
          USING 'RF05V-GJAHR'          
                t9fac_h-gjahr '' ''.
Dynpro 0700
  PERFORM bdc-dynpro
          USING 'SAPLF040'             "Program SAPLF040
                '0700'.                "Dynpro 0700
  PERFORM bdc-field
          USING 'BDC_OKCODE'           "Okcode - Book
                p_okcode '' ''.
ENDFORM.                    " COMPTABILISER-ANNULER
Nota: the fields called t9fac_h- are part of one of my application tables

Similar Messages

  • 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

  • Error "Specify account number" during PRELIMINARY_POSTING_FB01

    Dear All,
    I am trying to post FI document in FB01 through PRELIMINARY_POSTING_FB01 F.M.
    I am passing following data to it.
    *Populate the header
    Company code
    ls_bkpf-bukrs = ls_posting2-bukrs.
    Year
    ls_bkpf-gjahr = ls_posting2-budat+0(4).
    Document Type
    ls_bkpf-blart = p_blart.
    Posting date
    ls_bkpf-bldat = ls_posting2-bldat.
    Document Date
    ls_bkpf-budat = ls_posting2-budat.
    Period
    Is_bkpf-monat = Is_posting2-monat.
    *currency
    Is_bkpf-waers = is_posting2-waers.
    *Item data
    *posting key
    is_bseg-bschl = is_posting-bschl.
    *Account
    is_bseg-hkont = is_posting-hkont.
    *amount
    is_bseg-wrbtr = Is_postng-wrbtr.
    After executing this it gives error
    "Specify account number"
    Is there any sollution for that......
    Regards,
    Amar

    That is bcoz the account number you are populating in table parameters is not matching with values in table while processing.  Use FM conversion_exit to prefix zeroes so that it matches the value in table.

  • Parking an accounting document - PRELIMINARY_POSTING_FB01

    Hello experts,
    We are using FM PRELIMINARY_POSTING_FB01 to park accounting documents. We are able to successfully park accounting documents using this FM but when we try to post the parked document using this FM, we are getting an error based on missing exchange rate in exchange rate table. Not sure what we are missing or if we are passing wrong/insufficient values to the FM. Can someone who has used this FM before provide sample code for this FM. Thanks.

    As far as I understand this FM, this FM can only be used for parking a document. You can however post the parked document using the FM PRELIMINARY_POSTING_POST_ALL. The code for how to use this FM can be found in the business object FIPP method POST.
    Please do let me know if this helped you.
    Regards,
    Hari

  • Issue in PRELIMINARY_POSTING_FB01

    Hi Experts,
    I am using FM PRELIMINARY_POSTING_FB01 for parking multiple docs.
    But after every park info message pop up window occurs with doc no successfully parked so each time user has to press enter.
    Is there any way to avoid this popup window from coming?
    Please suggest.
    Regards,
    Kaustubh.

    Hi
       You can call the FM  'PRELIMINARY_POSTING_FB01' in back ground task.
        CALL FUNCTION 'PRELIMINARY_POSTING_FB01'
        IN BACKGROUND TASK
    Regards
    Swamy

  • Using FM PRELIMINARY_POSTING_FB01 for Posting a Document

    Hi there,
    Can we use FM PRELIMINARY_POSTING_FB01 for Posting a document? Has anybody done that? Please let me know which of the following needs to be populated? Thanks a lot.
    (TEXT_UPDATE)
    TEXT_ITEM_UPDATE)
    (I_UF05A)
    (I_XCMPL)
    (FS006_FB01)
    (I_TCODE)
    (I_PARGB)
    (I_TCODE_INT)
    Does anybody have any documentation/help on this FM? Please let me know - as I need to do this sometime next week.
    Edited by: sam jose on Apr 29, 2010 4:50 PM
    Edited by: Rob Burbank on May 5, 2010 10:13 AM

    Dear Sam,
    You can Use the bapi BAPI_ACC_DOCUMENT_POST. By using the extension tables of the BAPI when creating the accoutning documents you will pass all the fields you did not found on the standard tables.
    Now, you will use the BTE (Business Transaction Event) RWBAPI01 : SAMPLE_INTERFACE_RWBAPI01, and you will find all the data you fill in the tables Extension in the bapi, and you have to transfer it to table IT_ACCIT.
    You can fill even specific fields of table BSEG if you want.
    Regards,
    Yassine NEJMY

  • PRELIMINARY_POSTING_FB01 and profit segment

    Hi Expert,
    Currently I am building the upload program which is using for parking document. but I got problem with the creating profit segment under FM : PRELIMINARY_POSTING_FB01, and after run it pop up the error need to fill data under profit segment COPA, I wonder how I can create the profit segment data under PRELIMINARY_POSTING_FB01 or I need to use the other FM again to create profit segment COPA ??
    After I investigate there is 3 table in my system will be store under profit segment that is : CE48888, CE48888_ACT and CE4888_FLAG. but I don't know if there other table to be stored the data again if I only allocate value for this 3 tables above.
    Appreciate for you all if can help me. Thank you
    Regards,
    Koho koho

    Hello KK ,
    Better to use FM POSTING_INTERFACE_DOCUMENT or BAPI , see its documentation..
    regards
    Prabhu

  • COPA Fields using the FM PRELIMINARY_POSTING_FB01

    Hi everyone,
    I am using the Function modules PRELIMINARY_POSTING_FB01 to park the GL invoice documents. I am not able to populate the COPA fields of the document. How do we pass copa fields to the FM PRELIMINARY_POSTING_FB01?

    Hi,
    First populate PAOBJNR, PASUBNR from function module COPA_PRELIMINARY_SEGMENT and pass these to PRELIMINARY_POSTING_FB01 - TBSEG-PAOBJNR AND TBSEG-PASUBNR.
    Populating PAOBJNR:
    FORM get_paobjnr  TABLES   pt_tbkpf TYPE gty_tbkpf
                               pt_tbseg TYPE gty_tbseg.
      DATA: lv_tabix  TYPE sy-tabix,
            lv_kokrs  TYPE kokrs,
            wa_cobl   TYPE cobl,
            wa_cobl1  TYPE cobl.
      READ TABLE pt_tbkpf INTO wa_tbkpf INDEX 1.
      READ TABLE gt_bukrs INTO wa_bukrs WITH KEY bukrs = wa_tbkpf-bukrs BINARY SEARCH.
      IF sy-subrc = 0.
        READ TABLE it_tka01 INTO wa_tka01 WITH KEY ktopl = wa_bukrs-ktopl BINARY SEARCH.
        IF sy-subrc = 0.
          lv_kokrs = wa_tka01-kokrs.
        ENDIF.
      ENDIF.
      LOOP AT it_bseg INTO wa_bseg WHERE ( copa_kunnr IS NOT INITIAL OR
                                           copa_matnr IS NOT INITIAL OR
                                           copa_werks IS NOT INITIAL OR
                                           copa_vkorg IS NOT INITIAL OR
                                           copa_vtweg IS NOT INITIAL OR
                                           copa_spart IS NOT INITIAL OR
                                           copa_pspnr IS NOT INITIAL OR
                                           copa_prctr IS NOT INITIAL ) AND
                                          copa_valid = c_x.
        lv_tabix = sy-tabix.
        wa_cobl-glvor = 'RFBU'.
        wa_cobl-vorgn = 'RFBU'.
        wa_cobl-process = 'BELEGPOS'.
        wa_cobl-event = 'PRUEFEN'.
        wa_cobl-budat = wa_tbkpf-budat.
        wa_cobl-bldat = wa_tbkpf-bldat.
        wa_cobl-bukrs = wa_tbkpf-bukrs.
        wa_cobl-hkont = wa_bseg-hkont.
        wa_cobl-koart = c_s.
        wa_cobl-kokrs = lv_kokrs.
        wa_cobl-gjahr = wa_tbkpf-gjahr.
        wa_cobl-blart = wa_tbkpf-blart.
        wa_cobl-bschl = wa_bseg-bschl.
        wa_cobl-waers = wa_tbkpf-waers.
        wa_cobl-wrbtr = wa_bseg-wrbtr.
        wa_cobl-kunnr = wa_bseg-copa_kunnr.
        wa_cobl-vkorg = wa_bseg-copa_vkorg.
        wa_cobl-vtweg = wa_bseg-copa_vtweg.
        wa_cobl-spart = wa_bseg-copa_spart.
        wa_cobl-matnr = wa_bseg-copa_matnr.
        wa_cobl-werks = wa_bseg-copa_werks.
        CALL FUNCTION 'COPA_PROFITABILITY_SEGMENT'
          EXPORTING
            dialog              = space
            i_cobl              = wa_cobl
            i_update            = c_x
          IMPORTING
            e_cobl              = wa_cobl1
          EXCEPTIONS
            abnormal_leave      = 1
            btrans_not_relevant = 2
            error_copa          = 3
            OTHERS              = 4.
        IF sy-subrc = 0.
          READ TABLE pt_tbseg INTO wa_tbseg INDEX lv_tabix.
          IF sy-subrc = 0.
            wa_tbseg-paobjnr = wa_cobl1-paobjnr.
            wa_tbseg-pasubnr = wa_cobl1-pasubnr.
            MODIFY pt_tbseg FROM wa_tbseg INDEX sy-tabix TRANSPORTING paobjnr pasubnr.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_PAOBJNR

  • Parking documents using PRELIMINARY_POSTING_FB01

    Hi,
    I am a writing a custom program to park documents through FBV1.  Here I using PRELIMINARY_POSTING_FB01.  But as it doesn't have a return table of type bapiret,  I am not able to catch the messages.  Once an error message comes, it is exiting from the program itself.  But I need to save the error messages.  How will I do this ?

    Hi,
    I think that FM PRELIMINARY_POSTING_FB01 is for internal use only and was created just to be called from transaction FB01. I do not thing there is some way how to get error messages and supress terminating a program, because there are error messages without raising any exceptions. I have not found a BAPI for parking documents. The best way to solve your issue is probably creating a batch input. It should be easy.  If You want still to use FM PRELIMINARY_POSTING_FB01 , the only idea I have is a little bit complicated. You can call FM in background task, wait until job finishes and than read a job jog to get messages. But I do not think it is a good looking solution, but by this You can achieve that You will be able to get messages of FM without terminating a program. There are some other threads about BAPIs for parking documents:
    FM/BAPI for Parking a document ( FBV1 )
    BAPI to PARK accounting document
    FB01 and BAPI_ACC_DOCUMENT_POST
    Regards,
    Adrian

  • PRELIMINARY_POSTING_FB01 not parking document

    Hi All,
    I am trying to use the BAPI 'PRELIMINARY_POSTING_FB01' to park a document the way we park using FV60 and for this I have written the following code but when I run this program and put the breakpoint after the I call the BAPI but it's not doing anything and just returning back to the program. Can you please help me with this what i am doing wrong here.
    data: lt_bkpf type table of bkpf,
            ls_bkpf like line of lt_bkpf,
            lt_bseg type table of bseg,
            ls_bseg like line of lt_bseg,
            lt_bsec type table of bsec, "not used, required for call
            lt_bset type table of bset, "not used, required for call
            lt_bsez type table of bsez, "not used, required for call
            p_return LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    * Invoice header structure - BKPF table
      ls_bkpf-bukrs = '001'.
      ls_bkpf-blart = 'KR'.
      ls_bkpf-bldat = sy-datum.
      ls_bkpf-budat = sy-datum.
      ls_bkpf-usnam = sy-uname.
      ls_bkpf-tcode = 'FV60'.
      ls_bkpf-glvor = 'RFBU'.
      ls_bkpf-xblnr = 'test doc'.
    ls_bseg-wrbtr = '100'.
    *  Set posting key and d/c indicator based on amt_doccur
         if ls_bseg-wrbtr > 0.
           ls_bseg-bschl = '31'."Posting Key   31=Vendor Invoice
           ls_bseg-shkzg = 'H'. "D/C indicator H=Debit
         else.
           ls_bseg-bschl = '21'."Posting Key   21=Credit Memo
           ls_bseg-shkzg = 'S'. "D/C indicator S=Credit
         endif.
    *    local currency not required for header
         ls_bseg-pswsl = 'USD'.
         ls_bkpf-waers = 'USD'.
    *  Do not clear out ls_bkpf - needed for vendor line item
       append ls_bkpf to lt_bkpf.
       clear  ls_bkpf.
    * Vendor line item - required even for header only - BSEG table
      ls_bseg-buzei = '001'.
      ls_bseg-bukrs = '001'.
      ls_bseg-gjahr = '2010'.
      ls_bseg-augdt = sy-datum.
      ls_bseg-koart = 'K'. "Account Type -> K for Inv and CM
        ls_bseg-lifnr = '1234567'.
          "G/L Account information defaulted from vendor
          ls_bseg-saknr = '0000999999'.
          ls_bseg-hkont = '0000999999'.
      append ls_bseg to lt_bseg.
      clear  ls_bseg.
      call function 'PRELIMINARY_POSTING_FB01'
        exporting
          i_tcode       = 'FV60'
          I_XCMPL       = 'X'
          I_TCODE_INT   = 'FV60'
        tables
          t_bkpf        = lt_bkpf
          t_bseg        = lt_bseg
          t_bsec        = lt_bsec
          t_bset        = lt_bset
          t_bsez        = lt_bsez
        exceptions
          error_message = 1.
      p_return-id         = sy-msgid.
      p_return-type       = sy-msgty.
      p_return-number     = sy-msgno.
    if sy-subrc = 0.
      call function 'BAPI_TRANSACTION_COMMIT'
        exporting
          wait = 'X'.
      endif.

    Hi,
    Try like this
    CALL FUNCTION 'PRELIMINARY_POSTING_FB01'
            EXPORTING
              fs006_fb01    = wa_fs006
              i_tcode       = c_fb01
              i_tcode_int   = c_fb01
            TABLES
              t_bkpf        = i_bkpf
              t_bseg        = i_bseg
              t_bsec        = i_bsec
              t_bset        = i_bset
              t_bsez        = i_bsez
            EXCEPTIONS
              error_message = 1.

  • PRELIMINARY_POSTING_FB01 when I_XCMPL is set to 'X' document is posted

    Hi All,
    When I am trying to park documents using PRELIMINARY_POSTING_FB01, the document is posted when I set i_xcmpl = 'X' but if I am right it should park the document as if we 'SAVE AS COMPLETED' say in FV60 i.e with status Completed.
    I tried loads of other ways i.e just park using PRELIMINARY_POSTING_FB01with  i_xcmpl = ' ' and BDC to click on Save as Completed, but the document is posted rather than parked with status 'Completed'!!
    I tried to use PP_COMPLETE_DOCUMENT_ENJ which SAP uses behind FV60 when we click on Save as Complete, same problem again - Doc gets posted!!!!
    when I Save Doc as Complete with same parameters etc using FV60 manually the doc is nicely parked with Completed status!!
    Did anyone face/facing similar problem? Am I doing something wrong? Is Workflow not properly configured in our system?
    Any suggestions will be much appreciated.
    Thanks
    Naresh

    Hi Naresh,
    Did you able to resolve your issue? If so could you please let me know how you were able to do?
    Regards,
    Nanda.

  • Capture messages in PRELIMINARY_POSTING_FB01

    Hi everyone,
    I got an requirement, where i have to create an interface function module to park a finance document.
    So iam planning to build an custon RFC using 'PRELIMINARY_POSTING_FB01' FM.
    I am succesfull in posting the document by using above function module.
    But the  problem is araised in capturing Mesages from the function module.
    It is giving document number in information message.
    I want to supress that message and capture the document number.
    Any idea on above problem.
    Thanks in Advance.

    Hi
      Once the document has been parked, the document number will be stored in the system parameter 'BLN' which you can read into a variable using 'GET PARAMETER'  ( i.e  GET PARAMETER ID 'BLN' FIELD w_belnr ).
       Hope this helps.
    Regards
    Swamy

  • PRELIMINARY_POSTING_FB01 Cuatomer Expenses Park

    Hi Experts,
    We are trying to use mentioned FM to park customer expenses in SAP. Required entry as follows.
    Expenses Account Dr.......
    To Customer  Account ........Cr.....
    While using the mentioned FM,docuemnt has been parked and saved in VBKPF table but not in VBSEGD table. Kindly help me in this regard.
    Rgds
    Suma

    Closed

  • Insert/Update/Delete Non-PO Invoice Line Item via FM/BAPI?

    Does anyone know of a way to insert/update/delete an Invoice Line item (Non-PO Accounting Invoice - Transaction FB60 or FV60) using a BAPI or Function Module (or set of function modules) using ABAP? I have been trying to find some code to accomplish this and am stuck on a couple of issues.
    I have found PRELIMINARY_POSTING_FB01 and PP_CHANGE_DOCUMENT_ENJ but both seem to submit the details to background processes. This is an issue because it gives the user a success message after execution but later delivers the error to Workflow. This is for an interfacing program so the results should be as real time as possible.
    Has anyone accomplished this via FM or BAPI and if so would you mind sharing your experiences?
    Thank you very much,
    Andy

    SG- Thank you for the reply.
    I have been playing with BAPI_INCOMINGINVOICE_PARK and I'm not sure if it is doing exactly what we want, but it is something that I have considered in the past. I plan on looking into BAPI_ACC_INVOICE_RECEIPT_POST this morning, hopefully that will provide some more for us.
    If possible I'd like to avoid BDC sessions because this program could hypothetically interface with multiple SAP systems with different configurations.
    I will check into those FM's and thank you very much.

  • Bapi for Posting the vendor payment.F-53

    Hi,
    I need to post a document for Vendor payment using BAPI, by providing the Vendor Invoice number as Reference number which was created by using the FM PRELIMINARY_POSTING_FB01. I can able to generate a Vendor invoice, But i cant able to make this vendor invoice number as a reference number to post the vendor payment using the BAPI BAPI_ACC_DOUMENT_POST. After Executing this BAPI ,then i check in FBL1N means, the posted document was in open items. It Should be in cleared items. If i manually entered through F-53 means the payment is coming successfully and also as Cleared items in FBL1N.How to solve this issue..
    Regards
    Bala.

    Hi Bala,
    Can you please share your BDC code with me for clearing vendor invoice.
    Regards
    Neeraj Sharma

Maybe you are looking for

  • Inconsistence in standard sap report MCE1 and ME2N

    Hi Team, one of my user is using purchasing reports to analyse their spend in saphowever in some cases the purchis reports are incorrect, Using transaction MCE1 these are showing so many inconsistencies: Also while riuning ME2N for the same purchasin

  • Thumbnails for Nef files with upated exposure in Capture NX2 revert to original exposure

    I did a batch processing in Nikon Capture NX2 to update the exposure for all Nef files in a folder. When displayed in Bridge (CS6) the thumbnails at first show the thumbnail with the updated exposure, then slowly updates all the thumbnails to the ori

  • What is the command for return to a previous page in java

    Hi, I need to customize a OK button that return to a previous page instead of forwarding other page? The best way is to extend the CO class? If yes, what is the command to do so please. Thanks, CY

  • WAP121 forgot username and password

    Hi All, I have worked on WLCs and 1262n lwaps but this is for the first time I am working on WAP121, we forgot the username and password for this box, I just want to check how we can recover the credentials of this WAP. Any help is much appreciated.

  • Muse won't launch

    I just installed MuseCC. Went to launch it, its start screen displays and the app never comes up. Tried to uninstall it so I could inreinstall. No luck there.