Problem with back button in alv o/p

Hi guys,
I am using Grid display to display a data. but when i am clicking on back button on o/p the o/p is displaying duplicate records for the first o/p. i,e it is displaying multiple records, again clicking on back it displaying extended o/p with more duplicate data...

Hi
Check did u refreshed the internal that u displayed.
And also check grid control is initial or not
Data: g_cust_container TYPE REF TO cl_gui_custom_container,
         g_cust_grid TYPE REF TO cl_gui_alv_grid.
**Create Container ALV Grid
  IF g_cust_grid IS INITIAL.
Create Control Container for Grid
    CREATE OBJECT g_cust_container
       EXPORTING
          container_name = g_container.
    IF sy-subrc <> 0.
add your handling, for example
      CALL FUNCTION 'POPUP_TO_INFORM'
        EXPORTING
          titel = sy-repid
          txt2  = sy-subrc
          txt1  = text-m02. "The control could not be created.
    ENDIF.
    CREATE OBJECT g_cust_grid
       EXPORTING
          i_parent = g_cust_container.
  ENDIF.
  CALL METHOD g_cust_grid->refresh_table_display.
Regards,
Raghu.

Similar Messages

  • BDC problem with back button

    Hi all,
    i have idoc number in alv output.when the user clicks on this ,it should take the control to BD87 transaction with idoc number getting transferred there .also BD87 screen has changed on select option where the default is sy-datum .i need to clear this along with transfer of idoc number.
    i tried using submit statement,but its not working.
    then i used call transaction in error mode to acheive this functionality and i was sucessful.
    beloe is my code:
       REFRESH bdcdata.
            READ TABLE t_out INTO wa_out INDEX rs_selfield-tabindex.
            DATA: lv_mode(1) TYPE c VALUE 'E'.
            PERFORM bdc_dynpro      USING 'RBDMON00' '1100'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'SX_UPDDA-HIGH'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=CRET'.
            PERFORM bdc_field       USING 'SX_DOCNU-LOW'
                                          wa_out-docnum.
            PERFORM bdc_field       USING 'SX_CRETI-LOW'
                                          '00:00:00'.
            PERFORM bdc_field       USING 'SX_CRETI-HIGH'
                                          '00:00:00'.
            PERFORM bdc_field       USING 'SX_UPDDA-LOW'
            PERFORM bdc_field       USING 'SX_UPDDA-HIGH'
            PERFORM bdc_field       USING 'SX_UPDTI-LOW'
                                          '00:00:00'.
            PERFORM bdc_field       USING 'SX_UPDTI-HIGH'
                                          '00:00:00'.
            PERFORM bdc_call_transaction USING 'BD87' lv_mode 'N'.
    So,the control directly takes me inside the BD87 screen just after the screen which we get after execting the selection screen of bd87 with idoc details
    the problem is whn i click on back button or F3,the control does not take me back to the ALV output screen rather it takes me to the selection screen of BD87.
    So,any way out to solve the back button problem???
    Thanks

    Hi Kunal,
    That's a really tough report to handle by submit.
    You can try to call the transaction in error mode and place one moment to force the screen to appear. Then complete the BTCI with the last steps to exit the selection screen.
    Try it like this:
    REFRESH bdcdata.
    READ TABLE t_out INTO wa_out INDEX rs_selfield-tabindex.
    DATA: lv_mode(1) TYPE c VALUE 'E'.
    PERFORM bdc_dynpro USING 'RBDMON00' '1100'.
    PERFORM bdc_field USING 'BDC_CURSOR' 'SX_UPDDA-HIGH'.
    PERFORM bdc_field USING 'BDC_OKCODE' '=CRET'.
    PERFORM bdc_field USING 'SX_DOCNU-LOW' wa_out-docnum.
    PERFORM bdc_field USING 'SX_CRETI-LOW' '00:00:00'.
    PERFORM bdc_field USING 'SX_CRETI-HIGH' '00:00:00'.
    PERFORM bdc_field USING 'SX_UPDDA-LOW' ''.
    PERFORM bdc_field USING 'SX_UPDDA-HIGH' ''.
    PERFORM bdc_field USING 'SX_UPDTI-LOW' '00:00:00'.
    PERFORM bdc_field USING 'SX_UPDTI-HIGH' '00:00:00'.
    *btci is interrupted in presentation of the result screen
    *last steps to exit selection screen
    PERFORM bdc_dynpro   USING 'RBDMON00' '1100'.
    PERFORM bdc_field       USING 'BDC_OKCODE' '/ECBAC'.
    PERFORM bdc_field       USING 'BDC_CURSOR' 'SX_UPDDA-LOW'.
    *use error mode in call transaction
    CALL TRANSACTION 'BD87' USING bdcdata MODE 'E'.
    *PERFORM bdc_call_transaction USING 'BD87' lv_mode 'N'.
    hope it helps,
    Edgar

  • Problem with Back button in Top Level Navigation

    Hi all,
    We are facing a minor problem with the Back button in the Top Level Navigation in Portal. This button is present under the Roles and Worksets menu along with the History, Forward, and Add to Portal Favorites links.
    The problem is faced when we have some worksets under a single role. While browsing accross these worksets by randomly clicking on them, we wish to use the Back button as well to go back to the previous workset. But when we use the Back button, the Detailed Navigation panel in the last workset is not retrieved.
    I will explain with the System Administration Role. I open the worksets under this role in the following manner:
    First I open Transport;
    Next I open Portal Display;
    Next I open System Configuration;
    Now I wish to go back to Portal Display workset by clicking on the Back button. But when I do this, although the Portal Display workset opens up, but I cannot see the Detailed Navigation Panel. See the screenshot below:
    http://img399.imageshack.us/my.php?image=backbuttonkg6.jpg
    Please help me in solving this issue.
    Regards,
    Ankur

    I think I have found a resolution, although not very pleasant:
    [Note 950426 - Portal Back button not working correctly|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_ep_pi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d393530343236%7d]
    Regards,
    Ankur

  • Multiple Video Tracks Problem with Back Button

    Hi,
    I am making a DVD that has to contain 16 films. Unfortunately the videos don't have the same aspect ratios, so I have to create one video track for each film.
    When the DVD is started they are supposed to play all in a row (no menus). So the end action for each track is to jump to the first chapter of the next track.
    My problem is that once I am playing, say, track 5, there is no way to get back to track 4 with the "back button" on the remote control.
    Do I have to script this? And if yes, how?

    That is exactly my problem. Chapter markers only work on the same track, for some reason you can't jump to a chapter in a different track. What I need is a solution to jump from a track to the previous one when pressing the back button on the remote.
    As I wrote before I can't use just one track for all films, because they have different aspect ratios.
    Message was edited by: schmiddl

  • Servlet Problem with Back Button on IE

    Hello All:
    This is a weird problem I am facing on IE.
    I have a servlet which is invoked by the doGet() method. This servlet
    has a FORM which has few fields. One of the field has a hyperlink which
    makes a window.open() call for Onclick. This pop-up allows a user to
    search for some value. The result of the search is displayed in a
    SELECT box. Based on the value selected in this SELECT box, the field
    in the servlet that called this pop-up gets populated. After this is
    done, I close this pop-up & click on the proceed button of the FORM
    (using POST) which takes us to another servlet. Then when I click on
    the back button, the fields on the form which were populated are gone.
    I have made the following analysis:
    (i) On clicking the back button, a request is sent to the server.
    (ii) It works on FireFox & not on IE
    (iii) If I do not use the hyperlink to bring the pop-up, and then I
    click on proceed and then back, the fields do not vanish.
    (iv) I tried using http://www.google.com to the call on window.open().
    Does not help
    (v) The very action of using pop-up by clicking on it causes this
    problem
    (vi) I tried replacing the hyperlink with a button. It did not work.
    Any help or tips in this regard would be helpful.
    Thanks in advance.
    Mahesh

    I dont know how you can post on the back button, and am a bit confused as to why you need to go back, you would normally want to go forwards :).
    What I would do is have the same servlet handle both cases.
    I would make 1 servlet SUBMIT TO ITSELF.
    You may have to pass an additional parameter to indicate whether this is the initial / first request, or a subsequent request where the servlet has re-submitted back to itself.
    If you want to disable the back button you can use javaScript
    <script language="JavaScript" type="text/JavaScript">
    <!--
    javascript:window.history.forward(-1);
    -->
    </script>
    I used this when I found that users could use the back button and re-submit when I didnt want them to, kind of the opposite of your problem!

  • Problem with 'BACK' option for ALV grid

    Hi Friends,
    I'm using FM, REUSE_ALV_GRID_DISPLAY in my report.
    Once I got an ALV output, when I press the BACK button,
    it's going to blank sceen again when I press BACK am getting selection screen.
    From output am not able to goto the selection screen. Kindly suggest on this issue.
    Thanks in advance.
    Regards,
    Bharat.

    Hi,
    I don't have write statement anywhere in my prog.
    pls refer to the code.
    REPORT  ZCDC_TRACKING_REPORT no standard page heading message-id zz1
    tables:vbak,
           vbap,
           vbkd,
           vtfa,
           vbfa,
           vtrkh,
           vttk.
    TYPE-POOLS: SLIS.                      "Field catalog structure
    DATA: FCATALOG TYPE SLIS_FIELDCAT_ALV OCCURS 30.
    DATA: FZEILE   TYPE SLIS_FIELDCAT_ALV OCCURS 30 with header line.
    data:w_disp_variant TYPE disvariant,
         s_alv_layout   type slis_layout_alv.
    DATA: W_REPID     LIKE SY-REPID,
          W_SUBRC     LIKE SY-SUBRC,
          W_LOOPCOUNT LIKE SY-TABIX,
          W_LINES     TYPE I,
          IS_VARIANT  LIKE DISVARIANT,
          GS_LAYOUT   TYPE SLIS_LAYOUT_ALV.
    *Internal table declaration.
    data: begin of i_vbak occurs 0,
          vbeln like vbak-vbeln,
          kunnr like vbak-kunnr,
          bstnk like vbak-bstnk,
          end of i_vbak.
    data: begin of i_vbfa occurs 0,
          vbeln like vbfa-vbeln,
          vbelv like vbfa-vbelv,
          end of i_vbfa.
    data: begin of i_vtfa occurs 0,
          tknum like vtfa-tknum,
          vbeln like vbak-vbeln,
          end of i_vtfa.
    data: begin of i_vttp occurs 0,
          tknum like vtfa-tknum,
          vbeln like vbak-vbeln,
          end of i_vttp.
    data: begin of i_vttk occurs 0,
          tknum like vtfa-tknum,
          vsart like vttk-vsart,
          dtabf like vttk-dtabf,
          tdlnr like vttk-tdlnr,
          TNDR_TRKID like vttk-TNDR_TRKID,
          end of i_vttk.
    data: begin of i_final occurs 0,
          kunnr like vbak-kunnr,
          name1 like kna1-name1,
          vbeln like vbak-vbeln,
          bstkd like vbkd-bstkd,
          dtabf like vttk-dtabf,
          tdlnr like vttk-tdlnr,
          TNDR_TRKID like vttk-TNDR_TRKID,
          end of i_final,
          wa_final like i_final.
    data: v_name1 like kna1-name1,
          v_trackno like vtrkh-trackn.
    **selection-screen.
    SELECTION-SCREEN begin of block b1 with frame.
    parameters: R1 RADIOBUTTON GROUP rad1 DEFAULT 'X'.
    parameters: p_vbeln like vbak-vbeln,
                p_bstkd like vbkd-bstkd.
    SKIP.
    SKIP.
    *SELECTION-SCREEN end of block b1.
    *SELECTION-SCREEN begin of block b2.
    parameters: R2 RADIOBUTTON GROUP rad1.
    select-options: s_kunnr for vbak-kunnr.
    select-options: s_dtabf for VTTK-DTABF.
    SELECTION-SCREEN end of block b1.
    SELECTION-SCREEN begin of block b2 with frame.
    parameters: P_track RADIOBUTTON GROUP rad2 default 'X',
                P_car RADIOBUTTON GROUP rad2,
                P_both RADIOBUTTON GROUP rad2.
    SELECTION-SCREEN end of block b2.
    **Initialization.
    Initialization.
      MOVE SY-REPID TO W_REPID.
    *At selection-screen.
    At selection-screen.
    if R1 eq 'X'.
       if p_vbeln eq ' ' and p_bstkd eq ' '.
         message e000(zz1) with 'Please enter either PO # or SO #'.
       endif.
    elseif R2 eq 'X'.
      if ( s_kunnr-low is initial and  s_kunnr-high is initial ) and
         ( s_dtabf-low is initial and  s_dtabf-high is initial )  .
         message e000(zz1) with 'Please limit your selection criteria, this'
                             'cannot run without a Customer # & Date range'.
      endif.
    endif.
    **start-of-selection.
    start-of-selection.
    **if option foreground is selected
    IF R1 eq 'X'.
    **step1 select data from VBAK,VBKD
    **step2 select data from VTTK
      perform get_data_foreground.
    Perform process_data.
    elseif R2 eq 'X'.
    **if option Batch processing selected
    **select data from KNA1,VBAK,VTTKelseif R2 eq 'X'.
      perform get_data_batch_processing.
    endif.
      Perform process_data.
    end-of-selection.
    *&      Form  get_data_foreground
          text
    -->  p1        text
    <--  p2        text
    form get_data_foreground .
    if p_vbeln ne ' ' and p_bstkd ne ' '.
    select vbeln
           kunnr
           bstnk
           from vbak into table i_vbak
           where vbeln eq p_vbeln
             and bstnk eq p_bstkd.
    elseif p_vbeln eq ' ' .
    select vbeln
           kunnr
           bstnk
           from vbak into table i_vbak
           where bstnk eq p_bstkd.
    elseif p_bstkd eq ' '.
    select vbeln
           kunnr
           bstnk
           from vbak into table i_vbak
           where vbeln eq p_vbeln.
    endif.
    **Get data from VBFA
      if not i_vbak[] is initial.
       select vbeln
              vbelv from VBFA into table i_vbfa
              for all entries in i_vbak
              where vbelv = i_vbak-vbeln
                and vbtyp_n = 'J'.
      endif.
    **select data from VTTP
      if not i_vbfa[] is initial.
       select tknum
              vbeln
              from vttp into table i_vttp
              for all entries in i_vbfa
              where vbeln = i_vbfa-vbeln.
      endif.
    *select data from VTTK
    if not i_vttp[] is initial.
       select  tknum
               vsart
               dtabf
               tdlnr
               TNDR_TRKID  from vttk into table i_vttk
               for all entries in i_vttp
               where tknum eq i_vttp-tknum.
    endif.
    **select data from VTFA
    if not i_vbak[] is initial.
      select tknum
             vbeln
             from vtfa into table i_vtfa
             for all entries in i_vbak
             where vbeln = i_vbak-vbeln.
    endif.
    *select data from VTTK
    if not i_vtfa[] is initial.
      select  tknum
              dtabf
              tdlnr
              TNDR_TRKID  from vttk into table i_vttk
              for all entries in i_vtfa
              where tknum eq i_vtfa-tknum.
    endif.
    endform.                    " get_data_foreground
    *&      Form  get_data_batch_processing
          text
    -->  p1        text
    <--  p2        text
    form get_data_batch_processing .
    select vbeln
           kunnr
           bstnk
           from vbak into table i_vbak
           where kunnr in s_kunnr.
    **Get data from VBFA
      if not i_vbak[] is initial.
       select vbeln from VBFA into table i_vbfa
              for all entries in i_vbak
              where vbelv = i_vbak-vbeln
                and vbtyp_n = 'J'.
      endif.
    **select data from VTTP
      if not i_vbfa[] is initial.
       select tknum
              vbeln
              from vttp into table i_vttp
              for all entries in i_vbfa
              where vbeln = i_vbfa-vbeln.
      endif.
    *select data from VTTK
    if not i_vttp[] is initial.
       select  tknum
               vsart
               dtabf
               tdlnr
               TNDR_TRKID  from vttk into table i_vttk
               for all entries in i_vttp
               where tknum eq i_vttp-tknum
                 and dtabf eq s_dtabf.
    endif.
    **select data from VTFA
    if not i_vbak[] is initial.
      select tknum
             vbeln
             from vtfa into table i_vtfa
             for all entries in i_vbak
             where vbeln = i_vbak-vbeln.
    endif.
    **select data from VTTK
    if not i_vtfa[] is initial.
      select  tknum
              dtabf
              tdlnr
              TNDR_TRKID  from vttk into table i_vttk
              for all entries in i_vtfa
              where tknum eq i_vtfa-tknum
                and dtabf eq s_dtabf.
    endif.
    endform.                    " get_data_batch_processing
    *&      Form  process_data
          text
    -->  p1        text
    <--  p2        text
    form process_data .
    **loop processing
    loop at i_vbak.
       wa_final-vbeln = i_vbak-vbeln.
       wa_final-bstkd = i_vbak-bstnk.
       wa_final-kunnr = i_vbak-kunnr.
       select single name1 into v_name1
                           from kna1
                           where kunnr eq wa_final-kunnr.
       if sy-subrc eq 0.
         wa_final-name1 = v_name1.
       endif.
      read table i_vbfa with key vbelv = i_vbak-vbeln.
      if sy-subrc eq 0.
         read table i_vttp with key vbeln = i_vbfa-vbeln.
         if sy-subrc eq 0.
            read table i_vttk with key tknum = i_vttp-tknum.
             if sy-subrc eq 0.
                wa_final-dtabf = i_vttk-dtabf.
                if p_track eq 'X'.
                   if i_vttk-vsart = 'LTL'.
                      wa_final-TNDR_TRKID = i_vttk-TNDR_TRKID.
                   else.
                     select single trackn from VTRKH into v_trackno
                                      where uevbeln = i_vbfa-vbeln
                                        and uevbtyp = 'J'
                                        and vbtyp   = 'X'.
                       if sy-subrc eq 0.
                        wa_final-TNDR_TRKID = v_trackno.
                       endif.
                   endif.
                elseif P_car eq 'X'.
                   wa_final-tdlnr = i_vttk-tdlnr.
                else.
                   wa_final-tdlnr = i_vttk-tdlnr.
                   if i_vttk-vsart = 'LTL'.
                      wa_final-TNDR_TRKID = i_vttk-TNDR_TRKID.
                   else.
                     select single trackn from VTRKH into v_trackno
                                      where uevbeln = i_vbfa-vbeln
                                        and uevbtyp = 'J'
                                        and vbtyp   = 'X'.
                       if sy-subrc eq 0.
                        wa_final-TNDR_TRKID = v_trackno.
                       endif.
                   endif.
                endif.
             endif.
          endif.
      endif.
      append wa_final to i_final.
      clear : i_final, wa_final,i_vbak,i_vbfa,i_vttp, i_vttk,v_name1.
    endloop.
    IF R1 eq 'X'.
      PERFORM FIELDCATALOG.
      PERFORM LAYOUT_BUILD CHANGING GS_LAYOUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
             I_CALLBACK_PROGRAM       = W_REPID
             IS_LAYOUT                = GS_LAYOUT
             IT_FIELDCAT              = FCATALOG
            TABLES
                 T_OUTTAB             = i_final
            EXCEPTIONS
                 PROGRAM_ERROR        = 1
                 OTHERS               = 2.
    else.
      PERFORM BACKGROUND_JOB.
    **Transfer of data into Application server
    OPEN DATASET P_PFILE for output IN TEXT MODE encoding DEFAULT .
      if sy-subrc eq 0.
          loop at itab.
         transfer itab to p_pfile.
        endloop.
      else.
       message e000(zz1) with p_pfile.
      endif.
    CLOSE dataset p_pfile.
    endif.
    endform.                    " process_data
    *&      Form  FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    form FIELDCATALOG .
      DATA: L_FIELDNO LIKE SY-TABIX.
      L_FIELDNO = 1.
    **Cust. Number
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'KUNNR'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 15.
      FZEILE-SELTEXT_L  = 'Customer' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Customer name
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'NAME1'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 35.
      FZEILE-SELTEXT_L  = 'Customer Name' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Sales order
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'VBELN'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 10.
      FZEILE-SELTEXT_L  = 'Sales order' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Custmoer PO
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'BSTKD'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 30.
      FZEILE-SELTEXT_L  = 'Custmoer PO' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Date shipped
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'DTABF'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 15.
      FZEILE-SELTEXT_L  = 'Date shipped' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Carrier
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'TDLNR'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 15.
      FZEILE-SELTEXT_L  = 'Carrier' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
    **Tracking/Pro #
      CLEAR FZEILE.
      FZEILE-COL_POS    = L_FIELDNO.
      L_FIELDNO         = L_FIELDNO + 1.
      FZEILE-FIELDNAME  = 'TNDR_TRKID'.
      FZEILE-DATATYPE   = 'CHAR'.
      FZEILE-OUTPUTLEN  = 15.
      FZEILE-SELTEXT_L  = 'Tracking/Pro#' .
      FZEILE-LOWERCASE  = 'X'.
      FZEILE-SP_GROUP   = 'A'.
      FZEILE-KEY = 'X'.
      FZEILE-DDICTXT       = 'M'.          " medium text
      APPEND FZEILE TO FCATALOG.
      CLEAR FZEILE.
    endform.                    " FIELDCATALOG
    *&      Form  LAYOUT_BUILD
          text
         <--P_GS_LAYOUT  text
    form LAYOUT_BUILD  changing p_gs_layout TYPE SLIS_LAYOUT_ALV.
      CLEAR P_GS_LAYOUT.
      P_GS_LAYOUT-ZEBRA            = 'X'.
      P_GS_LAYOUT-BOX_FIELDNAME    = SPACE.
      P_GS_LAYOUT-MAX_LINESIZE     = 250.
    endform.                    " LAYOUT_BUILD
    *&      Form  BACKGROUND_JOB
          text
    -->  p1        text
    <--  p2        text
    form BACKGROUND_JOB .
    DATA: JOB_NAME         LIKE TBTCO-JOBNAME,
    JOB_NR           LIKE TBTCO-JOBCOUNT,
    JOB_RELEASED     TYPE C,
    JOB_START_SOFORT TYPE C.
    DATA: TITEL(15) TYPE C,
    TEXT1(35) TYPE C,
    TEXT2(40) TYPE C,
    ANSWER    TYPE C.
    DATA: PARAMS    LIKE PRI_PARAMS,
    VALID     TYPE C.
    JOB_NAME = SYST-REPID.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME          = JOB_NAME
    IMPORTING
    JOBCOUNT         = JOB_NR
    EXCEPTIONS
    CANT_CREATE_JOB  = 1
    INVALID_JOB_DATA = 2
    JOBNAME_MISSING  = 3
    OTHERS           = 4.
    IF SYST-SUBRC NE 0.
    MESSAGE I162(00) WITH
    'An error occured while creating the background job.'.
    STOP.
    ELSE.
    *set print parameters to output any errors to spool...
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    IMMEDIATELY            = ' '
    MODE                   = 'BATCH'
    NO_DIALOG              = 'X'
    RELEASE                = 'X'
    NEW_LIST_ID            = 'X'
    LINE_SIZE              = SY-LINSZ
    *LIST_NAME              = 'RBE'
    LIST_TEXT              = 'Extract Results'
    IMPORTING
    OUT_PARAMETERS         = PARAMS
    VALID                  = VALID
    EXCEPTIONS
    ARCHIVE_INFO_NOT_FOUND = 1
    INVALID_PRINT_PARAMS   = 2
    INVALID_ARCHIVE_PARAMS = 3
    OTHERS                 = 4.
    IF VALID NE SPACE.
    *submit job with all the selection screen params...
    SUBMIT (JOB_NAME) USER SYST-UNAME
    VIA JOB JOB_NAME NUMBER JOB_NR
    *WITH CLIENT   = CLIENT
    *WITH MONIFROM = MONIFROM
    *WITH MONI_TO  = MONI_TO
    *WITH TQ_FROM  = TQ_FROM
    *WITH TQ_TO    = TQ_TO
    *WITH WORKLOAD = WORKLOAD
    *WITH ALL      = ALL
    *WITH SPL1     = SPL1
    *WITH APPSERV1 = APPSERV1
    *WITH SPOOLNR  = SPOOLNR
    *WITH APPPATH1 = APPPATH1
    *WITH PCPATH   = PCPATH
    *WITH SPL2     = SPL2
    *WITH APPSERV2 = APPSERV2
    TO SAP-SPOOL SPOOL PARAMETERS PARAMS
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    IF SYST-SUBRC <> 0.
    CASE SYST-SUBRC.
    WHEN  4.
    MESSAGE I162(00) WITH
    'Error defining background job!'
    ' Background job canceled by User.'.
    WHEN 8.
    MESSAGE I162(00) WITH
    'Error defining background job!'
    ' Error in job scheduling (JOB_SUBMIT)'.
    WHEN 12.
    MESSAGE I162(00) WITH
    'Error defining background job!'
    ' Error in internal number assignment'.
    ENDCASE.
    ENDIF.
    endif.
    endif.
    endform.                    " BACKGROUND_JOB

  • Problem with back button  with myfaces/jsf

    Hi guys
    i have very strange kind of problem , i have a page where i am shwing tabular data with data scroller , thats work fine , in this tabbular data we are shing user infomration , and a link on user name ti see his details , this link works fine , and take user to user details page ,
    but from that page if user press back button , and reaches back to tabbular data page , in this page if user select any link , page reloads , and stay there , and after reloading page if user select any link then it works
    Any one geting this kind of preoblem , hope i am not alone
    please help me out
    X-preet

    Hi Luisa,
    1 .Create 2 views  View1 and View2
    2. Place buttons on both the views and create actions for both in view1 and view2
    3.Create outboundplug from View1 to View2.(Navigation link also)
    4.Create outboundplug from View2 to View1.(Navigation link also)
    5. In View1 button action fire the outboundplugto View2
    6. In View2 button action fire the outboundplugto View1.
    Regards, Anilkumar

  • Problem in Back button in ALV

    Hi All,
    I have developed ALV report using grid layout.The user wanted that when he execute the report and click on refresh button the report data gets refreshed as report output is based on Z table and same Z table is updating through RFC interface continously.So this functionality is working for me but problem is that after click refresh 2 to 3 times then to come back to selection screen he has to click back button same number of times as refresh button click.
    Could anybody help how I can come back to selection screen on single click after click refresh button.
    Thanks&Regards,
    Sachin

    Hi Sachin,
    This is what Madhukar meant
    On refresh button I am again fetching data and calling fieldcatlog and displaying report.
    Do not call the fieldcatalog and function module again.
    Get the new data into your internal table in user command event &
    Just add refresh = 'X' in your user command event.
    For example
    FORM f_user_command USING UCOMM LIKE SY-UCOMM v_selfld TYPE slis_selfield.
    if sy-ucomm = 'REF'.
    PERFORM get_data.
    selfld-refresh = u2018Xu2019.
    endif.
    ENDFORM.
    Kesav

  • Problem with total button in alv..?

    Hi abapers,
                      i am facing a problem with standard alv total button
    all the others button r working fine
    but when i am trying to add any column total by using standard total button
    its throwing dump..
    Can anyone tell me wat to do

    Hi Aarif Baig,
    Paste your dump analysis...
    what dump you are geting and source code for your field catelog...  ??
    as well as which field you are removing from your fieldcatelog so that dump is not coming... ??
    and code for that field in fieldcatelog  ??
    and is the type of that filed in fileld catelog and internal table is same or not... ??
    if i am not wrong you will be getting dump for message  x000..
    Please give complete details what you did with little source code and dump analysis....
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Having problem with back button on

    The bottom left hand button on the Zen Micro won't seem to work correctly unless it is charged into the power adapter. I've tried the clean up mode but that didn't do anything, is there anything else that I can do other than rebooting it because I would hate to have to go through the whole method of inporting my music back on there cause it takes hours. Please give me any advice you have!
    ~Michelle

    having the same problem at www.dealnews.com
    not a problem with previous 3.32 version, but now i can't get back to the previous page without pressing the back button twice quickly.
    if you press it once, it just reloads the same page.
    i've reset safari, but nothing fixes it.
    anyone else have an idea?
    thanks!

  • Problem in Back Button in ALV report

    Hi Team,
    I have created a report which has a selection screen. Based on the input I am showing an ALV OO grid in my custom screen 0100. Now In the system toolbar on my 0100 screen I have enabled back, up and exit button. On click of which I am wrting 'LEAVE TO SCREEN 0. '
    But it doesn't take me to the selection screen. Rather it throws me out of the transaction. Can anybody
    suggest me a command so that when I click on back button it will take to the selection screen.
    Thanks,
    Mainak

    Hi,
    Go through given program it is very usefull for you,
    ***Correct your program as follows...
    PROGRAM rsolett1 MESSAGE-ID sy.
    TYPE-POOLS: slis.
    data: repid like sy-repid.
    DATA: w_fieldcat TYPE slis_fieldcat_alv,
    t_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: w_listheader TYPE slis_listheader,
    t_listheader TYPE slis_t_listheader.
    DATA: BEGIN OF t_output OCCURS 0,
    slno TYPE char10,
    name TYPE char10,
    lino TYPE char10,
    prof TYPE char10,
    addr TYPE char10,
    fanm TYPE char10,
    plbu TYPE char10,
    END OF t_output.
    w_fieldcat-col_pos = 1.
    w_fieldcat-fieldname = 'SLNO'.
    w_fieldcat-seltext_m = 'SERIAL NUMBER'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 2.
    w_fieldcat-fieldname = 'NAME'.
    w_fieldcat-seltext_m = 'NAME'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 3.
    w_fieldcat-fieldname = 'LINO'.
    w_fieldcat-seltext_m = 'LICENCE NUMBER'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 4.
    w_fieldcat-fieldname = 'PROF'.
    w_fieldcat-seltext_m = 'PROFESSION'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 5.
    w_fieldcat-fieldname = 'ADDR'.
    w_fieldcat-seltext_m = 'ADDRESS'.
    w_fieldcat-do_sum = 'X'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 6.
    w_fieldcat-fieldname = 'FANM'.
    w_fieldcat-seltext_m = 'FATHER NAME'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    w_fieldcat-col_pos = 7.
    w_fieldcat-fieldname = 'PLBU'.
    w_fieldcat-seltext_m = 'PLACE OF BUSSINESS'.
    APPEND w_fieldcat TO t_fieldcat.
    CLEAR w_fieldcat.
    *PUPULATING TOP-OF-PAGE.
    w_listheader-typ = 'H'.
    w_listheader-info = 'FORMA'.
    APPEND w_listheader TO t_listheader.
    CLEAR w_listheader.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = ' '
    i_callback_top_of_page = 'SUB_TOP_OF_PAGE'
    it_fieldcat = t_fieldcat
    i_default = 'X'
    TABLES
    t_outtab = t_output.
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZPFSTATUS'.
    ENDFORM.
    Edited by: Ganesh Modhave on Aug 12, 2008 1:06 PM
    Thanks&Regards,
    Naresh kumar

  • Problem with back button in jsp

    hi all,
    i am submitting some text field values and select option to a do_registration.jsp page.
    till now everything is ok.
    code in do_registration
    if (rowCount > 0) //means user already exists
    out.print("user already exists");
    out.print("<A HREF='#' ONCLICK='javascript:history.back(-1);return false;'>back</a>");
    else
    insert syntax
    if userexists i its diplays the message and
    when i click on back link what ever the contents the registerform is cleared.i mean whatever the user input the values in the text fields etc everything has gone.user has to retype whole text again.
    so where i am wrong.
    any help

    You can definetly do this globaly on all browsers not looking at the settings by creating a small user bean. Just have a class User with getter and setter methods for main fields, or fields that you need to show in the back button. Then put that class in your WEB-INF classes dir.
    Create a JSP as the page before where you are trying to validate a user. Use jsp tags. <jsp:Bean var="user" class="myPackage.User" scope="session"> In form input fields do the following.
    <input name="first" value="<%=user.getFirst()%>">
    Now everytime this page will be called that field will be populated
    Hope this helps

  • Problem with back button when using task flow to navigate through pages

    I am using unbounded task flow to navigate through my pages
    in page2 I added back button so I can back to page1 using the action A2
    task flow 1
    page 1 -----A1-------> page 2
    page2 ----A2--------> page1
    the problem when I used page2 in another task flow
    task flow 2
    page 3 -----A3------> page2
    page 2 -----A4 -----> page3
    here when I click on back button he take me to page1
    how can I back to page3 ???????

    For this you have to know where the user came from when he navigated to page2. You can e.g. store the back target in a variable in the session or pageflow scope (when the user navigates from page1 or page3 to page2), then you bind the back button of page 2 to the stored variable.
    Timo

  • Navigation problem with back button in module pool

    Hi everyone,
    I have a scenario in module pool programming in which i need help.
    I have an i/p filepath screen where the user inputs his/her file and clicks on validate button provided in the toolbar.
    After that it goes to the next screen which displays all the messages(error/success).
    After I click on Execution button it goes to next screen displaying all the created data.
    Now when I click on back button I want it to go to the i/o filepath screen.
    Please give me your comments on this.
    Leave to screen XXXX is giving me dump so any other options plz let me know.
    Thanks in advance.

    Hi Amit,
       Lets say you have 3 screens 100, 200 and 300. screen 100 has you input file path and 200 shows the message and 300 shows the created data.
    Now in PAI of 300 write as below.
    IN the screen as below
    MODULE USER_COMMAND_300_EXIT AT EXIT COMMAND.
    In the include as below
    MODULE USER_COMMAND_300_EXIT.
    CASE sy-ucomm.
    WHEN 'BACK'.   " OK code for BACK button.
    CALL SCREEN 100.
    WHEN 'CANCEl'.
    LEAVE TO SCREEN 0
    ENDCASE.
    ENDMODULE.
    Please revert if you still face problems.
    Regards,
    Praveenkumar T

  • Problem with Excel button in ALV Grid...URGENT

    Hi All,
    I have developed a report in ALV Grid. As we all know that by default we get few buttons in ALV Grid, like summation, sorting download, etc.. In that we have one excel button. When i click that excel button the output of the report should give the output in excel sheet. But this is not working.
    The report is running fine except the excel button.
    Do anyone of u have any idea how to do that?
    Its very urgent...
    Regards,
    Parvez.

    Go through the code and Execute it on your system, I think this will do for you.
    In this code I used 3 radio buttons in my selection screen:
    If u selects the first radio button your out put shows into to the Excel sheet.
    If u selects the second radio button your out put shows the in the Editor screen.
    If u clicks the third radio button your output shows into the Excel as well as in the Editor.
    *&                       DATA DECLARATION                              *
    TABLES: MARA,                      "GENERAL MASTER DATA
            MARC,                      "PLANT DATA FOR MATERIAL
            MARD,                      "STORAGE LOCATION DATA FOR MATERIAL
            MBEW,                      "MATERIAL VALUATION
            MVKE,                      "SALES DATA FOR MATERIAL
            MAKT,                      "MATERIAL DESCRIPTION
            EKKO,                      "PURCHASING DOCUMENT HEADER
            EKPO,                      "PURCHASING DOCUMENT ITEM
            VBAK,                      "SALES DOCUMENT HEADER DATA
            VBAP.                      "SALES DOCUMENT ITEM DATA
    TYPE-POOLS : SLIS.
    DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
          V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          V_LAYOUT TYPE SLIS_LAYOUT_ALV,
          BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
          BEGIN OF I_MARA OCCURS 0,
             MATNR LIKE MARA-MATNR,  "MATERIAL NUMBER
             MBRSH LIKE MARA-MBRSH,  "INDUSTRY SECTOR
             MEINS LIKE MARA-MEINS,  "BASE UNIT OF MEASURE
             MATKL LIKE MARA-MATKL,  "MATERIAL GROUP
          END OF I_MARA,
          BEGIN OF I_MARC OCCURS 0,
             MATNR LIKE MARC-MATNR,  "MATERIAL NUMBER
             WERKS LIKE MARC-WERKS,  "PLANT
             LVORM LIKE MARC-LVORM,  "FLAG MATERIAL FOR DELETION AT PLANT
                                      "LEVEL
             DISPO LIKE MARC-DISPO,  "MRP CONTROLLER
          END OF I_MARC,
          BEGIN OF I_MAKT OCCURS 0,
             MATNR LIKE MAKT-MATNR,  "MATERIAL NUMBER
             MAKTX LIKE MAKT-MAKTX,  "MATERIAL DESCRIPTION
             SPRAS LIKE MAKT-SPRAS,  "LANGUAGE KEY
          END OF I_MAKT,
          BEGIN OF I_MVKE OCCURS 0,
             MATNR LIKE MVKE-MATNR,  "MATERIAL NUMBER
             VKORG LIKE MVKE-VKORG,  "SALES ORGANIZATION
             VTWEG LIKE MVKE-VTWEG,  "DISTRIBUTION CHANNEL
          END OF I_MVKE,
          BEGIN OF I_MARD OCCURS 0,
            MATNR LIKE MARD-MATNR,  "MATERIAL NUMBER
            LGORT LIKE MARD-LGORT,  "STORAGE LOCATION
            LABST LIKE MARD-LABST,  "VALUATED STOCK WITH UNRESTRICTED USE
          END OF I_MARD,
          BEGIN OF I_EKPO OCCURS 0,
            EBELN LIKE EKPO-EBELN,  "PURCHASING DOCUMENT NUMBER
            EBELP LIKE EKPO-EBELP,  "ITEM NUMBER OF PURCHASING DOCUMENT
            MATNR LIKE EKPO-MATNR,  "MATERIAL NUMBER
          END OF I_EKPO,
          BEGIN OF I_VBAP OCCURS 0,
            VBELN LIKE VBAP-VBELN,  "SALES DOCUMENT
            POSNR LIKE VBAP-POSNR,  "SALES DOCUMENT ITEM
            MATNR LIKE VBAP-MATNR,  "MATERIAL NUMBER
          END OF I_VBAP,
          BEGIN OF I_OUT OCCURS 0,
            MATNR LIKE MARC-MATNR,
            WERKS LIKE MARC-WERKS,
            LVORM LIKE MARC-LVORM,
            DISPO LIKE MARC-DISPO,
            MBRSH LIKE MARA-MBRSH,
            MEINS LIKE MARA-MEINS,
            MATKL LIKE MARA-MATKL,
            VKORG LIKE MVKE-VKORG,
            VTWEG LIKE MVKE-VTWEG,
            SPRAS LIKE MAKT-SPRAS,
            MAKTX LIKE MAKT-MAKTX,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
            EBELN LIKE EKPO-EBELN,
            EBELP LIKE EKPO-EBELP,
            VBELN LIKE VBAP-VBELN,
            POSNR LIKE VBAP-POSNR,
          END OF I_OUT,
          BEGIN OF I_HEADING OCCURS 0,
            TEXT1(20),
            TEXT2(20),
            TEXT3(20),
            TEXT4(20),
            TEXT5(20),
            TEXT6(20),
            TEXT7(20),
            TEXT8(20),
            TEXT9(20),
            TEXT10(20),
            TEXT11(40),
            TEXT12(20),
            TEXT13(20),
            TEXT14(20),
            TEXT15(20),
            TEXT16(20),
            TEXT17(20),
          END OF I_HEADING.
    *&                   S E L E C T I O N - S C R E E N                   *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
    PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
    SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
                    S_DISPO FOR MARC-DISPO,
                    S_EBELN FOR EKPO-EBELN .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
    PARAMETERS : RB1 RADIOBUTTON GROUP G1,
                 RB2 RADIOBUTTON GROUP G1,
                 RB3 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    *&             S T A R T - O F - S E L E C T I O N                     *
    START-OF-SELECTION.
      SELECT MATNR WERKS LVORM DISPO FROM MARC
      INTO CORRESPONDING FIELDS OF TABLE I_MARC
                          WHERE MATNR IN S_MATNR
                          AND DISPO IN S_DISPO
                          AND WERKS = P_WERKS.
      IF I_MARC[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
        EXIT.
      ENDIF.
      PERFORM PURCHASEDATA_VALIDATION.
      PERFORM SALESDATA_VALIDATION.
      SELECT MATNR LGORT LABST FROM MARD INTO TABLE  I_MARD
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR
                          AND WERKS EQ P_WERKS
                          AND LGORT IN S_LGORT.
      IF I_MARD[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
        EXIT.
      ENDIF.
      SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
                          FOR ALL ENTRIES IN I_MARC
                          WHERE MATNR = I_MARC-MATNR.
      IF I_MVKE[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
        EXIT.
      ENDIF.
      LOOP AT I_MARC.
        MOVE-CORRESPONDING I_MARC TO I_OUT.
        CLEAR MARC.
        SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
                          INTO CORRESPONDING FIELDS OF MARA
                          WHERE MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MARA-MBRSH TO I_OUT-MBRSH,
                MARA-MEINS TO I_OUT-MEINS,
                MARA-MATKL TO I_OUT-MATKL.
        ELSE.
          CONTINUE.
        ENDIF.
        SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
                        INTO  CORRESPONDING FIELDS OF MAKT
                        WHERE  MATNR = I_OUT-MATNR.
        IF SY-SUBRC = 0.
          MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
                MAKT-SPRAS TO I_OUT-SPRAS.
        ELSE.
          CONTINUE.
        ENDIF.
        LOOP AT I_EKPO WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
                I_EKPO-EBELP TO I_OUT-EBELP.
        ENDLOOP.
        LOOP AT I_VBAP WHERE MATNR =  I_MARC-MATNR.
          MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
                I_VBAP-POSNR TO I_OUT-POSNR.
        ENDLOOP.
        LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MARD-LABST TO I_OUT-LABST,
                I_MARD-LGORT TO I_OUT-LGORT.
        ENDLOOP.
        LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
          MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
                I_MVKE-VTWEG TO I_OUT-VTWEG.
          APPEND I_OUT.
        ENDLOOP.
        CLEAR I_OUT.
      ENDLOOP.
      PERFORM OPTIONS.
                         FORM  OPTIONS                                *
    FORM OPTIONS.
      IF RB2 = 'X'.
        PERFORM FIELDCAT.
        PERFORM OUTPUT.
      ELSE.
        IF RB1 = 'X'.
          PERFORM HEADINGS.
          PERFORM DLOAD.
        ELSE.
          IF RB3 = 'X'.
            PERFORM HEADINGS.
            PERFORM DLOAD.
            PERFORM FIELDCAT.
            PERFORM OUTPUT.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "OPTIONS
                         FORM  HEADINGS                               *
    FORM HEADINGS.
      I_HEADING-TEXT1 = 'MATNR'.
      I_HEADING-TEXT2 = 'WERKS'.
      I_HEADING-TEXT3 = 'LVORM'.
      I_HEADING-TEXT4 = 'DISPO'.
      I_HEADING-TEXT5 = 'MBRSH'.
      I_HEADING-TEXT6 = 'MEINS'.
      I_HEADING-TEXT7 = 'MATKL'.
      I_HEADING-TEXT8 = 'VKORG'.
      I_HEADING-TEXT9 = 'VTWEG'.
      I_HEADING-TEXT10 = 'SPRAS'.
      I_HEADING-TEXT11 = 'MAKTX'.
      I_HEADING-TEXT12 = 'LGORT'.
      I_HEADING-TEXT13 = 'LABST'.
      I_HEADING-TEXT14 = 'EBELN'.
      I_HEADING-TEXT15 = 'EBELP'.
      I_HEADING-TEXT16 = 'VBELN'.
      I_HEADING-TEXT17 = 'POSNR'.
      APPEND I_HEADING.
    ENDFORM.                    "HEADINGS
                         FORM  DLOAD                                  *
    FORM DLOAD.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.XLS'
          FILETYPE              = 'DAT'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_HEADING
        EXCEPTIONS
          FILE_WRITE_ERROR      = 1.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME              = 'C:\MATSTK.XLS'
          FILETYPE              = 'DAT'
          APPEND                = 'X'
          WRITE_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB              = I_OUT.
    ENDFORM.                    "DLOAD
                              FORM  FIELDCAT                          *
    FORM FIELDCAT.
      V_FIELDCAT-COL_POS = '1'.
      V_FIELDCAT-FIELDNAME     = 'MATNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '2'.
      V_FIELDCAT-FIELDNAME     = 'WERKS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '3'.
      V_FIELDCAT-FIELDNAME     = 'LVORM'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '4'.
      V_FIELDCAT-FIELDNAME     = 'DISPO'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
      V_FIELDCAT-REF_TABNAME   = 'MARC'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '5'.
      V_FIELDCAT-FIELDNAME     = 'MBRSH'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '6'.
      V_FIELDCAT-FIELDNAME     = 'MEINS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '7'.
      V_FIELDCAT-FIELDNAME     = 'MATKL'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
      V_FIELDCAT-REF_TABNAME   = 'MARA'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '8'.
      V_FIELDCAT-FIELDNAME     = 'VKORG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '9'.
      V_FIELDCAT-FIELDNAME     = 'VTWEG'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
      V_FIELDCAT-REF_TABNAME   = 'MVKE'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '10'.
      V_FIELDCAT-FIELDNAME     = 'SPRAS'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '11'.
      V_FIELDCAT-FIELDNAME     = 'MAKTX'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
      V_FIELDCAT-REF_TABNAME   = 'MAKT'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '12'.
      V_FIELDCAT-FIELDNAME     = 'LGORT'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
      V_FIELDCAT-OUTPUTLEN = 10.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '13'.
      V_FIELDCAT-FIELDNAME     = 'LABST'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-SELTEXT_M = 'STOCK'.
      V_FIELDCAT-OUTPUTLEN = 15.
    V_FIELDCAT-REF_FIELDNAME = 'LABST'.
    V_FIELDCAT-REF_TABNAME   = 'MARD'.
      V_FIELDCAT-DO_SUM = 'X'.
      V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
      V_FIELDCAT-HOTSPOT = 'X'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '14'.
      V_FIELDCAT-FIELDNAME     = 'EBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '15'.
      V_FIELDCAT-FIELDNAME     = 'EBELP'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
      V_FIELDCAT-REF_TABNAME   = 'EKPO'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '16'.
      V_FIELDCAT-FIELDNAME     = 'VBELN'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-HOTSPOT = 'X'.
      V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
      V_FIELDCAT-COL_POS = '17'.
      V_FIELDCAT-FIELDNAME     = 'POSNR'.
      V_FIELDCAT-TABNAME = 'I_OUT'.
      V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
      V_FIELDCAT-REF_TABNAME   = 'VBAP'.
      APPEND V_FIELDCAT TO VT_FIELDCAT1.
      CLEAR  V_FIELDCAT.
    ENDFORM.                      "FIELDCAT
                              FORM  OUTPUT                            *
    FORM OUTPUT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = SY-REPID
          I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
          I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
          I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
          IS_LAYOUT               = V_LAYOUT
          IT_FIELDCAT             = VT_FIELDCAT1
        TABLES
          T_OUTTAB                = I_OUT.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "OUTPUT
                            FORM  TOP-OF-PAGE                         *
    FORM TOP-OF-PAGE.
      DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
            WA_HEADER TYPE SLIS_LISTHEADER.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = 'REPORT FOR : '.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'MATERIAL DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'S'.
      WA_HEADER-INFO = 'SALES ORDER DETAILS'.
      APPEND WA_HEADER TO T_HEADER.
      CLEAR WA_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          I_LOGO             = 'GEAR'
          IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.                    "TOP-OF-PAGE
    *&                  FORM  PURCHASEDATA_VALIDATION                      *
    FORM PURCHASEDATA_VALIDATION.
      SELECT EBELN EBELP MATNR
                 FROM EKPO
                 INTO TABLE I_EKPO
                 FOR ALL ENTRIES IN I_MARC
                 WHERE MATNR = I_MARC-MATNR
                 AND EBELN IN S_EBELN
                 AND WERKS EQ P_WERKS.
      IF I_EKPO[] IS INITIAL.
        WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
        EXIT.
      ENDIF.
      DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
      T_EKPO[] = I_EKPO[].
      REFRESH I_EKPO.
      FREE I_EKPO.
      LOOP AT T_EKPO.
        SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
        WHERE EBELN = T_EKPO-EBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_EKPO TO I_EKPO.
          APPEND I_EKPO.
          CLEAR I_EKPO.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_EKPO.
    ENDFORM.                    "PURCHASEDATA_VALIDATION
    *&                  FORM  SALESDATA_VALIDATION                         *
    FORM SALESDATA_VALIDATION.
      SELECT VBELN POSNR MATNR
              FROM VBAP
              INTO CORRESPONDING FIELDS OF TABLE
              I_VBAP FOR ALL ENTRIES IN I_MARC
              WHERE MATNR = I_MARC-MATNR.
      DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
      T_VBAP[] = I_VBAP[].
      REFRESH I_VBAP.
      FREE I_VBAP.
      LOOP AT T_VBAP.
        SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
        WHERE VBELN = T_VBAP-VBELN.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T_VBAP TO I_VBAP.
          APPEND I_VBAP.
          CLEAR I_VBAP.
        ELSE.
          CONTINUE.
        ENDIF.
      ENDLOOP.
      SORT I_VBAP.
    ENDFORM.                    "SALESDATA_VALIDATION

Maybe you are looking for

  • HTTP 500 - Internal Server Error from Discoverer Viewer to Portal

    HI, I created a tab with a list of workbooks created with Discoverer Viewer and published with Discoverer Portliest Provider (List of Database Workbooks). Another tab contains four Discoverer Worksheets created with the same account. Everything works

  • In Bex Query day from calday value and sales in prev yr value not come

    Dear all right now i got output like                                                                             Sales                         Sales in Prev Yr      Sales Organization         Day From Calday          Calendar Day        Sales Value  

  • Best Practice Analyzer Results: Health Report Error EDS AlertValue Unhealthy.

    I ran the Microsoft Office 365 Best Practices Analyzer Beta 1.0 and I get the following error: C:\windows\system32>Get-healthreport -rollupgroup servername.. then I got lots of results.. I narrow it to the following! PSComputerName          : kaneex1

  • OSB Proxy service is not reachable

    Hi OSB experts, The proxy service which is configured in weblogic OSB environment for the application running in Jboss is not reachble with the below stack trace.... Can anyone help me to infer it exactly....or let me know what the below stack trace

  • Flash CS3 Critical Errors

    I am trying to now uninstall Flash CS3 and I receive the following error. "Critical errors were found in setup - Unsupported payload versions included - The installer database is invalid: please reinstall the product from the original media. Please s