Event triggering before needed in  transaction VA02 as user exit is involve

Hi All,
My requirement was to put authorisation check using ABAP coding in VA02 transaction so that a particular user can delete change or modify a particular order . For this i had maintained a ztable in which authorisation was given to each user. For this i used User exit to write my code. Initially tha code was running fine.
But now whenever i run the Transaction VA02 and enter the order number and hit the enter button , a message is displayed . which shuold have been displayed while the user made changes in line item. This message was written by me , whenever the user who is not authorised to change the Line Item . But it is comming when when order is entered i.e on initial screen.
So pls Help.
Thanks & regards
Vijju.

Vijju,
You have done your code in MV45AFZB which also gets triggered on ENTER if data is changed on screen, so behavior is OK.
i run the Transaction VA02 and enter the order number and hit the enter button , a message is displayed
This should be NOT the case, it is NOT the same for me, When I open an order in VA02, CHANGE any field and then press ENTER, then only Exit gets triggered and msg should appear.
If it is appearing for you without changing any field itself, then just DEBUG and check what is the data in XVBAP/YVBAP. Check with some other data as well, I think shouldn't be the case.
Also, I feel, if you change anything and error comes on ENTER itself before SAVE , it should be actually Fine with the user and is normal with many other std transactions as well.
1 more point, your condition " IF YVBAP NE XVBAP." should be the first condition and not later, because why you want to do a SELECT if nothing gets changed.
Regards,
Diwakar

