10-23-2006 1:52 PM
Hello All,
I need to declare a internal table with header line in a common part area ( Begin of common part), so that it can be used by more than one program of a program group.
The table structure is :
DATA : BEGIN OF i_msg OCCURS 0,
aenam LIKE zvs21-aenam,
langu LIKE zvs21-langu,
vbeln LIKE zvs21-vbeln.
INCLUDE STRUCTURE message.
DATA : END OF i_msg.
Kindly let me know how can i go abt this ?
Thanks in advance,
Sharat
10-23-2006 3:11 PM
Hi,
you can also use include program to declare internal
table
include zcommon.
DATA : BEGIN OF i_msg OCCURS 0,
aenam LIKE zvs21-aenam,
langu LIKE zvs21-langu,
vbeln LIKE zvs21-vbeln.
INCLUDE STRUCTURE message.
DATA : END OF i_msg.
report ztest.
include zcommon.
or
Variant 5 DATA: BEGIN OF COMMON PART c,
.....
END OF COMMON PART.
Effect Defines one or more common data areas in programs linked by
external PERFORM calls. If only one common data area exists,
you can omit the name c. There may be just one unnamed COMMON
area or one or more named COMMON areas. You assign named COMMON
areas to each other by name. The structure of data areas must
always be the same for both the calling and the called program
(otherwise, the program terminates with an error message at
runtime).
You must specify the name of a common data area as a direct
value, i.e. without quotation marks.
Notes - The table work areas are always in the common data area.
- In general, you define the area created as COMMON with a
common INCLUDE STRUCTURE. Occasionally, you use a INCLUDE
report which contains precisely the definition of the COMMON
PART.
- Field symbols cannot belong to a common data area, even if
the FIELD-SYMBOLS statement lies between DATA BEGIN OF
COMMON PART and DATA END OF COMMON PART.
Regards
amole
10-23-2006 2:14 PM
Add the following to both programs:
DATA: BEGIN OF COMMON PART.
DATA: BEGIN OF i_msg OCCURS 0,
aenam LIKE zvs21-aenam,
langu LIKE zvs21-langu,
vbeln LIKE zvs21-vbeln.
INCLUDE STRUCTURE message.
DATA: END OF i_msg.
DATA: END OF COMMON PART.
Rob
10-23-2006 3:11 PM
Hi,
you can also use include program to declare internal
table
include zcommon.
DATA : BEGIN OF i_msg OCCURS 0,
aenam LIKE zvs21-aenam,
langu LIKE zvs21-langu,
vbeln LIKE zvs21-vbeln.
INCLUDE STRUCTURE message.
DATA : END OF i_msg.
report ztest.
include zcommon.
or
Variant 5 DATA: BEGIN OF COMMON PART c,
.....
END OF COMMON PART.
Effect Defines one or more common data areas in programs linked by
external PERFORM calls. If only one common data area exists,
you can omit the name c. There may be just one unnamed COMMON
area or one or more named COMMON areas. You assign named COMMON
areas to each other by name. The structure of data areas must
always be the same for both the calling and the called program
(otherwise, the program terminates with an error message at
runtime).
You must specify the name of a common data area as a direct
value, i.e. without quotation marks.
Notes - The table work areas are always in the common data area.
- In general, you define the area created as COMMON with a
common INCLUDE STRUCTURE. Occasionally, you use a INCLUDE
report which contains precisely the definition of the COMMON
PART.
- Field symbols cannot belong to a common data area, even if
the FIELD-SYMBOLS statement lies between DATA BEGIN OF
COMMON PART and DATA END OF COMMON PART.
Regards
amole