01-10-2006 6:26 PM
Hello!
I´ve written a report Z1 which executes submit to a report type alv z2 (after loading parameters by screen), and shows the results.
As information is always changing, the user does not want to return to enter the parameters and to again execute the report, but that he wants to select a button (type refresh) and to see the updated data.
Then I´ve defined a function so that when it is chosen, the program executes a SUBMIT of himself (z2), in order to simulate the generation of data again:
SUBMIT z2 WITH kkber IN kkber
WITH sbgrp IN sbgrp
WITH cmngv IN cmngv
WITH knkli IN knkli
AND RETURN.
The problem is that after choosing 6 times the function then an error message appears:
"the Maxima amount of internal ways has been reached".
I have used this not to again write the generation of data.
Any solutions?
Thanks!!!!!!!
Liliana
01-10-2006 6:45 PM
01-10-2006 6:31 PM
01-10-2006 6:47 PM
Yes, it is ALV report.
But remember that data is always changing, I don't want a simple refresh of the screen but the updated data too, which must include the recently orders.
I'hope you can help me!!!!
01-10-2006 6:45 PM
01-10-2006 6:49 PM
The submit is ok, but the problem is that you can't execute n submits, the stack is over!
01-10-2006 7:43 PM
Hello Liliana,
this is due to the extension 'AND RETURN'. Without this extension there is no stack. But to refresh the data as proposed by Rich sounds like the better solution.
Regards
Klaus
01-10-2006 7:51 PM
01-10-2006 7:56 PM
Of course you loose the complete stack. If the report e.g. is part of a transaction there will be no way back.
A small enhancement would be to leave a 2nd level submit in case if refresh with a certain state (export to shared buffer) and use this as instrumentation for further level 2 calls.
Regards
Klaus
01-10-2006 8:06 PM
01-10-2006 8:10 PM
01-10-2006 6:47 PM
HI,
after the submit just use this selfied-refresh = 'X'.
regards
vijay
01-10-2006 6:48 PM
01-10-2006 6:59 PM
But if a write LEAVE TO TRANSACTION SY-TCODE, then the first screen appears and the user must write the parameters again and press F8?
For more information, I'm working with a copy of RVKRED02.
01-10-2006 6:54 PM
From Z1 you are SUBMITting Z2.
Z2 does some database updates and shows the data in ALV.
User presses REFRESH.
In which program is this function handled, in Z2?
Also, why can't the user work with Z2 directly?
Srinivas
01-10-2006 7:03 PM
I'm working with a copy of RVKRED02.
My ZRVKRED02 (vkm1) submits ZRVKRED01 (wich is a copy of another standard).
The ZRVKRED01 generates the data, and display the results.
The users press a button in order to see the updated orders without exiting the screen.
And he wants to do it lots of times.
This is why I can´t submit lots of times the program.
01-10-2006 7:04 PM
Here is what I mean, when I say about handling the refresh in the Z2 program. Notice here, you never have to leave the program in order to refresh the data. Just get the data again, and write the list again. Or in your case, throw the ALV again.
report zrich_0002 no standard page heading.
parameters: p_parm(10) type c.
data: datum type sy-datum,
uzeit type sy-uzeit.
start-of-selection.
* Create the status with a button on the application
* toolbar with FCOde as REFRESH
set pf-status 'MAIN'.
perform get_data.
perform write_data.
at user-command.
case sy-ucomm.
when 'REFRESH'.
* Setting sy-lsind allows for the refresh, this wouldn't
* work for alv grid. I believe the limit on lists is 20.
sy-lsind = sy-lsind - 1.
perform get_data.
perform write_data.
endcase.
*---------------------------------------------------------------------*
* FORM get_Data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form get_data.
datum = sy-datum.
uzeit = sy-uzeit.
endform.
*---------------------------------------------------------------------*
* FORM write_data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form write_data.
write:/ datum, uzeit.
endform.
01-10-2006 7:40 PM
I see why you want to do what you want to do. Here is a possible solution. This example uses memory to pass a flag back to the caller when the user presses refresh, the calling program will keep calling the other program under the user does not click refresh.
Calling Program.
report zrich_0001.
<b>data: flag type c value 'X'.</b>
parameters: p_parm(10) type c.
start-of-selection.
<b> while flag = 'X'.
clear flag.
submit zrich_0002
with p_parm = p_parm
and return.
import flag from memory id 'ZRICH_0002_REFRESH'.
free memory id 'ZRICH_0002_REFRESH'.
endwhile.</b>
The submitted program.
report zrich_0002 no standard page heading.
parameters: p_parm(10) type c.
data: datum type sy-datum,
uzeit type sy-uzeit.
<b>data: flag type c.</b>
start-of-selection.
set pf-status 'MAIN'.
perform get_data.
perform write_data.
at user-command.
<b> case sy-ucomm.
when 'REFRESH'.
flag = 'X'.
export flag to memory id 'ZRICH_0002_REFRESH'.
leave program.
endcase.</b>
*---------------------------------------------------------------------*
* FORM get_Data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form get_data.
datum = sy-datum.
uzeit = sy-uzeit.
endform.
*---------------------------------------------------------------------*
* FORM write_data *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
form write_data.
write:/ p_parm, datum, uzeit.
endform.
I am assuming that you are already successfully firing the refresh action when the user clicks a button.
Regards,
Rich Heilman
01-10-2006 8:07 PM