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

How to catch errors in calling program when using SUBMIT ... AND RETURN ?

Former Member
0 Likes
793

Hi ,

I am calling a report using submit and return statement from a function module. The report has select-options field for a date field. If user enters a date in low, which is greater than high, getting error message "Lower limit is greater than upper limit".

How to catch this error without endup stoping on selection screen of the report?

In the documentation, I read :

Programs called with SUBMIT ... AND RETURN or CALL TRANSACTION cannot propagate exceptions to the caller, because exception objects are bound to the internal mode of a program.

Is there any way to overcome this?

Also my aim is to write a validation on the date selection-option to have the date range not more than 20 days.

I am not sure of how to achieve this.

Is there a way to do validation of select-options data before submiting to the report ?

Is there any standard FM to achieve this task?

Thank you,

Surya.

Edited by: Surya on May 24, 2009 6:08 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
475

Hi Surya ,

In your function module's code validate the date .

If the low value of the date less than high and date period is not more than 20 then

call transaction and in else condition raise exception.

In your FM write like that - -

IF   date-low LT date-high AND 
                       date_difference LE '20' .

CALL  TRANSACTION   'transaction'.
ELSE.
RAISE  ...........  " Raise the invalid date exception
ENDIF.

Regards

Pinaki

1 REPLY 1
Read only

Former Member
0 Likes
476

Hi Surya ,

In your function module's code validate the date .

If the low value of the date less than high and date period is not more than 20 then

call transaction and in else condition raise exception.

In your FM write like that - -

IF   date-low LT date-high AND 
                       date_difference LE '20' .

CALL  TRANSACTION   'transaction'.
ELSE.
RAISE  ...........  " Raise the invalid date exception
ENDIF.

Regards

Pinaki