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

selection screen.

Former Member
0 Likes
1,360

hi,

i had a problem that i require the error message to b displayed on the same screen.

the functionality is when i check a check box the input box is activated n if i leave this input box empty n execute then an error message should be displayed on the same screen.

regards,

sohi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,322

you can check this sample program it may help you


TABLES : SSCRFIELDS.
parameters : p_val(10),
             chk as checkbox user-command ucom.

at selection-screen output.
if chk ne 'X'.
loop at screen.
if screen-name = 'P_VAL'.
screen-input = '0'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'P_VAL'.
screen-input = '1'.
*SCREEN-REQUIRED = '1'.
modify screen.
endif.
endloop.
ENDIF.

AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM NE 'UCOM'.
  IF P_VAL IS INITIAL.
   MESSAGE 'Pls enter the value' TYPE 'E'.
  ENDIF.

ENDIF.

regards

shiba dutta

17 REPLIES 17
Read only

Former Member
0 Likes
1,322

Hi

In the at selection-screen event

write the code that

IF V_CHK = space.

message e000 with 'Check the check box'.

ENDIF.

Regards

Anji

Read only

Former Member
0 Likes
1,322

HI Sohi,

You can show the same in AT SELECTION SCREEN.

Regards,

Atish

Read only

harimanjesh_an
Active Participant
0 Likes
1,322

hi sohi,

IF w_chk IS NOT INITIAL.

EXECUTE UR LOGIC.

ELSE.

<b>MESSAGE 'Display ur Error Message' TYPE 'E'.</b>

ENDIF.

where w_chk is checkbox.

E = Error Status

I = Information

S = SUccess

A = Abbend

Reward me if useful...........

Harimanjesh AN

Read only

Former Member
0 Likes
1,322

Hi Sohi,

Please try this:

At selection-screen.

If input_field is intial.

Message 'field is blank' type 'S' display like 'E'.

Endif.

Award points if found useful

Read only

former_member189629
Active Contributor
0 Likes
1,322

Sohi,

Use the code pattern showed below,

AT SELECTION SCREEN.

if P_CHKBX = 'X'. " if the checkbox is selected check s_field

AT SELECTION SCREEN ON s_field.

IF NOT s_field[] IS INITIAL. " validate field entry

select matnr from mara

into mara-matnr

where matnr = s_field.

IF sy-subrc NE 0.

MESSAGE e001. " message for invalid entry

ENDIF.

else. " if field is initial

MESSAGE e002. " message for blank field

ENDIF.

Reward if helpful

Read only

Former Member
0 Likes
1,322

May be you asked this:

Assusimg the checkbox is check and the Input field is empty and Execute button is pressed:

If InputField IS INITIAL.

Message e000 with 'Enter the InputField'.

ENDIF.

Award points if helpful

Read only

Former Member
0 Likes
1,322

Hi Sohi,

To display the Error message please follow the following:-

if ur_check_box is not initial.

*****Wirte the required steps for ur logic.

else.

message E000(zmes).

endif.

where:-

E is for Error Message

000 is the message no.

zmes is the name of the message table.

When you double click at E000(zmes), it will ask you to create the message in the zmes table and when you click yes, it will bring you to the 000 number where you can write your required message and finally save it.

Reward if useful.

Regards,

Shilpi

Read only

Former Member
0 Likes
1,322

Hi Sohi,

Check the below code.

SELECTION-SCREEN BEGIN OF BLOCK fildwn WITH FRAME.

*--Checkbox for download

PARAMETERS : p_dload AS CHECKBOX USER-COMMAND dwn.

PARAMETERS : p_path TYPE rlgrap-filename MODIF ID zzz.

SELECTION-SCREEN END OF BLOCK fildwn.

AT SELECTION-SCREEN.

  • file path

IF sy-ucomm = 'ONLI' OR sy-ucomm IS INITIAL.

IF p_dload = 'X' AND p_path IS INITIAL.

MESSAGE 'Enter a file name' type 'E'.

ENDIF.

ENDIF.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'ZZZ'.

if p_dload = 'X'.

screen-input = 1.

MODIFY SCREEN.

CLEAR : p_path.

ELSE.

screen-input = 0.

MODIFY SCREEN.

CLEAR : p_path.

ENDIF.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,322

Hi Sohi,

Try using the TYPE 'S'.

Hope this helps.

Benedict

Read only

former_member386202
Active Contributor
0 Likes
1,322

Hi,

Try this.

message e000 with 'Check the check box'.

LEAVE LIST-PROCESSING.

Regards,

Prashant

Read only

Former Member
0 Likes
1,322

hi,

You should use

AT SELECTION-SCREEN ON s_kunnr.

Write ur error message here with condition.

Note:

s_kunnr - is ur selection screen fieldname , which is ur error checking field.

Thanx

Read only

Former Member
0 Likes
1,322

hi guy's ,

the problem still is there.

if i use at selection screen n the input field then as soon as i check the check box the error message is displayed without allowing the user to enter any value..

also the error is displayed on the next page.....

regds,

sohi

Read only

0 Likes
1,322

Hi Sohi,

If you paste your code then we can tell you what is the issue.

regards,

Atish

Read only

0 Likes
1,322

Hi Sohi,

this following code bit complicated but Try to write this code in start-of-selction.

for example your selection scrren has following...

select-options: s_matnr for marc-matnr.

parameters : p_werks for marc-werks.

and also you have chk1 as check box and txt1 as text field.

**********

DATA: seltab TYPE TABLE OF rsparams,

m_tab LIKE LINE OF seltab.

m_tab-selname = 'S_MTNR'.

m_tab-sign = s_mtnr-sign.

m_tab-option = s_mtnr-option.

p_werks = p_werks.

LOOP AT s_mtnr.

m_tab-low = s_mtnr-low.

m_tab-high = s_mtnr-high.

APPEND m_tab TO seltab.

ENDLOOP.

"Here you are actual checking as per your requirement

IF chk1 EQ 'X' and tx1 EQ space.

SUBMIT zreport WITH p_werks EQ p_werks

WITH SELECTION-TABLE seltab VIA SELECTION-SCREEN.

ENDIF.

Read only

0 Likes
1,322

here is the code

loop at screen.

if screen-name = 'S_INPUT-LOW'.

if c_get ne 'X'.

screen-input = 0.

modify screen.

endif.

ENDIF.

if screen-name = 'S_TEXT-LOW' or screen-name = 'S_TEXT-HIGH'.

if c_vbeln ne 'X'.

screen-input = 0.

modify screen.

endif.

ENDIF.

endloop.

AT SELECTION-SCREEN ON s_input.

IF s_input-LOW EQ ' ' .

text = 'fill the entry'.

MESSAGE text type 'E'.

ENDIF.

i want that after the check box is checked the user get's the input field active to enter the data n then when he presses enter or he executes then the error message should be displayed.

rgds,

sohi.

Read only

0 Likes
1,322

THANKS GUYS .IT'S SOLVED.

Message was edited by:

sohi

Read only

Former Member
0 Likes
1,323

you can check this sample program it may help you


TABLES : SSCRFIELDS.
parameters : p_val(10),
             chk as checkbox user-command ucom.

at selection-screen output.
if chk ne 'X'.
loop at screen.
if screen-name = 'P_VAL'.
screen-input = '0'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'P_VAL'.
screen-input = '1'.
*SCREEN-REQUIRED = '1'.
modify screen.
endif.
endloop.
ENDIF.

AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM NE 'UCOM'.
  IF P_VAL IS INITIAL.
   MESSAGE 'Pls enter the value' TYPE 'E'.
  ENDIF.

ENDIF.

regards

shiba dutta