Start of Content Area

 Procedure documentation Creating Update Routines  Locate the document in its SAP Library structure

Prerequisites

You are in the update rules maintenance screen for your InfoProvider in the detail view of the key figure/data field/attribute for which you want to create a routine.

Procedure

...

       1.      Choose Routine.

       2.      Choose Create routine.

The ABAP editor appears with the following source code:

1.

PROGRAM UPDATE_ROUTINE.

2.

 

3.

*$*$ begin of global - insert your declaration only below this line  *-*

4.

* TABLES:...

5.

* DATA:  ...

6.

*$*$ end of global - insert your declaration only before this line   *-*

7.

*

8.

FORM compute_characteristics

9.

  TABLES   monitor structure rsmonitor "user defined monitoring

10.

  USING    COMM_STRUCTURE LIKE /BIC/CS<infosource>

11.

           RECORD_NO LIKE SY-TABIX

12.

           RECORD_ALL LIKE SY-TABIX

13.

           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS

14.

  CHANGING RESULT LIKE /BIC/V<infocube>T-<infoobject>

15.

           RETURNCODE LIKE SY-SUBRC.

16.

*

17.

*$*$ begin of routine - insert your code only below this line        *-*

18.

* fill the internal table "MONITOR" to make monitor entries

19.

 

20.

* result value of the routine

21.

  RESULT =.

22.

 

23.

* if the returncode is not equal zero, the result will not be updated

24.

  RETURNCODE = 0.

25.

 

26.

* if abort is not equal zero, the update process will be canceled

27.

 

28.

  ABORT = 0.

29.

*$*$ end of routine - insert your code only before this line         *-*

30.

*

31.

ENDFORM.

 

Text in blue italics and marked <> is replaced automatically with the relevant object names.

       3.      In lines 4 and 5, between *$*$ begin of global... and *$*$ end of global... you can add global declarations (tables or data) that you are able to use in any subsequent routines that you create.

Note

When you load data in series, this global data remains, provided that the process is retained. For this reason, a REFRESH statement has to be here with internal tables. When you load data in parallel, the global data does not remain, because a separate process is generated for each data packet. See also: Tab Page: Processing.

       4.      Insert your code under *$*$ begin of routine ... (line 17) and *$*$ end of routine ... (line 29). The Result = (21) field contains the result of your update routine.

       5.      Use the Check function to check the syntax of your routine.

       6.      Save your entries. You end the maintenance session for the routine by leaving the editor.

 

End of Content Area