Application Development 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: 

passing parametrs to fetch the 'number 'of corresponding entries???

Former Member
0 Kudos

I have passed a parameter p_count at selection screen

parameters : p_count type i,

select

matnr

from mara

into table t_mara

up to p_count

while executing when i give a number at selection screen it is fetching the records depending the entries in the database table.... but if the database entries are 10000 records and the user enters 10,001 it should show an error message and also if any new data is added in the data base record it should fetch that record as well

how can i solve the above query plz help

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can use the COUNT( * ) to know about total number of entries.


AT SELECTION-SCREEN ON P_COUNT.
  SELECT COUNT( * ) INTO L_COUNT FROM MARA.
  IF L_COUNT > P_COUNT.
*     ERROR MESSAGE
  ENDIF.

Regards,

Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

You can use the COUNT( * ) to know about total number of entries.


AT SELECTION-SCREEN ON P_COUNT.
  SELECT COUNT( * ) INTO L_COUNT FROM MARA.
  IF L_COUNT > P_COUNT.
*     ERROR MESSAGE
  ENDIF.

Regards,

Naimesh Patel

Former Member
0 Kudos

well i had to do to little bit of research .. but thanks for the reply which gave me an idea