Skip to end of metadata
Go to start of metadata

1) Go to the program LFDCBFC0.

2) Go to Edità Enhancement Operations à Show Implicit Enhancement Options.  

3) Go to Implicit enhancement option at  beginning of the form ‘CHECK_DOCUMENT_TYPE’ andRight clck à Enhancement Implementation à Create. 

4) It will ask new enhancement type declare that

5) Here keep your code like this

DATA : lv_message TYPE string .

IF sy-tcode EQ 'MIRO' or

    sy-tcode EQ 'MIR7'.

    IF bkpf-blart NE 'RE' AND

        bkpf-blart NE 'AN'.

          CONCATENATE 'Docu "' bkpf-blart '" is not allowed for this ' INTO    lv_message .

            MESSAGE lv_message TYPE 'E' .