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 error occured

Former Member
0 Likes
1,142

Hi,

I am using the following function module.it's throwing exception occured no_record_found.what shall i do?

CALL FUNCTION 'CSSF_STPOB_READ'

EXPORTING

estlty = wa_temp-stlty

estlnr = wa_temp-stlnr

edatuv = wa_temp-datuv

estlkn = wa_temp-stlkn

estlal = wa_temp-stlal

IMPORTING

ASTPOB = i_stpob

  • EXCEPTIONS

  • NO_RECORD_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc <> 0.

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

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
980

Hi Murali,

Just uncomment this code:

  • EXCEPTIONS

  • NO_RECORD_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc 0.

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

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

and then check why this FM is throwing the exception 'NO_RECORD_FOUND'.

Regards,

Prakash Pandey

Read only

Former Member
0 Likes
980

In your program handle exception, uncomment the EXCEPTION in your code & handle it with messages .

CALL FUNCTION 'CSSF_STPOB_READ'
EXPORTING
estlty = wa_temp-stlty
estlnr = wa_temp-stlnr
edatuv = wa_temp-datuv
estlkn = wa_temp-stlkn
estlal = wa_temp-stlal

IMPORTING
ASTPOB = i_stpob

 EXCEPTIONS
 NO_RECORD_FOUND = 1
 OTHERS = 2
.
 IF sy-subrc 0.
                        " Message in case exception occurs 
 ENDIF.

Read only

Former Member
0 Likes
980

Hi Murali,

Getting Exception is should really not be the issue because there is no output values for the Input that you have provided.

Try running the Function module through SE37 and you will get the same exception. I guess you can Ignore it.

if you are sure that it should have returned some value when you execute the FM then better start debug the code

Regards

Shital

Read only

0 Likes
980

hi,

when i uncomment the code in the above function module,it's throwing rc '1' and message showing is "no active tab exists for sapapo/matkey/".

1.what is the solution to avoid this?

2. can i skip printing the message?

Read only

dev_parbutteea
Active Contributor
0 Likes
980

Hi,

Just uncomment the exceptions part so that your program will not dump but remove the message display:

CALL FUNCTION 'CSSF_STPOB_READ'

EXPORTING

estlty = wa_temp-stlty

estlnr = wa_temp-stlnr

edatuv = wa_temp-datuv

estlkn = wa_temp-stlkn

estlal = wa_temp-stlal

IMPORTING

ASTPOB = i_stpob

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

IF sy-subrc EQ 0.

" do processing

ENDIF.

Regards.

Read only

0 Likes
980

hi,

I am using the above function module to get the valid to date of BOM.even though my exception error problem has been resolved,now my problem is that :

when i change the material to new material, I want to consider only which are valid.but the function module is throwing an error "No active nametab exists for /SAPAPO/MATKEY".so, the valid to date for new material is '0000000'.

plz help me in solving the above error or else is there any way to find valid to date of BOM?

murali.c

Edited by: murali ch on Mar 18, 2009 12:04 PM