cancel
Showing results for 
Search instead for 
Did you mean: 

Difference 1st and 2nd global declaration in the start routine of a transfo

Former Member
0 Kudos

Hi Folkds,

What is the difference between first and second global declaration in the start routine of a transformation?

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

Second: $$ begin of 2nd part global - insert your code only below this line *

I browse a lot of forum post but got no clear definition. Bellow definition from one post seemd to be the most approriated, but as there where several other onces I wanted to re-check if somebody can confirm bellow:

-


There are two places where you can make a global declaration in a Start or End Routine.

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

... "insert your code here

*" In this part your global declarations values will only be retained for the 1st packet. For e.g. if here you are reading any date range from a Ztable, then it will applt only for the first data packet

.*2. $$ 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 *

" You need to declare here in a scenario where data volume is large and you need to retain the values across the whole data set comprising of multiple packets. (As e.g I cited above)

-


Some difference I noted is that 1st part never acceptes an include. But 2nd part does.

Thanks for all replies in advance,

Axel

View Entire Topic
Former Member

>

>

> 1. $$ begin of global - insert your declaration only below this line -

> ... "insert your code here

>

> *" In this part your global declarations values will only be retained for the 1st packet. For e.g. if here you are reading any date range from a Ztable, then it will applt only for the first data packet

> l

not true

1st part => declarations according to OO standards

2nd part => declarations according to "normal" ABAP standards

the official docu is rather "vague"

(http://help.sap.com/saphelp_nw70ehp2/helpdata/en/43/857adf7d452679e10000000a1553f7/content.htm)

Former Member
0 Kudos

Mmmmm.... still confused.

Reading the docu means I understand

> 1. $$ begin of global - insert your declaration only below this line -

> ... "insert your code here

You define there CLASS data -> something you would use accross packages.

You define data -> somthing that is valid only for the particular package e.g. lookup table that is based on all entries in source package etc.

But how comes the 2nd global declaration into play?

Former Member
0 Kudos

hence the "vague"

as far as I understand

part 1 => CLASS DATA (ABAP OO)

part 2 => DATA (ABAP)

former_member186445
Active Contributor
0 Kudos

not sure about the class or abap declarations...but from experience, i know you can declare the same kind of data in both. then only difference i noted till today is : if you put ag a internal table in the first part, then the data is kept across all datapackage. put it in the second and the data is only kept for the current package.

M.

Former Member
0 Kudos

apparently I once double checked this with SAP, this was their answer

In the first global part you can write your declaration or code you want to be able to reach globally in the tranformation.

The 2nd global part will be used for those transformations which are migrated from an update or transfer rule. Routines used there will be automaticaly generated into the 2nd global part.