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

VALIDATION?

Former Member
0 Likes
405

How to validate the data at the time of extraction? i.e , inside start-of-selection

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
384

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

2 REPLIES 2
Read only

Former Member
0 Likes
385

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

Read only

varma_narayana
Active Contributor
0 Likes
384

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.