Obtaining varaible from calling program

Alles rund um die Sprache ABAP®: Funktionsbausteine, Listen, ALV
3 Beiträge • Seite 1 von 1
3 Beiträge Seite 1 von 1

Obtaining varaible from calling program

Beitrag von pja (ForumUser / 2 / 0 / 0 ) »
Guys,

The user-exit I'm using (IWO10004) does not have the import/export parameters I require.

Therefore I'm using the following code in the user-exit to extract the data from the call-stack

Code: Alles auswählen.

field-symbols: <fs>. 
data: xclnot like sy-datar. 

* Retrieve values from calling program 
assign ('(SAPLCOIH)XCLNOT') to <fs>. 
xclnot = <fs>. 
And it doesn't work. It seems to work OK for internal tables, but not for this single character field.

The problem seems to be that XCLNOT is a local variable to LCOIHFG8.

Is there any way (using assign, or other method) of getting this local variable from LCOIHFG8 into my user-exit (and back again).

PeteA

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Beitrag von ereglam (Top Expert / 1829 / 2 / 7 ) »
Hi Pete,

unluckily there is no way to get to know the content of this variable, unless you are prepaired to modify the calling form routine by exporting the value to memory.
Gruß
Ereglam


May the Force be with your code
|| .| |.|| | .... . ..|. ||| .|. |.|. . |... . .|| .. | .... |.|| ||| ..| .|. |.|. ||| |.. .

ABAP memory

Beitrag von Wob (ForumUser / 3 / 0 / 0 ) »
Hi,

You can 'grab' the memory from any calling program --> as long as the variable you wish to use is defined globally in the calling program i.e. not in the top of a function module, but within the top include.

The syntax is as you have defined, but I have found that it doesn't work unless you define the value as a variable with a fixed value.

Try this code.

field-symbols: <fs> type table.
data tab type table of MHIO.
data: l_variable(40) value '(SAPLCOIH)MHIO_TAB[]'.

* Retrieve values from calling program
assign (l_variable) to <fs>.
move <fs> to tab.

This will grab the internal table and allow you to use the values. Unfortunately the field XCLNOT is not defined in the top include of program SAPLCOIH, but within the top of the function module. So you can't get that value. Look in the top include and see if the value is stored their within another field.

Even more scary is that you can manipulate the value in the calling program --> humph not something I would advise!!

In debug if you view the call stack and navigate to that program you should see the variable's, and their values, available to you. The only pre-condition is that they must be defined globally within that program. A good example is table declarations.

Cheers

Wob
(even more of an SAP expert than ereglam :D )

Seite 1 von 1

Vergleichbare Themen

1
Antw.
2197
Views
Type conflict when calling a function module., error key: RF
von ichtouk » 27.09.2013 09:39 • Verfasst in ABAP® für Anfänger
3
Antw.
5884
Views
Errors in Program
von Gast » 09.08.2005 05:03 • Verfasst in Development Related
1
Antw.
4842
Views
Program logic
von Sri » 29.08.2005 15:02 • Verfasst in Development Related
3
Antw.
2205
Views
Leave Program
von Stahle71 » 28.06.2016 10:48 • Verfasst in ABAP® für Anfänger
7
Antw.
976
Views
itab aus FuBa in Program
von stony007_de » 22.09.2020 12:57 • Verfasst in ABAP® für Anfänger

Über diesen Beitrag


Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Aktuelle Forenbeiträge

Massenpflege Customer
vor 4 Stunden von Thomas R. gelöst 18 / 13967
Abstimmschlüssel ändern
vor 15 Stunden von FS1895 1 / 22

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Aktuelle Forenbeiträge

Massenpflege Customer
vor 4 Stunden von Thomas R. gelöst 18 / 13967
Abstimmschlüssel ändern
vor 15 Stunden von FS1895 1 / 22

Unbeantwortete Forenbeiträge

Abstimmschlüssel ändern
vor 15 Stunden von FS1895 1 / 22
Application-Log, SLG1 Meldungstext
vor 2 Wochen von chhe001 1 / 684