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

Handling mandatory import parameters

Former Member
0 Likes
1,082

Hi

Can you clarify on how to handle the check for initial status of the import parameters which are not optional. I do not need my method call to proceed without supplying some input (not inital) for the import parameters.

If exceptions are the only way to handle I would like to see one sample code for the same.

Regards

Karthick

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
769

Hi,

IN the method parameters..you can define the exception code..Like NO_INPUT.

in the code of the method..

Check the parameter...

Ex..



IF IM_INPUT IS INITIAL.

* Raise an exception that there is no input supplied..
  RAISE NO_INPUT.
ENDIF.

Thanks

Naren

2 REPLIES 2
Read only

Former Member
0 Likes
770

Hi,

IN the method parameters..you can define the exception code..Like NO_INPUT.

in the code of the method..

Check the parameter...

Ex..



IF IM_INPUT IS INITIAL.

* Raise an exception that there is no input supplied..
  RAISE NO_INPUT.
ENDIF.

Thanks

Naren

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
769

Hi,

Wiht out supplying the mandatory IMPORT paramter you will any get a SYNTAX error,

so if you want to check in the program if the supplied paramter is NOT initial then you have to check in the method implementation and raise an exception.

Example.

if IM_DATA is initial.

raise exception type cx_no_data_supplied (If class based exception)(Recommended).

also you can use

raise no_data_supplied.

Regards,

Sesh