Execute in Back ground when push button clicked on alv output

Hi Friends,
I have a alv list display report with check boxes and a 'Detail' Push button in output
when i check the check boxes and click on the 'Detail' Push button detail report is
displayed using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'. My requirement is if I click on 'Detail'
push button the code should also execute in back ground creating the spool. Request you
to help with sample code. I tried with below but not working.
WHEN 'DETAIL'.
      call function 'START_OF_BACKGROUNDTASK'
      exporting
       startdate = sy-datum
       starttime = sy-uzeit
      exceptions
      others    = 1.
      if sy-subrc = 1.
       exit.
      ELSE.
       PERFORM determine_table_from_output CHANGING rs_selfield.
       PERFORM call_alv_detail.
      endif.
     commit work.
Thanks,
Neetha.

You could encapsulate the detail display in a separate report and call it in your 'DETAIL'-section like this:
DATA: lv_number TYPE tbtcjob-jobcount,
           lv_name   TYPE tbtcjob-jobname,
           ls_rsparams TYPE rsparams,
           lt_rsparams LIKE STANDARD TABLE OF ls_rsparams.
*           Get free job number
             CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                 jobname          = lv_name
               IMPORTING
                 jobcount         = lv_number
               EXCEPTIONS
                 cant_create_job  = 1
                 invalid_job_data = 2
                 jobname_missing  = 3
                 OTHERS           = 4.
             IF sy-subrc = 0.
               SUBMIT 'ZDISPLAY_DETAIL'
               VIA JOB lv_name NUMBER lv_number
               WITH SELECTION-TABLE lt_rsparams
               AND RETURN.
               IF sy-subrc = 0.
*                Submit
                 CALL FUNCTION 'JOB_CLOSE'
                   EXPORTING
                     jobcount             = lv_number
                     jobname              = lv_name
                     strtimmed            = 'X'
                   EXCEPTIONS
                     cant_start_immediate = 1
                     invalid_startdate    = 2
                     jobname_missing      = 3
                     job_close_failed     = 4
                     job_nosteps          = 5
                     job_notex            = 6
                     lock_failed          = 7
                     OTHERS               = 8.
              ENDIF.
Regards,
Ulrich

