User exit doubt

Hi experts,
Iam trying to write userexit using MV45AFZB.
If AUART eq ZR01 & ZR02 and price limit(NETWR) is greater than 500,I want to raise the messgae.
data: v_total like vbap-netwr.
check xvbak-auart = 'ZR01' or
      xvbak-auart = 'ZR02'.
loop at xvbap where abgru = 'ZC'.
     v_total = v_total + xvbap-netwr.
endloop.
if v_total gt 500.
      message e000(zmsg) with
         'FOC sales order limit exceeded!'.
endif.
I have written this code in FORM USEREXIT_SAVE_DOCUMENT_PREPARE(MV45AFZB) subroutine.
It is not triggering when Amount is more that 500.What might be the reason? Where i need to write this program?
MV45AFZB or MV45AFZZ?And also let me know the subroutine.
When i press enter, i want display message.
Reward guaranteed
thanks
kaki

Hi Kaki,
You can code something like this and please debug it (if needed).
data: v_total like vbap-netwr,
      v_gtotal type i.
check xvbak-auart = 'ZR01' or
      xvbak-auart = 'ZR02'.
loop at xvbap where abgru = 'ZC'.
     v_total = v_total + xvbap-netwr.
endloop.
move v_total to v_gtotal.
if v_gtotal > '500'.
  message e000(zmsg) with
          FOC sales order limit exceeded!'.
endif.
Hope this will help.
Regards,
Ferry Lianto

