Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using values from main program

Former Member
0 Kudos

Hi Gurus,

Is it possible to retrieve values from the main program (SAPMM07M in my case) while being in an user-exit, several levels 'deeper' in the source?

And, secondly is it possible to alter these values, eventhough they're not exported from the user-exit?

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Hi Ron,

If you are out of the visibility of the data objects of SAPMM07M program you will not see its variables.

You can check when debugging if you see them. If they are global ones you may be lucky one, otherwise I am sorry.

There is one way to make these data objects visible at that point. You would have to use SAP memory or ABAP memory, but it requires adapation of main program. It means you would first have to export data objects you are interest in from main SAPMM07M, then when you are at lower level just import them back from the memory.

Unfortunatelly in this case changing stand. SAP programs is not possible so I affraid you can't do this.

BR

Marcin

6 REPLIES 6

MarcinPciak
Active Contributor
0 Kudos

Hi Ron,

If you are out of the visibility of the data objects of SAPMM07M program you will not see its variables.

You can check when debugging if you see them. If they are global ones you may be lucky one, otherwise I am sorry.

There is one way to make these data objects visible at that point. You would have to use SAP memory or ABAP memory, but it requires adapation of main program. It means you would first have to export data objects you are interest in from main SAPMM07M, then when you are at lower level just import them back from the memory.

Unfortunatelly in this case changing stand. SAP programs is not possible so I affraid you can't do this.

BR

Marcin

0 Kudos

Hi,

I know I can see the vars during debugging with viewing (SAPMM07M)mseg.

I tried making it visible by:

statics: lw_table(100),
            lt_mseg type standard table of mseg with header line.

   field-symbols: <lfs_mseg> type any table.

   lw_table = '(SAPMM07M)mseg[]'.

   assign (lw_table) to <lfs_mseg>.

   lt_mseg[] = <lfs_mseg>[].

0 Kudos

Yes, the solution for using the value is to create a field-symbol:


FIELD-SYMBOLS: <fs> TYPE ANY TABLE.
DATA: name(14) VALUE '(SAPMM07M)mseg'.
ASSIGN (name) TO <fs>

I'm not sure about modifying ... just try it ... but if it works just do it carefull.

Regards.

Valter Oliveira.

0 Kudos

>

> I'm not sure about modifying ... just try it ... but if it works just do it carefull.

>

> Regards.

> Valter Oliveira.

Hi Valter,

A small update. It's not really about reading the value ( I know see that the value of MSEG fields are visible) but the challenge is to update the field, while it is not an export parameter of the exit.

0 Kudos

Well, did you try it? Change (SAPMM07M)mseg in debug mode (not programatically, see the value of the itab itself) .. and see if changes are stored in main program.

Former Member
0 Kudos

I fiexed it witht the field symbol trick.