‎2007 Jun 25 5:09 PM
CALL FUNCTION 'FI_PERIOD_CHECK'
EXPORTING
I_BUKRS = 'C553'
I_OPVAR = ' '
I_GJAHR = it_out-datains1+0(4)
I_KOART = 'S'
I_KONTO = 'zzzzzzzzzz'
I_MONAT = L_IODM
EXCEPTIONS
ERROR_PERIOD = 1
ERROR_PERIOD_ACC = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
when i am testing this function module i am getting error_period_acc =2.
but i used this one in program like above code i am getting subrc=0.
i have doubt in this one is we can comment exceptions or uncomment.
i want sy-subrc <> 0.
how can i get
‎2007 Jun 25 5:30 PM
Try using this way
CALL FUNCTION 'FI_PERIOD_CHECK'
EXPORTING
i_bukrs = cashin_header-bukrs
i_gjahr = i_gjahr
i_koart = 'D'
i_monat = i_poper
EXCEPTIONS
error_period = 1
error_period_acc = 2
OTHERS = 3.
IF sy-subrc <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
cl = sy-msgid
number = sy-msgno
par1 = sy-msgv1
par2 = sy-msgv2
par3 = sy-msgv3
par4 = sy-msgv4
IMPORTING
return = return.
APPEND return.
ENDIF.
‎2007 Jun 25 5:37 PM
‎2007 Jun 25 5:43 PM
‎2007 Jun 26 4:16 AM
return = return.
APPEND return.
in this one return type.
how to declare.
‎2007 Jun 26 4:20 AM
Hi Venkat,
Data return type BAPIRET2.
Reward all useful answers.
Regards,
Atish
‎2007 Jun 25 5:31 PM
Check the parameters ,I mean are you passing valid values or not
I_KOART NE '+'.
then you will get message
CALL FUNCTION 'FI_PERIOD_CHECK'
EXPORTING
I_BUKRS = 'C553'
I_OPVAR = ' '
I_GJAHR = it_out-datains1+0(4)
I_KOART = <b>'+'</b> -> pass + value and see the results
I_KONTO = 'zzzzzzzzzz'
I_MONAT = L_IODM
EXCEPTIONS
ERROR_PERIOD = 1
ERROR_PERIOD_ACC = 2
OTHERS = 3
Thanks
Seshu
‎2007 Jun 26 4:50 AM
when any error is raised by raise <exception name> the sy-subrc is getting the value according to their decvlaration. In your case when
raise ERROR_PERIOD< sy-subrc = 1 return>
raise ERROR_PERIOD_ACC <sy-subrc = 2 return>
raise OTHERS <sy-subrc = 3 return>
if above statement are executed it will return the sy-subrc value as stated.
for getting this you have to un-comment the all the exception.
regards
shiba dutta