Application Development 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: 

avoid the error message of function module

former_member375669
Participant
0 Kudos
909

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

santhosh_patil
Contributor
0 Kudos
328

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

Former Member
0 Kudos
328

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

santhosh_patil
Contributor
0 Kudos
329

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

0 Kudos
328

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

0 Kudos
328

hi

what's the error you are getting?

Sathish. R

0 Kudos
328

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

0 Kudos
328

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

0 Kudos
328

hi satish

error message is

"Text 0080012665000020 ID 0002 language DE not found"

if i will pass 0080012665000010 then it will run perfectly .

0 Kudos
328

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.

0 Kudos
328

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

former_member375669
Participant
0 Kudos
328

thanks patil