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

avoid the error message of function module

Former Member
0 Likes
2,063

hi all

i am using FM read_Text and if it doesn't found any text entry then it gives a error message . i want to avoid that error message.

bcoz i am using not an standard table that's why a lot of time i get this prob.

plz help me

1 ACCEPTED SOLUTION
Read only

santhosh_patil
Contributor
0 Likes
1,482

Hi,

try with this ....

in the message part of the FM use

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 <b>into l_f_msag.</b>

ENDIF.

l_f_msag is of type char.

---Patil

Message was edited by:

Santhosh Patil

10 REPLIES 10
Read only

Former Member
0 Likes
1,482

Hi

Generally we check the value of Sy-SUBRC after the fun module code

and we write further code when the sy-subrc = 0.

So don't check the Sy-SUBRC <> 0 value to raise some exception.

Reward points if useful

Regards

Anji

Read only

santhosh_patil
Contributor
0 Likes
1,483

Hi,

try with this ....

in the message part of the FM use

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 <b>into l_f_msag.</b>

ENDIF.

l_f_msag is of type char.

---Patil

Message was edited by:

Santhosh Patil

Read only

0 Likes
1,482

hi santhosh and anji

i am not using if sy-subrc<>0 .block . i all ready commented this clause.

but still it is giving an error message.

ashish

Read only

0 Likes
1,482

hi

what's the error you are getting?

Sathish. R

Read only

0 Likes
1,482

Hi,

If the msg is coming from with in the FM then i have

no idea how to handel it....

Please check with others

-


Patil

Read only

0 Likes
1,482

Hi satish,

Here your using the standard FM. Even u commented the sy-subrc block, you will get the error becuse that is built in side like that. FM in source code blick they mentioned with raise statement. so that you are getting error even u commented that sy-subrc block.

Hope this helps you. Reply for queries, shall post the updates.

Regards.

Kumar

Read only

0 Likes
1,482

hi satish

error message is

"Text 0080012665000020 ID 0002 language DE not found"

if i will pass 0080012665000010 then it will run perfectly .

Read only

0 Likes
1,482

hi kumar

ya you are write but, i have to avoid that error message,

one way to do this is copy the whole fm and modify it. but i think it is not so practical.

Read only

0 Likes
1,482

hi

for some transactions, if the long text exists then, there will be some field in the table where the indicator X is set, the field is left blank if there is no long text (for eg. QMEL-INDTX = 'X' if the notification qmnum has long text or not)...so, before calling the fm, check if the line item whose long text you are trying to access has long text or not...the error comes because you are trying to read an object from memory which doesn't exist..reply back for queries

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
1,482

thanks patil