Similar Messages

  • Coming back to the Transaction from a User Exit

    Hi,
    I perform some checks in a User-Exit before saving a transaction & throw an error message if something is not proper. But, the transaction terminates after that. I need to give the user an option to make changes in the transaction. eg, if user exit checks if a certain field should not be empty, the user should have an option to enter the field after the user exit throws the message. How can i go back to the same screen from the exit to achieve the same.
    Thanks in advance.
    Bikash
    This was for a general scenario wherein after an error message triggered by an Exit is displayed, the transaction just terminates.
    Message was edited by: Bikash  Agarwal

    Hi,
    If you give error message, it will leave the current transaction.
    Instead try using some POPUP function module, which will have options 'OK' and 'CANCEL'.
    If user presses 'OK', then allow user to do modifications and if he presses 'CANCEL', then write LEAVE PROGRAM to come out of transaction.
    Hope it helps.
    Regards,
    Shashank

  • Event triggerred before Wait step

    What can we do when the event is triggerred before the wait step? Does anyone know about the concept of parked events?
    Iam using f.m swe_event_create, can we use the start_with_delay option or some other option..
    I would like to have some delay before the second event is raised. but at the same time as this would be a online program, the user should not feel the delay..
    or the Wait step should be modified to pick up already created events..(i think this is called parked events).
    CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
    *objtype =
    *objkey =
    *event =
    CREATOR = ' '
    TAKE_WORKITEM_REQUESTER = ' '
    START_WITH_DELAY = ' '
    START_RECFB_SYNCHRON = ' '
    NO_COMMIT_FOR_QUEUE = ' '
    DEBUG_FLAG = ' '
    NO_LOGGING = ' '
    IDENT =
    IMPORTING

    Hi Karri, thanks for the reply ..There is a presentation on parked events if you search the wiki and blogs on this site, you will find it but thats the only thing i have seen about it and its not really helpful.
    the problem is.. 2 Inbound idocs are created both at the same time one raises a event for workflow.. one raises a event for Wait step in the same workflow ..
    The 2 inbound F.Ms which raise the events, can error sometimes or the workflow can create a workitem before the Wait step and hang in there till its processed..(its unpredictable which one will trigger first)
    If the second event(for Wait step) is raised first and the workflow processing has not yet reached the Wait step, the workflow waits for the event to be raised(although the event is already there)
    Do you know of some way we can keep reprocessing until the Event receiver is found? (may be in a Raise event workflow step or in a Function Module)
    Edited by: sk123456 on Jun 5, 2010 11:47 AM

  • Add a new line item in VA01/VA02 using user exits.

    Hi Experts,
    I have a problem regarding adding of line items in VA01/VA02. I was able to add a line item but my problem is, there is no validation for the added line. I want SAP to validate it before posting it to database. I'm using USEREXIT_SAVE_DOCUMENT_PREPARE for this one.
    I also found out from other threads, that adding line items in XVBAP is not advisable since no checking will be done after USEREXIT_SAVE_DOCUMENT_PREPARE.
    I'm thinking if I can use FM DYNP_VALUES_UPDATE on one of the user exits to add a line item in VA01/VA02 and let SAP do the checking and validation. This way, I'm sure that the added line is correct and data integrity will be maintained.
    Do you have any comments/suggestions about this?
    Thanks a lot,
    Arman.

    Hi,
    I am trying to do this as well but I don't get it working...
    I am able to add records to XVBAP, but those never show up in my sales order.
    I have found that I should also add records to XVBEP, XKOMV and XKOMP before it will be working, but when I add something to XVBEP I do get a dump on SAVE.
    I would like to ask people that managed to get this working to post the code as an example here.
    Thanks and best regards,
    Marnix

  • Transactions ME51N & ME52N user exits - saving requisitions

    Hi all. 
    I have a new requirement for disallowing transactions ME51N & ME52N from saving purchase requisition records that have more than one line items associated with each of them.
    Basically upon the user clicking on the 'Save' icon I have to first check the purchasing group screen field (MEREQ3211GRID-EKGRP) of the captured purchase requisition at each event instance.  If the purchasing group matches the one I check for (i.e. the configured one) and the purchase requisition also has more than one line item associated to it then I should skip the posting functionality for this specific purchase requisition and then issue an error dialog message to the user telling him/her that such a transaction is not alllowed.
    Please help me to find the following:
    1) The user exit/BADI to use in order to implement such a change.
    2) The data objects or internal table/(s) that I may use in order to count the number of captured line items for each purchase requisition (e.g. via the 'DESCRIBE' command).
    Thanks in advance!

    Hi Venkatesan,
    I have looked at the definition of this BADI via se18.  The interface has a few parameters which also reference other types higher up in the hierachy.
    Which method do you think would be ideal in order to do the following:
    1) Get the item data count as captured by the user via the transaction ME51N?
    2) Get the item data count as collected from the database (i.e. as previously captured) and changed by the user via transaction ME52N?
    I have to then make changes exactly at these points.
    Thanks again!
    Edited by: L J Langa on Apr 16, 2009 3:00 PM

  • As01 transaction using substitution user exit populate classificaion

    Hi all,
    I have a requirement, where in using the substitution user exit rule U210, I need to populate fields ANLB-NDPER, ANLB-NDJAR and ALNA-VMGLI from the values maintained in Ztable.
    I am able to overwrite the SAP standard values for the fields ANLB-NDPER and ANLB-NDJAR. But not able to populate the filed VMGLI(Classification key).
    For some asset classes, the classification key is not mandatory and the user without giving the value in that field if save the transaction, then I need to populate the value of VMGLI with the ztable value.
    The present rule U210 is not working for classification key.
    Please suggest, is there any other user exit for the scenario where we can populate VBGLI field.
    regards
    Rajani Yeluri

    In the user exit documentation,  it doesn't say anything about this exit being used for validation, therefore,  it probably shouldn't be used as a validation routine, especially if its not being trigger at every PAI. 
    <i>FU EXIT_SAPLAISA_001
    Short text
    Assign Inventory Number
    Functionality
    Using this user exit, it is possible to assign an inventory number when you create a new asset master record.
    Notes
    In the user exit, it is absolutely forbidden to use a statement that leads to an update or removal of database changes. Examples of such statements are:
    'Commit Work' , 'Rollback Work' or call of function module 'DB_COMMIT'.
    Parameter
    I_ANLA
    E_INVNR
    Exceptions
    Function group
    XAIS</i>
    Regards,
    Rich Heilman

  • As01 transaction using substitution user exit populate classificaion key

    Hi all,
    I have a requirement, where in using the substitution user exit rule U210, I need to populate fields ANLB-NDPER, ANLB-NDJAR and ALNA-VMGLI  from the values maintained in Ztable.
    I am able to overwrite the SAP standard values for the fields ANLB-NDPER and ANLB-NDJAR. But not able to populate the filed VMGLI(Classification key).   
    For some asset classes, the classification key is not mandatory and the user without giving the value in that field if save the transaction, then I need to populate the value of VMGLI with the ztable value.
    The present rule U210 is not working for classification key.  
    Please suggest, is there any other user exit for the scenario where we can populate VBGLI field.
    regards
    Rajani Yeluri

    Hi,
    Did you find a solution. I'm just looking for the same thing.
    best regards..

  • Need help in creating a user exit variable

    Hi all,
    I have created a query in which a key figure needs to be automated with an user exit variable.I want to derive the value of this key figure 'x' based on calender month.
    This key figure should get the cumulative value from the first month of the fiscal year till the calender year month entered while executing the query.
    I got a basic understanding on the User exits from SDN. But Im not sure how to implement this logic.
    I would really appreciate if you could provide me a detailed explanation of how to do this.
    Thanks in advance,
    Vinoth

    Hi
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2d99121a-0e01-0010-e78c-b1ae566a2413
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/how-can-i-set-bex-variables-in-i_step3-exit_saplrrs0_001-335232

  • Transaction for this user exit

    Hi
    how can i find out to which transaction user exit SDVAX001 belongs?

    Hi Tushar,
    SDVAX001 is a Enhancement not a program , you can see this in SMOD , it will be having comoponents which is again having the supported Exits like Function Module Exits, Screen Exits, Menu Exits.. But this SDVAX001 Enhancement is having a Function Module Exit EXIT_SAPMV45A_001 which will be used to determine the billing plan type . In side this Function Module you can see a include named ZXVVAU01 , this one will be created by us by double clicking on it. In this We will using data of VBAK,VBAP,VBKD,TVAK,TVAP to manipulate  the FPART .
    Hope This Info Helps YOU.
    Regards,
    Raghav

  • Field Status by Transaction code or User Exit

    Hi all,
      Is it possiblee to change field status group according to transaction code and GL account? Any configuration or user exit?
      For example, transaction FB01 account 100000 using Field status group A and transaction FB60 account 100000 using field status group B.
      Or is there any user exit to change the screen of FI transaction?
    Thanks,
    Phon

    Maybe you could try with FI Validations...Tx. <b>OB28</b>
    Greetings,
    Blag.

  • Change VBEP in Va02 in user exit prepare_save_document

    Hi,
    I want to change the field ezeit in table vbep in all lines of the order when i'm modifing a sales order, I'm trying to change it in the userexit prepare_save_document but nothing changes. How can i change that? Here is the code that i'm using:
              LOOP AT xvbep.
                xvbep-ezeit = fl-value.
                MODIFY xvbep.
                vbep-ezeit = fl-value.
              ENDLOOP.

    Changing XVBEP in save_document_prepare can be tricky. You have to call some SAP routines for this and thoroughly TEST. Be careful not to resort XVBEP. here is some sample code that we used to set delivery block.
    i_vbap[] = xvbap[]. "copy to custom table to avoid re-sort
      loop at xvbep where lifsp eq c_zz.
        check xvbep-updkz ne updkz_delete.
        read table i_vbap with key posnr = xvbep-posnr.
        check ( sy-subrc eq 0
                and not i_vbap-grkor is initial )
               or l_abgru eq 'X'.
        read table ivbap with key posnr = xvbep-posnr.
        if sy-subrc eq 0.
          ivbap-selkz = c_x.   "select vbap line
          modify ivbap index sy-tabix.
        endif.
        read table ivbep with key posnr = xvbep-posnr
                                  etenr = xvbep-etenr.
        if sy-subrc eq 0.
          ivbep-selkz = c_x.               "select vbep line
          modify ivbep index sy-tabix.
        endif.
        rv45a-s_lifsp = ''.
        perform rv45a-s_lifsp_pruefen(sapfv45p).
        loop at xvbap where posnr = xvbep-posnr
                        and updkz ne updkz_delete.  "set correct VBAP line
        endloop.
        perform xvbap_lesen_allgemein(sapfv45p) using xvbap-posnr
                                                      space
                                             changing svbap-tabix.
        perform vbap_bearbeiten_vorbereiten(sapfv45p).
        perform vbap_fuellen(sapfv45p).
        perform vbap_bearbeiten(sapfv45p).
        read table ivbep1
             with key posnr = xvbep-posnr
                      etenr = xvbep-etenr.
        svbep-tabix = ivbep1-tabix.
        perform vbep_fuellen(sapfv45e).
        perform vbep_bearbeiten_vorbereiten(sapfv45e).
        vbep-lifsp = ''.
        perform xvbep_aendern(sapfv45e).
        perform vbep_bearbeiten(sapfv45e).
        perform vbap_bearbeiten_ende(sapfv45p).
      endloop.

  • Need Logic for writing the User exit

    Hi Gurus,
    I am writing the User Exit code to populate the 'Valid to' field in the data source.
    Technical Name - DATUB  and Type- DATS
    I am using the FM 'GET_STPO"
    My extract structure has following fields.
    MANDT
    MATNR
    WERKS
    STLAN
    STLNR
    STLAL
    STLTY
    STLKN
    STPOZ
    DATUV
    IDNRK
    PSWRK
    MEINS
    MENGE
    MTART
    DISMM
    DATUB
    I am not getting the DATUB value for some of the BOM Node Numbers(STLKN).
    Please suggest me as How Can I write the code?
    Thanks a lot.
    Shalaka.

    Hi ,
    You can also try this :
    int countold = 0;
    int countnew = 0;
    int k = 0;
    for(int i =0;i<var1.length;i++)
    countold = countnew + 1;
    countnew = countnew + Integer.parseInt(var1<i>);
    for( int j = countold-1 ;j<countnew;j++)
    result.addValue(var2[k]);
    k++;
    result.addContextChange();
    Regards,
    Ganesh

  • BADI / User Exit for APO Order transaction /SAPAPO/SNPTLB

    Hi Experts,
    We have a proxy interface and currently we are using FUNCTION EXIT_SAPMSNPUSER_006 for the APO Order transaction: /SAPAPO/SNPTLB.
    This exist is triggering before the Order is being saved in APO and at times it is throwing an error 'Order key already exists in live cache' in the APO system.
    Is there any other BADI or User exit available to Save the order in APO before the interface gets processed?, if so, plese guide me.
    Thanks & Regards,
    Vijaya

    Hello Lakshmi,
    I am having the same issue with the message "Order key already exists in live cache" in our system. 
    We are using the user-exit EXIT_SAPMSNPUSER_005 for UoM conversion.  But we are not making any explicit proxy calls
    to /SAPAPO/SNPTLB.  Does the system automatically call this transaction with this user-exit?
    Did you get a resolution for the issue.  I would really appreciate if you can let me know how you have addressed this.
    Thanks,
    Ratnam

  • BADI/User Exit for APO Transaction: /SAPAPO/SNPTLB

    Hi Experts,
    We have a proxy interface and currently we are using  FUNCTION EXIT_SAPMSNPUSER_006 for the APO Order transaction: /SAPAPO/SNPTLB.
    This exist is triggering before the Order is being saved in APO and at times it is throwing an error 'Order key already exists in live cache' in the APO system.
    Is there any other BADI or User exit available to Save the order in APO before the interface gets processed?, if so, plese guide me. 
    Thanks & Regards,
    Vijaya

    Hello Lakshmi,
    I am having the same issue with the message "Order key already exists in live cache" in our system. 
    We are using the user-exit EXIT_SAPMSNPUSER_005 for UoM conversion.  But we are not making any explicit proxy calls
    to /SAPAPO/SNPTLB.  Does the system automatically call this transaction with this user-exit?
    Did you get a resolution for the issue.  I would really appreciate if you can let me know how you have addressed this.
    Thanks,
    Ratnam

  • User exit for Previous and current system status  for  5 transactions

    Hi Experts
    My Objective to capture the Previous and current status  of system status  for  5 transactions  in their  user exits .
    Description                                         Business Object               Transaction
    Production Order operations              BUS2005                            CO02 to edit Production Order
    Maintenance Orders                           BUS2007A                         IW32 to edit Plant Maintenance Order
    INTernal   ORDER                                 BUS2075                          KO02 to edit Internal Order
    WorkBreakdownStruct                       BUS2054                          CJ02 To edit the WBS element
    Project System Network                      BUS2002                           CN22 to edit Network
    Activities Network
    For Both Production order  and   Project System Network Activities Network    ,
    i got  User exit  "  EXIT_SAPLCOBT_001  " 
    But i am not sure whether we can use this or  not for our purpose . When i am changing status and  then saving ,  my  break point comes  to  EXIT_SAPLCOBT_001  .
    But  can we capture   JEST   or   JCDS  related  data   in that  user  exit  or  How can we capture both Previous status  and Current ( Means New changed status ) . For eg  From Released   to   Technically complete   etc.
    I want Status changed and its immedtiate previous status. 
    Do i need to check Exit  or BADI  before  and after Saving .
    Thanks
    Regards
    Gaurav
    Edited by: TheGaurav on Sep 8, 2011 10:28 AM

    Hi Himanshu
    Many Thanks for the reply . 
    I also had some other processing needs to be done on the basis of those status. .
    So do you have any idea or  how to find what all exits or BADIs  i can use for all of these 5 transactions , where
    i can get data for JCDS ( or JEST ) .
    CO02 to edit Production Order                 
    IW32 to edit Plant Maintenance Order
    KO02 to edit Internal Order
    CJ02 To edit the WBS element
    CN22 to edit Network        
    can we use   EXIT_SAPLCOBT_001  for    CO02  and  CN22   .
    Edited by: TheGaurav on Sep 8, 2011 1:21 PM

