2009 Jul 28 2:30 PM
Hallo ...
I am calling a subroutine in program A(standard program ) from a program B . there are a set of global fields in program A that i need to first set before i call this subroutine from Program B. is it posible to set these fields from program B. (since i cannot do much on the program A side as it is standard).?
Can some one suggest how can set these fields . some of these fields are flags and some normal fields. Not all the fields have parameterd ids. any idea how can i set thses fields from program B ?????
Help will be appriciated
Thanks
Hallo ...
I am calling a subroutine in program A(standard program ) from a program B . there are a set of global fields in program A that i need to first set before i call this subroutine from Program B. is it posible to set these fields from program B. (since i cannot do much on the program A side as it is standard).?
Can some one suggest how can set these fields . some of these fields are flags and some normal fields. Not all the fields have parameterd ids. any idea how can i set thses fields from program B ?????
Help will be appriciated
Thanks
2009 Jul 28 2:34 PM
2009 Jul 28 3:12 PM
2009 Jul 28 5:03 PM
Hi,
I think it may not be possible to change the global variables of one program form another program.
Can you enhance the standard program using Enhancement spots?
Thanks,
Sreekanth
2009 Jul 28 10:38 PM
Hello,
there are two choices:
(1) You can add a form to program A, if the standard program lets you implement user-defined code. For example, in program SAPMV45A you use a certain include to implement user-defined forms. You can define a form which takes the actual values of the fields in program A which you want to change as parameter. The form then changes the fields (from within the form, the fields are visible and changable). You can call this form by using PERFORM your_form IN program_A.
(2) You can use a "dirty assign": Refer to the F1 help of the ASSIGN statement for more information about that. Sample may look like this (note the brackets and apostrophes):
ASSIGN ('(PROGRAM_A)GLOBAL_FIELD') to <fs_proga_global_field>.However, the assign only works when program A has already been loaded into the internal mode during runtime. This means before doing the ASSIGN, any code of program A must have been executed in the current internal mode.
Hope this helps,
David
2009 Jul 28 11:15 PM
Hi this is possible if your program A run and call B inside it.
now u can change the value using field symbols in explicit enhancment if you dont hav any implicit enh or user exit
cheers
2009 Jul 29 3:41 AM
Hi,
<li>You can call standard program subroutine without changing code in std program.
<li>You need to create two program as i created below.
report ZTEST_PROGRAM.
data: x type p,
y type p.
x = 1.
y = 2.
perform get_changed_values using x CHANGING y.
WRITE:/ x,y.
*&---------------------------------------------------------------------*
*& Form get_changed_values
*&---------------------------------------------------------------------*
form get_changed_values using p_x
changing p_y.
p_y = p_y + p_x + 1.
endform. " get_changed_values
<li>Run program ztest_notepad program and check the values.
I hope that it solves your problem.
Thanks
Venkat.OREPORT ztest_notepad.
data: x type p,
y type p.
x = 2.
y = 3.
perform get_changed_values(ZTEST_PROGRAM) using x CHANGING y.
WRITE:/ x,y.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |