‎2005 Jun 23 5:22 PM
Hi Experts,
I have a selection screen, wherein there's a pushbutton. If i press the pushbutton it should execute the form(procedure) in background. I tried out with this code but it's not working. But when i used a checkbox instead of this pushbutton it works, what could be the problem. Are there any limitations in selection screen for pushbutton. Any help will be of great help.
My requirement is when i press the pushbutton it must call the form and execute it in background. How do i achieve this.
Any help on this will be very great.
Thanks,
Prabhu.
Message was edited by: Prabhakaran Paramasivan
‎2005 Jun 23 5:44 PM
‎2005 Jun 23 5:44 PM
‎2005 Jun 23 5:51 PM
Hi Rich,
Here's the code.
SELECTION-SCREEN PUSHBUTTON 79(22) text-B03 USER-COMMAND ucom2.
INITIALIZATION.
AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN 'ucom2'.
PERFORM DCS_STATISTICS.
endcase.
FORM DCS_STATISTICS.
PERFORM DCS_RUN.
ENDFORM.
‎2005 Jun 23 5:57 PM
‎2005 Jun 23 6:32 PM
Hi Rich,
Thanks a lot, it worked, but how do i run or execute the form in background. so that my program executes faster.
To award points i don't see the radio buttons in the messages to do it. if so how do i award points.
thanks,
Prabhu.
‎2005 Jun 23 6:42 PM
‎2005 Jun 23 6:44 PM
‎2005 Jun 23 6:46 PM
‎2005 Jun 23 6:53 PM
Here is a sample..... Make sure that you make your function module RFC enabled.
report zrich_0001 .
selection-screen begin of block b1 with frame title text-001.
selection-screen pushbutton 30(30) go user-command go.
selection-screen end of block b1.
at selection-screen .
case sy-ucomm.
when 'GO'.
perform execute_background.
endcase.
start-of-selection.
at selection-screen output.
* Write pushbutton text
go = 'Execute In Background'.
*---------------------------------------------------------------------*
* FORM execute_background *
*---------------------------------------------------------------------*
form execute_background.
call function 'Z_RICH_TEST'
in background task.
call function 'START_OF_BACKGROUNDTASK'
exporting
startdate = sy-datum
starttime = sy-uzeit
exceptions
others = 1.
if sy-subrc = 1.
exit.
endif.
commit work.
endform.
Regards,
Rich Heilman
‎2005 Jun 23 7:42 PM
Hi Rich,
Thanks once again, it works, so now I have place all my code which is in the form into a function module and call this. or can i just specify it like this as how u have told.
call function 'Z_RICH_TEST' in background task.
thanks,
Prabhu
‎2005 Jun 23 7:51 PM
You can do it like this to.........you don't need the form. You <b>do</b> need all of the code inside the form though.
report zrich_0001 .
selection-screen begin of block b1 with frame title text-001.
selection-screen pushbutton 30(30) go user-command go.
selection-screen end of block b1.
at selection-screen .
case sy-ucomm.
when 'GO'.
call function 'Z_RICH_TEST'
in background task.
call function 'START_OF_BACKGROUNDTASK'
exporting
startdate = sy-datum
starttime = sy-uzeit
exceptions
others = 1.
if sy-subrc = 1.
exit.
endif.
commit work.
endcase.
start-of-selection.
at selection-screen output.
* Write pushbutton text
go = 'Execute In Background'.
I just think it makes it a little neater to have specific functionality in its own form.
Regards,
Rich Heilman