Problem while hide a block on selection screen on button press

Hi,
I have added two buttons on the application toolbar of the selection screen. I have input fields under two blocks on the selection-screen. Initially the second block is hidden. If I press the button 1 the second block should be made visible.
For this to happen, I captured the button 1 click event using the following statement.
IF sscrfields-ucomm = 'FC01'.
Inside the if ... endif, I looped at the screen and made the second block visible. It was working fine.
loop at screen.
  if screen-group4 = '013'.
     screen-invisible = 1.
     screen-active    = 0.
  endif.
endloop.
Later the second button was added. Now when i run the report for the first time, if button 2 is clicked the hidden block appears on the selection screen even though i have not added any code for it.
Just to check, i commented the logic to display the hidden block on button 1 click event. Even without any code the first time i press any of the two buttons added on the application toolbar the hidden block is displayed.
I saved a variant for the report.
During execution of the report, if i select any variant then the hidden block is displayed.
Can anyone please tell me how to fix this problem.
Regards,
T2.

Hi All,
The problem is solved.
Everyone was confusing between the pushbutton on the selectio-screen and on apllication toolbar
(where you have the execute icon).
Please find the code below. Thanks for you time and help. I appreciate it.
REPORT ztest.
INCLUDE <icon>.
*  TABLES                                                              *
TABLES: t001,              " Company Codes
        lfa1,              " Vendor Master (General Section)
        sscrfields.        " Fields on selection screens
* To capture button press event.
DATA: gv_button_press       TYPE c.
* Menu Painter: Program interface for dynamic texts
DATA: gs_dyntxt             TYPE smp_dyntxt.
*  SELECTION SCREEN                                                    *
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-s01.
* Company Code.
SELECTION-SCREEN BEGIN OF BLOCK ccode WITH FRAME TITLE text-s02.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY MEMORY ID buk.
SELECTION-SCREEN END OF BLOCK ccode.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK dsel WITH FRAME TITLE text-s04.
* Vendor Master.
SELECTION-SCREEN BEGIN OF BLOCK vend WITH FRAME TITLE text-s07.
SELECT-OPTIONS: s_konzs FOR lfa1-konzs MODIF ID aw1.
SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1 MODIF ID aw1.
SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2 MODIF ID aw1.
SELECTION-SCREEN END OF BLOCK vend.
SELECTION-SCREEN END OF BLOCK dsel.
* INITIALIZATION                                                       *
INITIALIZATION.
* Populate the Application toolbar button attributes.
  PERFORM populate_app_toolbar_buttons.
* Hide the dynamic screen intially.
  PERFORM hide_screenfields.
* AT SELECTION SCREEN                                                  *
AT SELECTION-SCREEN.
* Capture the button press event.
  PERFORM capture_button_press.
* AT SELECTION-SCREEN OUTPUT.                                          *
AT SELECTION-SCREEN OUTPUT.
* Show/Hide the dynamic selection screen based on button press.
  PERFORM adapt_screen.
*&  Form  populate_app_toolbar_buttons                                 *
*   Display Icon on the application toolbar buttons. Also set the      *
*   function codes for these buttons.                                  *
FORM populate_app_toolbar_buttons.
  CLEAR gs_dyntxt.
  WRITE icon_fencing     TO gs_dyntxt-icon_id AS ICON.
  MOVE  text-b01         TO gs_dyntxt-quickinfo.   " Dynamic Selections
  MOVE gs_dyntxt         TO sscrfields-functxt_01.
ENDFORM.                    " populate_app_toolbar_buttons
*&  Form  hide_screenfields                                            *
*   Initially hide the Dynamic selection screen.                       *
FORM hide_screenfields.
  LOOP AT SCREEN.
    IF screen-group1 = 'AW1'.
      screen-invisible = '1'.
      screen-active    = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
ENDFORM.                    " hide_screenfields
*&  Form  capture_button_press                                         *
*   Set the flag based on button press event. Appication bar button    *
*   tcode is available only at 'At Selection-screen' event.            *
*   Use the captured data at 'At Selection-screen Output' event.       *
*   Screen adjustments is possible only under this event.              *
FORM capture_button_press.
  IF sscrfields-ucomm = 'FC01'.
    IF gv_button_press IS INITIAL.
      gv_button_press = 'X'.
    ELSEIF gv_button_press EQ 'X'.
      CLEAR gv_button_press.
    ENDIF.
  ENDIF.
