Skip to Content
0
Former Member
Nov 19, 2012 at 06:21 PM

Making knvv-kvgr5 mandatory by showing popup message

300 Views

Hi Experts,

I got requirement that is,

At the time of Customer Save using transaction code XD01 or XD02 , a check has to be done to see if the field KNVV-KVGR5 is populated .

If KNVV-KVGR5 is Initial ,

then – Do Not Save and return to customer screen with a pop up message stating : “Please specify Customer Group5 field”.

I have USEREXIT for this, it is

: EXIT_SAPMF02D_001

and the include is ZXF04U01.

I wrote the code:

IF I_KNVV-kvgr5 is initial.

DATA: lv_id TYPE icon-id.

TABLES: icon.

SELECT SINGLE id

FROM icon

INTO lv_id

WHERE name = 'ICON_MESSAGE_WARNING'.

* ENDSELECT.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = 'Warning'

txt1 = lv_id

txt2 = 'message'

EXCEPTIONS

OTHERS = 1.

endif.

Avtually it is throwing popup message but it is saving the customer data.

My requirement is First thing is it has to throw a popup message then the customer data won't save.

please help me