‎2007 Oct 29 7:04 AM
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
‎2007 Oct 29 10:01 AM
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
‎2007 Oct 29 7:07 AM
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
‎2007 Oct 29 7:07 AM
HI Sohi,
You can show the same in AT SELECTION SCREEN.
Regards,
Atish
‎2007 Oct 29 7:09 AM
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
‎2007 Oct 29 7:10 AM
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
‎2007 Oct 29 7:12 AM
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
‎2007 Oct 29 7:13 AM
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
‎2007 Oct 29 7:17 AM
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
‎2007 Oct 29 7:26 AM
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.
‎2007 Oct 29 8:20 AM
‎2007 Oct 29 8:26 AM
Hi,
Try this.
message e000 with 'Check the check box'.
LEAVE LIST-PROCESSING.
Regards,
Prashant
‎2007 Oct 29 9:17 AM
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
‎2007 Oct 29 9:32 AM
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
‎2007 Oct 29 9:36 AM
Hi Sohi,
If you paste your code then we can tell you what is the issue.
regards,
Atish
‎2007 Oct 29 9:44 AM
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.
‎2007 Oct 29 9:52 AM
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.
‎2007 Oct 29 10:08 AM
‎2007 Oct 29 10:01 AM
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