ENDFORM.                    " capture_button_press
*&  Form  adapt_screen                                                 *
*   Show/Hide the dynamic selection screen based on button press       *
*   captured at 'At selection-screen' event.                           *
FORM adapt_screen.
* If button press flag is initial hide the dynamic selection screen.
  IF gv_button_press IS INITIAL.
    LOOP AT SCREEN.
      IF screen-group1 = 'AW1'.
        screen-invisible = '1'.
        screen-active    = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
* Elseif button press flag is 'X' show the dynamic selection screen.
  ELSEIF gv_button_press EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'AW1'.
        screen-invisible = '0'.
        screen-active    = '1'.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " adapt_screen
Regards,
T2
Message was edited by: Titu Joseph

Similar Messages

  • How to hide a block in Selection screen ?

    Hello abap gurus,
    I have a requirement where I have to hide a block on Selection screen. Can anyone of u give the command for that or code..
    Its urgent !
    Om Sai Ram,
    aRgD

    Hi,
    Just paste the following code in abap editor.
    *Selectionscreen elements..............................................
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS:
      p_uname     LIKE sy-uname
                  MODIF ID bl1.            " User name
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS:
      p_fname(10) TYPE c MODIF ID bl2
                         OBLIGATORY,       " First name
      p_lname(10) TYPE c MODIF ID bl2
                         OBLIGATORY,       " Last name
      p_empid(5)  TYPE n MODIF ID bl2
                         OBLIGATORY.       " Employee id
    SELECTION-SCREEN END OF BLOCK b2.
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      w_uname     LIKE sy-uname.           " User name
                 AT SELECTION-SCREEN OUTPUT EVENT                       *
    AT SELECTION-SCREEN OUTPUT.
      PERFORM validate.
                AT SELECTION-SCREEN ON FIELD EVENT                      *
    AT SELECTION-SCREEN ON p_uname.
      PERFORM validate_uname.
                      END OF SELECTION EVENT                            *
    END-OF-SELECTION.
      PERFORM output.
    FORM VALIDATE                                                      *
    This subroutine disables all parameters if user name is not        *
    initialized or user name is not valid.                             *
    There are no interface parameters to be passed to this subroutine. *
    FORM validate.
      w_uname = sy-uname.
      IF p_uname IS INITIAL OR p_uname NE w_uname.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'BL2'.
            screen-active = '0'.
          ELSE.
            screen-active = '1'.
          ENDIF.                           " IF screen-group1 EQ 'BL2'.
          MODIFY SCREEN.
        ENDLOOP.                           " LOOP AT SCREEN.
      ELSEIF p_uname EQ sy-uname.
        LOOP AT SCREEN.
          IF screen-group1 = 'BL1'.
            screen-active = 0.
            MODIFY SCREEN.
          ELSEIF screen-group1 = 'BL2'.
            screen-active = 1.
            screen-output = 1.
            screen-input = 1.
            screen-invisible = 0.
          ENDIF.                           " IF screen-group1 = 'BL1'.
          MODIFY SCREEN.
        ENDLOOP.                           " LOOP AT SCREEN.
      ENDIF.                               " IF p_uname IS INITIAL...
    ENDFORM.                               " VALIDATE
    Form VALIDATE_UNAME                                                *
    This subroutine gives error message and validates the user name.   *
    There are no interface parameters to be passed to this subroutine. *
    FORM validate_uname .
      IF p_uname IS INITIAL.
        MESSAGE 'Enter the user name'(001) TYPE 'E'.
      ELSEIF p_uname NE sy-uname.
        MESSAGE 'Authorization unsuccessful'(002) TYPE 'E'.
      ENDIF.                               " IF p_uname IS INITIAL.
    ENDFORM.                               " VALIDATE_UNAME
    Form  OUTPUT                                                       *
    This subroutine is used to print the output.                       *
    There are no interface parameters to be passed to this subroutine. *
    FORM output .
      IF p_fname IS NOT INITIAL.
        WRITE: / 'First name:'(003),p_fname.
        WRITE: / 'Last name:'(004),p_lname.
        WRITE: / 'Employee id:'(005),p_empid.
      ENDIF.                               " IF p_fname IS NOT INITIAL.
    ENDFORM.                               " OUTPUT
    I think this solves your problem.
    Reward if it helps you.....
    Regards,
    Sandhya

  • Dynamically hide a block in selection screen

    Hi All,
    Can we hide a whole block in a selection screen dynamically.
    If so, then how?
    Regards,
    Bhaskar Tripathi

    Hi,
    Refer this code
    *&      Form  sub_select_report
          text
    FORM sub_select_report .
      IF ( p_post  EQ c_chk ).
        LOOP AT SCREEN.
          IF ( screen-group1 EQ 'MD1' ) OR
             ( screen-group1 EQ 'MD2' ) OR
             ( screen-group1 EQ 'MD3' ) OR
             ( screen-group1 EQ 'MD4' ).
            screen-input   = c_ok.
            screen-active  = c_ok.
          ENDIF.
          IF ( screen-group1 EQ 'MD5' ) OR
             ( screen-group1 EQ 'MD6' ).
            screen-input   = c_1.
            screen-active  = c_1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSEIF p_rpt EQ c_chk.
        LOOP AT SCREEN.
          IF ( screen-group1 EQ 'MD5' ) OR
             ( screen-group1 EQ 'MD6' ).
            screen-input   = c_ok.
            screen-active  = c_ok.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " sub_select_report
    Regards,
    Prashant

  • How to hide particular block in selection screen

    Hi,
    I am having different blocks in a selection screen.
    How to show the blocks dynamically according to a radio button selection.
    means how to Hide/show entire block.
    Thanks,
    anandan

    Hi Anandan,
    Try this program.
    REPORT  zvk_collect.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME NO INTERVALS.
    PARAMETER : p_plant RADIOBUTTON GROUP g1 USER-COMMAND radio DEFAULT 'X',
                      p_mrp   RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME NO INTERVALS.
    PARAMETER : p_werks TYPE marc-werks MODIF ID sp1.
    SELECTION-SCREEN END OF BLOCK b2.
    *SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME NO INTERVALS.
    *PARAMETER : p_berid TYPE smdma-berid MODIF ID sp2.
    *SELECTION-SCREEN END OF BLOCK b3.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        CHECK screen-group1 = 'SP1' OR
              screen-group1 = 'SP2'.
        IF p_plant = 'X'.
          IF screen-group1 = 'SP2'.
            screen-input = 0.
            screen-active = 0.
            screen-required = 1.
            MODIFY SCREEN.
          ENDIF.
        ELSE.
          IF screen-group1 = 'SP1'.
            screen-input = 0.
            screen-active = 0.
            screen-required = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Execute with Comments ON and Without Comments and See the difference
    Reward if found helpful

  • Hiding block of selection screen

    Hi,
    1. Is it possible to Hide complete Block of selection screen (rather than using MODIF ID for each parameter )?
    Ex.  r1 - radiobutton group g1
           r2- radiobutton group g2
    selection-screen begin of block b1 -
    selection-screen end of block b1 ---
    selection-screen begin of block b2 -
    selection-screen end of block b2 ---
    if r1
    then hide block b2
    if r2
    then hide block b1
    Thanks.
    Kevin

    Hi,
    Just try to solve in the below way.
    constants: c_0             TYPE char1       VALUE '0'.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    ***Parameters Declaration
    PARAMETERS :
       rb_pros RADIOBUTTON  GROUP gr1 USER-COMMAND ucomm DEFAULT 'X'.
    PARAMETERS :
       rb_reprs RADIOBUTTON GROUP gr1 .
    ***Local file path
    PARAMETERS: p_lofile TYPE localfile MODIF ID bl2.
    ***Local file path to download data
    PARAMETERS: p_dnfile TYPE localfile.
    SELECTION-SCREEN : END OF BLOCK b1.
    ***Selection for check boxes
    SELECTION-SCREEN BEGIN OF BLOCK b3.
    ***Parameters Declaration
    PARAMETERS:
    ***Flag for test run
    cb_test AS CHECKBOX DEFAULT c_x.
    SELECTION-SCREEN END OF BLOCK b3.
    ***to modify the screen, if reprocess button is not
    ***selected then hide the file path option
    AT SELECTION-SCREEN OUTPUT.
      IF  rb_pros EQ c_x.
        LOOP AT SCREEN.
          IF  screen-group1 = 'BL2'.
            screen-active = c_0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
        CLEAR rb_reprs.
      ENDIF.

  • Hide / Show a block in Selection screen

    Hi,
    How to hide or show a block in selection screen.
    Plz help.
    Regards,
    Sriram

    REPORT  ZTESTETSET.
    02.
    03."First we create the selection screen which contains 2 option
    04."buttons For show and hide.
    05.
    06. SELECTION-SCREEN BEGIN of BLOCK screen1 WITH FRAME TITLE title1.
    07.  PARAMETERS: Show RADIOBUTTON GROUP opt USER-COMMAND aaa DEFAULT 'X',
    08.              Hide RADIOBUTTON GROUP opt .
    09.  SELECTION-SCREEN END OF BLOCK screen1.
    10.
    11.  "This is the selection screen that we will hide and show
    12.  "based on the selected option button above
    13.
    14. SELECTION-SCREEN BEGIN of BLOCK screen2 WITH FRAME TITLE title2.
    15.      PARAMETER  CONNID like spfli-connid.
    16.  SELECTION-SCREEN END OF BLOCK screen2.
    17.
    18."We capture the selected option event using
    19."AT SELECTION-SCREEN OUTPUT to modify the screen
    20.
    21.   AT SELECTION-SCREEN OUTPUT.
    22.  PERFORM modify_screen.
    23.
    24.  START-OF-SELECTION.
    25.
    26."This is the sub program that will loop all the elements on
    27."the selection screen to identify which element we want to
    28."hide or show based on screen name.
    29.
    30.  FORM modify_screen .
    31.  LOOP AT SCREEN.
    32.    IF Show NE 'X'.
    33.      IF screen-name CS 'CONNID'.
    34.        screen-active = 0.
    35.        MODIFY SCREEN.
    36.      ENDIF.
    37.    ENDIF.
    38.  ENDLOOP.
    39.ENDFORM.
    40.
    41."Give the selection block a title.
    42.INITIALIZATION.
    43.
    44.title1 = 'Show/Hide Option'.
    45.title2 = 'Selection Screen'.
    Thanks
    anurag Srivastava

  • How to hide F8 function on selection screen.

    Hi,
    How to hide F8 function on selection screen.

    Just create a customer status and SET this status in your INITIALIZATION block.
    <i>You can copy the standard status from program RSSYSTDB status %_00.</i>
    Regards

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • How to hide input fields on selection screen using variant attribute

    Hello all,
    I want to know how to hide input fields on selection screen using variant attribute conpletely.
    As you know, when setting the attribute of variant "Hide field" checked, the field is temporarily hidden, but when clicking "All Selections(F7)" button on the selection screen, the fileds become appeared.
    I want to hide the field completely. Di you know how to do ?
    Thank you for your support.
    Regards,
    Hideki Kozai

    Use this attribute hide field and save the variant. Then create transaction for this program setting default variant for parameter Start with variant . The user who runs it will have it by defualt set.
    Otherwise
    in PBO simply use LOOP at screen and output = 0 for this field. This will ensure that field is invisible in any case.
    Regards
    Marcin

  • FREE_SELECTIONS_INIT defining blocks on selection-screen.

    Hi,
    is it possible to define blocks on selection-screen if I use the function FREE_SELECTIONS_INIT.
    And is it possible to define the select-option obligatory.
    Best regards,
    Marcus

    hi
      Yes you can make select-options as obligatory by using
    SELECT-OPTIONS:
       s_abs for <some thing> OBLIGATORY
    and coming to the FM
    the function module receives information about
    the set of fields for which dynamic selections should be possible, and
    returns a selction ID
    i Think it is not possible
    regards
    Pavan

  • How to hide block on selection screen?

    Hi All,
    I want to hide a block on the selection screen. I implemented the following logic to hide the block the fields are getting hided but the block is displayed. is there any way to hide block also.
    SELECTION-SCREEN BEGIN OF BLOCK processing WITH FRAME TITLE text-030.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS pa_xmanu LIKE rm08mrbr-manu DEFAULT 'X'
                       RADIOBUTTON GROUP val MODIF ID ID1.
    SELECTION-SCREEN COMMENT 3(30) text-040 FOR FIELD pa_xmanu.
    SELECTION-SCREEN POSITION 40.
    PARAMETERS pa_xauto LIKE rm08mrbr-auto
                       RADIOBUTTON GROUP val MODIF ID ID1.
    SELECTION-SCREEN COMMENT 43(30) text-050 FOR FIELD pa_xauto.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: pa_xskto LIKE rm08mrbr-skto AS CHECKBOX MODIF ID ID1.
    SELECTION-SCREEN COMMENT 3(30) text-055
                                   FOR FIELD pa_xskto.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK processing.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SCREEN-GROUP1 = 'ID1'.
          SCREEN-ACTIVE = 0.
          modify screen.
        ENDIF.
      ENDLOOP.
    Thanks,
    Anil.

    Make sure you hide your comment lines with the MODIF ID as well.  
    selection-screen begin of block processing with frame title text-030.
    selection-screen begin of line.
    selection-screen position 1.
    parameters pa_xmanu like rm08mrbr-manu default 'X'
    radiobutton group val modif id id1.
    selection-screen comment 3(30) text-040 for field pa_xmanu modif id id1.  "<---  Here
    selection-screen position 40.
    parameters pa_xauto like rm08mrbr-auto
    radiobutton group val modif id id1.
    selection-screen comment 43(30) text-050
                                   for field pa_xauto modif id id1.  "<---  Here
    selection-screen end of line.
    selection-screen begin of line.
    parameters: pa_xskto like rm08mrbr-skto as checkbox modif id id1.
    selection-screen comment 3(30) text-055
    for field pa_xskto modif id id1.          "<---  Here
    selection-screen end of line.
    selection-screen end of block processing.
    at selection-screen output.
      loop at screen.
        if screen-group1 = 'ID1'.
          screen-active = 0.
          modify screen.
        endif.
      endloop.
    Regards,
    Rich Heilman

  • Problem while using Alv Block List

    HI All,
    PLZ help me .
    By using this code I select data from TXT file and insert data in CS13 transaction then I want to show each material which present in TXT file as ALV BLOCK DISPLAY.
    Suppose txt file contain 4 material so report will show 4 list block .means data of every material showing in different blocks in the report.
    Code which I am using showing showing data only for last material which present in the table it_matmaster in every block.
    Please guide me what is the problem.
    I am pasting changed code for you.
    i am using below codes..........
    *& Report  ZCS13                                                       *
    REPORT  zcs13                                   .
    TABLES:
            mara,
            stpo,
            t001w,
            stko.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_stb OCCURS 0.
            INCLUDE STRUCTURE zstpox.
    DATA:END OF it_stb.
    DATA: BEGIN OF it_matmaster OCCURS 0,
          matnr TYPE matnr,
          werks TYPE werks,
         stlal type stlal,
         capid type capid,
          emeng TYPE emeng,
          END OF it_matmaster.
    DATA : ievent TYPE slis_t_event.
    DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
    it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
    temp_cat TYPE slis_fieldcat_alv,
    sline TYPE slis_listheader,
    gt_list_top_of_page TYPE slis_t_listheader,
    gs_layout TYPE slis_layout_alv ,
    gt_events TYPE slis_t_event,
    gt_sort TYPE slis_t_sortinfo_alv,
    w_msg(255) TYPE c,
    int TYPE i VALUE 0.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    CONSTANTS c_x VALUE 'X'.
    DATA: w_topmat LIKE cstmat,
        fieldcat TYPE slis_t_fieldcat_alv ,
         wa_fieldcat TYPE slis_fieldcat_alv.
    DATA:v_file TYPE string.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'ASC'
         has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      =  it_matmaster
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'ZCS13'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
       i_callback_user_command        = ''
      IT_EXCLUDING                   =
    PERFORM fldcat.
      LOOP AT it_matmaster.
        PERFORM explode_assembly.
        PERFORM fldcat.
        PERFORM append_blocklist.
       PERFORM alv_display_grid.
      ENDLOOP.
      PERFORM alv_display_grid.
    *&      Form  EXPLODE_ASSEMBLY
          text
    FORM explode_assembly.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
      EXPORTING
        capid                 = 'BEST'
        cuols                 = c_x
        datuv                 = sy-datum
        emeng                 = it_matmaster-emeng
        knfba                 = c_x
        ksbvo                 = c_x
        mehrs                 = c_x
        mbwls                 = c_x
         mdmps                 = c_x
        mktls                 = c_x
         stlal                 = it_matmaster-stlal
         stlan                 = p_bomap
        mtnrv                 = it_matmaster-matnr
        werks                 = it_matmaster-werks
         svwvo                 = 'X'
         vrsvo                 = 'X'
      IMPORTING
        topmat                = w_topmat
      TABLES
        stb                   = it_stb
      EXCEPTIONS
        alt_not_found         = 1
        call_invalid          = 2
        material_not_found    = 3
        missing_authorization = 4
        no_bom_found          = 5
        no_plant_data         = 6
        no_suitable_bom_found = 7
        conversion_error      = 8
        OTHERS                = 9.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO w_msg.
       WRITE: / w_msg.
       EXIT.
    ENDIF.
    ENDFORM.                    "explode_assembly
    *&      Form  fldcat
          text
    -->  p1        text
    <--  p2        text
    FORM fldcat .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = 'ZCS13'
      i_internal_tabname           = 'IT_STB'
         i_structure_name             = 'ZSTPOX'
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = 'ZCS13'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " fldcat
    *&      Form  alv_display_grid
          text
    -->  p1        text
    <--  p2        text
    FORM alv_display_grid .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         EXPORTING
           i_interface_check             = 'x_print_layout'
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
         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.
      ENDIF.
    ENDFORM.                    " alv_display_grid
    *&      Form  append_blocklist
          text
    -->  p1        text
    <--  p2        text
    FORM append_blocklist .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = gs_layout
          it_fieldcat                      = fieldcat
          i_tabname                        = 'IT_STB[]'
          it_events                        = gt_events
         it_sort                          = gt_sort
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_stb[]
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 2
         OTHERS                           = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " append_blocklist

    Hi ,
    Use the upload function 'WS_UPLOAD' . Declare ITAB of type table of your choice.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME                = FILENAME( Has to specified by you )
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = ITAB
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                FILE_OPEN_ERROR         = 2
                FILE_READ_ERROR         = 3
                INVALID_TYPE            = 4
                NO_BATCH                = 5
                UNKNOWN_ERROR           = 6
                INVALID_TABLE_WIDTH     = 7
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
    LOOP AT ITAB.
    Use Split function to seperate the fields of the Internal table and append to a new Internal table of your choice.
    ENDLOOP.

  • Retaining the selected tab in a tabbed block of selection screen

    Hi,
    My report has a selection screen with a tabbed block displaying 3 tabs. I want to retain the tab that was selected before executing the report and display that tab as the activetab when the user back navigates from the output list of the report to the selection screen.
    I tried to store the value of 'activetab' component of the tabbed block in a global variable and assigned the global variable to the 'activetab' component. But it is not working.
    Is there any other way by which we can do this?
    Thanks and Regards,
    Tongston

    I had a similar problem some time ago. One clarification first, global variables will not work because when you come back from report output, all the global/local variables are initialized that is when you come back to selection screen from report output, it is like a new instance of report.
    To resolve this you can use Export to memory ID / Import from memory ID statements, as these will retain the data across report instances.
    Now the following code is doing exactly what you wanted. You should copy/ paste it in an abap program and run it to see for yourself how I retained active tab.  Hope this will help you.
    REPORT  yy_test002.
    TABLES: bkpf, bseg, glt0, fdes, lfa1.
    DATA: g_acttab(132) TYPE c.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS: p_bukrs LIKE bkpf-bukrs,  "obligatory,
                p_upto LIKE bkpf-budat.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon1 FOR bseg-hkont NO-EXTENSION,
                    s_lifn1 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 101.
    SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon2 FOR bseg-hkont NO-EXTENSION,
                    s_lifn2 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 102.
    SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
    SELECT-OPTIONS: s_hkon3 FOR bseg-hkont NO-EXTENSION,
                    s_lifn3 FOR bseg-lifnr.
    SELECTION-SCREEN END OF SCREEN 103.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME.
    PARAMETERS: p_dued LIKE bseg-fdtag.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tbblk FOR 8 LINES.
    SELECTION-SCREEN TAB (18) tabname1
    USER-COMMAND 'UTB1' DEFAULT SCREEN 101.
    SELECTION-SCREEN TAB (18) tabname2
    USER-COMMAND 'UTB2' DEFAULT SCREEN 102.
    SELECTION-SCREEN TAB (18) tabname3
    USER-COMMAND 'UTB3' DEFAULT SCREEN 103.
    SELECTION-SCREEN END OF BLOCK tbblk.
    SELECTION-SCREEN END OF BLOCK blk2.
    INITIALIZATION.
      tabname1 = 'GL Accounts set 1'.
      tabname2 = 'GL Accounts set 2'.
      tabname3 = 'GL Accounts set 3'.
      IMPORT g_acttab FROM MEMORY ID 'zssfsdfr3'.
      IF sy-subrc = 0.
        tbblk-prog = sy-repid.
        tbblk-activetab = g_acttab.
        CASE g_acttab.
          WHEN 'UTB1'.
            tbblk-dynnr = 101.
          WHEN 'UTB2'.
            tbblk-dynnr = 102.
          WHEN 'UTB3'.
            tbblk-dynnr = 103.
          WHEN OTHERS.
        ENDCASE.
      ENDIF.
    START-OF-SELECTION.
      g_acttab = tbblk-activetab.
      EXPORT g_acttab TO MEMORY ID 'zssfsdfr3'.
      WRITE:/ 'current active tab:', g_acttab.
      WRITE:/ 'bye'.

  • Hiding a block in selection screen

    Hi everybody,
             My requirement is to hide the entire block of a particular selection screen, find the below selection screen code.  with my piece of code,iindividual fields are getting hidden, please let me know how to hide the entire block.
              If I select rb_det then the block b2 should hide.
    Selection screen :
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t02.
    PARAMETER: rb_sum RADIOBUTTON GROUP rtyp DEFAULT 'X' USER-COMMAND DISP,
    rb_det RADIOBUTTON GROUP rtyp.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t04.
    PARAMETER: cb_asco AS CHECKBOX DEFAULT 'X' modif id SEL,
    cb_divi AS CHECKBOX modif id SEL,
    cb_buen AS CHECKBOX modif id SEL,
    cb_prod AS CHECKBOX modif id SEL,
    cb_bupa AS CHECKBOX modif id SEL,
    cb_inob AS CHECKBOX modif id SEL.
    SELECTION-SCREEN END OF BLOCK b2.
    Existing code :
    A T S E L E C T I O N - S C R E E N *
    at selection-screen output.
    loop at screen.
    if screen-group1 = 'SEL'.
    if rb_det = 'X'.
    if screen-name = 'CB_ASCO' or
    screen-name = 'CB_DIVI' or
    screen-name = 'CB_BUEN' or
    screen-name = 'CB_PROD' or
    screen-name = 'CB_BUPA' or
    screen-name = 'CB_INOB' .
    screen-active = 0.
    modify screen.
    endif.
    endif.
    endif.
    endloop.
    Thanks in advance...
    Regards,
    Ravi

    Hi,
    A block will be made invisible if everything inside it is inactive. If you give all of them a MODIF ID, too, the block will disappear.
    SELECTION-SCREEN BEGIN OF BLOCK processing WITH FRAME TITLE text-030.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS pa_xmanu LIKE rm08mrbr-manu DEFAULT 'X'
      RADIOBUTTON GROUP val MODIF ID id1.
      SELECTION-SCREEN COMMENT 3(30) text-040 FOR FIELD pa_xmanu MODIF ID
    id1.
      SELECTION-SCREEN POSITION 40.
      PARAMETERS pa_xauto LIKE rm08mrbr-auto
      RADIOBUTTON GROUP val MODIF ID id1.
      SELECTION-SCREEN COMMENT 43(30) text-050 FOR FIELD pa_xauto MODIF ID
    id1.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS: pa_xskto LIKE rm08mrbr-skto AS CHECKBOX MODIF ID id1.
      SELECTION-SCREEN COMMENT 3(30) text-055
      FOR FIELD pa_xskto MODIF ID id1.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN END OF BLOCK processing.
      AT SELECTION-SCREEN OUTPUT.
        LOOP AT SCREEN.
          IF screen-group1 = 'ID1'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
    Regards,
    Priyanka.

  • Hide the parameters on selection screen

    Hi1
    I have a report which has parameters as checkboxes in the sleection screen and by default all the three parameters are checked . What I want to do is hide these parameters in the selection screen while their functionality still existing mean when I run teh report the result should show what it showed when the three checjboxes were checked and the parameters were visible. So now I just want to hide these parameters in my selectiopn screen.
    Can anyone help me out pls.
    PARAMETERS:     p_varia TYPE disvariant-variant MEMORY ID wrk,
                    p_rb1 RADIOBUTTON GROUP G1  user-command ucomm default 'X' hide,
                    p_all AS CHECKBOX DEFAULT 'X' modif id 123,
                    p_group AS CHECKBOX modif id 123,
                    p_rb2 RADIOBUTTON GROUP G1,
                    p_date AS CHECKBOX MODIF ID 234,
                    p_bedat TYPE fpla-bedat DEFAULT sy-datum MODIF ID 234,
                    p_endat TYPE fpla-endat MODIF ID 234,
                    p_rental AS CHECKBOX MODIF ID 234.
    Thanks

    Hi,
    Try this sample code. Hope it will solve ur prob.
    REPORT  ztest_hl7.
    PARAMETERS: p_varia TYPE disvariant-variant MEMORY ID wrk,
    p_all AS CHECKBOX DEFAULT 'X' ,
    p_group AS CHECKBOX DEFAULT 'X' ,
    p_rental AS CHECKBOX DEFAULT 'X' .
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'P_ALL' OR screen-name = 'P_GROUP'
        OR screen-name = 'P_RENTAL'.
          screen-invisible = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    START-OF-SELECTION.
      WRITE /: p_all,p_group,p_rental.
    Regards,
    Joy.

