Me23N-ME22N edit-view

ME23N işlem kodu içinde Edit düğmesine tıklanıldıktan sonra program ME22N olarak  çalışırken işlem kodu ME23N olarak kalır.
İşlem modunu tespit etmek için `MEPO_DOC_GET_TRANSACTION_STATE` fonksiyonunu kullanabilirsiniz.

 
types: begin of ty_transaction_state,
          EX_CHANGED  TYPE  XFELD,
          EX_TRTYP  LIKE  T160-TRTYP,
          EX_AKTYP  TYPE  CHAR1,
          EX_TCODE  LIKE  SY-TCODE,
          EX_UNCOMPLETE TYPE  MMPUR_BOOL,
          EX_UNCOMPLETETYPE TYPE  MEMORYTYPE,
          EX_PARKING_ALLOWED  TYPE  MMPUR_BOOL,
          EX_PARKING_ALLOWED_FINAL  TYPE  MMPUR_BOOL,
          EX_HOLDING_ALLOWED_PH TYPE  MMPUR_BOOL,
          EX_HOLDING_ALLOWED_FINAL_PH TYPE  MMPUR_BOOL,
          EX_PARKING_ALLOWED_PH TYPE  MMPUR_BOOL,
          EX_PARKING_ALLOWED_FINAL_PH TYPE  MMPUR_BOOL,
          EX_PARKHOLD_ACTIVE  TYPE  MMPUR_BOOL,
          EX_NEUDRUCK TYPE  MMPUR_BOOL,

  end of  ty_transaction_state.

data: gs_transaction_state type  ty_transaction_state.

MODULE status_0002 OUTPUT.
perform get_state.

       LOOP AT SCREEN.
         case screen-group1 .
           when `UB3` .
             case <fs_ekKo>-bsart.
               when `ZUB3`.
                 screen-invisible = 0.
                 screen-input = 0."me23n
                 case gs_transaction_state-EX_TRTYP.
                   when `A`
"me23n
                   when `H`. screen-input = 1. "me21n
                   when `V`. screen-input = 1. "me22n
                   when others.
                     screen-invisible = 1.
                 endcase.

               when others.
                 screen-invisible = 1.
                 screen-input = 0.
             endcase.

         endcase.

         MODIFY SCREEN.
       ENDLOOP.

ENDMODULE.     

form get_state.
  clear gs_transaction_state.

  call function `MEPO_DOC_GET_TRANSACTION_STATE`
   IMPORTING
     EX_CHANGED                        = gs_transaction_state-EX_CHANGED
     EX_TRTYP                          = gs_transaction_state-EX_TRTYP
     EX_AKTYP                          = gs_transaction_state-EX_AKTYP
     EX_TCODE                          = gs_transaction_state-EX_TCODE
     EX_UNCOMPLETE                     = gs_transaction_state-EX_UNCOMPLETE
     EX_UNCOMPLETETYPE                 = gs_transaction_state-EX_UNCOMPLETETYPE
     EX_PARKING_ALLOWED                = gs_transaction_state-EX_PARKING_ALLOWED
     EX_PARKING_ALLOWED_FINAL          = gs_transaction_state-EX_PARKING_ALLOWED_FINAL
     EX_HOLDING_ALLOWED_PH             = gs_transaction_state-EX_HOLDING_ALLOWED_PH
     EX_HOLDING_ALLOWED_FINAL_PH       = gs_transaction_state-EX_HOLDING_ALLOWED_FINAL_PH
     EX_PARKING_ALLOWED_PH             = gs_transaction_state-EX_PARKING_ALLOWED_PH
     EX_PARKING_ALLOWED_FINAL_PH       = gs_transaction_state-EX_PARKING_ALLOWED_FINAL_PH
     EX_PARKHOLD_ACTIVE                = gs_transaction_state-EX_PARKHOLD_ACTIVE
     EX_NEUDRUCK                       = gs_transaction_state-EX_NEUDRUCK
            .


endform.
SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; }.L0S52 { color: #0000FF; }