Automatic Invoice and PGI after salesorder(userexit_document_save)

Hi All,
Here my requirement....
I need to do automatic Invoice and PGI for cash sales in Sales order.
For this, I coded inside the userexit_save_document, in this userexit i'm getting the sales order number to create Invoice and delivery number to create PGI but the issue before this userexit the sales order and delivery are created but not yet committed. So, when I am trying to create pgi and invoice in this exit.... it says the document doesn't exit.
Could anyone suggest me an methos to do that.
fyi: in my current approach for PGI im executing the standard report 'WS_MONITOR_OUTB_DEL_GDSI' using submit by passing the delivery number .............output says 'document don't exist'
for Invoice : I recorded the transaction 'VF01' and updating using bdc in funtion module, this function module is called from userexit_document_save using 'call function zffucn IN UPDATE TASK'..........this creates runtime error and shortdumb. when I looked in sm13 error says '00 671: ABAP/4 processor: POSTING_ILLEGAL_STATEMENT' , short text says 'Statement "CALL TRANSACTION" is not allowed in this form.'.
is there any better way to do this???
any suggestion will be appreciated
Regards.

Hi,
I tried using perform ...ON COMMIT....
Now i can clearly see that the sales order and delivery is created (message is displayed in the status bar)..
when i debug the code.....this is executed at last i.e  but still it shows that 'Document xxx does not exist'. SO, I believe it is not yet committed to database.
If I exit from that screen and enter into vf01 or standard report then it works...so its getting committed only getting out of that transaction ....i think there is some small change is missing...could anyone give suggestion.
regards.
Edited by: Shankar Raju Devadoss on Mar 17, 2011 11:07 PM

