‎2007 Sep 17 4:57 AM
How to validate the data at the time of extraction? i.e , inside start-of-selection
Thanks.
‎2007 Sep 17 5:02 AM
Hi Sagar,
Between the START and END -OF-SELECTION events in a report, you must ideally only have SELECT queries (or the like) to retrieve data from the DB. once you have all the data, processing (logical operations) on the data should be performed outside the block.
However, by validation in this block what you could do is, design the WHERE clause of your SELECT query in such a way that it excludes the invalid records from being picked up by the report.
However if this is not the purpose and instead program must return error messages as a result of validations, then i suggest putting it outside the block.
Regards,
Aditya
‎2007 Sep 17 5:02 AM
Hi Sagar,
Between the START and END -OF-SELECTION events in a report, you must ideally only have SELECT queries (or the like) to retrieve data from the DB. once you have all the data, processing (logical operations) on the data should be performed outside the block.
However, by validation in this block what you could do is, design the WHERE clause of your SELECT query in such a way that it excludes the invalid records from being picked up by the report.
However if this is not the purpose and instead program must return error messages as a result of validations, then i suggest putting it outside the block.
Regards,
Aditya
‎2007 Sep 17 5:03 AM
Hi Sagar.
Example:
TABLES EKKO.
PARAMETERS: P_LIFNR TYPE EKKO-LIFNR.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN.
START-OF-SELECTION.
SELECT * FROM EKKO INTO TABLE IT_EKKO
WHERE LIFNR = P_LIFNR
AND EBELN IN S_EBELN.
IF SY-SUBRC NE 0.
********Never dispay ERROR message here********************
MESSAGE 'No Data Found with this Criteria' type 'S'.
LEAVE LIST-PROCESSING. "to return the control to Selection Screen
ENDIF.
REWARD IF HELPFUL.