Skip to Content
avatar image
Former Member

User-exit in ME22N: how can I tell mode (change/display)

Hi All,

I have added a new field via Screen-exit to ME22N and it's working fine.

The problem I have is that ME22N can be used in Display mode and in such mode I would like to disable my field.

How can I tell the mode?

I searched the forum and found few threads, but none were answered.

Regards,

Ayal Telem.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 29, 2011 at 01:53 PM

    Thanks for everyone, but you missed the point.

    I know how to code for ME23N. This is not the problem.

    The problem is the duality of ME22n, which basically used to Change a document, but also have a Display mode.

    How can I tell at which mode am I when ME22n is called or refreshed (e.g. after you save your work in this t-code, it will automatically switch to display mode).

    Regards,

    Ayal Telem.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Nabheet Madan

      Dear Nabheet,

      SE93 was just a quick example you can test.

      More Production-like scenario will be when a process is using "CALL TRANSACTION" to access ME22N.

      Regards,

      Ayal.

  • avatar image
    Former Member
    Nov 29, 2011 at 01:19 PM

    Hi,

    Use below code inside your code where you are setting field properties of your custom fields.

    IMPORT i_trtyp FROM MEMORY ID 'change/display'.
        IF sy-subrc = 0.
    
    
          CASE i_trtyp.
    * Display
            WHEN 'A'.
              screen-input = 0.
    * Change
            WHEN 'V'.
              screen-input = 1.
          ENDCASE.
          MODIFY SCREEN.
        ENDIF.

    Field i_trtyp contain value of idsplay/change.

    If i_trtyp = 'V' means ME22n screen in change mode.

    If i_trtyp = 'A' means ME22n screen in Display mode.

    BR,

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 29, 2011 at 01:23 PM

    In the PBO of Screen 0111 of program SAPLXM06 check the sy-tcode.

    If it is ME23N, disable the EKPO_CI-ZField.

     " Program SAPLXM06 and Screen 0111
    LOOP AT SCREEN.
      IF screen-name EQ 'EKPO_CI-ZFIELD' AND 
         sy-tcode EQ 'ME23N'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

    PS: the above is applicable for Z field in PO 'Item Level', if it is in header level screen number will be 0101

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 30, 2011 at 08:56 AM

    Hi,

    If you have used MM06E005 then in that in function module we have parameter as I_TRTYP its transaction type. You can check its value. Else please let us know which exit have you used.

    thanks

    Nabheet

    Add comment
    10|10000 characters needed characters exceeded