Similar Messages

  • User exit doubts....

    I have to check the uniqueness of tax code for any vendor in canada. The code has been already implemented for south africa.
    A include called ZXF05ZZZ (Function pool SAPLXF05) is being used for south africa one.
    Can I use the same for implementing it for canada ?
    Is there any relation between  ZXF05U01 (include in EXIT_SAPMF02K_001) and ZXF05ZZZ (include in function pool SAPLF05 ) ?
    Please help me out...
    Relevant points will be awarded...
    Thanks...
    -Tushar.

    Hi
    Have you just another post with this problem?
    Anaway in the inlcude ZXF05U01 you insert the code of your EXIT, in the ZXF05ZZZ you cans define the gloabl data or routine you want to use in the function group of the exit.
    So if the exit is used, it should be better you put the  implementations in a own routine:
    INCLUDE ZXF05U01.
    IF BUKRS = .....
    PERFORM OTHER_COUNTRIES.
    ELSE.
    PERFORM CANADA.
    ENDIF.
    INCLUDE ZXF05ZZZ.
    FORM OTHER_COUNTRIES.
    ENDFORM.
    FORM CANADA.
    ENDFORM.
    Max
    Message was edited by: max bianchi

  • Doubt in user exit for transaction MM03

    Hi Friends,
        I have a doubt in user-exits. I have to add a button in MM03 which when clicked should open a particular URL taking material no. as the parameter.I have got the function for opening the URL, I just want to know which user exit should I be calling and in what way?Can anyone please give me step by step procedure as I am new in user exits.Thanks in advance....

    VA01 is a dialog program.  The use of WRITE statements in dialog program is really not done.
    You will need output your values to existing screen fields or create new ones in SE51.
    Sounds like you might want to review dialog prog in general.
    Also - the TABLES statement is for database tables.  It has nothing to do with internal tables.

  • Doubt in Idoc user exit..............

    Hi All,
               i have written the user exit for Sales Order subscreen tab called <b>additional data2</b> , this tab is provided by sap for developer can write their own user exit coding.
               my doubt is whenever PO comes as an <b>Inbound IDOC i need to pass the value from</b> <b>segment to my user exit fields</b>.
               <b>where can i find the inbound idoc user exit for SO .</b>
                Thanks in advance,
    Regards,
    Saravanan.

    Look at enhancement VEDA0001. It has got quite a few user exits you can use. You will also need to enhance the IDOC for the additional fields you have added on your screen.
    Cheers,
    Sanjeev

  • Doubt In VA01 User Exit........

    Hi,
            we are using <b>sap4.7.</b> In VA01 ( sales Order ) we have a tab called <b>additional data B</b>. where we can write our own user exit coding.
             my doubt is where can i find <b>user exit</b> <b>enhancement</b>. i tried in <b>smod t.code</b> but i am not able to find. can any one tell me the enhancement name if you already done.
    thank you,
    Regards,
    Saravanan.

    Check out this documentation.....
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    Under user exits>user exits in sales>user exits in sales document processing
    Regards,
    Rich Heilman

  • Hi frnds doubt in user exit..

    Hi frnds..
    i hav to write an exit code as per the req can any pne hlp me regarding this...
    User Exit assigned the number ranges for Purchase order ranges allotted for each business area whenever Purchase Department creates purchase order.
    looking for ur reply.
                                    with regards,
                                        sahakla

    hi rajesh,
    Please check this user exits EXIT_SAPMM06E_017 in enhancement MM06E005 (t/code <b>SMOD</b>).
    List of <b>user exits</b> for
    Transaction Code - <b>ME21</b> Create Purchase Order
    <b>
    Exit Name Description</b>
    AMPL0001 User subscreen for additional data on AMPL
    LMEDR001 Enhancements to print program
    LMELA002 Adopt batch no. from shipping notification when posting a GR
    LMELA010 Inbound shipping notification: Transfer item data from IDOC
    LMEQR001 User exit for source determination
    LMEXF001 Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001 Customer-Specific Source Determination in Retail
    M06B0001 Role determination for purchase requisition release
    M06B0002 Changes to comm. structure for purchase requisition release
    M06B0003 Number range and document number
    M06B0004 Number range and document number
    M06B0005 Changes to comm. structure for overall release of requisn.
    M06E0004 Changes to communication structure for release purch. doc.
    M06E0005 Role determination for release of purchasing documents
    ME590001 Grouping of requsitions for PO split in ME59
    MEETA001 Define schedule line type (backlog, immed. req., preview)
    MEFLD004 Determine earliest delivery date f. check w. GR (only PO)
    MELAB001 Gen. forecast delivery schedules: Transfer schedule implem.
    MEQUERY1 Enhancement to Document Overview ME21N/ME51N
    MEVME001 WE default quantity calc. and over/ underdelivery tolerance
    MM06E001 User exits for EDI inbound and outbound purchasing documents
    MM06E003 Number range and document number
    MM06E004 Control import data screens in purchase order
    MM06E005 Customer fields in purchasing document
    MM06E007 Change document for requisitions upon conversion into PO
    MM06E008 Monitoring of contr. target value in case of release orders
    MM06E009 Relevant texts for "Texts exist" indicator
    MM06E010 Field selection for vendor address
    MMAL0001 ALE source list distribution: Outbound processing
    MMAL0002 ALE source list distribution: Inbound processing
    MMAL0003 ALE purcasing info record distribution: Outbound processing
    MMAL0004 ALE purchasing info record distribution: Inbound processing
    MMDA0001 Default delivery addresses
    MMFAB001 User exit for generation of release order
    MRFLB001 Control Items for Contract Release Order
    LMEKO001 Extend communications structure KOMK for pricing
    LMEKO002 Extend communications structure KOMP for pricing
    MM06E011 Activation of PReq Lock
    No of Exits: 38
    Hope this will help.
    Cheers
    Alfred
    Reward with poinst if it is helpful.

  • Doubt user exit ME21N

    Hi All.
    Automatically I need to Populate Picked quantity in VL02N when I creating STO (delivery will be created after STO in ME21N .it s done through configuration so no need to create delivery by VL10)
    I found user exits for ME21N: EXIT_SAPMM06E_013
                        Include: ZXM06U44,
    In my functional spec their given program FV50C302 also. Shall I need to copy as
    ZFV50C302 and Include it in ZXM06U44 ?
    Picked Quantity should be equal to delivery quantity (“Picked Quantity” LIPSD-PIKMG = LIPSD-G_LFIMG “Delivery Quantity”)
    Please help me. Automatically how can populate picked quantity to VL02N?
    To be reward all helpful answers.
    Regards.
    Jay

    Hi Jay,
    For the first question: there is no need to copy FV50C302 and make a Z. Just double click on ZXM06U44, it will show a warning press enter. it will ask for creating the include. create it and pass required value to it.
    For the second question: for the pick quantity will be same of delivery quantity, try the exit V50PSTAT, and pass the required value.
    Hope it will solve the problem.
    Regards
    Krishnendu

  • Doubt on user exit

    hi experts,
    i had google on this but i didnt get proper answer so m posting this so plz give gun shot answer.
    what is the differece between USEREXIT_SAVE_DOCUMENT_PREPARE  and USEREXIT_SAVE_DOCUMENT.

    Hello balaji,
    The difference is that any check or change to the document can be done in the PREPARE but once you get to the user-exit SAVE should not change anything only record additional information in the process UPDATE.
    I hope you help.

  • Doubt on User Exit in ME22n

    Hi Friends,
    I want to create an User Exit to create a Change pointer.
    When a change is made to TCode ME22N.
    The Change pointer is used to Update EKES Table.
    It would be helpfull. If any one can suggest an User Exit Specific to this issue.

    Hi Sudhir,
    I will suggest you check with this badi ME_PO_PROCESS_CUST .
    Regards,
    Madhu.

  • Doubt user exit

    Hi All.
    I need to do some validation in VL10.
    I found User exits and program for that
    User exits: V50R_USEREXIT_PREPARE.
    Program:  RVV50R10C
    How to procedure with this user exits and program.
    As my under standing
    I need take copy of program from RVV50R10C as Z RVV50R10C.
    Shall I need add program ZRVV50R10C in User exits? And where I need to Validation (As my requirement) in User exits V50R_USEREXIT_PREPARE OR in Program ZRVV50R10C?
    Please help me.
    To be reward all helpful answers.
    Regards.
    Jay

    Hi
    No need to copy into Z program
    Straight away you write the Code for User exit in the V50R_USEREXITS program by taking the access key from the Basis guys
    save and activate and check by keeping a breakpoint.
    Regards
    Anji

  • Doubts on user exits

    Hi, Could someone help me out with :
    1) Specific user exits in SD and MM?
    2) What mainly should we know for using user exits while working on SD , MM and FICO modules'?
    3)How to find or search for BADI's

    3) Goto SE18 and you will be able to get the available BADI's. or
    You can debug the GET_CLASS_NAME_BY_INTERFACE method of CL_EXITHANDLER class at runtime.
    1) The below program is obtained from some previous posts. You can get the list of exits for a particular transaction.
    *& Report  ZKB_USER_EXIT_LIST
    REPORT  zkb_user_exit_list NO STANDARD PAGE HEADING.
    TABLES: tstc, tadir, modsapt, modact,
    trdir, tfdir, enlfdir, tstct.
    DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : hotspot(30).
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    AT LINE-SELECTION.
      GET CURSOR FIELD hotspot.
      CHECK hotspot(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM write_list.
    * FORM get_data *
    FORM get_data.
      SELECT SINGLE * FROM tstc
      WHERE tcode EQ p_tcode.
      CHECK sy-subrc EQ 0.
      SELECT SINGLE * FROM tadir
      WHERE pgmid = 'R3TR'
      AND object = 'PROG'
      AND obj_name = tstc-pgmna.
      IF sy-subrc NE 0.
        SELECT SINGLE * FROM trdir
        WHERE name = tstc-pgmna.
        IF trdir-subc EQ 'F'.
          SELECT SINGLE * FROM tfdir
          WHERE pname = tstc-pgmna.
          SELECT SINGLE * FROM enlfdir
          WHERE funcname = tfdir-funcname.
          SELECT SINGLE * FROM tadir
          WHERE pgmid = 'R3TR'
          AND object = 'FUGR'
          AND obj_name EQ enlfdir-area.
        ENDIF.
      ENDIF.
      SELECT * FROM tadir INTO TABLE jtab
      WHERE pgmid = 'R3TR'
      AND object = 'SMOD'
      AND devclass = tadir-devclass.
      SELECT SINGLE * FROM tstct
      WHERE sprsl EQ sy-langu
      AND tcode EQ p_tcode.
    ENDFORM.                    "get_data
    * FORM write_list *
    FORM write_list.
      FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
      WRITE:/(19) 'Transaction Code - ',
      20(20) p_tcode,
      45(50) tstct-ttext.
      SKIP.
      IF NOT jtab[] IS INITIAL.
        WRITE:/(95) sy-uline.
        FORMAT COLOR COL_HEADING INTENSIFIED ON.
        WRITE:/1 sy-vline,
        2 'Exit Name',
        21 sy-vline ,
        22 'Description',
        95 sy-vline.
        WRITE:/(95) sy-uline.
        LOOP AT jtab.
          SELECT SINGLE * FROM modsapt
          WHERE sprsl = sy-langu AND
          name = jtab-obj_name.
          FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WRITE:/1 sy-vline,
          2 jtab-obj_name HOTSPOT ON,
          21 sy-vline ,
          22 modsapt-modtext,
          95 sy-vline.
        ENDLOOP.
        WRITE:/(95) sy-uline.
        DESCRIBE TABLE jtab.
        SKIP.
        FORMAT COLOR COL_TOTAL INTENSIFIED ON.
        WRITE:/ 'No of Exits:' , sy-tfill.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'No User Exit exists'.
      ENDIF.
    ENDFORM.                    "write_list
    Regards
    Kathirvel

  • Doubts in abap user exit and coustomer exit

    Hi every bady,
    Any one knows the different between user exit and coustomer exit please answer my question
    with regards,
    Sentha

    Hi,
    Difference between user exits & customer exits:
    User exit - A user exit is a three character code that instructs the system to access a program during system processing.
    SXX: S is for standard exits that are delivered by SAP.   XX represents the 2-digit exit number.
    UXX: U is for user exits that are defined by the user.  XX represents the 2-digit exit number
    Customer exit - The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
    The following links are also useful:
    User Exit Vs Customer Exit
    coding in user exit in program rffous_t
    User exits
    User Exits
    Refer this link
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975e643b111d1896f0000e8322d00/frameset.htm
    Check the following links.
    For customer exits
    http://help.sap.com/saphelp_erp2005/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/c8/1975d943b111d1896f0000e8322d00/frameset.htm
    Difference b/w BADI and user exits
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    User Exits
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    Regards,
    Rakesh

  • Doubt in MIGO user exit

    Hi all,
    my requirement is "whenever the user is performing the MIGO transaction and presses the post button,i have to populate all the values what ever the user is entering along with the MBLNR (material document number) field and also to populate somemore fields from 2 ztables and post it into IDOCs".
    For this i have found the userexit which is MBCF0002.
    Im getting all the fields values, what ever the user is entering but for the MBLNR (material document number) field its blank. The reason for this is , only after the successful movement of the material MBLNR field will be generated.
    so ,
    To be Reward all helpfull answers.
    Regards.
    Jay

    Hi,
    You need to use a user exit which is getting triggered only after material document no has been generated. You may use   INCLUDE ZXMBCU01 of EXIT_SAPLMBMB_001. Please note that this exit is getting executed whenever a material document is generated by the system. Hence you need to check your specific tran code+reason code. Please also note that if at all you need to debug this exit, just put /h in command box just before pressing post & then settings---->update debugging shystem should give you the message update debugging has been switched on. You need to ensure this since it's a toggle.
    I hope this helps,
    Regrads
    Raju Chitale

  • Hi doubt regarding user-exits

    hi,
       how will  transfer data in user-exits?
    thanku very much ........
    surya.

    Hi,
    Check this,
    https://forums.sdn.sap.com/click.jspa?searchID=5794703&messageID=3302505
    Thanks.

  • User exit ZXPADU02 - evaluating SY-UCOMM

    Hello everyone,
    I am trying to display an error message whenever someone tries to create a new work schedule rule (P0007-SCHKZ) in infotype 7. However, the error message should just come up when the user is trying to save his data.
    I am using user exit ZXPADU02 for this purpose. My problem is that SY-UCOMM does not seem to hold reliable data in this user exit, and SSCRFIELDS does not seem to be supported at all.
    My code looks like this (only the relevant code snippet in ZXPADU02):
    CASE INNNN-INFTY.
            WHEN '0007'.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
            EXPORTING PRELP = INNNN
            IMPORTING PNNNN = P0007.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
            EXPORTING PRELP = PSAVE
            IMPORTING PNNNN = P0007_ALT.
          IF P0007_ALT-SCHKZ <> P0007-SCHKZ
          AND IPSYST-MASSN IS INITIAL " do not warn within an info group of a personnel action
          AND SY-UCOMM = 'UPD'. " only warn when saving the data -> problem here <-
            MESSAGE 'Do not change IT7 directly or else.' TYPE 'I' DISPLAY LIKE 'E'.
            SHOW_DATA_AGAIN = 'X'.
          ENDIF.
    At first glance, the above works nicely.  But this is what happens when I test more thoroughly:
    I create a new period in IT 7, enter a P0007-SCHKZ other than the one that was previously valid, press F11. Some warnings appear (for different reasons), which I dismiss using the Enter key. Afterwards, the above code fires, the error message is being displayed, and I am thrown back into the data screen. So far, so good.
    Now I simply alter the value in the field "Weekly hours" (P0007-WOSTD) and press Enter (!). Again a series of warnings appear, including one that a dataset is going to be deleted (seeing that an IT 7-period with just the same date range already exists). I confirm that with Enter, and the data is being saved. The above code does not fire because I have only pressed Enter - but the data is being saved anyway!
    Looks like a pretty erroneous behavior on the side of the SAP system. The question is whether I have a chance to do something about it in the code.

    Mihir Nagar wrote:
    Dear Petersen,
    Your IF condition seems ok. I doubt on the message statement. Can you replace your message statement with type E.
    MESSAGE 'Do not change IT7 directly or else.' TYPE 'E'.
          ENDIF.
    Hope this works.
    Regards,
    Mihir.
    I did not expect this to work, because normally you use type 'E'-messages only in certain PAI-environments, but it does the job, thank you!
    make use of  field IOPER of the structure  PSYST to check on the infotype actions INS, MOD, COP, DEL...
    In this particular case I did not care, so I did not check that. IT 7 should only be maintained through personnel actions in our case.
    Next you can check with sy-ucomm field the different between "enter" and "save". With "save" sy-ucomm will be 'UPD'.
    That is what I did, but as I described, there was a situation when SY-UCOMM is SPACE, but the system saved anyway due to a prior save attempt.

Maybe you are looking for