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: 

Recursive Submit

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

just write

SUBMIT Z2.

17 REPLIES 17

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You don't have to do that, put the refresh functionality in the Z2 program on the application toolbar, If the user presses the refresh button, perform the data retrieval and throw the ALV again. Its that simple. Are you using the function module ALV or the OO?

REgards

Rich heilman

0 Kudos

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!!!!

Former Member
0 Kudos

just write

SUBMIT Z2.

0 Kudos

The submit is ok, but the problem is that you can't execute n submits, the stack is over!

0 Kudos

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

0 Kudos

Wow, you learn something new everyday. I had no idea that removing the "AND RETURN" extension would do that.

That would probably fix your problem then.

Regards,

Rich Heilman

0 Kudos

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

0 Kudos

Thank you very much!!!!! It was all right!

0 Kudos

If your problem is solved please mark it as such by selecting "Solved Problem" next to the post that Klaus posted. Thanks.

Regards,

RIch Heilman

former_member188685
Active Contributor
0 Kudos

HI,

after the submit just use this selfied-refresh = 'X'.

regards

vijay

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Another possible way would be to....



* When user press refresh....

LEAVE TO TRANSACTION SY-TCODE.

If you do this, you would have to handle passing the selection screen values thru memeory using IMPORT/EXPORT.

Regards,

Rich Heilman

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

Thank you very much!!!!! It was all right too!