Skip to Content
author's profile photo Former Member
Former Member

usage of "Common part"

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.