How to create credit note automatically after PGR?

Hello SD Gurus,
Client's Business Process: Return Order (ZRE, ZPOR, ZARE, and ZMTR) is created with reference to billing document number and item category used for this order type is REN or ZREN. After the order is created, they do PGR (Return Delivery Type is LR) and then credit memo is created "manually". So, the issue with this process is that it is very time consuming and a lot of manual intervention is required.
To-be Process: The requirement is to create credit note "automatically" after the PGR is done to reduce the manual intervention and expedite the process. If item category is REN, then credit note will be created with invoice value. If item category is ZREN, then credit note will be created with Zero Value.
How should I write code in the user exit MV50AFZ1?
Regards,
Mohammed Anwar

Hi
Apart from Lakshmipathi's suggestion you can share the below logic with your ABAPER. There are two BAPIs we use to create billing automatically. Check whether you can call these BAPIs in userexit you have mentioned in your post.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
* EXPORTING
*   CREATORDATAIN         =
*   TESTRUN               =
*   POSTING               =
        TABLES
          billingdatain         = billingdatain
          conditiondatain       = conditiondatain
*   CCARDDATAIN           =
*   TEXTDATAIN            =
*   ERRORS                =
          return                = return3
          success               = success
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
      READ TABLE return3 WITH KEY type = 'E'.
      IF sy-subrc = 0.
        record-inv_rem = return3-message.
      ENDIF.
      WAIT UP TO 2 SECONDS.
*      READ TABLE return3 WITH KEY type = 'E'.
*      IF return3-type = 'E'.
*        WRITE:/ return3-message.
*      ENDIF.
      READ TABLE success INDEX 1.
      CLEAR: vbeln_vf.
      vbeln_vf = success-bill_doc.
    ENDIF.
Thank$

