‎2009 Jul 07 11:04 AM
Hi,
In my Report i am validating some fields as mandatory.
If the field is initial then one Error message should be display in the screen and user has to modify the selection screen.
But after displaying the errro message my selection screen is input disable except the mandatory field.
I want all the fields should be input enable.
Sample code for Error message,
MESSAGE E018 WITH 'Enter Plant'.
Please provide the code for this.
‎2009 Jul 07 11:09 AM
Hi Anil,
try this.
Messages 'Enter plant ' type 'I'.
leave list-processing.
Regards,
Vijay
‎2009 Jul 07 11:24 AM
Hi vijay,
After displying the Message Screen goes to report output.
its not stop in the Selection Screen.
‎2009 Jul 07 11:47 AM
Hello Anil ,
i think you are validating your field in start-of -selection Event ....
if yes than validate it in side the AT SELECTION-SCREEN event .
Thanks and Regards ...
Priyank
‎2009 Jul 07 12:13 PM
Hi,
I am doing this validation in AT SELECTION SCREEN ON < Field> only.
But i am not able to stop program in Seclection Sctreen if i used the Messsage type as ' i '.
‎2009 Jul 07 12:34 PM
Hi Anil ,
if you want to stop further processing ....either you you Error type message ....
or if you want to you Type I message than ...code like below ..
Data : v_flag type c .
At selection-Screen .
clear : v_flag .
write your code for validating ..with message .
v_flag = '1' .
Stop .
and than it will go to the End-of-selection .
End-of-selection .
if v_flag = '1'.
STOP .
endif .
thanks and Regards ..
Priyank
‎2009 Jul 07 12:40 PM
Hi Anil ,
This Code is working Perfectly ..
REPORT ZPRI_TESTLDB.
data: v_flag type c .
PARAMETERS: var1 type sy-datum .
AT SELECTION-SCREEN .
if var1 is INITIAL .
MESSAGE 'Blank' TYPE 'I' .
V_flag = '1' .
Stop .
endif.
write: 'Hello' .
end-of-SELECTION .
if v_flag = '1' .
stop .
endif.
Thanks and Regards ..
Priyank
‎2009 Jul 08 6:33 AM
Hi Anil again,
I think you should use AT SELECTION SCREEN OUTPUT
and not AT SELECTION SCREEN ON < Field>
Do your validation under this event.
I am sure this will solve your problem.
Regards,
Vijay
‎2009 Jul 08 7:33 AM
Vihjay, did you actually try this : When starting the report, data is initial, so error is issued in PBO => you get a popup on a partially written screen, and the report is stopped, back to menu...
Look at [Messages in dialog processing |http://help.sap.com/abapdocu/en/ABENABAP_MESSAGE_DIALOG.htm], in PBO/ AT SELECTION-SCREEN-OUPUT the message is converted to a Abort message, popup and program termibnated.
Try, change the code i provided, replace AT SELECTION-SCREEN ON BLOCK dum, with AT SELECTION-SCREEN OUTPUT and see.
Regards,
Raymond.
‎2009 Jul 07 11:16 AM
Hi,
This si simple rather tahn using the message type as 'E' use as "I" mooreover if is the failure from the database fetchung the message type can be 'S'
This will solve your problem
Pooja
‎2009 Jul 07 11:18 AM
Hi,
Please check if the code is written in the at selection-screen event. If not please try the same. Else provide the code that you have written and under which event.
Regards,
Sachin
‎2009 Jul 07 11:19 AM
Hey,
u can use Obligatory addition while defining the screen.
e.g. PARAMETERS : P_WERKS TYPE WERKS_D OBLIGATORY .
System will itself validate the entry.
‎2009 Jul 07 11:20 AM
Hi,
Try using message type 'W' or type 'I' in place of 'E',
because error message disables the input
fields. or,
Take the input fields as obligatory in your
code and dont use any message type with
those fields, the obligatory keyword throws
error message itself and does not disables the input
fields also.
Hope it helps
Regards
Mansi
‎2009 Jul 07 11:20 AM
have use used at selection-screen on.
if so try with
at selection-screen.
‎2009 Jul 07 11:21 AM
Hi,
Use information message instead of Error message
parameter: p_plant(20) type c.
if p_plant is initial.
MESSAGE 'Enter Plant' type 'I'.
endif.
i
Thanks ®ards
Ashu Singh
‎2009 Jul 07 11:23 AM
Hi,
Do as below,
1) Remove the OBLIGATORY option of the field.
2) For mandatory filling do the validation in AT SELECTION-SCREEN ON field for INITIAL
3) Give the message as I type.
Sample code
PARAMETERS : p_matnr TYPE mara-matnr,
strt_dat ,
end_dat ,
emp_id,
emp_name,
location,
usage.
DATA : w_matnr TYPE mara-matnr.
AT SELECTION-SCREEN ON p_matnr.
IF p_matnr IS INITIAL. " This makes the field a mandatory
MESSAGE 'Enter material ' TYPE 'I'.
ELSE.
SELECT SINGLE matnr FROM mara INTO w_matnr
WHERE matnr = p_matnr.
IF sy-dbcnt = 0.
MESSAGE 'Not a Valid Material ' TYPE 'I'.
ENDIF.
ENDIF.
START-OF-SELECTION.Regards
Bala Krishna
Edited by: Bala Krishna on Jul 7, 2009 3:53 PM
‎2009 Jul 07 11:35 AM
Hi,
Screen goes to Report outout.
My controll should be in Selection screen only........
‎2009 Jul 07 11:37 AM
Hi anil again,
Did you try this.
IF sy-dbcnt = 0.
MESSAGE 'Not a Valid Material ' TYPE 'I'.
Leave List-processing.
ENDIF.
Regards,
Vijay
‎2009 Jul 07 11:24 AM
Performing checks on SELECTION-SCREEN
- if the check uses only one independent field (e.g.: value exist in a table) use a[ AT SELECTION-SCREEN ON <field>|http://help.sap.com/abapdocu/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_2@2@], the field will be editable when error is raised
- if the check uses some fields, group them using [SELECTION-SCREEN BEGIN OF BLOCK <block>/END OF BLOCK <block>|http://help.sap.com/abapdocu/en/ABAPSELECTION-SCREEN_BLOCK.htm] and then [AT SELECTION-SCREEN ON BLOCK <block>|http://help.sap.com/abapdocu/en/ABAPAT_SELECTION-SCREEN_EVENTS.htm#!ABAP_ALTERNATIVE_4@4@], each field of the block will be editable when error is raised
So, if you really want that each and every field be editable when an error is raised, declare every parameter and select-options in a big block, and perform the check in a unique AT SELECTION-SCREEN ON BLOCK xxx.
Use Error message, Warning and Information don't break the flow of the report.
Regards,
Raymond
‎2009 Jul 07 11:34 AM
Hi,
I am writing code in the AT SELECTION SCREEN ON <fIELD> only.
But i am not able to see the fields in input enable.
Please provide the solution ASAP.
‎2009 Jul 07 11:37 AM
‎2009 Jul 07 1:19 PM
If you don't manage to find, a little sample.
REPORT z_test_block.
SELECTION-SCREEN BEGIN OF BLOCK dum. " dummy block
PARAMETER a(10).
PARAMETER b(5).
SELECTION-SCREEN END OF BLOCK dum.
AT SELECTION-SCREEN ON BLOCK dum.
IF a IS INITIAL.
SET CURSOR FIELD 'A'.
MESSAGE e020(kf) WITH 'A'.
ENDIF.
IF b IS INITIAL.
SET CURSOR FIELD 'B'.
MESSAGE e020(kf) WITH 'B'.
ENDIF.
START-OF-SELECTION.
WRITE: / 'report started'.Regards,
Raymond
‎2009 Jul 07 11:37 AM
HI Anil ,
Where you are validating your field (in which Event ) ?
Thanks and Regrds ..
Priyank
‎2009 Jul 07 12:56 PM
u can display the error message like success
so that i will be displayed in the selection screen itself
and it wont disable the the fields
display e(XXX) like s
it will work for sure
cheers
s.janagar