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

Explain yhe below ABAP Code

Former Member
0 Likes
355

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

1 ACCEPTED SOLUTION
Read only

martin_lehmann4
Active Participant
0 Likes
318

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.

1 REPLY 1
Read only

martin_lehmann4
Active Participant
0 Likes
319

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.