‎2009 Aug 28 3:28 PM
Hello friends,
I had to add a refresh buttom to a classical interactive report.
I have done with the below code and it works
{
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'REFRESH'.
SUBMIT zsgnr002
WITH s_wadat IN s_wadat
WITH s_edatu IN s_edatu
WITH s_vbeln IN s_vbeln
WITH s_vstel IN s_vstel
WITH p_reject EQ p_reject .
ENDCASE.
}
The problem is when the users executes the reprort he gets the output as required. But when he hits the green arrow back it dosent take him to the selection screen. Instead it takes to the main SAP screen.
ANy suggestion
Bob
‎2009 Aug 31 3:05 PM
This Works...
back button must be of type Exit-command
PARAMETERS: pa_1 TYPE char255.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'BCK'.
LEAVE LIST-PROCESSING AND RETURN TO SCREEN 0.
WHEN 'REFRESH'.
SUBMIT ykesavtbc
WITH pa_1 = 'A'.
ENDCASE.
START-OF-SELECTION.
SET PF-STATUS 'ABC'.
WRITE pa_1.
‎2009 Aug 28 3:35 PM
Hi,
Try this:
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'REFRESH'.
SUBMIT zsgnr002
WITH s_wadat IN s_wadat
WITH s_edatu IN s_edatu
WITH s_vbeln IN s_vbeln
WITH s_vstel IN s_vstel
WITH p_reject EQ p_reject
AND RETURN "ADD THIS.
ENDCASE.Regards,
Gilberto Li
‎2009 Aug 31 2:52 PM
Thanks Gilberto.
I have tried with the submit....and return.
the problem is when the user clicks refresh then he has to het the green back button twice to come to the screen. if the user hits it refresh 3 time he has to hit the green back button 4 times and so on.
bob
‎2009 Sep 01 6:27 AM
Hello Bob,
Check with job scheduling option. I think that is more easier than submit....and return.
Thanks,
Augustin.
‎2009 Aug 28 4:21 PM
Hello Bob,
Why don't you try scheduling background JOB when user click refresh. This way you will still remain on selection screen and report will run in background.
You can use JOB_OPEN, JOB_SUBMIT & JOB_CLOSE function modules.
Hope this helps,
Thanks,
Augustin.
‎2009 Aug 28 4:40 PM
Hi ,
Please use 'Return' with your syntax .
e.g.
SUBMIT REPORT01
VIA SELECTION-SCREEN
USING SELECTION-SET 'VARIANT1'
USING SELECTION-SETS OF PROGRAM 'REPORT00'
AND RETURN.
‎2009 Aug 31 3:05 PM
This Works...
back button must be of type Exit-command
PARAMETERS: pa_1 TYPE char255.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'BCK'.
LEAVE LIST-PROCESSING AND RETURN TO SCREEN 0.
WHEN 'REFRESH'.
SUBMIT ykesavtbc
WITH pa_1 = 'A'.
ENDCASE.
START-OF-SELECTION.
SET PF-STATUS 'ABC'.
WRITE pa_1.
‎2009 Aug 31 4:28 PM
‎2009 Aug 31 5:20 PM
If the requirement is to go back to the selection screen, you should try the LEAVE statement & its variations. SUBMIT and RETURN creates a new internal session and might result in an error, if the user goes back and forth too many times between the list & the selection screen.
~Suresh