‎2008 Feb 26 5:00 PM
Hi,
The following CODE was written in the Update Rules as Field routine...of a Business Content.
Could you please explain me what job does the code was performing
fill the internal table "MONITOR", to make monitor entries
result value of the routine
if not &CS&-datebirth is initial.
&RS& = &CS&-calday0(4) - &CS&-datebirth0(4).
IF &CS&-calday4(4) LT &CS&-datebirth4(4).
&RS& = &RS& - 1.
ENDIF.
ENDIF.
if the returncode is not equal zero, the result will not be updated
&RC& = 0.
if abort is not equal zero, the update process will be canceled
&AB& = 0.
Thanks
‎2008 Feb 28 10:15 AM
Hello BW USER,
* fill the internal table "MONITOR", to make monitor entries
This is a comment, that you can use the MONITOR table for your own error messages in the scheduler protocol; if needed I could send you the appropriate code..
* result value of the routine
This comment indicates the section, where the results were computed.
if not &CS&-datebirth is initial.
&RS& = &CS&-calday+0(4) - &CS&-datebirth+0(4).
IF &CS&-calday+4(4) LT &CS&-datebirth+4(4).
&RS& = &RS& - 1.
ENDIF.
ENDIF.
Now the values of the communication structure &CS& are transformed in values of the return structure &RS& (here the current age of a person in years). The type of &RS& and &CS& depend on the technical name of your update rule, e.g. RESULT LIKE /BIC/VZIB_POSIBT-/BIC/ZIM_CGCO and COMM_STRUCTURE LIKE /BIC/CSZI_POSIB_IST.
* if the returncode is not equal zero, the result will not be updated
&RC& = 0.
Here you can return whether your transformation was successful or not.
* if abort is not equal zero, the update process will be canceled
&AB& = 0.
Finally you can state whether a technical error appeared during your transformation.
Hope this helps
regards M.L.
‎2008 Feb 28 10:15 AM
Hello BW USER,
* fill the internal table "MONITOR", to make monitor entries
This is a comment, that you can use the MONITOR table for your own error messages in the scheduler protocol; if needed I could send you the appropriate code..
* result value of the routine
This comment indicates the section, where the results were computed.
if not &CS&-datebirth is initial.
&RS& = &CS&-calday+0(4) - &CS&-datebirth+0(4).
IF &CS&-calday+4(4) LT &CS&-datebirth+4(4).
&RS& = &RS& - 1.
ENDIF.
ENDIF.
Now the values of the communication structure &CS& are transformed in values of the return structure &RS& (here the current age of a person in years). The type of &RS& and &CS& depend on the technical name of your update rule, e.g. RESULT LIKE /BIC/VZIB_POSIBT-/BIC/ZIM_CGCO and COMM_STRUCTURE LIKE /BIC/CSZI_POSIB_IST.
* if the returncode is not equal zero, the result will not be updated
&RC& = 0.
Here you can return whether your transformation was successful or not.
* if abort is not equal zero, the update process will be canceled
&AB& = 0.
Finally you can state whether a technical error appeared during your transformation.
Hope this helps
regards M.L.