Maybe you are looking for

  • Can anyone help me out w/ a simple question?

    I need a little help getting this to work. This is my first script so go easy on me! 8) I looked at the forums but being that this is my first script it's still too difficult to decipher everything. In my document that's already open I want the scrip

  • How to delete photos from iPad when original pics are no longer on computer

    Hi I need to clear photos from my iPad that were synced from my computer some time agi. Since sycing those pics from the pc to the ipad, I cleared up my pc and backed up the photos onto discs. How do I now delete those pics from the iPad, as the the

  • HT4993 my phone was stolen and i had 5gig backed up on icloud and i cannot pull it up

    My phone was stolen and I had 5gigs backed up on icloud and I cannot retrieve it.

  • Table(cast  - invalid datatype problem

    Hi All, Basic scenario: PACKAGE create or replace PACKAGE C2_PAYMENT_DOC IS TYPE bin_array IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; FUNCTION test_fun(l_doc_id IN integer) RETURN bin_array; PACKAGE_BODY create or replace package body C2_PAYMENT_DOC

  • Editor zum zweiten Mal öffnen

    Ich habe heute Fotoshop elements 12 instaliert. Wenn ich vom Organizer in den Editor wechsle, klappte es nur beim ersten bearbeiteten Bild Zurück im Organizer kann ich kein weiteres Bild im Editor öffnen, ausser wenn ich Fotoshop elements ganz schlie