on 09-01-2017 5:25 AM
Hello,
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?
Regards,
Karthick
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"if you are not in such program, then you can just write"
No, you shouldn't reuse includes
Hey Horst, the link you provided (https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_i...) is broken.
To clarify -"if you are not in such program, then you can just write" - I meant that if you are in a program completely different and want to reuse some code from another program then you can use INCLUDE statement in such a way where you do not use include programs more than once.
Hi! Horst must have gotten an internal URL. This should be a working one:
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenmultiple_use_include_guidl.htm
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"
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.