Going back to selection screen from ALV

Hi there,
I have scenario: program -> selection screen -> ALV
In the 'BACK' button I have put: LEAVE TO SCREEN 0. It should go back to selection screen. But it does not and exits the program. I also tried to call the selection screen like CALL SELECTION-SCREEN 1000. But in this case if I hit BACK on selection screen, it goes back to previous screen, the ALV not the program. Can you please assist any other way to use the back button from
ALV -> Selection screen. Thanks.
Regards,

Hi Johnny
Previously i got the same requirement according to that i had developed a report just go through this hope it may helpfull very much
*& Report  ZALVDEMO                                                    *
REPORT  ZALVDEMO.
TABLES : J_1IEXCHDR, " header table
J_1IEXCDTL, " item table
J_1IPART2, " Excise Part II details
LFA1, " vendor master table
J_1IMOVEND, " vendor excise details table
MSEG, " Document Segment: Material
MKPF, " Header: Material Document
DD07T, " domain text table
T001W. " Plant and Branch Details
DATA : BEGIN OF IT_CHDR OCCURS 100,
DOCNO LIKE J_1IEXCHDR-DOCNO,
DOCYR LIKE J_1IEXCHDR-DOCYR,
EXNUM LIKE J_1IEXCHDR-EXNUM,
EXDAT LIKE J_1IEXCHDR-EXDAT,
WERKS LIKE J_1IEXCHDR-WERKS,
EXBED LIKE J_1IEXCHDR-EXBED,
EXCCD LIKE J_1IEXCHDR-EXCCD,
ECS LIKE J_1IEXCHDR-ECS,
END OF IT_CHDR.
DATA : BEGIN OF IT_CDTL OCCURS 100,
DOCYR LIKE J_1IEXCDTL-DOCYR,
DOCNO LIKE J_1IEXCDTL-DOCNO,
EXNUM LIKE J_1IEXCDTL-EXNUM,
EXDAT LIKE J_1IEXCDTL-EXDAT,
LIFNR LIKE J_1IEXCDTL-LIFNR,
MATNR LIKE J_1IEXCDTL-MATNR,
MAKTX LIKE J_1IEXCDTL-MAKTX,
CHAPID LIKE J_1IEXCDTL-CHAPID,
EXBAS LIKE J_1IEXCDTL-EXBAS,
EXBED LIKE J_1IEXCDTL-EXBED,
ECS LIKE J_1IEXCDTL-ECS,
MENGE LIKE J_1IEXCDTL-MENGE,
MEINS LIKE J_1IEXCDTL-MEINS,
RDOC2 LIKE J_1IEXCDTL-RDOC2,
END OF IT_CDTL.
DATA TEXT(10).
DATA : BEGIN OF IT_OUT OCCURS 0,
SERIALNO LIKE J_1IPART2-SERIALNO,
TEXT1 LIKE TEXT,
EXNUM LIKE J_1IEXCDTL-EXNUM,
EXDAT LIKE J_1IEXCDTL-EXDAT,
NAME LIKE LFA1-NAME1,
DDTEXT LIKE DD07T-DDTEXT,
EXCCD LIKE J_1IEXCHDR-EXCCD,
BUDAT LIKE MKPF-BUDAT,
EXBAS LIKE IT_CDTL-EXBAS,
EXBED LIKE IT_CDTL-EXBED,
ECS LIKE IT_CDTL-ECS,
MATNR LIKE IT_CDTL-MATNR,
MAKTX LIKE IT_CDTL-MAKTX,
CHAPID LIKE IT_CDTL-CHAPID,
MENGE LIKE IT_CDTL-MENGE,
MEINS LIKE IT_CDTL-MEINS,
DEL_IND(1),
END OF IT_OUT.
DATA IT_PART2 LIKE J_1IPART2 OCCURS 0 WITH HEADER LINE.
DATA S_NO(4) .
DATA DB_CNT LIKE SY-TABIX.
DATA EBELN_T LIKE MSEG-EBELN .
TYPE-POOLS : SLIS.
DATA : AFIELD TYPE SLIS_FIELDCAT_ALV.
DATA : LIST_HEADER TYPE SLIS_T_LISTHEADER,
FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
LS_FTCAT TYPE LVC_S_FCAT,
SORTCAT TYPE SLIS_T_SORTINFO_ALV,
SORTCAT_LN LIKE LINE OF SORTCAT,
G_REPID LIKE SY-REPID,
G_BACK_GROUND(70), "like bapibds01-objkey,
GS_VARIANT LIKE DISVARIANT,
G_SAVE ,
GT_EVENTS TYPE SLIS_T_EVENT,
ALV_EVENT TYPE SLIS_ALV_EVENT,
EVENTCAT TYPE SLIS_T_EVENT,
EVENTCAT_LN LIKE LINE OF EVENTCAT,
LAYOUT_IN TYPE SLIS_LAYOUT_ALV,
LAYOUT_IN1 TYPE SLIS_LAYOUT_ALV.
CONSTANTS : GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
'TOP_OF_PAGE',
GC_FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE
'USER_COMMAND',
GC_FORMNAME_BEFORE_OUTPUT TYPE SLIS_FORMNAME VALUE
'BEFORE_OUTPUT'.
* ALV_EVENT TYPE SLIS_ALV_EVENT,
DATA EX_NO LIKE IT_CHDR-EXNUM VALUE 0.
DATA REGTYP_1 LIKE J_1IPART2-REGTYP.
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME.
PARAMETERS WERKS TYPE J_1IEXCHDR-WERKS.
SELECT-OPTIONS : BUDAT FOR J_1IEXCHDR-EXDAT.
PARAMETERS : R1 RADIOBUTTON GROUP GRP DEFAULT 'X',
R2 RADIOBUTTON GROUP GRP.
SELECTION-SCREEN END OF BLOCK B.
INITIALIZATION.
G_REPID = SY-REPID.
G_SAVE = 'A'.
* PERFORM BUILD_EVENT USING GT_EVENTS[].
PERFORM ALV_EVENT_INIT.
AT SELECTION-SCREEN.
REFRESH LIST_HEADER.
PERFORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER.
START-OF-SELECTION.
* PERFORM ALV_EVENT_INIT.
G_REPID = SY-REPID.
G_BACK_GROUND = ' ' .
IF R1 = 'X'.
CLEAR R2. CLEAR : REGTYP_1.
REGTYP_1 = 'A'.
* set titlebar 'BALAJI' with DB_CNT.
ELSEIF R2 = 'X'.
CLEAR R1.CLEAR : REGTYP_1.
REGTYP_1 = 'C'.
* set titlebar 'BALAJI1' with DB_CNT.
ENDIF.
SELECT * FROM J_1IPART2
INTO CORRESPONDING FIELDS OF TABLE IT_PART2
WHERE REGTYP = REGTYP_1 AND
TRNTYP = 'GRPO' AND
BUDAT IN BUDAT.
* DOCYR = IT_CDTL-DOCYR AND
* DOCNO = IT_CDTL-DOCNO.
LOOP AT IT_PART2.
SELECT SINGLE * FROM J_1IEXCHDR
INTO CORRESPONDING FIELDS OF IT_CHDR
WHERE TRNTYP = 'GRPO' AND
DOCYR = IT_PART2-DOCYR AND
DOCNO = IT_PART2-DOCNO AND
WERKS = WERKS AND
exdat IN BUDAT.
* ORDER BY EXDAT.
IF SY-SUBRC = 0.
APPEND IT_CHDR.
ELSE.
CONTINUE.
ENDIF.
* IF SY-SUBRC <> 0.
* MESSAGE E084.
* ENDIF.
ENDLOOP.
LOOP AT IT_CHDR.
SELECT * FROM J_1IEXCDTL
INTO CORRESPONDING FIELDS OF IT_CDTL
* FOR ALL ENTRIES IN IT_CHDR
WHERE
TRNTYP = 'GRPO' AND
DOCNO = IT_CHDR-DOCNO AND
DOCYR = IT_CHDR-DOCYR AND
EXNUM = IT_CHDR-EXNUM AND
EXDAT = IT_CHDR-EXDAT AND
WERKS = IT_CHDR-WERKS.
IF SY-SUBRC = 0.
APPEND IT_CDTL.
ELSE.
CONTINUE.
ENDIF.
ENDSELECT.
ENDLOOP.
LOOP AT IT_CDTL.
CLEAR TEXT.
DB_CNT = DB_CNT + 1.
READ TABLE IT_CHDR WITH KEY EXNUM = IT_CDTL-EXNUM.
READ TABLE IT_PART2 WITH KEY DOCNO = IT_CDTL-DOCNO .
IT_OUT-SERIALNO = IT_PART2-SERIALNO.
SELECT SINGLE NAME1 FROM LFA1
INTO IT_OUT-NAME
WHERE LIFNR = IT_CDTL-LIFNR.
SELECT SINGLE * FROM LFA1
WHERE LIFNR = IT_CDTL-LIFNR.
IF LFA1-LAND1 EQ 'IN'.
TEXT = 'INVOICE'.
IT_OUT-TEXT1 = TEXT.
ELSE.
TEXT = 'BOE'.
IT_OUT-TEXT1 = TEXT.
ENDIF.
SELECT SINGLE * FROM J_1IMOVEND
WHERE LIFNR = IT_CDTL-LIFNR.
SELECT SINGLE * FROM DD07T
* INTO IT_OUT-DDTEXT
WHERE DOMNAME = 'J_1IVTYP' AND
DDLANGUAGE = 'EN' AND
DOMVALUE_L = J_1IMOVEND-J_1IVTYP.
IF DD07T-DDTEXT = 'First Stage Dealer of indigenous excisable goods'
OR
DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisablegoods'.
DD07T-DDTEXT = 'Dealer'.
ENDIF.
IT_OUT-DDTEXT = DD07T-DDTEXT.
* ELSEIF DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisable
*goods'.
* DD07T-DDTEXT =
CLEAR EBELN_T.
SELECT SINGLE LFBNR FROM MSEG
INTO EBELN_T
WHERE MBLNR = IT_CDTL-RDOC2 .
SELECT SINGLE * FROM MSEG
WHERE BWART = '106' AND
LFBNR = EBELN_T ."and
* ebeln = ebeln_t.
IF SY-SUBRC = 0.
IT_OUT-DEL_IND = 'X'.
ELSE.
IT_OUT-DEL_IND = ' '.
ENDIF.
SELECT SINGLE BUDAT FROM MKPF
INTO IT_OUT-BUDAT
WHERE MBLNR = EBELN_T ."MSEG-LFBNR.
IT_OUT-EXNUM = IT_CDTL-EXNUM.
IT_OUT-EXDAT = IT_CDTL-EXDAT.
IT_OUT-EXCCD = IT_CHDR-EXCCD.
IT_OUT-EXBAS = IT_CDTL-EXBAS.
IT_OUT-EXBED = IT_CDTL-EXBED.
IT_OUT-ECS = IT_CDTL-ECS.
IT_OUT-MATNR = IT_CDTL-MATNR.
IT_OUT-MAKTX = IT_CDTL-MAKTX.
IT_OUT-CHAPID = IT_CDTL-CHAPID.
IT_OUT-MENGE = IT_CDTL-MENGE.
IT_OUT-MEINS = IT_CDTL-MEINS.
APPEND IT_OUT.
* EX_NO = IT_CDTL-EXNUM.
ENDLOOP.
* Title Portion
IF REGTYP_1 = 'A'.
SET TITLEBAR 'BALAJI' WITH DB_CNT.
ELSEIF REGTYP_1 = 'C'.
SET TITLEBAR 'BALAJI1' WITH DB_CNT.
ENDIF.
AFIELD-COL_POS = 1.
AFIELD-FIELDNAME = 'SERIALNO'.
AFIELD-SELTEXT_L = 'INPUTS'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 2.
AFIELD-FIELDNAME = 'TEXT1'.
AFIELD-SELTEXT_L = 'TYPE OF DOC'.
AFIELD-JUST = 'L'.
AFIELD-DECIMALS_OUT = '0'.
AFIELD-NO_ZERO = 'X'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 3.
AFIELD-FIELDNAME = 'EXNUM'.
AFIELD-SELTEXT_L = 'DOC.NO'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 4.
AFIELD-FIELDNAME = 'EXDAT'.
AFIELD-SELTEXT_L = 'DOC.DATE'.
AFIELD-JUST = 'C'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 5.
AFIELD-FIELDNAME = 'NAME'.
AFIELD-SELTEXT_L = 'NAME OF THE SUPPLIER'.
AFIELD-NO_ZERO = 'X'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 6.
AFIELD-FIELDNAME = 'DDTEXT'.
AFIELD-SELTEXT_L = 'TYPE-OF-SUPPLIER'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 7.
AFIELD-FIELDNAME = 'EXCCD'.
AFIELD-SELTEXT_L = 'ECC OF THE SUPPLIER'.
AFIELD-NO_ZERO = 'X'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 8.
AFIELD-FIELDNAME = 'BUDAT'.
AFIELD-SELTEXT_L = 'INPUT RECV DATE'.
AFIELD-JUST = 'C'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 9.
AFIELD-FIELDNAME = 'EXBAS'.
AFIELD-SELTEXT_L = 'ASSESSABLE-VALUE'.
AFIELD-DO_SUM = 'X'.
AFIELD-JUST = 'R'.
AFIELD-DECIMALS_OUT = '2'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 10.
AFIELD-FIELDNAME = 'EXBED'.
AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN CENVAT'.
AFIELD-JUST = 'R'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 11.
AFIELD-FIELDNAME = 'ECS'.
AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN E-CESS'.
AFIELD-JUST = 'R'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 12.
AFIELD-FIELDNAME = 'MATNR'.
AFIELD-SELTEXT_L = 'MATERIAL-CODE'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 13.
AFIELD-FIELDNAME = 'MAKTX'.
AFIELD-SELTEXT_L = 'DESCRIPTION'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 14.
AFIELD-FIELDNAME = 'CHAPID'.
AFIELD-SELTEXT_L = 'TARIFF-ID'.
AFIELD-JUST = 'L'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 15.
AFIELD-FIELDNAME = 'MENGE'.
AFIELD-SELTEXT_L = 'QUANTITY'.
AFIELD-JUST = 'R'.
AFIELD-DO_SUM = ' '.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 16.
AFIELD-FIELDNAME = 'MEINS'.
AFIELD-SELTEXT_L = 'UOM'.
AFIELD-JUST = 'C'.
APPEND AFIELD TO FIELDCAT.
AFIELD-COL_POS = 17.
AFIELD-FIELDNAME = 'DEL_IND'.
AFIELD-SELTEXT_L = 'Deleted'.
AFIELD-JUST = 'C'.
APPEND AFIELD TO FIELDCAT.
* * LAYOUT FOR ZEBRA CATLOG
LAYOUT_IN-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT_IN-ZEBRA = 'X'.
LAYOUT_IN-GET_SELINFOS = 'X'.
LAYOUT_IN-CONFIRMATION_PROMPT = 'X'.
LAYOUT_IN-DETAIL_POPUP = 'X' .
* SORTCAT-decimals = '0'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_SAVE = G_SAVE
IS_VARIANT = GS_VARIANT
IT_FIELDCAT = FIELDCAT
IT_SORT = SORTCAT
IS_LAYOUT = LAYOUT_IN
IT_EVENTS = EVENTCAT
* I_BACKGROUND_ID = g_back_ground
TABLES
T_OUTTAB = IT_OUT.
*& Form TOP_OF_PAGE_LIST_HEADER
* text
* -->LIST_HEADERtext
FORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER TYPE SLIS_T_LISTHEADER.
DATA : HLINE TYPE SLIS_LISTHEADER,
TEXT(60) TYPE C.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
* WRITE 'ROOTS INDUSTRIES LTD' TO TEXT.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
SELECT SINGLE * FROM T001W WHERE WERKS = WERKS.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
WRITE 'PLANT :' TO TEXT.
WRITE WERKS TO TEXT+8.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
WRITE T001W-NAME1 TO TEXT.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
WRITE T001W-STRAS TO TEXT.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
WRITE T001W-ORT01 TO TEXT.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
CLEAR : HLINE,TEXT.
HLINE-TYP = 'H'.
WRITE 'DATE :' TO TEXT.
WRITE BUDAT-LOW TO TEXT+7.
IF BUDAT-HIGH NE ''.
WRITE 'TO' TO TEXT+18.
WRITE BUDAT-HIGH TO TEXT+22.
ENDIF.
HLINE-INFO = TEXT.
APPEND HLINE TO LIST_HEADER.
ENDFORM. "TOP_OF_PAGE_LIST_HEADER
*& Form ALV_EVENT_INIT
* text
FORM ALV_EVENT_INIT .
CLEAR ALV_EVENT.
ALV_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
ALV_EVENT-FORM = 'ALV_TOP_OF_PAGE'.
APPEND ALV_EVENT TO EVENTCAT.
CLEAR ALV_EVENT.
ALV_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
ALV_EVENT-FORM = 'ALV_TOP_OF_LIST'.
APPEND ALV_EVENT TO EVENTCAT.
* CLEAR ALV_EVENT.
* ALV_EVENT-NAME = SLIS_EV_END_OF_LIST.
* ALV_EVENT-FORM = 'ALV_END_OF_LIST'.
* APPEND ALV_EVENT TO GT_EVENTS.
* CLEAR ALV_EVENT.
* ALV_EVENT-NAME = SLIS_EV_END_OF_PAGE.
* ALV_EVENT-FORM = 'ALV_END_OF_PAGE'.
* APPEND ALV_EVENT TO GT_EVENTS.
ENDFORM. "ALV_EVENT_INIT
*& Form ALV_TOP_OF_PAGE
* text
FORM ALV_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = LIST_HEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "ALV_TOP_OF_PAGE
*& Form BUILD_EVENT
* text
* -->P_GT_EVENTS[] text
FORM BUILD_EVENT USING P_EVENTS TYPE SLIS_T_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND INTO
ALV_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_USER_COMMAND TO ALV_EVENT-FORM.
APPEND ALV_EVENT TO P_EVENTS.
ENDIF.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_BEFORE_LINE_OUTPUT INTO
ALV_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_BEFORE_OUTPUT TO ALV_EVENT-FORM.
APPEND ALV_EVENT TO P_EVENTS.
ENDIF.
ENDFORM. " BUILD_EVENT
Reward if helpfull
Regards
Pavan

