Question on selection screen in a subscreen in dialog prorgamming

hi,
i have a module pool in which the main program has the definition of the selection screen as follows:
SELECTION-SCREEN BEGIN OF SCREEN 0101 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS: S_VSTEL FOR  TVST-VSTEL,
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 0101.
In the PBo of screen 100 this is called
CALL SUBSCREEN SUBSCREEN1 INCLUDING SY-REPID L_DYNNR.
The subscreen is displayed as
Shipping point  _______ To _________  =>
When I click that arrow (( extension )) nothing happens !! I am supposed to get the standard extension screen in whcih i can select single values, ranges, exclude values, ranges !!
why is this not displayed..any idea ?
i have the same code in a normal report program and it works fine ..
thks

in module pool you need to add code for the => this is not been handled by SAP in module pool whereas it is been handled in report program.
There is one FM which needs to be used so that when => is clicked it works...

Similar Messages

  • Calling a selection screen in a subscreen of a tabstrip

    hi,
    I have created a tabstrip where i have included a subscreen.
    I want to create and call a selection screen within that subscreen.
    Can anybody tell me the steps required?
    thanks in advance,
    Abhishek

    hi
    good
    try this
    In the same way that you can define a screen as a subscreen in the Screen Painter, it is now possible to define selection screens as subscreens in an ABAP program:
    SELECTION-SCREEN BEGIN OF SCREEN scrn AS SUBSCREEN
                                         [NO INTERVALS]
                                         [NESTING LEVEL n].
    SELECTION-SCREEN END OF SCREEN scrn.
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
    http://sap.niraj.tripod.com/id40.html
    thanks
    mrutyun^

  • Displaying selection screen as pop-up from dialog box

    Hi,
          I have a screen which is of dialog-box type. This dialog screen shows an ALV and has a button in the ALV toolbar. On pressing this button, a pop-up screen is to be displayed. This pop-up screen is designed as a selection-screen. Is it possible to display this selection screen as a pop-up from a dialog box screen?
    Regards,
    Suhas

    Hi Suhas,
    Its possible to display selection screen as pop-up from dialog box.....Check the code below...copy paste and execute...
    SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE text-001.
    PARAMETER p.
    SELECTION-SCREEN END   OF SCREEN 123.
    CALL SELECTION-SCREEN 123 STARTING AT 20 5
                                ENDING AT 80 15.
    The below code might help u to add a button in alvgrid's toolbar......
    *       CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        DATA: wa_toolbar   TYPE stb_button,
              calc         TYPE REF   TO cl_gui_frontend_services.
        METHODS : toolbar_handle FOR EVENT toolbar      OF cl_gui_alv_grid
                                        IMPORTING e_object
                                                  e_interactive,
                  ucomm_handle   FOR EVENT user_command OF cl_gui_alv_grid
                                        IMPORTING e_ucomm.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD toolbar_handle.
        MOVE   3 TO  wa_toolbar-butn_type.
        APPEND wa_toolbar   TO e_object->mt_toolbar.
        MOVE : 0            TO wa_toolbar-butn_type,
               'CALC'       TO wa_toolbar-function,
               '@0M@'       TO wa_toolbar-icon,
               'Calculator' TO wa_toolbar-quickinfo.
        APPEND wa_toolbar TO e_object->mt_toolbar.
      ENDMETHOD. "toolbar_handle
      METHOD ucomm_handle.
        IF e_ucomm = 'CALC'.   " When button added in toolbar is clicked
          IF calc IS INITIAL.
            CREATE OBJECT calc.
          ENDIF.
          CALL METHOD cl_gui_frontend_services=>execute
       EXPORTING
         application            = 'CALC'.
        ENDIF.
      ENDMETHOD. "ucomm_handle
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    DATA : container    TYPE REF   TO cl_gui_custom_container,
           grid         TYPE REF   TO cl_gui_alv_grid,
           event        TYPE REF   TO lcl_event_handler,
           it_display   TYPE TABLE OF mara,
           wa_display   TYPE mara.
    START-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'BASIC'.
      PERFORM build_it_display.
      PERFORM create_objects.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'EXIT'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'CANC'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  build_it_display
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_it_display .
      SELECT * FROM mara UP TO 15 ROWS INTO TABLE it_display.
    ENDFORM.                    " build_it_display
    *&      Form  create_objects
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_objects .
      IF container IS INITIAL.
        CREATE OBJECT container
        EXPORTING
          container_name     = 'CUSTOM'.
        CREATE OBJECT event.
        CREATE OBJECT grid
          EXPORTING
            i_parent         = container.
        SET HANDLER event->toolbar_handle FOR grid.
        SET HANDLER event->ucomm_handle   FOR grid.
        CALL METHOD grid->set_table_for_first_display
          EXPORTING
            i_structure_name = 'MARA'
          CHANGING
            it_outtab        = it_display.
      ENDIF.
    ENDFORM.                    " create_objects
    Cheers,
    Jose.

  • Initializing Selection-Screen as dynpro subscreen

    Hello!
    I wrote a dynpro program that includes a selection screen as subscreen. In the flow logic the subscreen is called before output like this.
    process before output.
      call subscreen sub including sy-repid '110'.
      module status_0100.
    The program works fine to this point. Now I want to initialize a select-options table in the selection screen with some values. Doing this in the status_0100 module doesn't work. I suppose at this point it is too late to change values of the selection screen. I can't change the flow logic of the selection-screen 110 because it is generated automatically.
    My questions are:
    1. Is there any kind of initialization block or something like this where i can place the code to fill the select-options table?
    2. Filling a select-options table by appending lines to it is the common way to do this, isn't it?
    Thank you for your answers,
    Georg

    There is nothing stopping your from doing this?
    process before output.
    module status_0100.    "<-- Put this here
    call subscreen sub including sy-repid '110'.
    And then fill your select-option in the STATUS_0100 module, make sure that you apend to the internal table!
    Regards,
    Rich HEilman

  • Question on selection-screen

    Hi,
    1) How we can provide two fields on selection-screen side by side
    2) How we can provide Text on selection-screen (ie some comments regarding selection-screen fields)

    Moderator message - Welcome to SCN
    However, this is not a training forum for ABAP. Please read the appropriate documentation.
    Thread locked..
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.

  • One question about Selection screen

    Hi experts,
    I am writing a report, on the selection screen, I need to input the file path and then do the file upload.
    My question is about how to check the file path I put is correct or not? If it is incorrect, I want to get a message and the cursor still in the field and don't jump to the next page.
    How can I do like that?
    Any one has any suggestion, please help me.
    Thanks in advance.
    Regards,
    Chris Gu

    Hi Chris,
        do it this way: check my code after calling gui_upload what condition i am using.
    parameters:
      p_file type rlgrap-filename.          " File name
    *           AT SELECTION-SCREEN ON VALUE-REQUEST EVENT               
    at selection-screen on value-request for p_file.
      perform get_file_name.
    *                       AT SELECTION-SCREEN EVENT                    
    at selection-screen on p_file.
      perform validate_upload_file.
    *  Form  GET_FILE_NAME                                               
    form get_file_name.
      call function 'F4_FILENAME'
       exporting
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
         field_name          = ' '
       importing
         file_name           = p_file.
    endform.                               " GET_FILE_NAME
    *  Form  VALIDATE_UPLOAD_FILE                                        
    form validate_upload_file.
      data:
        lw_file  type string.              " File Path
      lw_file = p_file.
      call function 'GUI_UPLOAD'
        exporting
          filename                    = lw_file
          filetype                    = 'ASC'
          has_field_separator         = 'X'
          dat_mode                    = 'X'
        tables
          data_tab                    = t_final_data.
      IF sy-subrc ne 0 and t_final_data is initial. " here message if file path is wrong
        Message 'File not found' type 'E'.
      ELSEIF sy-subrc eq 0 and t_final_data is initial.
        Message 'File empty' type 'E'.
      ENDIF.                              
    endform.                               " VALIDATE_UPLOAD_FILE
    With luck,
    Pritam.
    Edited by: Pritam Ghosh on May 8, 2009 8:57 AM

  • Question reg. selection screen

    I am writing a report. On selection screen, I have a field for Sales order (vbeln) from a custom table zsales.  Now when the user selects this field on selection screen and press F4, he/she should be able to select the salesorders from the table zsales.
    I wrote:
    SELECT-OPTIONS: s_vbeln FOR zsales-vbeln.
    But on the output, when I press F4, I am still not getting any input help. What change can you suggest?
    Appreciate your input.
    Thanks,
    Krishen

    Try something like this.
    report zrich_0001 .
    tables: zsales
    data: begin of izsales occurs 0,
           vbeln type vbak-vbeln,
          end of izsales.
    select-options s_vbeln for zsales-vbeln.
    initialization.
      select vbeln into table izsales from zsales.
      sort izsales ascending by vbeln.
      delete adjacent duplicates from izsales comparing vbeln.
    at selection-screen on value-request for s_vbeln-low.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
           exporting
                retfield    = 'VBELN'
                dynprofield = 'S_VBELN'
                dynpprog    = sy-cprog
                dynpnr      = sy-dynnr
                value_org   = 'S'
           tables
                value_tab   = izsales.
    start-of-selection.
    Regards,
    Rich Heilman

  • Question in selection screen

    how many push buttons put in selection screen
    plzzz answer my question

    Hi,
    U can place as many push buttons as u need...
    Please reward if helpful.

  • HI Question On Selection Screen

    Hi Abapers,
                       i  declared four parameters , one is assigned with one parameter is , and the other three are assigned with another parameter id , initially only one parameter has to display , if the entered parameter is valid one , then other three parameters has to be displayed, i wrote the folling code kindly make any corrections to the below code.
    parameters:p_kunnr type kna1-kunnr modif id ABC.
    parameters:p_vbeln type vbak-vbeln modif id DEF,
               p_bukrs type bukrs  modif id DEF,
               p_werks type werks modif id DEF.
    data: w_kunnr type kunnr,
          val type i value 1.
    at selection-screen .
    select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.
    if sy-subrc eq 0.
    val = 100.
    else.
    message e000(0) with 'invalid '.
    endif.
    start-of-selection.
    write:/ 'success'.
    at selection-screen output .
    IF VAL = 1.
    loop at screen.
    if screen-group1 = 'DEF'.
    SCREEN-ACTIVE = 0.
    MODIFY SCREEN.
    endif.
    endloop.
    ENDIF.
    IF VAL NE 1.
    loop at screen.
    if screen-group1 = 'DEF'.
    SCREEN-ACTIVE = 1.
    MODIFY SCREEN.
    endif.
    endloop.
    ENDIF.
    Thanks & Regards
    Bhaskar Rao.M

    hai,
    Bhaskar try this code...
    parameters:
    p_kunnr type kna1-kunnr modif id ABC .
    parameters:p_vbeln type vbak-vbeln modif id DEF,
    p_bukrs type bukrs modif id DEF,
    p_werks type werks modif id DEF.
    data:
      w_kunnr type kunnr,
      val type i  value 1.
    at selection-screen output .
    IF  p_kunnr is initial.
    loop at screen.
    if screen-group1 = 'DEF'.
    SCREEN-ACTIVE = 0.
    MODIFY SCREEN.
    endif.
    endloop.
    ENDIF.
    at selection-screen .
    select single kunnr from kna1 into w_kunnr where kunnr = p_kunnr.
    if sy-subrc ne 0.
    message e000(0) with 'invalid '.
    endif.
    start-of-selection.
    if p_vbeln is initial.
    message 'error' type 'I'.
    else.
    write:/ 'success'.
    endif.
    regards,
    ananth

  • Validation for a selection screen used as a subscreen

    Hi friends,
    I have a screen say '0001' in that screen i have three subscreens 0002 0003 0004
    In the subscreen 0002, i have declared three selection screens 0102, 0202, 0302
    In the Application toolbar of the screen 0001 (PF Status) i have declared three push buttons A, B, C,
    On click of A i ll invoke 0102 selection screen inside the subscreen 0002.
    Similarly On click of B i ll invoke 0202 selection screen inside the subscreen 0002
    Similarly On click of C i ll invoke 0302 selection screen inside the subscreen 0002.
    I have completed till the above ...
    My problem is ........................
    The selection screens will have their own Parameters and select options .....
    some of them are mandatory & some of them not .......
    Now when i switch from one push button to another say from A to B and then again to C .... for each and every click it is asking to fill in the mandatory paramters and select options ........ and then only allowing to move to the next sel screen .......
    Needed solution:
    ~~~~~~~~~~~~~
    1. How can i avoid this message "Fill in the required fields" ?
    2. How can i validate the user entries if i take away all the "OBLIGATORY"
        additions in the selection screen declaration part
    3. Where can i write "At selection screen" validation? becoz iam using a function
        group for the creation of screens and all and have included the selection
        screen declaration in the top include of the Function group?
    Hope iam clear with my question!!
    Revert back if you need more clarrifications on the question itself
    Cheers
    Kripa Rangachari .....

    Hi,
       In the pf status - for push buttons give the type as E.
    Write the processing for this in at exit command.
    Validation should be done in AT SELECTION-SCREEN ON field.
    Reward if helpful.

  • How can I add a new field in selection screen for this report

    *& Report  ZGS_BARKODLA_HIZLI_GIRIS
    report  zgs_barkodla_hizli_giris.
    tables: mara,
            mseg,
            mch1,
            *mch1,
            mkpf,
            mchb ,
            makt.
    type-pools: esp1.
    data: i_message_tab  type esp1_message_tab_type,
          wa_message_tab type esp1_message_wa_type ,
          sc_count type i.
    ALV
    type-pools: slis, kkblo.
    data: gs_layout   type slis_layout_alv                     ,
          gt_fldcat   type slis_t_fieldcat_alv with header line,
          gt_header   type slis_t_listheader   with header line,
          gt_sortin   type slis_t_sortinfo_alv with header line,
          g_repid     like sy-repid                            .
    define add-fieldcat.
      gt_fldcat-fieldname     = &1.
      gt_fldcat-ref_tabname   = &2.
      gt_fldcat-seltext_s     = &3.
      gt_fldcat-seltext_m     = &3.
      gt_fldcat-seltext_l     = &3.
      gt_fldcat-reptext_ddic  = &3.
      gt_fldcat-ddictxt       = 'M'.
      append gt_fldcat.
      clear  gt_fldcat.
    end-of-definition.
    types: begin of titab,
            sel   type xfeld,
            matnr type matnr,
            maktx type maktx,
            charg type charg_d,
            menge type menge_d,
            erfmg type erfmg,
           end of titab.
    data : witab type titab.
    data : itab type table of titab.
    data : ok_code type sy-ucomm.
    controls: tc_itab type tableview using screen 0100.
    data: gv_header like bapi2017_gm_head_01,
          gv_code   like bapi2017_gm_code.
    BAPI export parameters
    data: gv_headret type bapi2017_gm_head_ret,
          gv_matdoc  type bapi2017_gm_head_ret-mat_doc,
          gv_matyear type bapi2017_gm_head_ret-doc_year.
    data : lv_objek like inob-objek .
    data : ls_inob  like inob .
    data : imseg type ty_t_mseg.
    data : wmseg type mseg.
    data : answer.
    data : count type i.
    data : v_atinn type atinn.
    BAPI movement details
    data: i_goodsmvt_items type bapi2017_gm_item_create occurs 0
          with header line.
    data: i_return type bapiret2 occurs 0 with header line.
    start-of-selection.
    call function 'CONVERSION_EXIT_ATINN_INPUT'
       exporting
         input  = 'Z_ORAN'
       importing
         output = v_atinn.
      call screen 100.
    *&      Module  status_0100  OUTPUT
    module status_0100 output.
      set pf-status '100'.
      set titlebar '100'.
      mseg-werks = 1000.
      mseg-umwrk = 1000.
    **added
      sc_count = sc_count + 1.
      if sc_count eq 1.
        mseg-bwart = 313.
      endif.
      mkpf-budat = sy-datum.
    **added
      describe table itab lines tc_itab-lines.
    endmodule.                 " status_0100  OUTPUT
    *&      Module  user_command_0100  INPUT
    module user_command_0100 input.
      data field(20).
      data: line_t like sy-index.
      data: lines  like sy-index.
      data line_count like sy-loopc.
      data: begin of cols,
             screen      like screen,
             index       type i,
             selected(1) type c,
             vislength   like icon-oleng,
             invisible(1) type c,
           end   of cols.
      case ok_code.
        when 'DELE'.
          delete itab where sel eq 'X'.
        when 'ENTE'.
          check *mch1-charg is not initial.
          read table itab into witab with key charg = *mch1-charg.
          if not sy-subrc is initial.
            witab-charg = *mch1-charg.
            select single matnr from mch1 into witab-matnr
                               where charg eq witab-charg.
            if not syst-subrc is initial.
              set cursor field '*MCH1-CHARG'.
              message e115(12) with *mch1-charg.
            endif.
            select single maktx from makt into witab-maktx
                               where matnr eq witab-matnr
                                 and spras eq syst-langu.
            witab-erfmg = 1.
            concatenate witab-matnr witab-charg into lv_objek .
            clear ls_inob .
            select single * into ls_inob
                            from inob
                            where objek = lv_objek and
                                  klart = '023'    and
                                  obtab = 'MCH1' .
            select single atflv from ausp into witab-menge
                     where objek = ls_inob-cuobj and
                           klart = '023' .
            append witab to itab.
    **added
            clear *mch1-charg.
    **added
          endif.
        when 'SAVE'.
          if mkpf-budat is initial.
            set cursor field 'MKPF-BUDAT'.
            message e055(00).
          endif.
          if mseg-lgort is initial.
            set cursor field 'MSEG-LGORT'.
            message e055(00).
          endif.
          if mseg-umlgo is initial.
            set cursor field 'MSEG-UMLGO'.
            message e055(00).
          endif.
          if mseg-bwart is initial.
            set cursor field 'MSEG-BWART'.
            message e055(00).
          endif.
          refresh imseg.
          loop at itab into witab.
            move-corresponding witab to wmseg.
            append wmseg to imseg.
          endloop.
          call function 'ZMM_POPUP_WITH_DATA'
            exporting
              imseg  = imseg
            importing
              answer = answer.
          if answer eq 'Y'.
            perform create_goods_movement.
          endif.
        when 'P--'.
          clear ok_code.
          perform paging using 'P--'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P-'.
          clear ok_code.
          perform paging using 'P-'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P+'.
          clear ok_code.
          clear lines.
          perform paging using 'P+'.
          set cursor field 'MARA-MATNR' line 1.
        when 'P++'.
          clear ok_code.
          perform paging using 'P++'.
          set cursor field 'MARA-MATNR' line 1.
        when 'SORA'.
          read table tc_itab-cols into cols with key selected = 'X'.
          if sy-subrc is initial.
            field = cols-screen.
            field = field+5(10).
            sort itab ascending by (field).
          endif.
        when 'SORZ'.
          read table tc_itab-cols into cols with key selected = 'X'.
          if sy-subrc is initial.
            field = cols-screen.
            field = field+5(10).
            sort itab descending by (field).
          endif.
        when 'PRNT'.
          perform write_alv.
      endcase.
    endmodule.                 " user_command_0100  INPUT
    *&      Module  read_table  OUTPUT
    module read_table output.
      mara-matnr = witab-matnr.
      makt-maktx = witab-maktx.
      mch1-charg = witab-charg.
      mseg-menge = witab-menge.
      mseg-erfmg = witab-erfmg.
      line_count = sy-loopc.
    endmodule.                 " read_table  OUTPUT
    *&      Module  write_table  INPUT
    module write_table input.
      witab-matnr = mara-matnr.
      witab-maktx = makt-maktx.
      witab-charg = mch1-charg.
      witab-menge = mseg-menge.
      witab-erfmg = mseg-erfmg.
      modify itab from witab index tc_itab-current_line.
    endmodule.                 " write_table  INPUT
    *&      Module  exit  INPUT
    module exit input.
      leave to screen 0 .
    endmodule.                 " exit  INPUT
    *&      Form  create_goods_movement
    form create_goods_movement .
      clear : gv_header, i_return[], i_goodsmvt_items[].
      gv_header-doc_date = gv_header-pstng_date = mkpf-budat.
      gv_header-pr_uname = sy-uname.
    GM with reference to reservation
      loop at itab into witab.
        i_goodsmvt_items-material   = witab-matnr.
        i_goodsmvt_items-entry_qnt  = witab-erfmg.
        i_goodsmvt_items-entry_uom  = 'ST'.
        i_goodsmvt_items-move_type  = mseg-bwart.
        i_goodsmvt_items-plant      = mseg-werks.
        i_goodsmvt_items-stge_loc   = mseg-lgort.
        i_goodsmvt_items-move_plant = mseg-umwrk.
        i_goodsmvt_items-move_stloc = mseg-umlgo.
        i_goodsmvt_items-batch      = witab-charg.
        append i_goodsmvt_items.
      endloop.
    find BAPI processing transaction
      if gv_code is initial.
        perform determine_bapi_code using mseg-bwart
                                 changing gv_code.
      endif.
      call function 'BAPI_GOODSMVT_CREATE'
        exporting
          goodsmvt_header  = gv_header
          goodsmvt_code    = gv_code
        importing
          goodsmvt_headret = gv_headret
          materialdocument = gv_matdoc
          matdocumentyear  = gv_matyear
        tables
          goodsmvt_item    = i_goodsmvt_items
          return           = i_return[].
    cancel blocking process
      loop at i_return where type eq 'E' or type eq 'A' or type eq 'X'.
        exit.
      endloop.
      if sy-subrc ne 0.
        refresh i_message_tab.
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
        wa_message_tab-msgid = 'M7'..
        wa_message_tab-msgty = 'S'.
        wa_message_tab-msgno = '060'.
        wa_message_tab-msgv1 = gv_matdoc.
        wa_message_tab-msgv2 = ''.
        wa_message_tab-msgv3 = ''.
        wa_message_tab-msgv4 = ''.
        append wa_message_tab to i_message_tab.
      else.
        refresh i_message_tab.
        call function 'BAPI_TRANSACTION_ROLLBACK'.
    write a message as there is an unexpected error.
        loop at i_return.
          wa_message_tab-msgid = i_return-id.
          wa_message_tab-msgty = i_return-type.
          wa_message_tab-msgno = i_return-number.
          wa_message_tab-msgv1 = i_return-message_v1.
          wa_message_tab-msgv2 = i_return-message_v2.
          wa_message_tab-msgv3 = i_return-message_v3.
          wa_message_tab-msgv4 = i_return-message_v4.
          append wa_message_tab to i_message_tab.
        endloop.
      endif.
      call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
        tables
          i_message_tab = i_message_tab.
    endform.                    " create_goods_movement
    *&      Form  determine_bapi_code
    form determine_bapi_code using p_bwart type bwart
    changing p_code type bapi2017_gm_code.
      data: lt_t158b type table of t158b with header line.
      clear p_code.
      select tcode from t158b into corresponding fields of table lt_t158b
      where bwart eq p_bwart.
      loop at lt_t158b.
        select single gmcode from t158g into p_code
        where tcode eq lt_t158b-tcode.
        if sy-subrc is initial.
          exit.
        endif.
      endloop.
    endform. " determine_bapi_code
    *&      Form  paging
    form paging using code.
      data: i type i,
            j type i.
      case code.
        when 'P--'. tc_itab-top_line = 1.
        when 'P-'.
          tc_itab-top_line = tc_itab-top_line - line_count.
          if tc_itab-top_line le 0.
            tc_itab-top_line = 1.
          endif.
        when 'P+'.
          i = tc_itab-top_line +  line_count.
          j = tc_itab-lines -  line_count + 1.
          if j le 0.
            j = 1.
          endif.
          if i le j.
            tc_itab-top_line = i.
          else.
            tc_itab-top_line = j.
          endif.
        when 'P++'.
          tc_itab-top_line = tc_itab-lines - line_count + 1.
          if tc_itab-top_line le 0.
            tc_itab-top_line = 1.
          endif.
      endcase.
    endform.                    " paging
    *&      Form  write_alv
    form write_alv .
      perform find_list_header.
      perform fill_field_cat.
      perform fill_sortinfo.
      g_repid = sy-repid.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
      answer = 'Y'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_buffer_active        = ''
          i_callback_program     = g_repid
          i_save                 = 'A'
        i_callback_top_of_page = 'TOP_OF_PAGE'
          is_layout              = gs_layout
          it_fieldcat            = gt_fldcat[]
         it_sort                = gt_sortin[]
        tables
          t_outtab               = itab[].
    endform.                    " write_alv
         Form  find_list_header
    form find_list_header.
      data : v_datum(10),
             v_datlo(10),
             v_dathi(10),
             v_uzeit(8).
      clear: gt_header, gt_header[].
      gt_header-typ  = 'H'.
      gt_header-info = sy-title.
      append gt_header.
      clear gt_header.
      gt_header-typ  = 'S'.
      gt_header-key  = 'Çal&#305;&#351;t&#305;rma Zaman&#305; : '.
      write syst-datum to v_datum.
      write syst-uzeit to v_uzeit.
      concatenate v_datum '/' v_uzeit into gt_header-info.
      append gt_header.
    endform.                    " find_list_header
         Form  fill_field_cat
    form fill_field_cat.
      refresh gt_fldcat.
      clear   gt_fldcat.
      gt_fldcat-key = 'X'.
      add-fieldcat 'MATNR'  'MARA' ''.
      add-fieldcat 'MAKTX'  'MAKT' ''.
      add-fieldcat 'CHARG'  'MSEG' ''.
      gt_fldcat-do_sum = 'X'.
      add-fieldcat 'MEINS'  'MARA' 'Olcu Birimi '.
      gt_fldcat-do_sum = 'X'.
      add-fieldcat 'ERFMG'  'MSEG' 'Adet'.
    endform.                    " fill_field_cat
         Form  fill_sortinfo
    form fill_sortinfo.
      gt_sortin-up            = 'X'.
      gt_sortin-fieldname     = 'MATNR'.  append gt_sortin.
    endform.                    " fill_sortinfo
         Form  top_of_page                                              *
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          i_logo             = 'ZKUTAS'
          it_list_commentary = gt_header[].
    endform.                    " top_of_page

    HI,
    if it is a normal report program then you can directly create a Selection screen field.
    After the Type-pool you can use Parameters or Select-options to create the selection screen field..
    If it is a Modulpool program then you can create a selection scren field like
    SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
    PARAMETERS: p1(10) TYPE c.
    SELECTION-SCREEN END OF SCREEN 1100.
    defines a selection screens – 1100 – as subscreens.
    The next screen number of screen 100 is 100 (statically-defined).
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      CALL SUBSCREEN area INCLUDING sy-repid number.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      CALL SUBSCREEN area.
      MODULE user_command_0100.
    look at the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
    Regards
    Sudheer

  • Issue with tabbed block in selection screen

    Hi All,
    I have created a report program with the following code.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    PARAMETERS: p1 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    PARAMETERS: q1 TYPE c LENGTH 10.
    SELECTION-SCREEN END OF SCREEN 200.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                      TAB (20) button1 USER-COMMAND push1,
                      TAB (20) button2 USER-COMMAND push2,
                      END OF BLOCK mytab.
    INITIALIZATION.
      button1 = 'Selection Screen 1'.
      button2 = 'Selection Screen 2'.
      mytab-prog = sy-repid.
      mytab-dynnr = 0100.
      mytab-activetab = 'PUSH1'.
    AT SELECTION-SCREEN.
      CASE sy-dynnr.
        WHEN 1000.
          CASE sy-ucomm.
            WHEN 'PUSH1'.
              mytab-dynnr = 100.
            WHEN 'PUSH2'.
              mytab-dynnr = 200.
          ENDCASE.
      ENDCASE.
    Execute the program and click on the second tab-page. Now, click on the 'Execute' button or press F8 (there is no specific functionality coded here).
    The issue now is that the first tab-page is displayed, instead of the second tab remaining displayed. I require the navigation to remain within the second tab-page after the EXECUTE button is clicked.
    Could someone help me out with this issue?
    Regards,
    Dinup
    Edited by: Dinup Sudhakaran on Feb 18, 2008 1:40 PM

    Hi,
    Go through below document with example code.
    It will help you.
    Tabstrip Controls on Selection Screens
    As with screens, you can now use tabstrip controls on selection screens. To do this, you must define a tabstrip area and the associated tab pages, and assign a subscreen to the tab pages. You do not have to (indeed, cannot) declare the tabstrip control or program the screen flow logic in your ABAP program, since both are automatically generated.
    To define a tabstrip area with tab pages, use the following statements in your selection screen definition:
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK <tab_area> FOR <n> LINES,
                      TAB (<len>) <tab1> USER-COMMAND <ucom1>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      TAB (<len>) <tab2> USER-COMMAND <ucom2>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      END OF BLOCK <tab_area>.
    This defines a tabstrip control <tab_area> with size <n>. The tab pages <tab1>, <tab2>… are assigned to the tab area. <len> defines the width of the tab title. You must assign a function code <ucom> area to each tab title. You can find out the function code from the field SY-UCOMM in the AT SELECTION-SCREEN event.
    For each tab title, the system automatically creates a character field in the ABAP program with the same name. Before the selection screen is displayed, you can assign a text to the field. This then appears as the title of the corresponding tab page on the selection screen.
    You must assign a subscreen to each tab title. This will be displayed in the tab area when the user chooses that title. You can assign one of the following as a subscreen:
    A subscreen screen defined using the Screen Painter.
    A selection screen subscreen, defined in an ABAP program.
    You can make the assignment either statically in the program or dynamically at runtime. If, at runtime, one of the tab titles has no subscreen assigned, a runtime error occurs.
    Static assignment
    Use the DEFAULT addition when you define the tab title. You can specify an ABAP program and one of its subscreens. If you do not specify a program, the system looks for the subscreen in the current program. When the user chooses the tab title, it is activated, and the subscreen is assigned to the tabstrip area. The static assignment is valid for the entire duration of the program, but can be overwritten dynamically before the selection screen is displayed.
    Dynamic assignment
    For each tab area, the system automatically creates a structure in the ABAP program with the same name. This structure has three components – PROG, DYNNR, and ACTIVETAB. When you assign the subscreens statically, the structure contains the name of the ABAP program containing the subscreen, the number of the subscreen, and the name of the tab title currently active on the selection screen (and to which these values are assigned). The default active tab page is the first page. You can assign values to the fields of the structure before the selection screen is displayed, and so set a subscreen dynamically.
    If you assign a normal subscreen screen to a tab title, the dialog modules containing its flow logic must be defined in the current ABAP program. If the subscreen is a selection screen, user actions will trigger the AT SELECTION-SCREEN event and its variants (see Selection Screen Processing). This includes when the user chooses a tab title. If one selection screen is included on another, AT SELECTION-SCREEN will be triggered at least twice – firstly for the "included" selection screen, then for the selection screen on which it appears.
    REPORT demo_sel_screen_with_tabstrip.
    DATA flag(1) TYPE c.
    SUBSCREEN 1
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
    PARAMETERS: p1(10) TYPE c,
                p2(10) TYPE c,
                p3(10) TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN END OF SCREEN 100.
    SUBSCREEN 2
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
    PARAMETERS: q1(10) TYPE c OBLIGATORY,
                q2(10) TYPE c OBLIGATORY,
                q3(10) TYPE c OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN END OF SCREEN 200.
    STANDARD SELECTION SCREEN
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,
                      TAB (20) button1 USER-COMMAND push1,
                      TAB (20) button2 USER-COMMAND push2,
                      TAB (20) button3 USER-COMMAND push3
                                       DEFAULT SCREEN 300,
                      END OF BLOCK mytab.
    INITIALIZATION.
      button1 = text-010.
      button2 = text-020.
      button3 = text-030.
      mytab-prog = sy-repid.
      mytab-dynnr = 100.
      mytab-activetab = 'BUTTON1'.
    AT SELECTION-SCREEN.
      CASE sy-dynnr.
        WHEN 1000.
          CASE sy-ucomm.
            WHEN 'PUSH1'.
              mytab-dynnr = 100.
              mytab-activetab = 'BUTTON1'.
            WHEN 'PUSH2'.
              mytab-dynnr = 200.
              mytab-activetab = 'BUTTON2'.
          ENDCASE.
        WHEN 100.
          MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
        WHEN 200.
          MESSAGE s888(sabapdocu) WITH text-040 sy-dynnr.
      ENDCASE.
    MODULE init_0100 OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'MOD'.
          CASE flag.
            WHEN 'X'.
              screen-input = '1'.
            WHEN ' '.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      MESSAGE s888(sabapdocu) WITH text-050 sy-dynnr.
      CASE sy-ucomm.
        WHEN 'TOGGLE'.
          IF flag = ' '.
            flag = 'X'.
          ELSEIF flag = 'X'.
            flag = ' '.
          ENDIF.
      ENDCASE.
    ENDMODULE.
    START-OF-SELECTION.
      WRITE: / 'P1:', p1,'Q1:', q1,
             / 'P2:', p2,'Q2:', q2,
             / 'P3:', p3,'Q3:', q3.
    This program defines two selection screens – 100 and 200, as subscreens, and places a tabstrip control area with three tab pages on the standard selection screen. A subscreen screen 300 (from the same program) is assigned statically to the third tab page.
    The layout of screen 300 is:
    The input/output fields P1 to Q3 are defined by using the parameters from the ABAP program The pushbutton has the function code TOGGLE.
    The screen flow logic for screen 300 is as follows:
    PROCESS BEFORE OUTPUT.
      MODULE init_0100.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
    Both dialog modules are defined in the ABAP program.
    When you run the program, the standard selection screen appears. In the INITIALIZATION event, the texts are defined on the tab titles, the subscreen selection screen 100 is assigned to the tab area, and the first tab title is activated.
    User actions on the selection screen are processed in the AT SELECTION-SCREEN event block. In particular, it is here that the subscreens are assigned and tab titles activated when the user chooses one of the first two tab titles. This is not necessary for the third tab title, since the dynamic assignment (screen 300) is always placed in the structure MYTAB when the user chooses it.
    Before the subscreen screen is displayed, the PBO module INIT_100 is executed. User actions on the subscreen screen trigger the PAI module. This includes when the user chooses a tab title. After that, the AT SELECTION-SCREEN event is triggered.
    Messages in the status line show where an action has been processed.

  • At selection-screen output and  at selection-screen on

    Hi Experts,
    I had coded in both at selection-screen output for disabling input of certain fields and at selection-screen for validation like this:
    AT SELECTION-SCREEN output.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_amt = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_AMT'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_B4C'.
              screen-input = '1'.
            WHEN 'P_AFC'.
              screen-input = '1'.
            WHEN 'P_COM'.
              screen-input = '1'.
            WHEN 'P_COM1'.
              screen-input = '1'.
            WHEN 'P_COM2'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_pdf = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_PDF'.
              screen-input = '1'.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'P_PATH'.
              screen-input = '1'.
            WHEN OTHERS.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
      IF p_afc = 'X'.
        LOOP AT SCREEN.
          CASE screen-name.
            WHEN 'P_TST'.
              screen-input = '1'.
            WHEN 'S_FID-LOW' OR 'S_FID-HIGH'.
              screen-input = '0'.
            WHEN 'S_ORG-LOW' OR 'S_ORG-HIGH'.
              screen-input = '0'.
            WHEN 'S_OFF-LOW' OR 'S_OFF-HIGH'.
              screen-input = '0'.
            WHEN 'S_DAT-LOW' OR 'S_DAT-HIGH'.
              screen-input = '0'.
          ENDCASE.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    AT selection-screen on block b5.
    if p_tst is initial.
      message text-016 type 'E'.
    endif.
    AT selection-screen on block b2.
    if p_amt ne 'X' and p_pdf ne 'X'.
    if s_fid is initial and s_org is initial.
    message text-000 type 'E'.
    endif.
    if s_dat is initial.
    message text-000 type 'E'.
    endif.
    endif.
    when i comment out at selection-screen validations the input is disabled for the screen fields as set, else the validations are executed first.
    Any solution for this???
    Thanks in advance.

    AT SELECTION-SCREEN
    Syntax
    AT SELECTION-SCREEN selscreen_event.
    Effect
    This statement defines event blocks for different events selscreen_event that are triggered by the ABAP runtime environment during selection screen processing.
    Selection screen events occur immediately before sending a selection screen and after certain user actions on a displayed selection screen. They assist in selection screen processing in the ABAP program.
    AT SELECTION-SCREEN is triggered at least twice during actions on selection screens that are linked into another selection screen as a subscreen - first for the linked selection screen itself, and then for the linking selection screens.
    Note
    The event blocks after AT SELECTION-SCREEN are implemented internally as procedures. Declarative statments in these event blocks create local data.

  • How to use selection-screen in function module?

    Hello
    I've created a function module and i have to create within the function module a selection-screen(with select-options for entering data) but i get an error that within form routines and function modules this statement is not allowed.
    Can anybody help?
    thanx

    Hi,
       YOu cannot create a selection screen withing a function module.
    What you can do is to call a screen , say '0100'.
    Create a screen '0100' and then include a selection -screen as a subscreen in that screen.
    Regards,
    Ravi

  • Populate Select-Option in a subscreen

    I've created a selection-screen as a subscreen and calling it inside the flow logic.  It's working fine except that I can't pass any value to a select-options.  When it's in a debug mode, I can see the values.  But when I'm trying to insert some value to it in a module, the select-option (ex. s_matnr) is not recognized as if it does not exists.  Please help.
    Thanks.

    Hi
    Iam also having the same problem can briefly exaplain the solution .
    i have scenairo like this :
    In the Dialog program in the main scrren we are calling the subscreen in that subscreen we have one material number
    for that number we need to add the mulltiple selection screen .
    how should we can add these .
    let me know yours soluion .
    thanks

Maybe you are looking for