Application Development and Automation 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: 
Read only

Submit issue

Former Member
0 Likes
776

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

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
745

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.

8 REPLIES 8
Read only

Former Member
0 Likes
745

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

Read only

0 Likes
745

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

Read only

0 Likes
745

Hello Bob,

Check with job scheduling option. I think that is more easier than submit....and return.

Thanks,

Augustin.

Read only

Former Member
0 Likes
745

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.

Read only

Former Member
0 Likes
745

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.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
746

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.

Read only

faisalatsap
Active Contributor
0 Likes
745

Hi, Dan

Please be clear with your Subject Line next time

Faisal

Read only

suresh_datti
Active Contributor
0 Likes
745

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