Similar Messages

  • How to see the SQL running in back ground when we genarate a report.

    Hi All,
    I am new to Oracle Reports Builder toll and I would like to see the SQL query/script running in back ground when we run any perticular report using Reports Builder 10g.
    Please help me with this query, Thank You Very much for your help in Adv.
    Thanks,

    Hi,
    well the only option you can try is enabling trace from Builder (Program --> Tracing --> ALL) and then from the OS keep checking the trace file being created when the report is running. Something like the following will be recorded.
    example
    10:14:18 APP .. ( Repeating Frame R_G_EMPNO
    10:14:18 APP ... ( Group G_EMPNO Local Break: 0 Global Break: 0
    10:14:18 APP .... ( Query Q_1
    10:14:18 SQL EXECUTE QUERY : select * from emp where deptno=:x
    Bind Variable Value
    X 10
    10:14:18 APP .... ) Query Q_1
    10:14:18 APP ... ) Group G_EMPNO
    10:14:18 APP ... ( Text Field F_DEPTNO
    Hope this helps
    Roberto

  • Multiple flash files change when a button click using javascript function

    hi.. am new in flsh...
    i want to multiple flash files change when a button click using a javascript

    <script>
    var count=0;
    function mafunct(newSrc){
        alert("hi");
    var path="a"+count+".swf"; 
    flash+='<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="100%" HEIGHT="100%">';         
        flash+='<PARAM NAME=movie VALUE="'+path+'">';         
        flash+='<PARAM NAME="PLAY" VALUE="false">'; 
        flash+='<PARAM NAME="LOOP" VALUE="false">';
        flash+='<PARAM NAME="QUALITY" VALUE="high">';
        flash+='<PARAM NAME="SCALE" VALUE="SHOWALL">';
        flash+='<EMBED NAME="testmovie" SRC="Menu.swf" WIDTH="100%" HEIGHT="100%"PLAY="false" LOOP="false" QUALITY="high" SCALE="SHOWALL"swLiveConnect="true"PLUGINSPAGE="http://www.macromedia.com/go/flashplayer/">';
        flash+='</EMBED>';
        flash+='</OBJECT>';    
    count++;
    alert(path+"aa");
    </script>
    <button onclick="mafunct()">next</button>

  • HT1689 I want to close apps running in back ground but after double clicking I dont get apps running in back ground instead photo apps open after double clicking home screen

    I want to close apps running in back ground but after double clicking I dont get apps running in back ground instead photo apps open after double clicking home screen Please help.

    iPhone 3G does not support multitasking

  • What happens in the back ground when you schedule a Sales Order?

    Gurus,
    What happens in the back ground when you schedule a Sales Order?
    Assemble to Order scenario.
    Edited by: 792050 on May 17, 2011 3:24 AM
    Edited by: 792050 on May 17, 2011 3:24 AM

    If I merge libraries and then back the merged libraries up onto an external drive or DVD, do I just back up the libraries themselves, or do I also back up the original files?
    If you're running a Managed Library, then backing up the Library also backs up the original files.
    I ask because my HDD is getting pretty full. I want to reduce the amount of stuff on it, and the iPhoto libraries are the biggest single consumer of space at the moment (Nearly 100GB).
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD
    P.s. If you're running a Managed library, then it's the default setting, and iPhoto copies files into the iPhoto Library when Importing
    If you're running a Referenced Library, then you made a change at iPhoto -> Preferences -> Advanced and iPhoto is NOT copying the files into the iPhoto Library when importing.

  • Differebce between session and Execute in back ground

    Hi Gurus,
    Can any one explain me what is the Differebce between session and Execute in back ground.
    Thanks in advance!!!!!
    Thanks and Regards,
    Boppana
    Moderator: Please, search before posting and use relevant forums

    Hi, back ground works 'directly on server'. So it needs less resources

  • How to add a push button on an ALV grid  ?

    Hi,
    How to add a push button on an ALV grid, using ON_TOOLBAR, ON_USERCOMMAND Methods. Clicking on that push button, a new screen has to be displayed.

    Hi,
            Assuming that you want to have a "push-button" column, i.e. push-buttons within an ALV grid then you need to implement the following steps:
    (1) Set the style of the column as button
      ls_fcat-style = CL_GUI_ALV_GRID => MC_STYLE_BUTTON.
    (2) When the user pushes the button event BUTTON_CLICK is triggered. Thus, define an appropriate event handler method.
    <b>Reward points</b>
    Regards

  • Can we disable the default push buttons on the ALV Grid

    Hi,
        Can we disable the default push buttons on the ALV
    Grid Control...
        If so, pls send me the procedure...
    thanks and regards
       raghu

    Hi,
    In the PBO:
      PERFORM f9100_exclude_functions USING :
                             i_exclude[]  '&CHECK',
                             i_exclude[]  '&REFRESH',
                             i_exclude[]  '&LOCAL&CUT' ,
                             i_exclude[]  '&LOCAL&COPY',
                             i_exclude[]  '&LOCAL&PASTE',
                             i_exclude[]  '&LOCAL&PASTE_NEW_ROW',
                             i_exclude[]  '&LOCAL&UNDO' ,
                             i_exclude[]  '&LOCAL&APPEND',
                             i_exclude[]  '&LOCAL&INSERT_ROW',
                             i_exclude[]  '&LOCAL&DELETE_ROW',
                             i_exclude[]  '&SORT_ASC',
                             i_exclude[]  '&SORT_DSC',
                             i_exclude[]  '&FIND',
                             i_exclude[]  '&SUMC',
                             i_exclude[]  '&SUBTOT',
                             i_exclude[]  '&MINIMUM',
                             i_exclude[]  '&MAXIMUM' ,
                             i_exclude[]  '&VGRID' ,
                             i_exclude[]  '&VEXCEL' ,
                             i_exclude[]  '&VCRYSTAL',
                             i_exclude[]  '&HTML',
                             i_exclude[]  '&MAINTAIN',
                             i_exclude[]  '&SAVE',
                             i_exclude[]  '&GRAPH',
                             i_exclude[]  '&HELP',
                             i_exclude[]  '&ALL' ,
                             i_exclude[]  '&SAL' .
    *                         i_exclude[]  '&EXCLALLFC'.
    *&      Form  f9100_exclude_functions
    * This form exclude buttons  from the toolbar.
    *      -->P_IEXCLUDE  text
    *      -->P_1150   text
    FORM f9100_exclude_functions USING   pexclude LIKE i_exclude
                                   value(pfunction).
      DATA: l_exclude TYPE ui_func.
      l_exclude = pfunction.
      APPEND l_exclude TO pexclude.
    ENDFORM.                    " f9100_exclude_functions
    This will exculde the default push buttons.
    Let us know if it works for you.
    Regards,
    Anjali

  • Adding push buttons in standard ALV

    Hi ,
    Is there any possiblity to add custom push buttons to standard ALV in Webdynpro for ABAP.
    If so, please provide me the solution.
    Thanks in Advance.
    cheers,
    sravan.

    I got the answer .

  • Add button to QA33 ALV output list

    Hi, SAP experts:
    I need to add a custom button to the ALV output list display in QA33 transaction.
    I´ve only found the BAdi ALV_SWITCH_GRID_LIST, but it doesn´t fit my requirements at all.
    Any idea?
    Thank you very much!

    Hi,
        Please check if this explanation helps you,
    Custom Butoon in REUSE_ALV_GRID_DISPLAY_LVC
    Regards
    Ram

  • New window everytime when submit button clicked in JSF

    Hi all,
    I am facing an issue where I need to popup a new window everytime the submit button on my JSF form is clicked.
    I have tried several methods but none is working to my purpose.
    1. Add a target="_blank" attribute in the JSF form. The problem is that even if any of my ValuechangeListeners get invoked, the page is rendered in a new window. My ValuechangeListeners work on onchange="submit()".
    2. Invoke a new window from javascript and name the window as say" new" . Also name the form's target as "new" but this does not generate a new window everytime and also problem 1 persists.
    3. If i use actionlistener and onclick event on button in the form, then the new page is rendered in both current page and new window.( javascript for new window is written).
    What I need is when a person clicks on submit button in the form, a new window should always popup up and the page should be rendered in the new window. The original form should remain as it is so that a user can again do a submit and get a new window.
    Please suggest.

    devayani wrote:
    Thanks all for the replies.
    Try onchange="this.form.target='_self';submit();"This works fine if all the valuechangelisteners are invoked. Suppose,if I dont select the radio
    button and dont select any values in list box. Now if i click submit, since the target=_blank,
    the page giving validation errors (for not selecting the list box)
    renders in a new page. As expected behavior, not my solution.
    If you need validation to remain in the same window (and that seems like the best for the user experience you have described), then delay the creation of the new window until after the request finishes. I.e., your page should always go back on itself. Under the right conditions (which you can set in your action method) it conditionally writes JavaScript which targets the new window.
    >
    Try returning false from the onclick event.I had tried it long back, so I just messed it up while writing, there were no actionlisteners.
    sorry about my third solution, lets consider solution 2 as below:
    Javascript
    <script type="text/javascript" >
         function newWindow(){
              window.open('','mywindow','width=400,height=200');
              return false;
         </script>
    JSF
    <h:form id="Frm_New" target="mywindow">     
    <h:commandButton id="btn_submit" disabled="false"             
                  action = "#{TestBean.submitValues}"
                  value="#{bundle.SC_SUBMIT}"
                  onclick ="newWindow()">But again this approach has above problems and also no new window everytime. For new window you said:
    Append a time stamp or random number to
    the end of the window name.This solution will not work as I have to reset the target for my form everytime to this new window name.You can remember the name of the window if necessary. Although you seem to be changing things on the fly; earlier the problem was you didn't get a new window every time. Or are you just confused on how to set the target?
    onclick="var wname = getWindowName(); createNewWindow(wname); this.form.target = wname; return true;">
    I was trying to actually set the target of the form as _blank at runtime during one of the phases of JSF lifecycle ( by using phaselistener). Although its not working as of now. Does this sound a good approach
    This is because I dont think that setting it on jsf would work as the page rendering on a new window( in my case) not only depends on clicking the submit button only but it depends on whether the user is done with all vaildations and now has to see the final result into new window.This would be addressed by the conditional JavaScript solution above.

  • How to popup a menu when rigth button clicked?

    Hi, i have a mouse listener on a Jtree, it is working fine and now i want that when the user clicks in the right button of the mouse, a popUp menu appears with diferent options depending on the type of node....i only need to know how do make the menu to appear...
    thanks

    I have had this same problem. For me it always occurs on Mandrake (I've only tried 8.0 and 8.1), but I have never had it occur on other Linux distributions such as Red Hat or Debian.
    Quick caveat: Although Sun says that this is not a
    bug I have installed Java on 5 different computers
    with various versions of Mandrake Linux (7.1, 8.0, and
    8.1) In these installations a left click (the main
    button click) will return a mouse event with a button
    mask of BUTTON1_MASK + BUTTON3_MASK instead of simply
    BUTTON1_MASK. This makes your popup window appear on
    every mouse click instead of just right button click.
    The solution (until this bug is fixed) is to see if
    the int returned from the getModifiers() method on
    mouse event == BUTTON1_MASK + BUTTON3_MASK and if it
    does then DONT popup the window.
    Oddly enough, I've had other people test this and they
    tell me that the mouse events return the proper button
    mask but every time I've tested it I get this bug.
    Just a FYI. If you see that behavior then this is how
    to fix it.

  • Execute in back ground!!

    Hi,
    I am executing my program in background and sending mail for the output produced on  the screen ...
    in foreground as well as in case of back ground but in background the excel file is going blank
    any pointers?
    Regards
    Gunjan

    Hi,
    Gothroygh the below link ..
    http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
    Regards
    Sudheer

  • Popup window when radio button clicked

    Hello,
    I have a button that has a URL redirect of:
    javascript:popUp2('f?p=&APP_ID.:8:&SESSION.::NO:::', 400, 400);
    This opens a separate window.
    Now I want this to happen when the user clicks on a radio button on that page.
    Thank you,
    Matt

    You dont have to put this in html head..
    ON THE PAGE RENDERING SECTION..
    UNDER ITEMS... FIND THE RADIO BUTTON ITEM AND CLICK ON THAT..
    U WILL SEE DIFFERENT TAB OVER THERE... LIKE .. SHOW ALL , NAME , DISPLAYED , LABEL , ELEMENT ... ETC..
    SELECT ELEMENT..
    UNDER ELEMENT YOU WILL SEE
    HTML FORM ELEMENTS ATTRIBUTES... IN THAT TEXT BOX U JUST HAVE TO COPY AND PASTE THE ABOVE CODE

  • How to disable the custom push button in Classic ALV

    Hi All,
    Iam Using Classic Alv (with out classes).I have a created a push button.now at run time i want to make it dynamic .
    iam using REUSE_ALV_GRID_DISPLAY
    for ex.
    i have some records in my out put.
    i have a push button "INSERT"
    For first time when i clicked it will be inserted.
    Now if i run the report for the same inputs as top,i will get the records.But the "INSERT" push button should be disable.IS that Possible ??
    If yes kindly send me the solution.

    Hi,
    Here is the piece of code for your understanding...
    FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
      REFRESH i_extab.
      PERFORM f4210_exclude_fcodes CHANGING i_extab.( This form is mentioned below ).
      SET PF-STATUS 'STANDARD' OF PROGRAM '(Program name)' EXCLUDING i_extab.( This line of code will excude the function u don't want)
    ENDFORM.
    FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
      DATA: ws_fcode TYPE slis_extab.
      CLEAR ws_fcode.
      ws_fcode = '&EB9'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&ABC'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&NFO'.           
      APPEND ws_fcode TO i_extab.
      ws_fcode = '&LFO'.          
      APPEND ws_fcode TO i_extab.
    ENDFORM.                    " f4210_exclude_fcodes
    I hope this clarifies. Revert for any queries.
    Cheers,
    Venkat

Maybe you are looking for