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

Regarding problem in Function Module

Former Member
0 Likes
609

Hi experts,

I have created a function module .But in epc check list I am founding 2 warnings

1.No RAISE for EXCEPTION NOTHING_ACTIVE in the Exception Group

2.No RAISE for EXCEPTION ERROR_COUNTRY_CODE in the Exception Group

can you please help me to solve this?(I have given the code in below)

Regards,

Sarkar

FUNCTION Z_bte_00003410.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(IM_MLDLA) TYPE MLDPARAM-MLDLA

*" REFERENCE(IM_MLDEM) TYPE MLDPARAM-MLDEM

*" REFERENCE(IM_MLZLA) TYPE MLDPARAM-MLZLA

*" REFERENCE(IM_SPRAS) TYPE T002-SPRAS DEFAULT SY-LANGU

*" REFERENCE(IM_TABNAME) TYPE DFIES-TABNAME

*" REFERENCE(IM_RECORD)

*" CHANGING

*" REFERENCE(CH_INTCA) TYPE T005-INTCA

*" REFERENCE(CH_LANDA) TYPE T005-LANDA

*" REFERENCE(CH_LKVRZ) TYPE T005-LKVRZ

*" REFERENCE(CH_LANDX) TYPE T005T-LANDX

*" REFERENCE(CH_LANDX50) TYPE MLDPARAM-LANDX50

*" REFERENCE(CH_IDTYP) TYPE MLDPARAM-IDTYP

*" EXCEPTIONS

*" ERROR_COUNTRY_CODE

*" NOTHING_ACTIVE

*"----


************************************************************************

************************************************************************

*Local Variable Declaration:

DATA : l_v_landa TYPE landa_005z,

l_v_landx TYPE landx,

l_v_lkvrz TYPE lkvrz_005z,

l_v_landx50 TYPE landx50_005z.

  • Check if an entry exists in T005Z

SELECT SINGLE t005z~landa

t005zt~landx

t005zt~lkvrz

t005zt~landx50

FROM t005z INNER JOIN t005zt "#EC CI_BUFFJOIN

ON t005zmldla = t005ztmldla

AND t005zmldem = t005ztmldem

AND t005zintca = t005ztintca

INTO (l_v_landa,l_v_landx,l_v_lkvrz,l_v_landx50)

WHERE t005z~mldla EQ im_mldla

AND t005z~mldem EQ im_mldem

AND t005z~intca EQ im_mlzla

AND t005zt~spras EQ im_spras .

IF sy-subrc EQ 0.

ch_intca = im_mlzla.

ch_landa = l_v_landa.

ch_lkvrz = l_v_lkvrz.

ch_landx = l_v_landx.

ch_landx50 = l_v_landx50.

ENDIF.

ENDFUNCTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
554

Hi,

Raise proper exceptions based on the value of SY-SUBRC.

Add your code for raising exception in the ELSE condition of IF SY-SUBRC EQ 0, like

case sy-subrc.
    when 0.
     ch_intca = im_mlzla.
     ch_landa = l_v_landa.
     ch_lkvrz = l_v_lkvrz.
     ch_landx = l_v_landx.
      ch_landx50 = l_v_landx50. 
    when 4.
      raise nothing_active.
    when others.
      raise error_company_code.
  endcase.

Regards

Vinod

3 REPLIES 3
Read only

Former Member
0 Likes
555

Hi,

Raise proper exceptions based on the value of SY-SUBRC.

Add your code for raising exception in the ELSE condition of IF SY-SUBRC EQ 0, like

case sy-subrc.
    when 0.
     ch_intca = im_mlzla.
     ch_landa = l_v_landa.
     ch_lkvrz = l_v_lkvrz.
     ch_landx = l_v_landx.
      ch_landx50 = l_v_landx50. 
    when 4.
      raise nothing_active.
    when others.
      raise error_company_code.
  endcase.

Regards

Vinod

Read only

0 Likes
554

Thanks a Lot Vinod.....

Read only

Former Member
0 Likes
554

Sarkar,

Since you have declared some exceptions you may need to raise them somewhere in the code otherwise it may give warning.

Thanks

Bala Duvvuri