2007 Apr 30 4:39 AM
Is there any other methods for validation of a field apart from at selection-screen on field.
Is there any other methods for validation of a field apart from at selection-screen on field.
2007 Apr 30 5:57 AM
Hi Prasoon,
Before the START OF SELECTION event, we have to do the validation part based on the selection screen parameters. So this can be done thro' AT SELECTION SCREEN ON FIELD event.
Regards,
Suresh
2007 Apr 30 7:06 AM
Hi Prasoona,
Go through this program. In this program i done the validations on filed.
REPORT YCLASSICREPORTING NO STANDARD PAGE HEADING LINE-COUNT 20(5)
LINE-SIZE 88 MESSAGE-ID ZMGSVMR .
TABLES : LFA1.
SELECT-OPTIONS : VENDOR FOR LFA1-LIFNR.
DATA: BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
END OF ITAB.
DATA : FNAME(10) , FVAL(10) TYPE N.
INITIALIZATION .
VENDOR-LOW = 100.
VENDOR-HIGH = 1500.
VENDOR-OPTION = 'BT'.
VENDOR-SIGN = 'I'.
APPEND VENDOR.
AT SELECTION-SCREEN ON VENDOR.
IF VENDOR-LOW < 100 OR VENDOR-HIGH > 1500.
MESSAGE I000(ZMSGVMR) WITH 'enter oroper input'.
ENDIF.
START-OF-SELECTION.
SELECT LIFNR NAME1 ORT01 FROM LFA1 INTO TABLE ITAB WHERE LIFNR IN
VENDOR.
LOOP AT ITAB.
FORMAT COLOR 1.
WRITE : / ' accno' , 'name of vendor' , 'city of vendor' .
WRITE : / ITAB-LIFNR ,SY-VLINE , ITAB-NAME1,SY-VLINE , ITAB-ORT01,
SY-VLINE.
ULINE.
FORMAT COLOR OFF.
ENDLOOP.
SET PF-STATUS 'YVMR'.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'VENDOR'.
GET CURSOR FIELD FNAME VALUE FVAL.
SET PARAMETER ID 'LIF' FIELD FVAL.
CALL TRANSACTION 'XK02' AND SKIP FIRST SCREEN.
ENDCASE.
TOP-OF-PAGE.
WRITE : / 'VENDOR DETAILS ' COLOR 3 .
END-OF-PAGE.
WRITE 😕 'PAGE NO:' , SY-PAGNO COLOR 6.
END OF SELECTION.
Rewards some points.
Rgds,
P.Naganjana Reddy
2007 Apr 30 11:12 AM
HI,
You can validate under At SELECTION-SCREEN.
But if an error encounters then this will not trigger to the error selection option,,
But when you validate undet AT SELECTION-SCREEN on FILED.
This will get to the particular field where the error occured and make to change the value of the field to run the program,,
rewrds if useful,
regards,
nazeer
2007 May 01 9:47 AM
Hai,
You can <b>use dialog programming</b>.
Create your own sceens and events for actions on the screen.
In <b>event definition,validate the fields.</b>
Make sure of your sceen sequence.
Regds,
Rama chary.Pammi
2007 May 09 7:41 AM
U can perform the validation in at selection-screen only..
The thing is u no need to write the validation code in at-selection..U can use subroutines and call those sub-routines in at selection-screen...
2007 May 09 8:25 AM
Hi Prasoon,
Apart from <i>At Selection-Screen on <Field></i>, one can use <b><i>AT SELECTION- SCREEN</i></b> to validate the input on the screen. As by this time, the screen input is already passed to ABAP code.
Following is a small e.g. showing the validation & message display for some condition on <i>AT SELECTION-SCREEN.</i>
AT SELECTION-SCREEN.
IF CARRID-LOW IS INITIAL
OR CITY_FR IS INITIAL
OR CITY_TO IS INITIAL.
MESSAGE E000(HB).
ENDIF.
Hope this sorts out your issue.
PS If the answer sorts out your query, plz close the thread by rewarding each reply.
Regards
2007 May 09 8:41 PM
You can use only 2 events to validate data on the selection screen.
1) AT SELECTION-SCREEN
2) AT SELECTION-SCREEN ON <field>.
The difference between the two is that when you use AT SELECTION-SCREEN and you issue an error message (message of type E) when the validation of a field fails then all the fields ar enabled for input. In this case your message should be clear enough to direct the user to the field whose data needs to be changed.
If you use AT SELECTION-SCREEN ON <field> and you issue an error message (message of type E) when the validation of a field fails then only the field containing the incorrect data is enabled for input. All the other fields are disabled. This makes it obvious to the user which field needs attention.
2007 May 16 7:53 AM
hi prasoon
we can use AT LINE-SELECTION as below...
AT LINE-SELECTION ON s_kunnr.
loop at s_kunnr.
select single * from kna1 where kunnr in s_kunnr.
if sy-subrc ne 0.
message e012(ZMSG) with 'Invalid Input'.
endif.
endloop.
REWARD IT PLEASE...!!
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |