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

general

Former Member
0 Likes
689

What are the exceptions in function module?

1 ACCEPTED SOLUTION
Read only

satykumar
Product and Topic Expert
Product and Topic Expert
0 Likes
669

Exceptions in function modules or classes denote those situations where the function module or class has failed to perform the task for which it is intended.In such cases we fill the exception tab in function or class with all possible exception cases that can be anticipated

6 REPLIES 6
Read only

dev_parbutteea
Active Contributor
0 Likes
669

Hi,

exceptions are errors that may occur in the Fm.

you have to raise exceptions that you think might occur!

Read only

0 Likes
669

Each exception is an error condition.

Hope this will solve ur problem..

<b><u>Dont forget to reward all the useful replies</u></b>

Sudheer

Read only

Former Member
0 Likes
669

Hi,

lwa_error-level = 1.

lwa_error-severity = 'E'.

lwa_error-langu = sy-langu.

lwa_error-ag = 'FTI_LDB_MESSAGE'.

lwa_error-msgnr = 202.

lwa_error-var1 = i_rfha.

APPEND lwa_error TO e_t_error.

Error number : Number of the mesage

class : msg class

text: Any tectxt to appear along with the msg

Var1..var4 can hold values

***do reward if usefull

regards,

vijay

Read only

Former Member
Read only

satykumar
Product and Topic Expert
Product and Topic Expert
0 Likes
670

Exceptions in function modules or classes denote those situations where the function module or class has failed to perform the task for which it is intended.In such cases we fill the exception tab in function or class with all possible exception cases that can be anticipated

Read only

Former Member
0 Likes
669

Hi,

In general in report programm we will display some messages according to situation.

In the same way while creating FM , insated of messgaes we will go for exceptions.

Ex: RASIE NO_DATA.

suppose if the FM doesnt export any parametrs, then in that siatution we will raise exception RASIE NO_DATA.(cpends on theuser requiremnt too)

wen we call the FM , each exception will be assigned a one number.

and after calling the fM in report program , we will check thru sy-subrc .

if sy-subrc = 1(i.e NO_DATA message)

;;;;;;

;;;;;

some logic.

endif,

Revert back if any issues.

Reward with points if helpful.

Regards,

Naveen.