Similar Messages

  • Automatic invoice before PGI

    HI experts,
    im facing issue that
        invoice happening automatically  for gift vocher ( service item having delivery) immidiatly after delivery before PGI.
    we r fallowing auto delivery,
    we are in is-retailing
    plz give me solution to the same,
    advance thanks
    reddy

    hi,
    chek in the item category definition if its with reference to the sales order. as for automatic generation of invoices chek if there are ne background jobs taht are running. but in case of sales of services u do not need to have the delivery creation, u can do w/o it.
    saurabh

  • Automatic invoice and credit memo delivery

    Good day:
    As some of you know it is now required by law to generate and send electronic invoices, credir memos and debit memos to the customer.
    Currently in Mexico there are two standards, which I will explain very briefly:
    - CFD: SAP generates locally an XML and PDF file to send to the customer
    - CFDI: The XML file is generated by a service provider
    My problem right now is with CFD, is there a manual or tutorial to setup the automatic delivery via email these files? is it even possible?

    Hi,
    You may check:
    http://forums.sdn.sap.com/thread.jspa?messageID=9974561#9974561
    http://forums.sdn.sap.com/thread.jspa?messageID=9927331#9927331
    Thanks,
    Gordon

  • Auto Creation of Delivery with PGI and Billing after creation of Sale Order

    Dear Experts,
    I am having one Req. like...After creation of sales order ..automatic Delivery and Billing should be done.
    Right now i m able to create automatic Delivery but PGI is not happening for that delivery.
    Is there any configuration I have to do ... or by any user exit we can get the solution.
    Can u please provide me solution for this.
    Regards,
    Sanket.

    Hello,
    yes, you can create the PGI Atomatically by BATCH JOB using the program nder the VL23 transaction code.
    Goto the Transaction code SM36 to create a job for the program  SAPMSSY0 which is the program for the AUTO PGI
    create a variant for the Delivery document types and sales organisation combinatioans and add this variant to the bath job created in SM36.
    Set the time of the Job to run after every 5 minutes, so once the job exected it will pcik all the Deliveries which are pending for the PGI.
    After the PGI done you can run SDBILLDL program to create the Billing for all the document which were cleared and due for Billing.
    Hope it is clear for yo, please revert if you need frther clarification .
    santosh

  • Automatic Invoice creation after Final Settlement (in Route Accounting)

    Hello Gurus,
    could you please advise how to customize automatic Invoice creation after the Final Settlement.
    Now when we press final settlement in COCKPIT (or in Fast Entry) transaction we have new sales order for return (in case of return), then delivery for this order and posting GI for the delivery but we cannot achieve Invoice creation. In settlement log we can see Area: Invoices but they are missing there and system does not try create invoice.
    Please advise what we missed.
    Thank you in advance
    Regards,
    Igor

    Hello,
    could you please check object /DSD/TOUR if it is useful for this?
    This is for TOUR STATUS..
    For each activity, there will be dedicated status determined by the system??
    check with your DSD functional consultant (on customization), to identify the status in which authorization needs to be blocked..
    thank you
    Venkatesh

  • I need to create automatic invoice(vf01) on click of pgi.so which Bapi?

    Hi all,
               I need to create automatic invoice(vf01) on click of pgi.
    so which bapi shell i use and how shell i pass   outbound deliver((likp-vbeln) to document (KOMFK-vbeln) through that bapi.
    Is BAPI_BILLINGDOC_CREATE is correct bapi to do so.if it is then what i have to pass in parametres.
    Please suggest me.
    Regards,
    Himanshu

    Hi,
      Thanks buddy for your kind support. Now i have below code ..plese check.
    tables:  nast.
      data : bb like BAPIVBRK occurs 0 with header line ,
             re like BAPIRET1 occurs 0 with header line ,
             ss like BAPIVBRKSUCCESS occurs 0 with header line .
            bb-REF_DOC = nast-OBJKY.
           bb-REF_DOC_CA = 'J'. " commented"
              append bb.
    CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
    EXPORTING
      CREATORDATAIN         =
      TESTRUN               =
      POSTING               =
      TABLES
        BILLINGDATAIN         = bb
      CONDITIONDATAIN       =
      CCARDDATAIN           =
      TEXTDATAIN            =
      ERRORS                =
        RETURN                = re
        SUCCESS               = ss .
    I have to chek whether it works or not.
    Regards,

  • PGI after Invoicing process

    Dear All,
    We have a scenario wherein due to lack of space in Factory, the goods is moved to an external warehouse and from there it is being dispatched to the Customer as soon as they get the clearance approval. The Excise Invoice and pre-shipment Invoice are raised when the goods move out of factory without the PGI . The PGI is done later when the goods move out of the external warehouse to the Ship-to- location. Subsequently the Commercial Invoice is created.
    For this we had mapped external warehouse as Storage location and the scenario is working fine.
    Now there is a case arised where the business wants to move the goods from the external warehouse to a C&F location in the region of the Ship-to-party so that there is no delay in the dispatch.
    So the cycle will be  Plant--> External warehouse> C&F location--> Ship-to-Party.
    I would like to know the best way to map this scenario considering the process and the documentation.
    Regards,
    Karthik.

    Dear Lakshmipathi,
    a) Material is being sold to some X1 customer for which, a sale order is raised and that end customer is treated as a sold to party.- Correct
    b) Once stock is made ready in parent plant, it would be moved to external warehouse which is treated as another storage location and you create a delivery, do PGI & Billing on X1 with Y1 as ship to party who are in another state for which the necessary tax and ED are levied in the billing document.-  Correct
    c) Though goods are invoiced, one more physical activity is being carried out that is it is being transhipped at C&F location and from there with the documents generated at second stage stated above, the goods are delivered to X1 customer.-  This is the new requirement which needs to be mapped.
    I would also like to add that I am stil not clear on what clearance your client has got from statutory authorities to have a transhipment at c&f location. May be if you can explain this from legal point of view, to some extent, suitable proposal can be given.- Basically the sold to party i.e. the customer decides to which location  the dispatch of the goods to happen.So based on that the dispatch is being done from the External warehouse.  But the quantity which needs to be delivered to the Ship-to-party is known well in advance and hence the Outbound delivery is made but PGI is not done until the goods is actually shipped to the customer.  The Trans-shipment from External Warehouse to the C&F location is being planned to avoid the delay in transit after the Customer gives the Dispatch clearance. Unless the clearance is given we cannot do the PGI as till that time it is the liability of the company. 
    Hope the scenario is clearer now.
    Regards,
    Karthik.

  • Automatic billing , invoice and printout

    Hi all,
    The client has a requirement in such a way that when he does pgi in VL01N , automatic billing and invoice should happen in background and the printout should be generated.How can i achieve this?
    Regards,
    C.A

    It is not possible just for a single specific document, but you can schedule the Billing Due List (SDBILLDL program = VF04 transaction) to run in background with a variant even every 2 min. and this will create a billing document for all the eligible deliveries. (This will most likely include only those with PGI.)
    Naturally, the output type for the billing document must be configured to be printed immediately. This is all SD configuration and has nothing to do with ABAP whatsoever. Redirect this request to your SD specialist.

  • After delivery what postings will be happen and PGI also?

    Hi All
    after delivery what postings will be happen and PGI also?
    thanking you
    Sarvesh

    Hi,
    When you create the delivery, the open order quantity is reduced and the status of line item gets updated as either partial, complete. The document flow is updated with corresponding delivery.
    When you post goods issue for an outbound delivery, the following functions are carried out on the basis of the goods issue document:
    Warehouse stock of the material is reduced by the delivery quantity
    Value changes are posted to the balance sheet account in inventory accounting
    Requirements are reduced by the delivery quantity
    The serial number status is updated
    Goods issue posting is automatically recorded in the document flow
    Stock determination is executed for the vendor's consignment stock
    A worklist for the proof of delivery is generated
    After goods issue is posted for an outbound delivery, the scope for changing the delivery document becomes very limited. This prevents there being any discrepancies between the goods issue document and the outbound delivery.
    Hope it helps. Please reward if useful.
    Thanks & Regards
    Sadhu Kishore

  • Creation of Automatic delivery and invoice..

    Hi Team,
    Can you guys please tell me the configuration steps of automatic delivery and invoice creation.
    Actually I want to create the delivery and invoice as soon as order get saved.
    I will be highly oblige if you kindly revert me back
    regards,
    jeetsap

    Dear Prasanna,
    In vl23, you will not be able to make changes in the STANDARD VARIANTS.
    You can create your own variant by (SHIFT + F7).
    Give a variant name ' TEST' and click create.
    Now you can give the selection parameters
    Click on attributes
    So you will reach a variant screen, where you have to give  a 'meaning name'...like variant for TEST
    You can see fields .
    Imagine that initially you had given 1100 in the sales organisation.
    Now if we do not want that value to be changed, then use protect field.
    If that field need not be displayed, the choose hide field.
    Usually, these two will be used, if we are going for background processing.
    SAVE and you can see a new variant in VL23 now.
    Thanks & Regards,
    Hegal K Charles
    Edited by: Hegal . K . Charles on Jul 18, 2011 11:48 AM

  • Need to enter invoice and payment in the system after a manual check issued

    Client Need to enter invoice and payment in the system after a manual check is issued for some urgent transactions.
    Please suggest few ways to do this .

    Hi,
    If client can maintain a separate check book sequence for manual issue, we can configure a separate payment document with the same sequence and later record the invoice and generate payment ....
    Regards,
    Ivruksha

  • Invoice and Order Confirmation automatic Print

    Hi everyone,
    The user wants the following configurations:
    Automatic printing of Invoices and Order Confirmations to the following printer: #$%$#%#%u2026.this printer is located on the following server: $%$#%$#
    Thanks for prompt response
    Nick

    Hi,
    Try this method and see.
    Ask your Basis to set the LOCAL Printer in SAP.
    Then go to that users computer and set the Default Printer of that Machine to the printer: #$%$#%#%.
    Then once Invoice is saved, SAP will send it to LOCAL Printer in SAP, Then from there it'll automatically direct to the Default Printer of the machine.
    So, for each user you can set the default printer as required.
    We do same when we need to get a PDF output of Invoice. What we have asked was to set the user computer default printer as PDF Writer as & when they want PDF format of the Invoice.
    Same way as mentioned above, it sends to LOCAL, & then to machine default printer (PDF Writer), where you can save the PDF.
    Try and see !
    Best regards,
    Anupa

  • GR Reversal after posting invoice and paying Vendor

    Hi MM Friends,
    Is it possible in SAP standard  functionality that we can do a GR reversal and post GR again after the PO is invoiced and paid to Vendor ? We did like this in our system and it accepted. We think system would have thrown some error message or Information message, but it did not. Pl let us know.
    Thanks
    Niranjan

    Thanks to both Indranil and Jurgen for taking time and answering my question. That solved my issue.

  • Sales order quantity decrease after delivered and PGIed.

    Hi All,
    I need all of your's help for the below mentioned requirement ---
    --- Customer care can decrease a sales order line after it has already been delivered and PGIed. Customer care receives a warning massage, but can ingore this warning and proceed with the change. The requirement is to make this warning massage as a hard error massage so that it cant be changed.
    Please guide me whether there is any settings by which I can make this as error massage so that it cant be changed by the customer care after Delivery and PGI is done.
    Kindly guide me with the complete details ASAP.
    Thanks,
    Som.

    Hi Seshu,
    Thanks for your kind help, and please help whether there are any other way to do this warning massage as hard core error massage.
    And as you said i was trying with that - after entering into SHD0 and putting VA02 its asking for the Variant, so can you please guide me with the required variant name.
    Please let me know.
    Thanks again,
    Som.
    Edited by: som1983 on Jul 28, 2011 2:04 PM
    Edited by: som1983 on Jul 28, 2011 2:05 PM
    Edited by: som1983 on Jul 28, 2011 2:05 PM

  • Once I "match" and upload my songs, will newly added albums (from LPs) automatically be uploaded/matched after the initial batch? Do I have to keep the initial batch on that Mac?

    Once I "match" and upload my songs, will newly added albums (from LPs) automatically be uploaded/matched after the initial batch? Do I have to keep the initial batch on that Mac?

    Fryx wrote:
    Once I "match" and upload my songs, will newly added albums (from LPs) automatically be uploaded/matched after the initial batch?
    Yes.
    Fryx wrote:
    Do I have to keep the initial batch on that Mac?
    No. However iTunes Match is not a backup service: FAQ: Why iTunes Match Can Not Be Used as a Backup

Maybe you are looking for

  • XML file as datasource

    Hi All I want to read an xml file which contains all the requried data for presentation purposes. Is there any in which this file can be used a datasource and we can query this file to create different reports. From [this|Re: Can XML files be used fo

  • How to attach a hyperlink to a jpeg w ps touch

    how to attach a hyperlink to a jpeg with ps touch?

  • Project Lite users cannot see Project link on Office365 toolbar

    Our Project Lite users do not see the PROJECT link in the Office365 toolbar. All other roles can see the link - these have either Project Online subscription or Project Pro for Project Online subscription. I have verified the following: These users h

  • Safari won't load pages

    I'm running 4.0.5 and off and on over the last few months it would just stop loading pages. I have it open up to the thumbnail view of the top sites and whether I would click on one of those or click on a site in the bookmark bar, it just shows it th

  • Infix to Postfix calculation: having problems.. help?

    This is a program that when you input infix expression, it converts it to postfix expressions the evaluates the postfix.. I'm having difficulty in my main method. How do i loop it? when the user wants to another input an expression?.. import java.io.