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.

Similar Messages

  • Release authorization for Posting FI document nor Parked document

    hii guru
    I am facing a problem as below. i have created a release authorization for parking document using workflow variant, created event - Created, object type - FIPP, receiver type - WS10000051, and when i am parking the document its working fine, wants release authorization to post parked document. but my client requirement is to set release authorization for posting FI document in fb50.  not parked document.
    please give me a solution how do i cofigure the release authorization to post directly FI Document in fb50.
    thanks & regards
    Rajesh

    i have solved by myself

  • 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

  • Withholding tax Amount not being displayed in the Invoice while posting a Parked Document

    Hi,
    I have created a parked document for the Vendor who has the Witholding tax code w9 - 15% . I created Parked Document using FBV1 and then tried posting the same using FBV0.Somehow I am not getting the Withholding tax Amount in the FI Document created. However the W/Tax Base Amount and the W/ Base LC are being displayed correctly.
    Say if the Line item Amount is 1,000$ then both the amounts mentioned above in the Additional tab "Withholding tax Data" are being displayed as 1,000 usd but the W/Tax Amount is 0,00 USD.
    2. Also We have the PI and the Interface is written to post the Parked document while the xml file. There is a Method Execute_Asynchronous which has two BDCs one  for FBV2 ( Change Parked Document ) followed by the Post Parked Document FBV0. Hence When I try to post the Parked Document using the SPROXY Interface which has two BDCs Viz FBV2 & FBV0 I still get the Invoice with the Same Amounts and at times with additional 2 zeros added to it in the Additionsal Tax Data Screen.
    I am not sure what is the reason for this. Can anybody help  me sort out this Issue.
    Can there be any Config issues. Please let me know what all config Settings we need to do to sort out this Issue.
    Also let me know why the 2 Zeros are getting added to the Base Amount e.g if the Vendor Line item is 12,000 USD it shows as 12,00000.00 in the Withholding tax Data  Tab in the Invoice.
    Regards,
    Deepak.

    Dear Praveen,
    please check into IMG if You defined the WT type You are using for Your Comapny code:
    IMG --> Assign Withholding Tax Types to Company Codes
    I hope this helps.
    Mauri

  • BAPI_ACC_GL_POSTING_POST is not posting a parked document

    Hi,
    I am trying to post a parked document using BAPI 'BAPI_ACC_GL_POSTING_POST' but its giving an error 'Balance in transaction currency'. I am providing the document number of the parked document in the header data of the BAPI and providing G/L details(Debit) where the document will be posted. The parked document already contains the credit entry i.e. vendor number and the amount of the invoice. So in the BAPI, I am just entering the Debit amount and the G/L. But its giving the error. Has any one posted a parked document using this BAPI or any BAPI. I want do the same thing as we are doing through transaction 'FBV0'.
    Your help will be appreciated.
    Thanks,
    Padman

    - Call transaction SM13 after calling your BAPI, to check if some update tasks are waiting or running.
    - Did you check BAPI BAPI_CASHJOURNALDOC_CREATE ([Note 616804 - FBCJ: BAPI for saving cash journal documents|https://service.sap.com/sap/support/notes/616804])
    - For extension in BAPI accounting, check [Note 487722 - Using EXTENSION1 for accounting BAPIs|https://service.sap.com/sap/support/notes/487722]
    - For general information on ACC BAPI check [Note 306504 - Collective note: BAPIs for the AC interface|https://service.sap.com/sap/support/notes/306504]
    - If data is already in FBCJ, look at FM FCJ_POST_ALL and FCJ_POST.
    Regards,
    Raymond

  • Not able to post a parked document in G/L

    I created a G/L document using FB50. After Simulating it I parked the document. When I try to post the document using FV50, the "Post" tab is not active in the parked document. Can anyone suggest how to post this parked document?
    Regards

    No matter what transaction you use, the Post command will show as greyed out.
    That's simply because to post the parked document, choose the icon "Save as completed" either from the screen icon, or from the top menu (Document --> Save as completed).
    The document will be saved and effectively will be posted. You can then go to FB03 (or any other view txn), and use the same document number to view the posted document.
    Rgds
    Gulshan

  • Not able to post park document

    Hi All,
    we have a park vendor docuemnt which was parked through t code FB60. Now when we are going to FBV0 to post that parked document, we are not getting post button there.
    Regards
    Deepak

    Hi Garg,
    We also have the same scenario, actually we have activated the workflow, and when one person park the invoice, its went to workflow, and if we click on Save as Completed, this will give use option to choose reviewal or complete, if we choose to complete this will post.
    You can also process the workflow item by SWIA, manully.
    Regards
    Javed

  • Not able to post parked document

    Hello All,
    I am unable to post parked documents.
    I enter one credit memo from vendor vide menu FB65.   I could NOT post the document.   The option was greyed out.  I could only park it.  I parked it.
    I am not able to post this parked document.  I tried posting this parked document vide menu FBV0 / FBV60.  The post option is not available and is greyed out.
    Regards
    Rao

    Hi Kasturi,
    On the same screen where you are trying to post the invoice type /nSU53 and take the snap shot of the screen (authorization missing objects). Send it to your SAP secutiry team or the team who gives you authorization for any transaction.
    They will provide you the required access to post the invoice.
    Please let me know if it helps!!
    Regards.

  • Parked document could not be posted 00 S 349 BSEG-BEWAR

    Hello Friends ,
    Users have parked Journal entries which has vendor , customer and GL line items .
    the documents were getting posted through workflow till sometime back .
    suddenly  , we have started to get the error message as    " Parked document could not be posted 00 S 349 BSEG-BEWAR "
    the BSEG-BEWAR field is missing in the SAPMF0A screen while trying to post.
    Could you please guide me what could be the reason .
    I did search before posting this question ,  but not able to find any relavent ones.
    I am aware of the function configuration using OB41, but not sure if the issue is related to the same.  
    Please assist.
    thanks
    Raghu V

    Hi,
      BEWAR field is Transaction type field. Check whether Transaction type is missing in your document.
    The issue is not related to OB41.
    Regards,
    B. Radhika

  • Parked document 1000 700010042 2010 does not exist, Message no. FP076

    Hi,
    There is one Document which is not on tax return but made a entry in a GL account (VAT).
    When I display document from FB03 for fiscal year 2010 the transaction code FB03 is diverting to FBV3 and giving error message : "Parked document 1000 700010042 2010 does not exist" "Message no. FP076"
    I also checked the tables "BSEG" & "BKPF" where this document is visible to me also I checked the GL line items from FBL3N for the VAT GL where this document is showing in line items report, but when i double clik to display this documents again am getting screen of FBV3 with the same error message.
    can any one let me know what could be the problem? and how to resolve this issue?
    Many thanks in advance.
    Regards,
    Abdul

    Hi Venkata,
    Thanks for the information....
    Addition to the above information ... there are 3 line items are there in this document 1 - K (Vendor), 2 - S (GL).
    The strange thing I can see is against 1st line item (K-Vendor) there is a clearing document updated.
    So if there is a clearing document against vendor line that means this document is no more in parking ...
    I am not sure why system is performing like this...
    Can anyone help me on this ....
    Thanks in advance.
    Regards,
    Abdul

  • Document not parked

    Hello,
    When i am making down payment to Vendor through F-48 and making payment to Vendor through F-53, System is not parking the document. It is directly posting the document in to the system
    Please help me to come out from the problem
    Thanks in advance
    CA Sanjay Darji

    Hi Sanjay,
    I'm afraid that it is not possible to park documents created under this transactions because it is a system limit per design as message number FP030 explains :
    "You have selected a posting key with a special G/L indicator of type 'Bill of exchange', or 'Down payment'. Document parking is not defined for special G/L transactions of the type 'Bill of exchange' or 'Down payment'.
    I won't recommend you to avoid this message but in case you still needed to set it I think you should create Sp GL indicators under "Others" type (not like a downpayment) on tx. OBXY for customers and OBXT for vendors, and afterwards try to post the parked documents wiht tx.:
    - F-42 - Without Clearing
    - F-21 - Transfer Without Clearing
    Using this entries the system no longer will check for existant downpayments when entering invoices...
    Nevertheless, as the downpayment request it is a standard functionality I would recommend you chosed this as a workaround for parking downpayments as it does not mean a real posting, it can also be locked until someone authorizates it, and can even be treated under the automatic payment program.
    Regards,
    Lidia

  • FBV0 Post only - do not allow to change parked document

    I had FBV0 access to post parked document, no complaints.
    But, i should not be able change parked document.
    can we restrict FBV0 to Post only - do not allow to change parked document ??
    Thanks.

    Dear P1023,
    To segregate the authority to park and to post, i suggest that you
    either
    - use the exit provided by SAP note 361420 (BTE 1140) to deactivate the posting/
    parking button depending on users.
             OR
    - set up a validation to prevent a users from posting/parking
             OR
    - Use workflow to release the park documents.
    I hope this helps.
    Mauri

  • Parked Document not Posting Automatically

    Hello,
    I'm using custom workflow for the Invoice Parking Document. When I test in Sandbox, the document gets posted after the release. But in Quality, when i test the workflow, the posting doesn't happening automatically after release is set. The status is In Process. Is there any config have to be done for this.
    Binding all is correct.
    Can anyone knows what is the problem ??
    Regards,
    JMB

    JMB,
    create a new parked document. go to swo1 and instantiate the object, and then try to post it by calling the method. If you are able to post here then there could be a problem at the workflow level when it calls the method. But if you are not, then there seems to be a problem with the method. Are you using the standard method 'POST' or have u developed a custom one?
    Anwar

  • Error_DP: MIR6 Adding text to the Note tab then posting a parked document

    We receive an error when posting a parked document in MIR6 only when we click on Change mode and click on the Note tab.  Then when we click Post button, a Runtime error occurs.
    SAP Note 939340 was implemented to our QA system, but the problem persists.
    Runtime error is:  RAISE EXCEPTION.  Exception condition ERROR_DP raised.
    A raise statement in the program "C_TEXTEDIT=========CP" raised the exception.
    We think it is related to the billing block, but it only occurs when the Note tab is involved.
    Any ideas?

    Hi,
    it seems it is not a problem of MIR6/MIR4.
    It is a question of texedit control.
    There are several OSS Notes regarding this (depending on your version).
    e.g.
    https://service.sap.com/sap/support/notes/814358
    Best regards.

  • Is not post parked document using workflow

    Hi friends!!!!
    Weu2019re using workflow for document parked through FIPP_FRAME_1 template and task Task WS10000051 delivered by SAP
    The system does not post parked document parked that are processed via the workflow although they have been released, but, when we try posting it through the menus u201CDocuments > Complete" in the Tcode FBV0 the document parked is not post.
    When checked in the Tcode SWIA, We´re having an endless loop
    the moment we choose workflow logs option. The items keep on
    repeating on a loop giving us a long scroolbar with repeated lines.
    Thanks!!!!

    In FBV0 use document list and the try and post it
    Cheers
    Prakash

Maybe you are looking for

  • Can't Log In with Different AppleID

    I accidentally tried to log in with the wrong AppleID this morning and now I don't even get the option of trying to log in under a different ID. Every time I try, I click "log in" and the next page that comes up already has the wrong ID listed and of

  • "Disk too slow or System Overload"

    So while I'm doing rather simple things like recording vox or even playback, the audio stops and I get the message: "Disk is too slow or System Overload. (-10010) The Sudden Motion Sensor may have parked the hard drive head, or the disk performance i

  • Affordable 19" LCD monitor recom?

    HI, I wanted to add a 19" LCD screen to my newly purchased mac mini but the whole compatibility issue seems pretty complicated. I've seen D-sub and dvi-d connections and don't even know if they'll work with a mini. I've checked the site that was post

  • 100% CPU Usage in CS5.5 Premiere Pro during export/encoding

    I am wondering why my CPU usage is so high during exporting of my videos.  My counter shoots up to 100% as soon as I start and hovers at 95% throughout the whole process.  This seems dangerous to me so I wanted to bring it up here as I haven't found

  • I have misplaced by cs3 discs and need to reinstall cs5.5 upgrade what do I do?

    I have misplaced by cs3 discs and need to reinstall cs5.5 upgrade what do I do?