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: 

EPC Error in Function Module

Former Member
0 Kudos

Hi ,

I have the following code .............

CALL FUNCTION 'L_REF_DELETE_DOC'

EXPORTING

i_lgnum = p_y_wa_t311_lgnum

i_refnr = p_y_wa_t311_refnr

i_rbtyp = p_y_k_rbtyp

TABLES

t_rbnum = p_y_li_rbnum[].

IF sy-subrc EQ y_k_zero.

*Success message for all TRs deleted at group level

MESSAGE s028(ydev) WITH p_y_wa_t311_refnr.

CLEAR y_gwa_rbnum.

LOOP AT p_y_li_rbnum INTO y_gwa_rbnum.

*Success message for all TR deleted at TR level

MESSAGE s029(ydev) WITH y_gwa_rbnum-rbnum.

CLEAR y_gwa_rbnum.

ENDLOOP.

ENDIF.

When I am doing an EPC check , am getting the following error :

No EXCEPTION to set SY_SUBRC Declared for CALL FUNCTION 'L_REF_DELETE_DOC'

Thus the value of SY-SUBRC is always 0

(The message can be hidden with "#EC *).

Let me know how to correct the same . I dont want to hide the message.

Regards,

Kalyan

1 REPLY 1

Former Member
0 Kudos

Hi Kalyan,

In the function module call, you have not included the exceptions, and you are not handling those exceptions

the function module has the following exceptions

REFNR_BLOCKED

STATUS_BLOCKED

STATUS_ACTIV

STATUS_TO_CREATED

STATUS_RELEASED

REFNR_DOES_NOT_EXIST

that means if sy-subrc = 1. the reason is Reference number is blocked and like that you need to handle them in the calling program.

The error says that only. Hope this is helpful to you

Regards,

Ravi