Maybe you are looking for

  • Photoshop cc 64 bits does not start anymore

    Since yesterday my photoshop CC 64 bits does not start aymore with an error message like "the internal file signature is incorrect." (it is a translation I use the French version). My photoshop cc 32 bits works still fine. I have the version 14.1.1 o

  • Working eMTA config for a Metaswitch for Cisco DPQ3925

    I need a working emta config for a DPQ3295 cable modem that will work with a Metaswitch AGC using NCS

  • Problem installing creative cloud with cookies?

    Hi, I am currently trying to download a trail for Adobe Illustrator to see if it is compatible for my needs. I've tried to download the creative cloud but I keep getting a pop up notification that says "Error starting Creative Cloud cookies dir: cann

  • BW System Migration

    Hi We are currently running our NW04 BW 350 landscape on Windows 2003 Server 32 Bit/ MS SQL Server 2000 32 Bit, thats DEV, QA & PRD. Due to performance issues and a hardware upgrade we are looking to migrate from 32 Bit OS to 64 Bit OS, so we will en

  • VirtualDVHS help or capturing with JVC HM-DH30000

    A friend asked me to copy an old VHS tape for her to DVD, which I didn't think I could do until I realized I have my old JVC DVHS deck in cold storage. Low and Behold it has a firewire out on it. I've read a lot on forums that suggest that I could us