Similar Messages

  • Going back to selection screen from Change mode in ALV.

    Hello Gurus,
    I am working on a issue related to ALV where ALV becomes editable when user clicks on change button.  The Change button is a custom button defined in application toolbar of ALV display.
    case ucomm.
    WHEN 'TBACK'.
         leave to screen 0.
    when 'CHNG'.
            loop at it_apst01.
                  WA_FIELD_LST-EDIT = 'X'.
    *             Then some field symbol stuff is there
                  MODIFY FIELD_LST from wa_field_lst transporting edit
                         where FIELDNAME = <FS5>.
                ENDIF.
              endif.
            endloop.
          ENDIF.
          describe table gt_alv lines c_hits.
          c_alv_hits = c_hits.
          concatenate text-010 c_alv_hits 'hits' into c_alv_title separated
          by space.
          perform display_report tables gt_alv USING c_alv_title.
    form display_report tables p_outtab using p_title.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = lv_progname
                i_callback_pf_status_set = 'ALV_STATUS'
                i_callback_user_command  = 'ALV_UCOMM'
    *            i_callback_top_of_page   = 'TOP_OF_PAGE'
                is_layout                = is_layout
                it_fieldcat              = field_lst
    *            is_variant               = g_variant
                it_event_exit            = gt_event_exit
                i_save                   = 'A'
                it_sort                  = it_sort
                i_screen_start_column    = i_start_col
                i_screen_start_line      = i_start_ln
                i_screen_end_column      = i_end_col
                i_screen_end_line        = i_end_ln
           tables
                t_outtab                 = p_outtab
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    Everything is working ok. But when I click on Back button,the screen goes first to the ALV display mode from edit mode, then user has to click one time more the back button to go to selection screen because the FM 'REUSE_ALV_GRID_DISPLAY' is called once again when user clicks
    on change button because I am making the EDIT flag = 'X' and then calling FM again.
    Is there a way that when user clicks on Back button, he will directly go to Change Screen -> Selection screen instead of going to Change screen -> Display screen -> Selection screen
    Regards,
    Rajesh.

    You must not call the FM 'REUSE_ALV_GRID_DISPLAY' again to make it editable. Instead you can call the FM REUSE_ALV_GRID_LAYOUT_INFO_GET and REUSE_ALV_GRID_LAYOUT_INFO_SET to make your grid editable / non-editable.
    Like this:
    REPORT grid_edit.
    TYPE-POOLS: slis.
    * Data to be displayed
    DATA: gt_sflight TYPE TABLE OF sflight.
    DATA: gs_layout TYPE slis_layout_alv.
    parameters: p_test type flag.
    start-of-selection.
    * Selection
    SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
    * Eingabebereit
    gs_layout-edit = 'X'.
    * Call ABAP List Viewer (ALV)
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-cprog
        i_callback_user_command = 'USER_COMMAND'
        i_structure_name        = 'SFLIGHT'
        is_layout               = gs_layout
      TABLES
        t_outtab                = gt_sflight.
    *&      Form  user_command
    FORM user_command USING r_ucomm TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      DATA: ls_layout TYPE slis_layout_alv.
      IF r_ucomm = '&DATA_SAVE'.
        MESSAGE i000(0k) WITH text-001.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
          IMPORTING
            es_layout = ls_layout.
        IF sy-subrc <> 0.
        ENDIF.
        ls_layout-edit = ' '.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
            is_layout = ls_layout.
      ENDIF.
    ENDFORM.                    "user_command
    In this example, when you SAVE, it will give you one Information message and than make the Layout to non-editable mode. When you press back button, it will get you back to selection screen.
    Regards,
    Naimesh Patel

  • How to get back to Selection Screen from Drill Down Screen in ALV

    Hi All
              How can I come back directly to the Selection Screen from the drill down screen of an ALV Report i.e. in an Interactive ALV Report when sy-lsind > 1.
    Thanks
    Kulpreet

    Try to use ....
    SET SCREEN 0.
    LEAVE SCREEN.
    Regards,
    Rich Heilman

  • Reg: GOING TO SELECTION SCREEN FROM ALV GRID.

    Hi all,
    Iam using an ALV grid display.
    I have called the grid display every times when i select a check box in the grid display.
    Then when i click on the back button the screen navigates to the previous ALV grid. My requirement is to go to the first selection screen.
    For this I have coded in the Back button as Call selection--screen <screen no>.
    When i do this, and after navigation to the selection-screen when i click on the back button on the selection screen its navigating back to the ALV grid.
    But i need to exit to the program in this case.
    Can anyone Help me on this issue?
    Regards
    Naveen

    You have to use LEAVE TO SCREEN 0.
    Regards
    Eswar
    Addition: Also see that you are releasing the grid with statement like CALL METHOD g_grid->free.
    So the code should be something like:
      CASE ok_code.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          CALL METHOD g_grid->free.
          LEAVE TO SCREEN 0.
      ENDCASE.
    Edited by: Eswar Rao  Boddeti on Feb 19, 2008 1:48 PM

  • GOING TO SELECTION SCREEN FROM ALV GRID.

    Hi all,
    Iam using an ALV grid display.
    I have called the grid display every times when i select a check box in the grid display.
    Then when i click on the back button the screen navigates to the previous ALV grid. My requirement is to go to the first selection screen.
    For this I have coded in the Back button as Call selection--screen <screen no>.
    When i do this, and after navigation to the selection-screen when i click on the back button on the selection screen its navigating back to the ALV grid.
    But i need to exit to the program in this case.
    Can anyone Help me on this issue?
    Regards
    Naveen

    Naveen,
      Write below code,
    DATA ref1 TYPE REF TO cl_gui_alv_grid.
    WHEN 'BACK'
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
             IMPORTING
                  e_grid = ref1.
        CALL METHOD ref1->check_changed_data.
        CALL METHOD ref1->refresh_table_display.
        LEAVE TO SCREEN 0.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Aug 8, 2008 4:24 PM

  • Navigate to selection screen from ALV.

    Hi All,
    I am using ALV in my report which is editable alv. when i save after edit one more alv is generated with loggs. but when i click on back tab from application toolbar it navigate to previous alv. But i want to navigate to selection screen. so how to achive it.
    i have defined my own PF status and i tried following code which gives short dump.
    IF sy-ucomm = 'BACK'.
        SET SCREEN 1000.
        LEAVE TO SCREEN 1000.
      ENDIF.
    thanks ,
    Swarup.

    Hi Swarup,
    I have implemented the exact scenario, this is what you need to do.
    FORM f_alv_user_comm USING i_ucomm TYPE syucomm           
                              i_rs TYPE slis_selfield.
    *  Display ALV2 (This list shows the list blocked/unblocked customers)
        PERFORM f_display_alv2 CHANGING i_ucomm.
      IF i_ucomm EQ '&F03'.         " here you can use the back button code
    * Return to seletion screen
        LEAVE TO SCREEN 0.
      ENDIF.
    endform.
    In f_display_alv2 do like this :
    FORM f_display_alv2 CHANGING e_ucomm TYPE syucomm.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_bypassing_buffer = c_mark
            i_callback_program = w_repid
            is_layout          = lws_layout
            it_fieldcat        = int_fieldcat2[]
            it_events          = int_events_alv2
          TABLES
            t_outtab           = int_alv2_out
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          e_ucomm = '&F03'.                          " This will take the back button code
        ENDIF.
    endform.
    This is the right way to do it.
    Regards,
    Salil Sonam

  • Apps still frozen after reset when you touch the app the screen flashes and then goes back to selection screen

    Help

    Try another  Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank then power ON again in the normal way.]

  • Go back selection-screen from level2 of cl_salv_hierseq_table

    Hi,
    Problem is to go back on selection screen in one go using BACK , CANCEL or EXIT button
    cl_salv_hierseq_table is being called to display output list.
    Same class cl_salv_hierseq_table is being used to display new list if user wants to see.
    All output list goes into ABAP stack.
    Neither a single standard button BACK , CANCEL or EXIT allow me to go back on selection-screen directly from 2 level onwards . it goes one by one level
    Copied GUI-status to use on_user_command and tried to use LEAVE TO TRANSACTION / CALL TRANSACTION but selection screen values in select-options / parameters not retrived
    How to back on selection-screen from level2 onwards and see all values which are entered initially
    Thanks
    ammonin

    Hi,
    No custom screen is created in my program for displaying result.
    Calling METHOD display of CL_SALV_HIERSEQ_TABLE ,
    So every time each DISPLAY method goes into stack .
    In degug , I found FM REUSE_ALV_HIERSEQ_LIST_DISPLAY is being called
    As per your suggestion it happens only when I am on first level of display result
    If I am calling same METHOD display for another output without distroying exsiting one. it stores in ABAP stack
    I do not know how to initializie existing / Kill CL_SALV_HIERSEQ_TABLE session before calling it again
    Standard button BACK/EXIT/CANCEL does
    SET SCREEN 0
    LEAVE SCREEN and goes back to only one level back not on directly on selection screen.
    If it is on first level then only selection-screen comes with values.
    Thanks
    Amy

  • How to go back selection screen from its next screen

    I having one problem with output display
    actually i am displaying data in Initial Screen, which have 6 fields
    whenever i click on field 1 it should display one new screen (selection screen)which contain 6 radio buttons
    whenever i click on Radio Button r1 it should go to new screen (screen 3) to display its correponding data
             when i use f3 or back it should go to previous screen (selection screen), when we click radio button r2
             it should go to new screen (screen n)to display its correponding data.
    this what i have to display.
    but i am facing some probelms during my output
           i am going to initail screen from Screen 3.
           how to go back radiobutton screens (selection screen) from screen 3

    Hi Anil,
               U can get the fcode for standard <b>back</b>  button by debugging. To the fcode of  the "back' button.
    write this code :
    at user-command.
    case sy-ucomm.
    when 'back'.
    set screen <scr no>       " here scr no  is the screen no of  radio button screen
    leave screen.
    endcase.
    Reward points if helpful.
    Regards,
    Hemant

  • Leave to selection screen from drill down ALV

    Hi Guys,
    I am doing an interactive ALV report. In that, if I click on SAVE button in second interactive ALV, it should go to the selection-screen.
    The flow of the program is something like below.
    Selection-screen --> Main Report --> Detailed Report -- Click SAVE --> Goto Selection-screen.
    I tried LEAVE TO SCREEN 0, LEAVE LIST-PROCESSING,.. Its all going only to the previous screen (Main Report), not going to the selection-screen. If I say, CALL SCREEN 1000, it is throwing an exception DYNPRO_NOT_FOUND
    Please help me on this issue.
    Regards,
    Yasin.

    Hi,
    Define a transaction code (XXX) for the report.
    Use LEAVE TO TRANSACTION 'XXX'. (All CAPS in colons)
    This will take you to the selection screen.
    Hope this helps you!!!
    Regards,
    Ganga

  • Switchin to selection screen from end-of-selection

    Hi Experts,
        I am creating a report, where I generate an ALV output. From selection screen, I am going to some 4, 5 output screens.
    selection screen -> output screen1 -> output screen2 -> output screen3.
    Can I go to selection screen from output screen 3. In output screen 3 I have pf-status also. When the back button, in the triggered code what I have to write to switch to selection screen.
    Thanks and regards,
    Venkat.

    Hi
    1.Make your selection screen as screen no.100.
    2.selection screen(100) -> output screen1 -> output screen2 -> output screen3.
    3.Make separate pf-status for each screens.
    4.In the PAI of your 3rd screen write
    CASE SY-UCOMM.
      WHEN 'BACK'.
         LEAVE TO SCREEN 100.
    ENDCASE.
    Hope this had helped you.
    Regards
    Hareesh Menon

  • Reg: calling selection screen from the second list

    Hi all,
    How can we call the selection screen from the second screen.
    Can any one help me to solve this problem.

    HI RJ,
    Try .....
    case sy-ucomm.
    WHEN '&F03'.
    LEAVE TO SCREEN '0'.
    endcase.
    after the FM for grid-display
    i m using the same .....
    i hav selection-screen..then alv grid screen 1  then again another screen with alv grid display..
    bt in my code for first alv grid ...i m using REUSE_ALV_GRID_DISPLAY_LVC
    as
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
          EXPORTING
            i_callback_program       = sy-repid
            i_callback_pf_status_set = 'SET_PF_STATUS'(303)
            i_callback_user_command  = 'USER_COMMAND'(304)
            i_grid_title             = 'Reconcilation Report'(305)
            is_layout_lvc            = it_layout
            it_fieldcat_lvc          = gt_fieldcat3[]
          TABLES
            t_outtab                 = gt_msg[].
    here i musing set_pf_status to add one pushbutton to the screen. in ur case u can avoid that...
    after that
    *&      Form  set_pf_status
          text
         -->EXTAB      text
    FORM set_pf_status USING extab TYPE slis_t_extab.           "#EC NEEDED
      SET PF-STATUS 'STANDARD_FULLSCREEN'.
    *get back to Selection Screen
      case sy-ucomm.
        WHEN '&F03'(328).
          LEAVE TO SCREEN '0'.
      endcase.
    ENDFORM.                    "set_pf_status
    its working for me..
    Thnx
    Rohit...
    Edited by: Rohit Kumar on Oct 29, 2008 3:20 PM

  • IOS 8.1 Safari not loading, goes back to home screen

    I have an iPhone 5, 5S and ipad air all on version 8.1.  Safari is not working on any of them.  It tries to load, the blank safari screen comes up, then it crashes and goes back to home screen.  I have to use google chrome to access the internet. I tried restoring my one phone to factory, installed the backup, reset the safari data, reset network settings and still no help.  Can anyone tell me how the **** to delete safari and re-install it? I don't know what else to do about this issue.

    ok. seems to be working now. i wiped (settings/general/reset/erase all content and settings) the iphone6plus that had 8.1 on it and backed up from a backup made with 8.0.2.
    Mail is now loading instantly. but now i have to load all my passwords again for everything - even though i had encrypted backups. weird.

  • My Ipod Touch keeps going back to main screen and won't let me play games, read my ebook, etc.

    My IPOD Touch was working great until about 2 weeks ago.  Now when I try to play a game, read an ebook, etc. it automatically goes back to the screen showing all my apps and won't let me stay and use the app I have selected.  Is there anything I can do?

    Try a hard reset of the iPod.  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    B-rock

  • Back to selection screen after error

    Hello ABAPers,
    I have a executable program (REPORT) to do some processing (e.g. read a standard table with the parameters and select-options and save the data in a Z table).
    When occurs an error (e.g. when sy-subrc <> 0 after select) and a message of type E is showed, the program show the message in a "clean" screen with title SAP. Then, after ENTER or ESC, it leaves to initial screen of SAP (SAP Easy Access).
    The message of type E is triggered from a routine (FORM) called from START-OF-SELECTION event. And the program don´t write nothing in list (only return a status message if everithing is ok).
    How can I force the program to back to selection screen after some error?
    Thanks in advance.
    Best regards,
    Charles Oliveira

    hi,
    Do the following for your requirement.
    in the message give the following
    start-of-selection.
    Perform <routine>.
    Form <routine>.
    if <condition>.
      message 'xxxx' type 'S' display like 'E'.
      exit.
    endif.
    endform.
    This way the control returns to selection screen even after the message is triggered.
    Thanks
    Sharath

Maybe you are looking for

  • FrameMaker 8.0p277 Crashes When Creating Postscript Files

    We have an automated process that was internally created in FrameMaker 8.0p277 that takes a FrameMaker Book file that contains a large number of individual mutual fund files and breaks out each mutual fund into an individual file using the fund's uni

  • Error parsing envelope: (1, 1) Start of root element expected.

    Hello BI Publisher: The issue has been resolved. I found the cause the problem. The following line in my WSDL was preventing BI Publisher from reading the WSDL, which will return the "Error parsing envelope" message: <xsd:attribute name="dateTimeTagF

  • DVD transfer problems

    I put in my dvd in the computer, cuz i want to watch it on my iPod, but it says please insert a disc, when the disc has clearly been inserted. this isnt really iPod Question, but i need some step by step help

  • Error (-42032) when accessing the iTunes Store?

    Hello to all, Could somebody tell me, why I always get the following message in German "An unknown error occured (-42032)" when I try to access the iTunes Store and how can I avoid this message? The technician from Appel was unable to help me. I wond

  • Using variables for function arguments AS2

      Hello, I am trying to create a function in AS2. After creating the function, I want to use values stored in variables for the function arguments rather than manually typing static values for carrying out the function calculation. Also, I want to us