‎2013 Aug 01 6:57 AM
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?
‎2013 Aug 01 2:52 PM
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.
‎2013 Aug 01 3:09 PM
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.
‎2013 Aug 01 3:28 PM
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.
‎2013 Aug 01 3:01 PM
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
‎2013 Aug 02 4:31 AM
‎2013 Aug 02 4:44 AM
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
‎2013 Aug 02 5:23 AM
Hi Barnabas Simorangkir,
Simple use OBLIGATORY in select oprtions
for example
TABLES : EKPO.
SELECT-OPTIONS : S_EBELN FOR EKPO-EBELN OBLIGATORY.
Output
‎2013 Aug 02 5:37 AM
yah, but actually, when i use obligatory , the user can't see it with the big size ,
‎2013 Aug 02 7:59 AM
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.
‎2013 Aug 02 5:49 AM
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
‎2013 Aug 02 5:51 AM
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
‎2013 Aug 02 5:52 AM
Hi,
Use it like this.
Message e016(rp) 'Text' Display like 'I'.
This will give you a popup.
‎2013 Aug 02 8:07 AM
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