Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

need user exit or BADI name

Former Member
0 Kudos

Hi

I have the below requirement.

In the transaction Me51n, in the item data->valuation tab

when the valuation price is greater than 5000.then

it should display an error message 'user should not enter mothan price Rs 5000'.

Please provide me the user exit or Badi name to implement the code.

6 REPLIES 6

Former Member
0 Kudos

One user-exit and 3 badis available for this ME51n

User-Exits:-

MEREQ001 Customers' Own Data in Purchase Requisition

Badi's

ME_COMMITMNT_PARKING BAdI for Redefining Commitment Interface When Parking

ME_MEREQ_PARKING BAdI Purchase Requisition: "Hold"

ME_REQ_HEADER_TEXT Copy Header Text: Enjoy Purchase Requisition

0 Kudos

Hi ,

I have the below requirement.

In the transaction Me51n, in the item data->valuation tab

when the valuation price is greater than 5000.then

it should display an error message 'user should not enter mothan price Rs 5000'.

Please provide me the user exit or Badi name to implement the code.

i did not find any exporting parameter like structure EBAN in the User Exits available.Please suggest me how to implement the code.........if possible please provide me the code to implement........

Edited by: pilotsahu on May 5, 2009 12:34 PM

Edited by: pilotsahu on May 5, 2009 12:35 PM

0 Kudos

Hi

U can try to use the BADI ME_PROCESS_REQ_CUST, method PROCESS_ITEM

Max

Former Member
0 Kudos

Hi,

Use this code

it will tel u all the exits related to ur transaction.

Just go to se38 and copy this code there, activate and execute


*&---------------------------------------------------------------------*
*& Report  ZTEST_MANISH
*& Program to find exits for a particular transaction
*&---------------------------------------------------------------------*

REPORT ZTEST_MANISH NO STANDARD PAGE HEADING.
TABLES : TSTC, TADIR, MODSAPT, MODACT, TRDIR, TFDIR, ENLFDIR.
TABLES : TSTCT.
DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA : FIELD1(30).
DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
PARAMETERS : P_TCODE LIKE TSTC-TCODE OBLIGATORY.

SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
IF SY-SUBRC EQ 0.
  SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
                   AND OBJECT = 'PROG'
                   AND OBJ_NAME = TSTC-PGMNA.
  MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
  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.

      MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
  ENDIF.
  SELECT * FROM TADIR INTO TABLE JTAB
                WHERE PGMID = 'R3TR'
                  AND OBJECT = 'SMOD'
                  AND DEVCLASS = V_DEVCLASS.
  SELECT SINGLE * FROM TSTCT WHERE SPRSL EQ SY-LANGU AND
                                   TCODE EQ P_TCODE.
  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.
ELSE.
  FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
  WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.

AT LINE-SELECTION.
  GET CURSOR FIELD FIELD1.
  CHECK FIELD1(4) EQ 'JTAB'.
  SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
  CALL TRANSACTION 'SMOD' AND SKIP FIRST   SCREEN.

Or u can use the following steps:

1. Open transaction SE24.

2. Now open the object CL_EXITHANDLER in display mode.

3. Go to the method tab and double click on the method GET_INSTANCE.

4. Put a break point on cl_exithandler=>get_class_name_by_interface.

5. Now execute the transaction you want to find EXIT for, it will take you to the above method.

6. Write EXIT_HANDLER in fieldnames and hit enter, it will tell you the EXIT used for your transaction.

7. Hit F8 and it will tell you all the EXITu2019s for your transaction.

Regards,

Manish

0 Kudos

Hi manish,

I found one BADI i.e ME_PROCESS_REQ_CUST.in this one method is there i.e PROCESS_ITEM.

But how to implement the code can u please suggest me bacz i never faced this type of scenario..........

0 Kudos

Hi

U need to create an implementation for that BADI by tra SE18 and then implement the abap code in the method PROCESS_ITEM.

This method has IM_ITEM as import parameter, it's based on interface IF_PURCHASE_REQUISITION_ITEM: u can get the method GET_DATA

method PROCESS_ITEM.
  DATA: W_ITEM TYPE MEREQ_ITEM.
  
* Get item data
  CALL METHOD IM_ITEM->GET_DATA
      RECEIVING 
            RE_DATA = W_ITEM.

* Check item data
  IF W_ITEM-<FIELD> = .......
  ENDIF.
endmethod.

Max