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

Exception in Function Module

Former Member
0 Likes
590

Hi,

i have one basic doubt.

I created one FM.

In that i writen Raise statement.

Ex; Raise Not_found.

and in the exception block i given the shorttext and created longtext as partners are not found.

But when i exicute the FM it is displaying only Not_found.

not that text..

What may be the problem

Can any body give some suggession

Thanks in Advance.

5 REPLIES 5
Read only

Former Member
0 Likes
552

Hi

Use MESSAGE .... RAISING stament to link a message to your excption:

MESSAGE E208(00) with 'Not found' RAISING NOT_FOUND.

Max

Read only

Former Member
0 Likes
552

the exception which is raised has to be caught. if you are excuting the FM in SE37 then only the exception is raised. Call the function module in program in SE38, and then handle it

for example.

define a instance

lp_object type ref to cx_root.

then catch the exception into the instance.

read the instance using get text and then move the value to a variable. The value which you retrieve in the variable will have the text which you had passed while raising the exception.

hope this helps

Read only

Former Member
0 Likes
552

Hi,

did you maintained the long text properly...

Regards

vijay

Read only

0 Likes
552

Yes.After creating the longtext i saved and activated it and it turned to green color.

Read only

0 Likes
552

Hi,

Long texts are for help, what ever you maintain they will not come along with raise. you have to do it separately...like this..

when you want to raise...

<b>message e000(zz) with 'no data found' raising no_data.</b>

this will do that,not long texts.

Regards

vijay