Hello guys,
I need to understand the meaning of Return code in a field Routine. Here is a field Routine that should be migrated or new coded on 7.4 bw system.
changing from comm_structure to source_fields is ok but what about replacing the first condition in IF Statement, Returncode = 1
should I replace it with RAISE EXCEPTION TYPE CX_RSROUT_SKIP_VALUE AND RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD
RESULT = COMM_STRUCTURE-COSTELMNT.
* accept all cost element except 699999
if SOURCE_FIELDS-COSTELMNT = '0000699999' OR
SOURCE_FIELDS-COSTELMNT = '0000560000'.$
RETURNCODE = 1. (RAISE EXCEPTION TYPE CX_RSROUT_SKIP_VALUE /
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD)
else.
RETURNCODE = 0 (RESULT = SOURCE_FIELDS-COSTELMNT)
or what should I do here?
AS-IS
PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...
*$*$ end of global - insert your declaration only before this line *-*
FORM compute_key_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS8ZHC_DS37
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/VZ11HC_37AT-COSTELMNT
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line
fill the internal table "MONITOR", to make monitor entries
* put Cost element into Result field
RESULT = COMM_STRUCTURE-COSTELMNT.
* accept all cost element except 699999
if COMM_STRUCTURE-COSTELMNT = '0000699999' or
COMM_STRUCTURE-COSTELMNT = '0000560000'.
RETURNCODE = 1.
else.
RETURNCODE = 0.
endif.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.
*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.