USER-EXIT,   EXIT_SAPLEBND_002 , ZXM06U22

I am using the Function module EXIT_SAPLEBND_002, I have to write the code into INCLUDE ZXM06U22.  There i am fetching release group and release strategy, after that I have to  populate those fields while creating a PO.
Here in EXIT_SAPLEBND_002 there are no export parameters for FRGGR, FRGSX, FRGZU, FRGRL, FRGKZ, how can I export these values out ?
I m trying to give Info message in the include but it is not triggering.
Is there any separate way to give info message
I have seen by searching in SDN, but i did'nt get exact solution.
Thanks,
Ajay

First check if this is the correct exit for you.
If you want to access variables or the main program, outside the exit you have to use the assign statement.
See example:
http://www.sapdev.co.uk/enhance/enhance_fsymbol.htm
And lastly, You have to create a project in CMOD for your exit and activate the project.
Then only the exit will work.
Regards,
Ravvi

Similar Messages

  • User exit EXIT_SAPLEBND_002,

    HI,
    in the include ZXM06U22.
    iam checking the payment terms of the PO with the vendor payment terms,
    if they are different,
    while creating the PO i want to give error, and doesn't allow the PO to save.
    but,
    when i am trying this way, it's not meeting my requirement.
    1) IF L_EKKO_ZTERM <> L_LFB1_ZTERM.
              MESSAGE A398(00) WITH TEXT-005.
            ENDIF.
    pl. help.
    thank you

    HI,
    the user exit i am trying is wrong, later i found that the exit EXIT_SAPMM06E_012 is triggered, before saving the PO.
    so the validations for the payment terms (ie) po payment terms and vendor payment terms  are checked. if not equall through the error.
    it wont  allow to save the PO.
    regards
    harikumar.p

  • EXIT_SAPLEBND_002 of M06E0004 User exit to Reset Release Status if PO

    Hi All,
    I have implemented a user-exit EXIT_SAPLEBND_002 of M06E0004, as advised, which can reset/cancel the release status of a certain PO document when a certain field has been changed aside from the quantity and price fields.
    I would just like to ask if how woud the exit know if something in the document has been changed by the user if he goes to me22n? Basically, the requirement was that everytime a user changes the partially released PO in the header data and other fields aside from price and quantity, the release status should be reset to start all over again.
    I have this code, but this should only be ran if a partially released PO has been changed in most of its fields (header/item).
    DATA: wa_ekpo TYPE ekpo,
          wa_bekpo TYPE ekpo,
          lv_frgke TYPE ekko-frgke,
          tx_ekko TYPE char200,
          tx_ekbe TYPE char200,
          lv_frgzu TYPE ekko-frgzu.
    FIELD-SYMBOLS: <fs_ekko>  TYPE ekko.
    tx_ekko = '(SAPLMEPO)ekko'.
    ASSIGN (tx_ekko) TO <fs_ekko>.
    If <fs_ekko>-frgke = '1' AND
       <fs_ekko>-frgzu IS NOT INITIAL.
    <fs_ekko>-frgke = '2'.
    <fs_ekko>-frgzu = space.
    ENDIF.
    UNASSIGN <fs_ekko>.
    Kindly send some recommendations.
    Regards,
    RE

    Add this code in user exit exit_saplbend_002 .
    Code=> This code use to change release status on PO amount decrease and increase.
    ================================
    **** Start of changes for Release status change on PO amount decrease .
    E_CEKKO = I_CEKKO .
    DATA : wa_bekpo type BEKPO,
           wa_ekpo TYPE ekpo,
           WA_CEKKO TYPE CEKKO,
           w_reset(1) TYPE c VALUE 'X'.
    if sy-tcode eq 'ME22N' OR sy-tcode eq 'ME22'.
    WA_CEKKO = I_CEKKO .
    IMPORT WA_CEKKO = WA_CEKKO FROM MEMORY ID 'ZREL_COST'.
    IF SY-SUBRC NE 0.
      EXPORT WA_CEKKO = WA_CEKKO TO MEMORY ID 'ZREL_COST'.
    ENDIF.
    ENDIF.
    if ( sy-tcode eq 'ME22N' OR sy-tcode eq 'ME22' )
      and sy-ucomm eq 'MESAVE' or sy-ucomm eq 'MECHECKDOC'.
    *Import/Export the origninal values.
    *Check if the limit is passed.
    LOOP AT it_bekpo INTO wa_bekpo .
    SELECT SINGLE NETWR FROM ekpo INTO wa_ekpo-netwr WHERE ebeln eq wa_bekpo-ebeln and ebelp eq wa_bekpo-ebelp.
    IF SY-SUBRC EQ 0.
    IF wa_bekpo-netwr < wa_ekpo-netwr.
        w_reset = 'X'.
      endif.
    ENDIF.
    ENDLOOP.
    *IF limit passed - reset the value to high limit beyond tolerance.
    IF w_reset = 'X'.
    E_CEKKO-GNETW = WA_CEKKO-GNETW + 1000000.
    ENDIF.
    endif.
    **** End of changes for Release status change on PO amount decrease .

  • Modify Std. code to get value for User Exit.

    I am executing release strategry at user exit EXIT_SAPLEBND_002  ( Exit Name M06E0004 ), for the field ( USRN1)
    This has got user program ZXM06U22 in it. In this exit I get values from I_CEKKO , IT_BEKPO, IT_BEKET, IT_EKKNU
    and I have to pass the PO value from these structures to E_CEKKO-USRN1   ( This field has set in SPRO setting ) .
    I get the PO value as per standard calculation in the field IT_BEKPO-EFFWR , I also get a value in I_CEKKO-GNETW. However not one of both these values satisfy any one of my conditions. My document condition is defined in SPRO as ZVPA and values against it is calculated considering Taxes On PO. The fields EFFWR or GNETW does not include taxes. And my release startegy should get executed after considering the amount with taxes.
    After debugging a lot I have found that the PO_AMOUNT can be obtained from the Internal Table TKOMV. In this it is stored at TKOMV-KAWRT. I can get the TKOMV values at the point where this user-exit is called.
    i.e. in program MM06EF0S_STRATEGIE_CEKKO    in the last you can see the call to user exit wriiten as below
        CALL FUNCTION 'EXIT_SAPLEBND_002'
          EXPORTING
            i_cekko  = cekko
            it_bekpo = pot[]
            it_beket = ett[]
            it_ekknu = knt[]
          IMPORTING
            e_cekko  = cekko.
    If I put the debugger on  CALL FUNCTION 'EXIT_SAPLEBND_002 and go to TABLES tab and enter there 'TKOMV'
    I can get the table and it's values. However If I press F5 then I go inside my exit code i.e. ZXM06U22. But Here I Don't Get access to the internal table TKOMV , which is  accessible from main calling program MM06EF0S_STRATEGIE_CEKKO.
    My job can be done if I get value from TKOMV inside the code of ZXM06U22. However to get that code in ZXM06U22 what right now I can do is to get the access key of MM06EF0S_STRATEGIE_CEKKO and write code before exit Call and pass the ZVPA from TKOMV there. However many people here advised me not to do that since it is a STANDARD CODE.
    So I would like to know your suggestion in this regard.
    Amol

    Hi All
    Thanks for your quick replies. I wrote code below in my exit. But I am getting Compilation error at following line ( In Bold )
    DATA: l_name(50).
    DATA: my_tkomv TYPE TABLE OF komv.
    <b>FIELD-SYMBOLS: <tkomv> type standard table of komv.</b>l_name = '(SAPMMM06E)TKOMV[]'.
    ASSIGN (l_name) TO <tkomv>.
    my_tkomv[] = <tkomv>.
    The error is below
         "," expected after "TABLE".          
    I don't know whether TYPE TABLE OF is correct or not.
    I will be glad If I get some further help.
    Amol

  • ME28 user exit - sy-ucomm not available

    Hi experts,
    I have a requirement to check sy-ucomm in the user exit EXIT_SAPLEBND_002 which is triggered by transaction ME28 - convert a planned order to purchase requisition. Immediately after pressing the release button for the purchase document the SY-UCOMM value is '%_GC 102 2'.
    When the program control reaches the user-exit, SY-UCOMM is already cleared. Analysing the flow shows it is cleared by the method,
    CL_GUI_CFW=>DISPATCH. This is totally the ALV way of handling things. The ALV control passes on to call the function module BAPI_PO_RELEASE which inturn calls the user exit.
    The question is?? How to get the SY_UCOMM in the user exit. Has any one has ever experienced this before. Your answers are much appreciated.

    Ok Guys
    Sorry for my ignorance.But i think that i don't udesrtand correctly .sorry.
    1-you go to ME28 and do your process (click)
    2-this process pass by exit .
    3-I dont understand the ALV  in this case.
    Can you send images of screens with process ?
    I think maybe you could use assign but i need know more about it.
    thanks and sorry again.

  • Updating EKKO within user exit ZXM06U22 (EXIT_SAPLEBND_002)

    I am trying to update EKKO table (2 new fields that I added to CI_EKKODB) in user exit ZXM06U22 (EXIT_SAPLEBND_002).  I am populating E_CEKKO (the 2 new fields) with this information, but for some reason, it is not saving to the database (EKKO table) after I save my ME21N or ME22N transaction.  The very first thing i do in this user exit is:
    move-corresponding I_CEKKO to e_cekko.
    Does anyone have any ideas for other code that I need to add to this user exit to get these new field values in EKKO to save to database table?
    Thanks!
    Sarah.

    You should use SMOD enhancement MM06E005 to do this
    EXIT_SAPMM06E_006, EXIT_SAPMM06E_007, EXIT_SAPMM06E_008

  • EXIT_SAPLEBND_002 -- user exit for release strategy

    Hi,
    This is regarding help on user exit for release strategy, ref: note no. 365604, however after going through all the config part given in the given note we activate the fm in cmod.... but after activating the release tab goes off from  me29n.
    That is after you activate in cmod and then if u create po and go to me29n the relese tab is not there.
    if u deactivate and create po and then relese the release tab in me29 would appear.
    All we are trying is that the po in me29n should be open to release again if we change the delivery date. However what coding and how is still a second step , first is as soon as the exit is active the tab goes off.
    New to user exit . plz help.

    Hi Again,
    I guess I have solved the issue temporarily, however Am not sure if this is the best which cld be doen to the issue.
    I didnt make any new characteristics in ct04, for the delivery dats since i didn't want to restrict the delivery date. All I did i yje coding below in the exit :
      DATA wa_eket TYPE LINE OF mmpur_beket.
      DATA wa_eket1 TYPE LINE OF mmpur_beket.
      data: c type i.
       data: p type i.
      break1.
      break2.
      e_cekko   = i_cekko.
    loop at it_beket into wa_eket . " for comparing previous and the current del date
      e_cekko-usrc1 = wa_eket-eindt.
      SELECT SINGLE * FROM eket INTO wa_eket1 WHERE ebeln = wa_eket-ebeln
      AND ebelp = wa_eket-ebelp.
      if wa_eket1-eindt <> wa_eket-eindt.
      import c from memory id 'CID'.
      c = c + 1.
      clear p.
      p = c mod 2.
      if p is not initial.             " adding 0.01 to the characteristic value for p.o amt.
      e_cekko-GNETW = e_cekko-GNETW + '0.01'.
      else.
      e_cekko-GNETW = e_cekko-GNETW - '0.01'.
      export c to memory id 'CID'.
      endif.
      endif.
      endloop.
    The logic I tried using is since the relese gets reset incase of p.o amnt and hence indirectly po amnt so i changed the value of p.o value by 0.01 incase of change in delivery date. cekok-gnetw doesnt reflect anywhere in the p.o as amnt, I guess its for defing range for relese stragey's amont in ct04 characteristics.
    However anything better incase u know plz let me know, or do u think this can cause any problems later....new to exits.
    Rgds,
    Anu.

  • User exit in PO

    Dear friends,
    I need to do user exit in transaction ME21N and ME22N in which I need to validate material group with that of material group in services tab for BSART = 'DDS'. Its a table control and I need to validate as soon as the user presses enter. Since the enter function code does not have any function code in ME21N. Can anybody suggest how to show the error as soon as somebody enters service whose material group does not match. I am attaching my code in EXIT_SAPLEBND_002. ENHANCEMENT IS M06E0004.
    IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N'
    AND ( SY-UCOMM = 'MESAVE' or SY-UCOMM = 'MECHECKDOC') .
    IF I_CEKKO-BSART = 'DDS'.
    LOOP AT IT_BEKPO INTO IT_EKPO1 WHERE PSTYP = '9'.
    SELECT SINGLE WGBEZ FROM T023T INTO T023T-WGBEZ WHERE MATKL = IT_EKPO1-MATKL.
    SELECT SRVPOS FROM ML_ESLL INTO ML_ESLL-SRVPOS WHERE EBELN = IT_EKPO1-EBELN
                                                     AND EBELP = IT_EKPO1-EBELP.
    CHECK:  NOT ML_ESLL-SRVPOS IS INITIAL .
    *IF  SY-UCOMM = 'MECHECKDOC' .
    SELECT SINGLE MATKL FROM ASMD INTO ASMD-MATKL WHERE ASNUM = ML_ESLL-SRVPOS.
    CHECK: ASMD-MATKL NE IT_EKPO1-MATKL.
    *MESSAGE 'MATERIAL GROUPS DON''T MATCH' TYPE 'E'.
    SET CURSOR FIELD 'ESLL-SRVPOS' LINE SY-STEPL.
    MESSAGE E000(ZZ) WITH ML_ESLL-SRVPOS T023T-WGBEZ .
    *ENDIF.
    *ENDIF.
    CLEAR: ASMD-MATKL.
    *ENDIF.
    CLEAR ML_ESLL-SRVPOS.
    ENDSELECT.
    CLEAR T023T-WGBEZ.
    ENDLOOP.
    ENDIF.
    ENDIF.
    I need to show error message in the line only in table line.
    Regards.
    Debopriyo Mallick

    Hey Deb,
    You are right .. there is no function code assign to enter . but when you press enter it will trigger PAI event. and you always want to validate valid material group..
    obviously in any case what ever it may be we can't go ahead with invalid data.
    So what you can do is just remove ( SY-UCOMM = 'MESAVE' or SY-UCOMM = 'MECHECKDOC')  condition from IF. Thus if fields is not initial it should contain valid value else error.
    Hope this helps you.
    Enjoy SAP.
    Pankaj SIngh

  • PO Release strategy User Exit  if value is Reduced

    Hi,
    I need to write a user exit to trigger the release strategy in Purchase order even if the value is "Reduced".
    As you may be knowing releases will only be triggered if the value is increased according to standard SAP functionality.
    So to trigger the release stratgey even if the value of PO is reduced some one suggested me user exit "M06E0004" Program :ZXM06U22.I guess we need to define a new characteristic called "URSC1".But cannot make out how really i can achieve this.
    Can any one please guide,if you have worked on it earlier.
    Thanks.

    Gentlemen,
    Any Ideas....!!!

  • User exit for route determination in Stock trasnport order

    Hi All,
    Can somebody help me with a user exit that I can use for route determination in the Stock transport order.
    Kind Regards
    Chakradhar

    Exit to be used is   EXIT_SAPLEBND_002. Enhancement M06E0004.
    DATA it_ekpo TYPE LINE OF mmpur_bekpo .
    To have controls in system for Standard Cost Estimation under two conditions if SCE is not run then,
    1)      System will not allow creating Process Order (COR1).
    2)      System will not allow Post Goods Issue (VL02N).
    Till date we do not have any control of SCE while creating Stock Transport Order.
    Now we have another control for SCE, that is
    3)      Henceforth system will not allow creating STO (ME21N).
    IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N'.
      IF i_cekko-bsart = 'UB'.
        LOOP AT it_bekpo INTO it_ekpo.
          SELECT SINGLE mtart FROM mara INTO mara-mtart WHERE matnr = it_ekpo-matnr .
          IF mara-mtart = 'IFIG' OR mara-mtart = 'ISFG'.
            SELECT SINGLE * FROM mbew WHERE matnr EQ it_ekpo-matnr
                                                AND bwkey EQ it_ekpo-werks.
            IF mbew-vprsv = 'S'.
              SELECT SINGLE * FROM mbew WHERE matnr EQ it_ekpo-matnr
                                              AND bwkey EQ it_ekpo-werks.
              IF mbew-stprs > '0.00'.
                CONTINUE.
              ELSE.
                MESSAGE e004(zpp) WITH it_ekpo-matnr it_ekpo-werks.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Regards,
    Mallick

  • Code Review of User Exits with Code Inspector

    Hi,
        We are using Code Inspector(Tcode - SCI) for checking the quality of ABAP Codes. It is working fine for all custom programs. But when we are checking the code of User Exits i: e MV50AFZ1 or ZXM06U22 then it checks the std SAP program (SAPMV50A) or (SAPLXM06) for these exits in place of checking that particular Exit only . How the customer/User Exits can be checked using Code Inspector. Pls advice.

    Hi there!
    Today, I stumbled over the same problem: Defining an Include for user exits leads to a check of the surrounding function group from SAP which I don't want to correct at all.
    Is there a nice an elegant way of filtering out the SAP modules from checking? If not, the only way to get around this seems to be building an own implementation of the Code Inspector integration into CTS.
    Thanks, Markus

  • Problem after implementing exit EXIT_SAPLEBND_002

    Hello Experts,
    I had implemented the exit EXIT_SAPLEBND_002 for triggering release strategy whenever user make any changes in Purchase order.
    Now, the problem is release strategy and versions management are not getting activated at the same time.
    If I am activating version management then release strategy getting deactivated automatically.
    How should I correct it. Please help.

    Add this code in user exit exit_saplbend_002 .
    Code=> This code use to change release status on PO amount decrease and increase.
    ================================
    **** Start of changes for Release status change on PO amount decrease .
    E_CEKKO = I_CEKKO .
    DATA : wa_bekpo type BEKPO,
           wa_ekpo TYPE ekpo,
           WA_CEKKO TYPE CEKKO,
           w_reset(1) TYPE c VALUE 'X'.
    if sy-tcode eq 'ME22N' OR sy-tcode eq 'ME22'.
    WA_CEKKO = I_CEKKO .
    IMPORT WA_CEKKO = WA_CEKKO FROM MEMORY ID 'ZREL_COST'.
    IF SY-SUBRC NE 0.
      EXPORT WA_CEKKO = WA_CEKKO TO MEMORY ID 'ZREL_COST'.
    ENDIF.
    ENDIF.
    if ( sy-tcode eq 'ME22N' OR sy-tcode eq 'ME22' )
      and sy-ucomm eq 'MESAVE' or sy-ucomm eq 'MECHECKDOC'.
    *Import/Export the origninal values.
    *Check if the limit is passed.
    LOOP AT it_bekpo INTO wa_bekpo .
    SELECT SINGLE NETWR FROM ekpo INTO wa_ekpo-netwr WHERE ebeln eq wa_bekpo-ebeln and ebelp eq wa_bekpo-ebelp.
    IF SY-SUBRC EQ 0.
    IF wa_bekpo-netwr < wa_ekpo-netwr.
        w_reset = 'X'.
      endif.
    ENDIF.
    ENDLOOP.
    *IF limit passed - reset the value to high limit beyond tolerance.
    IF w_reset = 'X'.
    E_CEKKO-GNETW = WA_CEKKO-GNETW + 1000000.
    ENDIF.
    endif.
    **** End of changes for Release status change on PO amount decrease .

  • Enhancement M06E0004, EXIT_SAPLEBND_002, ZXM06U22

    Hi Experts,
    I am writing some logic while PO creation in the user exist ZXM06U22.
    As per my understanding this user exit should trigger for all the company code but its getting triggere for only few company code, I am not able to understand why its not getting trigger for all the company code.
    its already in use for some other functionality.
    Please suggest.
    Sagar.

    Hi Sagar,
    The Enhancement M06E0004 is basically used to change the communication structure, which can inturn be used to trigger the release strategy if you want to calculate few values in runtime.
    If the exit is not getting triggered for few company codes i would suggest you to check the functional configuration steps where characteristics, groups, codes, strategies are defined.. may be there are chances that few company codes are not configured for release strategy.
    Regards,
    deepak.

  • User Exit for ME21

    Hi Gurus,
    I am new to User Exits. I have one requirement.
    In T Code ME21N if the Document type (BSART) is P373 and Vender number (SUPERFIELD) is ‘70370’, then only purchase order should be created otherwise it should raise error message.
    To do this user exit i have got the User exit name and enhancement name. 
    User Exit Name : EXIT_SAPLEBND_002
    Enhancement Name : M06E0004
    Version 4.7
    The user exit mentioned above has already been implemented. I need to add the code to meet the above mentioned requirement now.
    Is it possible to add to the already existing user exit. If YES, please explain the procedure.
    The two fields mentioned above are from structures. How do I find out the actual tables for these two fields. The fields BSART, SUPERFIELD are from structure MEPO_TOPLINE.
    Thanks in advance
    and
    Points for every useful answer.
    Regards

    Hi Raj,
    To add code in the existing implementation of exist, you have to write code in that specific include of that function module.
    Otherwise you can create another project and assign that exit; but at a time one implementation can be active, so you have to first deactivate the previous implementaion before activating it (here fear of losing old implemented logic remains!!!)
    And for your information vendor number is LIFNR.
    you will get these data from I_CEKKO structure.
    Hope it will solve ur problem.
    Regards
    Krishnendu

  • User exit deactivation

    hi,
         I need to decativate user exit.(M06E0004).I found out its in package ME.As I am new to user exit.Please tell how to deactivate the particular user exit.
    Regards ,
    Bathri.

    Hi ,
    Go to the transaction SMOD and in the Enhancement field give the name M06E0004 .
    Then Hit the Test button .
    Now you will get the the Exit EXIT_SAPLEBND_002 .
    Now Click the Deactive button  in the Application tool bar.
    The deactivation will be done .
    Regards
    Pinaki

Maybe you are looking for

  • Getting Combobox values from a mySQL database

    Hello, I have a combobox like this: <mx:FormItem label="Avancement:" id="avancement_form"> <mx:ComboBox id="avancementCol"> <mx:dataProvider> <mx:Array> <mx:Object label="Livraison ce jour" /> <mx:Object label="Livraison cette semaine"/> <mx:Object l

  • How to get ios8 on iphone 4s

    i can not download ios8 on my iphone4s

  • Zen Vision:M = iP

    I just noticed, the connection for computer hookup on the Creative Zen Vision:M is the same as the iPod's hookup. I plugged a family member's iPod USB cable into my Zen Vision:M, and it had a perfect fit. This leads me to think... Would iPod sounddoc

  • I need to use RTF on forms and reports

    I need an RTF (Rich Text Format) text field, in wich I can copy and paste from other programs (like word), save on a db, and then print using a report. How can I do, please?

  • Call one TF in other TF

    Hi, I have two taskflows... in each of the taskflow i have a default activity as home page when i am running independently these taskflows initially home page gets displayed But when i am calling the second taskflow in the first taskflow i want the h