Application Development and Automation 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: 
Read only

Error Messages (box) at selection screen

Former Member
0 Likes
5,895

Hai, i need your help, i want to display error message (box) in selection screen process.


More detail, i have one field (select-option) where we have to fill it. If we haven't fill it yet, it will show error message (box) at screen.


Anybody know?

13 REPLIES 13
Read only

Former Member
0 Likes
4,819

OBLIGATORY keyword in addition to SELECT-OPTIONS is sufficient for blank value check.

DATA a TYPE char10.
SELECT-OPTIONS s_a FOR a OBLIGATORY.

Below code can be used if you still want error popup.

DATA a TYPE char10.
SELECT-OPTIONS s_a FOR a.

AT SELECTION-SCREEN ON s_a.
  MESSAGE 'message test' TYPE 'E' DISPLAY LIKE 'A'.

SAP GUI settings can be changed to show error message as popup by default. In that case, "DISPLAY LIKE 'A'" won't be necessary.

Read only

0 Likes
4,819

Hi Manish,

If i assume correctly this setting is specific to single SAP GUI and if this is to be worked all over the system in each and every system this needs to be changed even in the client system isn't it?

Please correct me if I am wrong.

thanks,

Aswath.

Read only

0 Likes
4,819

Yes, the 3rd option, SAP GUI setting is client specific. Only advantage is that existing programs need not be changed.

An end user once asked me if it is possible to get popup instead of status message, and he was happy with SAP GUI setting.

Read only

jogeswararao_kavala
Active Contributor
0 Likes
4,819

For the same purpose I've used this code:

resulting the following screen, when trying to execute with blank fields.

(This is due to some constraints of using 'Obligatory' syntax')

You can apply this by modifying suitably to your requirements.

Jogeswara Rao K

Read only

Former Member
0 Likes
4,819

Thanks Manish, it works!.

Thanks for all.

God bless

Read only

arindam_m
Active Contributor
0 Likes
4,819

Hi,

Check the link below will give you a very good idea on usage of POP UP in ABAP.. Apart from that the rest would be the GUI option but depends on what you are looking for program change or GUI level control.

http://wiki.sdn.sap.com/wiki/display/ABAP/Different+Pop_Ups+in+ABAP

Cheers,

Arindam

Read only

former_member209120
Active Contributor
0 Likes
4,819

Hi Barnabas Simorangkir,

Simple use OBLIGATORY in select oprtions

for example

TABLES : EKPO.

SELECT-OPTIONS : S_EBELN FOR EKPO-EBELN OBLIGATORY.

Output




Read only

0 Likes
4,819

yah, but actually, when i use obligatory , the user can't see it with the big size ,

Read only

0 Likes
4,819

Then try like this

TABLES : ekpo.

SELECT-OPTIONS : s_ebeln FOR ekpo-ebeln.

at SELECTION-SCREEN on s_ebeln.

  if s_ebeln is INITIAL.

    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
      EXPORTING
*      TITEL              = ' '
        textline1          = 'Enter Data'.
*      TEXTLINE2          = ' '
*      START_COLUMN       = 25
*      START_ROW          = 6
              .
    endif.


Read only

Former Member
0 Likes
4,819

hi barnabas,

I hope this fulfills ur requirement.

TABLES MARA.

TYPES : begin of ty_ernam,

          ernam type mara-ernam,

        end of ty_ernam.

data : it_ernam type table of ty_ernam.

SELECTION-SCREEN begin of screen 502 as WINDOW title t2.

  SELECTION-SCREEN begin of block b3 WITH FRAME TITLE h1.

    SELECTION-SCREEN begin of line.

      SELECTION-SCREEN comment 1(15) c1.

      SELECTION-SCREEN POSITION 40.

      SELECT-OPTIONS so_ernam for mara-ernam OBLIGATORY.

    SELECTION-SCREEN end of line.

  SELECTION-SCREEN end of block b3.

SELECTION-SCREEN end of screen 502.

INITIALIZATION.

t2 = 'Window 502'.

h1 = 'New Block'.

c1 = 'Created By'.

AT SELECTION-SCREEN on so_ernam.

    if sy-subrc NE 0.

    MESSAGE 'Enter Correct Lower Input' TYPE 'E'.

  endif.

START-OF-SELECTION.

CALL SCREEN 502.

Regards,

Santhosh

Read only

Former Member
0 Likes
4,819

Dear Barnabas,

i think you can try pop up function module.

for reference please check discussion link below:

http://scn.sap.com/thread/1603990

Regards,

Husin

Read only

Former Member
0 Likes
4,819

Hi,

Use it like this.

Message e016(rp) 'Text' Display like 'I'.

This will give you a popup.

Read only

SwadhinGhatuary
Active Contributor
0 Likes
4,819

check wih tis one at event

AT-SELECTION SCREEN ON <YOUR_SELCT-OPTIONS>

IF <YOUR_SELCT-OPTIONS> IS INTIAL

CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'

EXPORTING

  DEFAULTOPTION        = 'Y'

   DIAGNOSETEXT1        = 'please enter select-option'

  DIAGNOSETEXT2        = ' '

  DIAGNOSETEXT3        = ' '

  TEXTLINE1            = 'Do You want to Exit'

  TEXTLINE2            = ' '

   TITEL                = 'POPUP_TO_CONFIRM_WITH_MESSAGE'

  START_COLUMN         = 25

  START_ROW            = 6

*----for the display of cancel button  do like this.

  CANCEL_DISPLAY       = ' '

IMPORTING

  ANSWER               = ANS

         .

  IF ANS = 'J' .

*---put code on selecting yes

  ELSE.

*---put code on selecting no

ENDIF.

or any other popup you required

http://wiki.sdn.sap.com/wiki/display/ABAP/Different+Pop_Ups+in+ABAP