Skip to Content
0
Apr 18, 2008 at 04:43 PM

BADI Implementation Error Message Problem

1273 Views

Dear Sir,

I implemented following BADI which is being called in ME21n transaction . The Syntax is :

method IF_EX_ME_PURCHDOC_POSTED~POSTED.

DATA: wa_ekpo like line of IM_EKPO .

DATA: wa_doctype TYPE EKKO-BSART.

if IM_EKPO[] is not initial .

LOOP AT IM_EKPO into wa_ekpo .

if im_ekko-bsart EQ 'ZIMP' .

SEARCH wa_ekpo-MATNR FOR '-I' .

IF SY-FDPOS EQ 0 .

IF wa_ekpo-BWTAR is INITIAL .

MESSAGE ID 'XXX' TYPE 'E' NUMBER '000' WITH 'Valuation Type'.

ENDIF.

ENDIF.

else.

SEARCH wa_ekpo-MATNR FOR '-I' .

IF SY-FDPOS NE 0 .

IF wa_ekpo-BWTAR is INITIAL .

MESSAGE ID 'XXX' TYPE 'E' NUMBER '000' WITH 'Valuation Type'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

endif.

endmethod.

My problem is that when MESSAGE statement get executed , then a dialog box for the error message appear and subsequently on pressing enter key, the screen get cleared and all input values get lost .

Instead of complete screen getting cleared , it should retain the values so that user can make the necessary correction in the input .

Kindly help me , as how to resolve the problem .

Regards

B Mittal