Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Making knvv-kvgr5 mandatory by showing popup message

Former Member
0 Kudos
458

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

9 REPLIES 9

basarozgur_kahraman
Contributor
0 Kudos
158

Hi Vinod,

try this;

CALL FUNCTION 'POPUP_DISPLAY_MESSAGE'

       EXPORTING

         TITEL         = 'Error'

         MSGID         = 'MILL_SD'

         MSGTY         = 'E'

         MSGNO         = 164

         MSGV1         = 'Please specify Customer Group5 field'.

or

MESSAGE ID 'MILL_SD' TYPE 'E' NUMBER '164' DISPLAY LIKE 'I' WITH 'Please specify Customer Group5 field'.

.


0 Kudos
158

Hi Kahraman,

Thanks for the reply , Actually the function module you suggested is throwing a popup message, but the problem here is if I press enter the changes are saving. But my requirement is it should throw a popup plus it does not save the customer data it should return to customer screen(XD02 or XD01).

please help me....

0 Kudos
158

hi Kahraman,

If i am displaying the message as status bar message it is not displaying the message fully. Actual message I need to display is

"Please specify Print Indicator in Sales Area Data / Additional Data / Customer Group5 field"

but it is displaying "

Please specify Print Indicator in Sales Area Data ".

So is there any option to increase message length ????

0 Kudos
158

Refer this blog to increase message size

There was one more blog which was related to this. Unfortunately, I lost the link. Did you try the badi option ?

0 Kudos
158

Hi Vinod,

you can do like this also

  MESSAGE e000(0k) WITH

'Please specify Print Indicator in Sales Area Data'(001)' Additional Data'(002)'Customer Group5 field'(003).

Thanks,

Lavanya.

0 Kudos
158

HI Lavanya,

Thank you for the reply.. It is working fine. Now Functional's asking some more enhancement that is

after displaying the Error message if they press ENTER it should go to CUSTOMER Screen (XD02 & XD01). So Can I call screen here?.....

0 Kudos
158

In the respective badi I mentioned, you have the option to navigate to the required screen with the error message, In customer exit you do not have such option to navigate to screen. Convince your guys to use badi.

kesavadas_thekkillath
Active Contributor
158

It is better to implement like below in badi CUSTOMER_ADD_DATA in method CHECK_ALL_DATA

check E_MSGID is initial.

IF S_KNVV-kvgr5 is initial.

e_msgid = 'ZMSG'.

e_dynnr = '7000'

E_FCODE = 'XYZ'.

endif.

Read the method documentation please.

0 Kudos
158

HI Kesavadas...

I didn't tried the BADI option because they are asking me to implement in UserExit's ..