Similar Messages

  • How to create Delivery Note automatically after realising SO in VKM3

    Hi,
    I've realesed a Sales Order in VKM3 that was blocked by credit limit.  I would like Delivery Notes/Orders to be automatically created once the Sales Order have been released.  Is there any kind of configuration that has to be made so that this can happen?
    Thanks for your help!

    Did you try in T.code VOV8, in the sales document type by setting value A in the immediate delivery field.
    Note that this will impact all the sales orders, even those orders not going into credit hold.
    Regards,

  • How to create Oppertunity doc automatically after lead in CRM SALES

    Hi,
    how to create oppertunity doc automatically after creating lead in crm sales
    Thanks7regards
    kishor kumar

    Hi Kishore,
    Create SAP Business Workflow for Opportunity from Lead 
    Use
    A lead is a business transaction that describes, stores, updates, and manages the potential business interests of a business partner, and the interactions based on this over a period of time. The goal is to provide the "sales" area with the information gained in the lead, in order that it can be used as a basis for deciding whether to create an opportunity.
    The information gathered in the lead is transferred to the "sales" area via the workflow "create opportunity from lead".
    In the workflow, you decide whether the opportunity is generated manually or automatically.
    If the lead-specific attributes Priority and Lead group fulfill specific criteria, the workflow automatically generates an opportunity. Otherwise, the workflow sends a work item to the sales employee responsible, for manual creation. Once he has checked the data in the lead, the sales employee can either reject this lead or create an opportunity from it.
    The workflow is automatically started when the lead is saved.
    The sales representative entered in the lead is first taken as the sales employee whose task it is to create the opportunity based on the information in the lead. This person can be determined using partner determination in CRM, depending on the prospect in the lead, and can, for example, be a manager of a sales area. If no sales representative is entered, the workflow takes an organizational unit assigned in the workflow template, and sends the work item to all users assigned to the organizational unit.
    Prerequisites
    u2022     The type linkage for the start events AttributeChanged and SetErrorFree for the workflow WS10001011 are deactivated as a standard procedure, and, if you wish to start the workflow template, they have to be activated again in Customizing. The workflow task processors must also be maintained. In Customizing, choose Customer Relationship Management  Basic Functions SAP Business Workflow  Perform Task-Specific Customizing.
    u2022     The workflow template uses the user statuses SAAC (accepted by sales) and SARE (rejected by sales) of the status profile CRMLEAD. If you have defined several user statuses, the data flow for task TS10008154 (set status) must be adapted accordingly.
    u2022     When the opportunity is created, the workflow template uses the opportunity transaction type OPPT. If you have defined several transaction types for the opportunity, the data flow for task TS10008151 (create opportunity) must be adapted accordingly.
    u2022     If the sales employee rejects the lead, the workflow resets the qualification level to value 02 (warm). If you have specified your own qualification levels in Customizing, you need to adapt the data flow for task TS10007918 (change qualification level) accordingly.
    Process of Workflow WS10001011 (create opportunity from lead)
    The workflow "create opportunity from lead" is started when a lead is saved with qualification level Hot and status Error-free. The system uses the lead-specific attributes Priority and Lead group to check whether an opportunity can be automatically created, or a sales employee first needs to decide. If the sales employee decides that an opportunity can be created, the lead status is set to "accepted by sales", and an opportunity is created in the background. If necessary, this is forwarded to the sales employee to check. If the sales employee rejects the lead, the lead status is set to "rejected by sales", and the initiator is informed by mail.
    The workflow is ended if no opportunity is created and
    o     the lead is deleted or
    o     the qualification level of the lead is changed to a value other than Hot or
    o     the status of the lead is changed to a value other than Error-free.
    Path for the workflow:
    ==> SPRO
    ==> Customer Relationship Management
    ==> Basic Functions
    ==> SAP Business Workflow
    ==> Perform Task-Specific Customizing
    Select the Application Componenet  Abbrevation as CRM and expand
    Select CRM-BTX and expand
    Select CRM-BTX-LEA and click on Activate event linking  and acivate workflow WS 10001011
    It may helps you
    Regards
    Narayana

  • Create credit memo automatically when creating returns to vendor...

    How can i create create "Credit Memo" automatically upon creating
    returns to vendor (Movement Type 122) considering right calculation of
    the sales tax & withholding tax.

    Hi,
    There is a special display variant in the item list for invoice reduction. You enter
    the invoice quantities or values that differ to the quantities or values suggested by
    the system separately into the item list. (You can only enter data in these fields
    when you have flagged the item as Vendor error: reduce invoice).
    When you post a reduced invoice, the system creates two accounting documents.
    The first document contains the invoice postings with the actual quantities and
    values. The second document contains a credit memo for the difference between
    the actual quantities and values and the default quantities and values.
    Therefore, with invoice reduction, you do not actually reduce an invoice. Instead,
    you also post a credit memo for the amount of the reduction. The amount payable
    to the vendor is the value of the invoice reduced by the credit memo amount.
    The PO history is updated with the unchanged default values.
    When you post an invoice reduction, the system creates a message record. You
    can use this to send a letter of complaint (notification of credit memo posting)
    to the vendor.
    Regards
    Ankur

  • How to creat Process messages automatically through PI sheet saved?

    How to creat Process messages automatically through PI sheet to the Process message destinations.

    Hi Jessie,
    When you process instruction category PROD_3 in master recipe, the process message PI_PROD is created.
    After releasing process order, you have to create control recipe. Upon successful creation of control recipe, process instructions will get generated. Check the error log for control recipe creation for error if any. 
    Note that control recipe will be generated only with order status "Released".
    You have to sent this control recipe to process control (CO53).
    Hope it is helpful.
    Regards,
    Sachin

  • Issue in creating Credit Note for road carrier invoice from SAP TM system

    Dear All,
    I am facing issue in creating Credit Note for road carrier invoice from SAP TM system.
    The following steps I have performed:
    1)  
    1)    1) Create Freight order with Amount 20,100
    2)     2) Create Freight Settlement Doc and send it to ECC. Hence PO and SES will be created in ECC with Amount 20,100
    3)     3) Invoice verification (MIRO) done w.r.t. FO in ECC with Amount 20,100 and following entries posted :
    Carrier A/c - 20,100Cr
    GR/IR A/c – 20,100 Dr
    4)    4) Created Credit Note in SAP TM against freight order with Amount 1,010 and transfer it to SAP ECC.
    5)    5)  By this a new PO and SES was created with negative values (with amount 1,010) in SAP ECC
    6)    6)  In transaction MIRO, Credit Memo was created against the freight order.
    7)    7)  By this it is showing value 21,110 by adding the line items of Original Purchase Order and Credit Note Purchase Order as 20,100 and 1,010 respectively.
    8)    8)  By posting this following are the accounting entries which is not correct:
    Carrier A/c – 21,110 Dr
    GR/IR – 20,100 Cr
    GR/IR – 1,010 Cr
    9)    9)  In report FBL1N which is showing the remaining liability of value 1,010(21,100 – 20,100) instead of 19,090 (20,100-1,010=19,090) for the carrier.
    Please suggest how to resolve the issue and get the correct accounting for credit memo?
    Regards,
    Vibhu Gupta

    Hello,
    Like my reply in Linkedin group, I got the same issue and solved with BADI in TM side(REQREQ...).
    Regards, Marcelo Lauria

  • How do I Credit Note negative amount line item in Invoice

    Hi Experts,
    I have an AP Invoices that have a negative line item total.
    Now that I realize there is something wrong with this AP Invoice, I will like to CN it. But I was stopped by SAP, because I cannot CN a negative amount line item.
    Can anyone advice me how can I Credit Note (in any sense) this negative line item?
    Much Thanks!
    Warmest Regards,
    Chinho

    Hi Chinho,
    I believe this functionality is to be made available in version 8.8. The SAP workaround for 2007 is:
    To cancel an invoice with negative line, please use the workaround as
    per below:
    1. For the rows with the positive Row Total, create an "independent"
    Credit Memo (not based on an Invoice).
    2. For the rows with the negative Row Total, create another Invoice
    with a positive Row Total opposite to the original negative Row,
    and reconcile between the two rows manually via Internal
    Reconciliations. (This option is available in Banking module in
    2005 version and in Business Partner module in 2007 version.)

  • Is possible to create a TO automatically after production order confirmation?

    Hi all
    I have just a question in order to know if we can configurate a procedure to a Production Order, so my question
    is possible to create a TO automatically after production order confirmation in a standard enviroment?
    Thanks in advance for all your comments

    Hi Gurus,
    Thank you for your help in this case.
    Process:
    The customer create a production order in CO01 and then they confirm the order in CO15, after confirmation TR is created ( we can see this in LB10 ) and negative stock is created (  we can see this in LS24 ).
    Requirement:
    They are asking to create the TO automatically after the production order confirmation. Negative stock is afecting the process.
    Workaround:
    They are creating the TO in background in LB10. ( negative is fixed )
    Question:
    Can we create the TO automatically after confirmation in standard configuration?
    if no ,  how can we confirm this TO .using a JOB option?
    TR created after confirmation
        TR header
    LS24 negative units.
    Regards!!
    Ronald

  • How to set capital letter automatically after enter.. during email

    how to set capital letter automatically after enter.. during email
    as it defaults to lower case all the time..  just like above
    However would like to know how to change so its like the H in the word However automaticlly
    thanks.

    thanks.
    i tried this..
    in transformations the three options are in ghost txt.. not bold.
    tried them all.. and no change..

  • How to create sales order Automatically with reference to contract?

    how to create sales order automatically through batch or online? can anyone please suggest what needs to be change in SAPMV45A program?

    Hi,
    Wt am able to understand from the above question is, you want to create automatic sales order against contract on a day to day basis by doing batch program, hope am wright.
    See you can do it in two ways.
    1. By using BDC, in SHDB T code record how exactly you will do transaction and then give it to your abaper rest he will do. he will write a program and he will schedule that program every day night.
    2. By using BAPI. Just check in there are many threads are there which gives sales order bapi. Tell your abaper to map that bapi and tell them to schedule back ground job.
    Hope this will help out in solving your problem.
    Regards,
    Nagesh

  • How to create credit and debit for an account

    Please tell how to create credit and debit for an account in currencies like EURO,GBP other than functional currency(USD).

    hi,
    You will find Dr and Cr entry for Both currencies which are functional & Transaction currency.
    Regards,
    Srikanth.Kura

  • Creating Credit Note based on Invoice

    HI there,
    I am trying to create a Credit Note through the DIAPI using VB. This Credit Note must be linked to the Invoice 88 for example :
      Try *
                'Get the required business object *
                ''Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                Dim queryString As String*
                Dim oRecSet As SAPbobsCOM.Recordset*
                oRecSet = oCompany.GetBusinessObject(300)*
                queryString = "SELECT T0.CardCode from OINV T0 where T0.DocNum = 88 "*
                oRecSet.DoQuery(queryString)*
               Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                'Set the business partner code*
                oCreditDoc.CardCode = oRecSet.Fields.Item(0).Value*
                'set the documents due date -mandatory*
                oCreditDoc.DocDueDate = Now*
                'add first line on invoice*
                'use the SO order specified in the text box *
                'as a base document*
                oCreditDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oInvoices*
                oCreditDoc.Lines.BaseEntry = CInt("88")*
                oCreditDoc.Lines.BaseLine = 0*
                'add the new invoice document*
                lRetCode = oCreditDoc.Add*
                'check return code*
                If lRetCode <> 0 Then*
                    oCompany.GetLastError(lErrCode, sErrMsg)*
                    MsgBox("Error : " & lErrCode & " : " & sErrMsg)*
                Else*
                    'store newly created object code in a new string*
                    '(could have stored it in OrdCodeStr)*
                    Dim OrdCodeStr2 As String*
                    OrdCodeStr2 = ""*
                    oCompany.GetNewObjectCode(OrdCodeStr2)*
                    MsgBox(" Created Credit Note : " & OrdCodeStr2)*
               End If*
            Catch ex As Exception*
                MsgBox("Exception. Connect: " & ex.Message)*
            End Try*
    I am getting an "Item code missing" error. Does this mean i must set up each and every line to credit? What if there are millions of lines? Can we not just set a BaseEntry and BaseType for the document as a whole so it knows which Invoice needs to be credited completely?
    Kind regards,
    Greeshma
    p.s. i tried to get this to display as code but seems this editor is either confusing me or it doesnt work! sorry. when i find the right person to complain about it to i will!
    Edited by: Greeshma Gulab on Nov 18, 2009 11:13 AM
    Edited by: Greeshma Gulab on Nov 18, 2009 11:15 AM

    Hi,
    I am not able to make out ur code because of the formating problem, but anyways check the below thread, it might be helpful to u..
    Create Credit Memo based on A/R Invoice
    Vasu Natari.

  • Can i create credit note request with selling price,but without material no

    hi
    can i create credit note request with selling price, but without material no.? which item cat. i should choose?
    thanks

    Hi,
    The price is controlled for any item category with the help of the Item Category setting (VOV7 tcode) that is, the field Pricing under Business Data section.
    Select the option X in the Pricing field.
    Now for your case, the setting will be greyed out. as it is a text item....
    To make it for entering any option ....then change the option to A in the Item Type field.
    Reagrsd

  • How to create index not unique at the time of the CREATE TABLE

    Hi,
    I am trying to find out how in Oracle create secondary indexes that can accept duplicated into the CREATE TABLE statement, without have to execute a CREATE INDEX separately.
    As far I can see the only syntax accepted by Oracle 9i to create more than one index at the time of the table creation is:
    CREATE TABLE test_tab (x INTEGER, y INTEGER, z INTEGER PRIMARY KEY(x,y), UNIQUE(z))
    But, in my case I need to have the unicity only for the primary key, but not for the second index, that I would like to have not unique.
    How to do that inside of the CREATE TABLE statement?
    Any help?
    Thanks a lot in advance.

    To create an index automatically (not constraint related) , you will need to have an 'event' trigger on the schema that will (IE: detecting a table create/drop matching ARCHIVE_%) , generate the appropriate SQL required (create index sql) and pass THAT to a DBMS_JOB.
    Make sure you have job queue's enabled.
    This was the ONLY way that I could re-create a view automatically as new tables were created that matched a criteria IE ARCHIVE_JAN06, ARCHIVE_FEB06 etc.
    The application's "archiving" method created and was thus aware of these tables and permitted searching within 'archived' data, but 3rd party reporting applications needed to see a view encompassing all data, regardless of the tables involved. The view automatically created was a 'union_all' of all tables concerned.

  • How to create the Batch Automatically during creation of Production order

    Hi All,
    I wanted to create the Batch Automatically for the Specific order type during creation.
    Not for all order type so OPKP transction will not work for me.
    Please suggest any way or user exit any production order.
    Thanks,
    Amit Shah

    Hi All,
    Thanks for your inputs.  
      1. Why we want create the Batch Auto -
          For Std Production Order type we want to generate Batch Automatically.
          For Re-work Production Order type we don't want Batch Created Auto.
          If you have better solution please let me know.
    2.  Scheduling profile.
          I think I misunderstood your solution.
          You want to say that mainatin the Schd profile in the SPRO with repect to Sub Schdler.
          Already client is maintaining the Schd Profile in the Material Master.
           please correct me if i am wrong.
    Thanks,
    Amit Shah

Maybe you are looking for

  • Skype not working in 10.5.2

    Downloaded and updated to 10.5.2 with no hassles 'cept Skype (2.0.85) is not working anymore? I'm downloading Skype 2.6 and will post an update on what happens.

  • How to running a single form on the browser

    Hi below is the link for deployment of our application on app server. http://100.180.127.225:7779/forms90/f90servlet?config=abc and this is the entries in formsweb.cfg file. [abc] form=G:\Oracle10gBinaries\abc\FMX\test.fmx otherparams=prm_init_file=G

  • [SOLVED] Failed pacman -Syu system update

    I tried update pacman -Syu and gave me this message: error: failed to init transaction (unable to lock database) if you're sure a package manager is not already running, you can remove /var/lib/pacman/db.lck so I changed db.lck to db.lck.bac and when

  • Self registration - automatic login into the product

    Per requirement, after self registration request is complete (last button pushed) the user should be automatically logged in into OIM. Out of the box user is redirected to the login screen. How this could be implemented? Thank you for your help.

  • Tomcat cant start in windows xp 64bits

    Dear members i have windows xp, processor and mainboard of 64 bits now C:\Documents and Settings\Administrator>java -version java version "1.5.0_12" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04) Java HotSpot(TM) 64-Bit Server