Skip to Content
avatar image
Former Member

Reuse Global TYPES Declaration in Program


Is there any way to access the global types inside our exit?.

Eg : In Program MV45AZZ, global types has been declared as GY_XXX.

I need to reuse this global types inside my exit.

data : lt_table type table of ( 'SAPMV45A'(gy_xxx) ).

is there any way to reuse the types from top include?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 11, 2017 at 07:24 AM

    You are generally able to access things (like types or data declarations) within their scope. And "User-exit subroutines" like MV45AFZZ (if that is the one you mean) are in the scope of the main SAPMV45A. (In this case, you can use it just like you would expect: DATA: lt_table TYPE TABLE OF gy_xxx).

    However if you leave the scope in your exit, like calling another program och a class where you implement the logic for your exit, then you can not.

    Or if the data type you want is not on the main program level of SAPMV45A, you may not be in the scope of that data type.

    Please tell us which type you want to use, where it is declared, and where you want to use it in your implementation.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 09, 2017 at 05:07 PM


    I'm not sure I understand your problem. If you are writing code in a program that is aware of INCLUDE some_top_globals (let's assume it contains GY_XXX type) then you can use that GY_XXX type, if you are not in such program, then you can just write

    INCLUDE some_top_globals.
    "Your code from here onwards is aware of GY_XXX type

    If I'm off point from what you meant please let me know and I'll try and adjust the answer.

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks!

      And as I said (better written and coherent):

      "Do not use include programs more than once

      Use an include program for the modularization of exactly one master program. It must not be integrated into multiple different master programs. Also, an include program should only be integrated once within a master program"

  • Dec 09, 2017 at 09:56 PM

    You may declare the type in a new interface pool ZIF_name, and rename GY_XXX to ZIF_name=>GY_XXX everywhere it's used in SAPMV45A.

    Add comment
    10|10000 characters needed characters exceeded