on ‎2005 Nov 30 5:15 AM
Hi all,
When we declare the data declaration using STATICS and DATA.
What are the advantages using STATICS. why we use when we are creating generic extractors using FM.
Please let me.
Thanks and Regards
Satish
Request clarification before answering.
Hi Satish,
from SAP-Docu:
Example
The subroutine add_1 gets the same result for the variable local for each call as this is instanced again each time. The static variable static is already available and its value increased by one during each call.
DO 10 TIMES.
PERFORM add_one.
ENDDO.
FORM add_one.
DATA local TYPE i VALUE 10.
STATICS static TYPE i VALUE 10.
local = local + 1.
static = static + 1.
WRITE: / local, static.
ENDFORM.
/manfred
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
you need static variables in generic extractors using FM because the function module is not called once but several times from BW (Once for initialization, then depending on size of data packages). Your extraction programm needs to keep some data from the initial call to be able to extract corectly in the next call. If you use standard (DATA) variables, they will be cleared again and again.
Hope that helps
Stephan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.