2009 Mar 17 6:13 PM
There is a function module MATERIAL_UNIT_CONVERSION where I need to go to next record when an exception is raised.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = P_TBL_PLAF_VCAP_GSMNG
IMPORTING
OUTPUT = P_TBL_PLAF_VCAP_GSMNG
EXCEPTIONS
OVERFLOW = 8.
IF SY-SUBRC = 8.
" what should I write here
ENDIF.
2009 Mar 17 6:15 PM
If you calling in a loop, then just write "continue". thats it.
Kuntal
2009 Mar 17 6:15 PM
P_TBL_PLAF_VCAP_GSMNG
Is it a single record?
and where ur fm is? is it in a subroutine?
кu03B1ятu03B9к
2009 Mar 17 6:18 PM
I guess you need recursive programming here....
Perform f_material_unit.
form f_material_unit_conv.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = P_TBL_PLAF_VCAP_GSMNG
IMPORTING
OUTPUT = P_TBL_PLAF_VCAP_GSMNG
EXCEPTIONS
OVERFLOW = 8.
IF SY-SUBRC = 8.
perform f_material_unit_conv.
ENDIF.
endform.
Never had to do recursive programming in abap before but I think this will work.
Mathews
2009 Mar 17 6:20 PM
Hi Annapurna,
You need to call FM 'MATERIAL_UNIT_CONVERSION' in LOOP (of Material data?).
If sy-subrc NE 0 Do CONTINUE. so it proceeds to the next record in loop.
Regards
Shital
2009 Mar 17 6:23 PM
Hi Kartik,
The Function Module is in a Form and it is called multiple times in the program.
Yes it is in Loop endloop ,but in the same loop the Form is called multiple times.
2009 Mar 17 6:29 PM
you keep a flag in if- endif. and depending on it do a continue like below:
Loop.
clear v_flag.
Perform " Your perform
If v_flag eq 'X'.
continue.
endif.
Endloop.
Form " Start of your perform
" Call the FM
if sy-subrc eq 8.
v_flag = 'X'.
endif.
Endform.
Kuntal
2009 Mar 17 6:39 PM
2009 Mar 18 2:35 AM
Hi Annapurna,
is ur program is like this.
loop.
perform mat_unit_conversion.
endloop.
form mat_unit_conversion.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = P_TBL_PLAF_VCAP_GSMNG
IMPORTING
OUTPUT = P_TBL_PLAF_VCAP_GSMNG
EXCEPTIONS
OVERFLOW = 8.
endform.
if it is so.
u can follow the below to skip the loop to process the next record,
loop.
perform mat_unit_conversion.
if v_flag = 'X'.
continue. " it will skip to the next loop.
endloop.
form mat_unit_conversion.
data : v_flag.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = P_TBL_PLAF_VCAP_GSMNG
IMPORTING
OUTPUT = P_TBL_PLAF_VCAP_GSMNG
EXCEPTIONS
OVERFLOW = 8.
if sy-subrc = 8.
v_flag = 'X'.
exit. " it exits from the sub-routine.
endif.
endform.
hope this will help u.
<< Please do not beg for points >>
Guru
Edited by: Rob Burbank on Mar 17, 2009 10:39 PM