on 02-18-2009 10:03 AM
Hi Experts,
does anybody know, what for is the 2nd part global declaration in a routine of a transformation?
Myself I'm a developer, so I can differ between global and local declaration in a class-definition. But the second possibility to declare variables is outside of class-definition and class-implementation.
I checked start routine, end routine and character/ keyfigure routine. I can see both of the declaration. Does it makes any sence to use this declaration?
***************************************************
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
$$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
$$ end of 2nd part global - insert your code only before this line *
***************************************************
Thanks in advance.
Greets Nico
Hi Nico
The usage of 1st global decleration or 2nd global area depends on scenarios.
If you have multiple data packages and u need to declare a global variable that can be used for all records in a single package then u should use data declerations with 'DATA'. This can be written in either 1st global area or the second.
But if you need to declare a global variable that can be accessed by the entire request (all packages),
then u need to use data declerations with 'CLASS-DATA'. This can be written in only in the first global area.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lijo,
first, thank you for you answer.
I'm not sure if I got it.
If you want to use a global variable for all packages that will be processed, I have to declare a CLASS-DATA. That means the instance of the class won't be deleted the whole data package.
If I want to use a global variable that will be used in character/ keyfigure routine it's sufficient to declare DATA in 1st or 2nd part of declaration.
I understand it in a way, that the second declaration part is redundant. Is it right?
Thanks in advance.
Greets Nico
As far as i know... this is the only difference. Whether the second global area is redundant or not depends on how u use it. Normally people use the second global area for all global declerations and the first global area is used only when there is a CLASS-DATA decleration.
But in ur case you use the first global area for all declerations. So may be u can consider it redundant.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm also searching for the SAP intent with this area (2nd part global). I was thinking of using this area for defining and implementing my own local classes. How does that strike you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.