Question on Logic of seperation in OOAbap-Selection screen

Hello guys
I like to ask you one question i found and get your ideas.
If you look at the codes for creating an ALV
it always recommends you to seperate logic and business layer etc..
this is the new way of creating an ALV
So you have  a model view and a controller
I implemented that following useful resources.
So that there s class called view
and the selection screen gets called from there inside the method
like
    call SELECTION-SCREEN 100.
     IF sy-subrc EQ 0.
     ENDIF.
But one issue when you execute the report and press GO BACK standard button it doesnot come back to your selection screen but way to your code.
Is there a get around to that?
here is the code below:
Header 1
*& Report  ZZ_SOLEN_FIRST
REPORT ZZ_SOLEN_FIRST.
DATA: gv_vbeln type vbap-Vbeln.
***Screen
SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
SELECTion-SCREEN: END OF block aa.
SELECTion-SCREEN: END OF SCREEN 100.
*****DATA Layer
class lcl_data DEFINITION.
   PUBLIC SECTION.
     TYPES: BEGIN OF ty_out,
       vbeln type vbap-vbeln,
       posnr type vbap-posnr,
       matnr type vbap-matnr,
       vkorg type vbak-vkorg,
       END OF ty_out
     TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
     TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
     DATA: gt_output TYPE tt_out.
     methods: constructor,
              select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
ENDclass.
class lcl_data IMPLEMENTATION.
   method constructor.
     clear GT_OUTPUT.
   ENDMETHOD.
   method select_data.
     DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
     FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
                    <lfs_vbak> like LINE OF lt_vbak
     select vbeln posnr matnr from vbap
       INto TABLE
        GT_OUTPUT
       where vbeln in S_VBELN
     IF sy-SUBRC EQ 0.
       select * from vbak
         INTO TABLE lt_vbak
         FOR ALL ENTRIES IN  GT_OUTPUT
         where vbeln = GT_OUTPUT-vbeln
       LOOP AT gt_output ASSIGNING <lfs_output>.
         READ TABLE lt_vbak ASSIGNING <lfs_vbak>
         with TABLE KEY vbeln = <lfs_output>-vbeln.
         IF sy-Subrc eq 0.
           <lfs_output>-vkorg = <lfs_vbak>-VKORG.
         ENDIF.
       ENDLOOP.
     ENDIF.
   ENDMETHOD.
ENDCLASS.
****Display
class lcl_view DEFINITION.
   PUBLIC SECTION.
     methods: start RETURNING VALUE(rv_true) type abap_bool.
     METHODS: display CHANGING it_data TYPE STANDARD TABLE.
ENDCLASS.
class lcl_view IMPLEMENTATION.
   METHOD start.
     call SELECTION-SCREEN 100.
     IF sy-subrc EQ 0.
       rv_true = abap_true.
     ENDIF.
   endmethod.
   method display.
     DATA: lo_salv_table type REF TO CL_SALV_TABLE,
           lt_columns TYPE SALV_T_COLUMN_REF.
     FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
     CL_SALV_TABLE=>FACTORY(
*    exporting
*      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE    " ALV Displayed in List Mode
*      R_CONTAINER    =     " Abstract Container for GUI Controls
*      CONTAINER_NAME =
       importing
         R_SALV_TABLE   = lo_salv_table    " Basis Class Simple ALV Tables
       changing
         T_TABLE        = it_data
*    catch CX_SALV_MSG.    " ALV: General Error Class with Message
     lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
*    LOOP AT  lt_columns ASSIGNING <lfs_columns>.
*    break developer.
*    ENDLOOP.
     lo_salv_table->DISPLAY( ).
   ENDMETHOD.
ENDCLASS.
class lcl_controller DEFINITION.
   PUBLIC SECTION.
     methods: main.
ENDCLASS.
class lcl_controller IMPLEMENTATION.
   method main.
     DATA: lo_view type REF TO lcl_view,
           lo_data TYPE REF TO LCL_DATA .
     CREATE OBJECT: lo_data, lo_view.
     break developer.
     IF lo_view->START( ) Eq abap_true.
**get the data
       lo_data->SELECT_DATA( s_vbeln[] ).
       lo_view->DISPLAY(
         changing
           IT_DATA = lo_data->GT_OUTPUT
     ENDIF.
   ENDMETHOD.
ENDCLASS.
INITIALIZATION.
START-OF-SELECTION.
   break developer.
   DATA: lo_controller type REF TO lcl_controller.
   CREATE OBJECT lo_controller.
   lo_controller->MAIN( ).

Here is the complete code that works fine!!!
Thanks to your ideas:
OO ALV
*& Report  ZZ_SOLEN_FIRST
REPORT ZZ_SOLEN_FIRST.
DATA: gv_vbeln type vbap-Vbeln.
***Screen
SELECTION-SCREEN: BEGIN OF SCREEN 100 TITLE t-004.
SELECTION-SCREEN: BEGIN OF block aa WITH FRAME TITLE t-001.
SELECT-OPTIONS: s_vbeln FOR gv_vbeln.
SELECTion-SCREEN: END OF block aa.
SELECTion-SCREEN: END OF SCREEN 100.
*****DATA Layer
class lcl_data DEFINITION.
   PUBLIC SECTION.
     TYPES: BEGIN OF ty_out,
       vbeln type vbap-vbeln,
       posnr type vbap-posnr,
       matnr type vbap-matnr,
       vkorg type vbak-vkorg,
       END OF ty_out
     TYPES: tt_out TYPE STANDARD TABLE OF ty_out.
     TYPES: gr_vbeln TYPE RANGE OF vbap-vbeln.
     DATA: gt_output TYPE tt_out.
     methods: constructor,
              select_data IMPORTING VALUE(rs_vbeln) TYPE gr_vbeln.
ENDclass.
class lcl_data IMPLEMENTATION.
   method constructor.
     clear GT_OUTPUT.
   ENDMETHOD.
   method select_data.
     DATA: lt_vbak type SORTED TABLE OF vbak WITH UNIQUE KEY vbeln.
     FIELD-SYMBOLS: <lfs_output> like LINE OF gt_output,
                    <lfs_vbak> like LINE OF lt_vbak
     select vbeln posnr matnr from vbap
       INto TABLE
        GT_OUTPUT
       where vbeln in S_VBELN
     IF sy-SUBRC EQ 0.
       select * from vbak
         INTO TABLE lt_vbak
         FOR ALL ENTRIES IN  GT_OUTPUT
         where vbeln = GT_OUTPUT-vbeln
       LOOP AT gt_output ASSIGNING <lfs_output>.
         READ TABLE lt_vbak ASSIGNING <lfs_vbak>
         with TABLE KEY vbeln = <lfs_output>-vbeln.
         IF sy-Subrc eq 0.
           <lfs_output>-vkorg = <lfs_vbak>-VKORG.
         ENDIF.
       ENDLOOP.
     ENDIF.
   ENDMETHOD.
ENDCLASS.
****Display
class lcl_view DEFINITION.
   PUBLIC SECTION.
     methods: start RETURNING VALUE(rv_return_flag) type abap_bool.
     METHODS: display CHANGING it_data TYPE STANDARD TABLE.
ENDCLASS.
class lcl_view IMPLEMENTATION.
   METHOD start.
     call SELECTION-SCREEN 100.
     IF sy-subrc EQ 0.
       rv_return_flag = abap_true.
     ENDIF.
   endmethod.
   method display.
     DATA: lo_salv_table type REF TO CL_SALV_TABLE,
           lt_columns TYPE SALV_T_COLUMN_REF.
     FIELD-SYMBOLS: <lfs_columns> like LINE OF lt_columns.
     CL_SALV_TABLE=>FACTORY(
*    exporting
*      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE    " ALV Displayed in List Mode
*      R_CONTAINER    =     " Abstract Container for GUI Controls
*      CONTAINER_NAME =
       importing
         R_SALV_TABLE   = lo_salv_table    " Basis Class Simple ALV Tables
       changing
         T_TABLE        = it_data
*    catch CX_SALV_MSG.    " ALV: General Error Class with Message
     lt_columns = lo_salv_table->GET_COLUMNS( )->GET( ).
*    LOOP AT  lt_columns ASSIGNING <lfs_columns>.
*    break developer.
*    ENDLOOP.
     lo_salv_table->DISPLAY( ).
   ENDMETHOD.
ENDCLASS.
class lcl_controller DEFINITION.
   PUBLIC SECTION.
     methods: main.
ENDCLASS.
class lcl_controller IMPLEMENTATION.
   method main.
     DATA: lo_view type REF TO lcl_view,
           lo_data TYPE REF TO LCL_DATA .
     CREATE OBJECT: lo_data, lo_view.
     break developer.
*    while lo_view->START( ) eq abap_true.
***get the data
*      lo_data->SELECT_DATA( s_vbeln[] ).
*      lo_view->DISPLAY(
*        changing
*          IT_DATA = lo_data->GT_OUTPUT
*    ENDWHILE.
     do.
       if lo_view->START( ) eq abap_true.
***get the data
         lo_data->SELECT_DATA( s_vbeln[] ).
         lo_view->DISPLAY(
           changing
             IT_DATA = lo_data->GT_OUTPUT
       else.
         return.
       ENDIF.
     ENDDO.
   ENDMETHOD.
ENDCLASS.
class lcl_test_submit DEFINITION.
   PUBLIC SECTION.
     TYPES: tr_vbeln TYPE RANGE OF vbap-vbeln.
     data: lt_list type table_abaplist.
     methods: test_submit IMPORTING VALUE(ir_vbeln) type tr_vbeln
                          EXCEPTIONS submit_failed
                                     no_data_found
ENDCLASS.
class lcl_test_submit IMPLEMENTATION.
   method test_submit.
  submit ZZ_SOLEN_FIRST
   with s_vbeln in ir_vbeln
   exporting list to memory and return
***Get the list from the memory
    call function 'LIST_FROM_MEMORY'
       tables
         listobject = lt_list
       exceptions
         not_found  = 1
         others     = 2.
     if sy-subrc <> 0.
       raise submit_failed.
     endif.
     if lt_list is initial.
       raise no_data_found.
     endif.
   ENDMETHOD.
ENDCLASS.
INITIALIZATION.
START-OF-SELECTION.
   break developer.
   DATA: lo_controller type REF TO lcl_controller.
****Testing the Main
   CREATE OBJECT lo_controller.
   lo_controller->MAIN( ).

Similar Messages

  • Logic based on Date on Selection-Screen

    Dear friends,
    I've been writing a report in which I have the date field on selection-screen. By default I have been displaying the system date on the selection-screen.
    The reqiurement is that the user cannot execute the code for a date in past (less than the system date) or cannot give a date less than the sytem date
    but can execute the same for a date in future (greater than the system date).
    Can any one give me the logic for the same.
    Regards,
    Alok.

    Hi
    This is the code for u.
    PARAMETERS : P_DATE TYPE SY-DATUM .
    INITIALIZATION.
      MOVE SY-DATUM TO P_dATE.
    AT SELECTION-SCREEN ON P_DATE.
       IF P_DATE < SY-DATUM.
                  MESSAGE 'Entered date cannot be in Past' Type 'E'.
    **Raise any message that u created otherwise 
       ENDIF.
    <b>Reward if Helpful</b>

  • Logical Database (PNPCE) , selection screen hide.

    Hi Gurus,
             i have couple of questions related to logical database pnpce.
    1.Since i know logical database has there own selection screen , my requirement is i want to add my custom fields to the selection screen other than what is provided is it possible or not.
    2. i want to hide the selection screen of the logical database, but i do want to create my own in which i will be declaring some select options of the standard logical database screen has, like pernr, organisation unit, etc, how do i communicate the entered data with the logical database if i dont use the logical database standard selection screen, hope i could able to explain my problem, please see into my problem and let me know thanks in advance,
    hussaini

    Hussain,
    LDB have standard selection screens, if at all you want to customize those standard selection screen you would have to define a report category for your program. You`ll have to configure in the spro settings for your corresponding report category.
    If you would like to declare your own selection criteria, you can very well do it and these criteria are visible below the standard selection criteria. You can process these elements in your program and not in the LDB standard program. Use the normal selection screen events in your program for processing your selection criteria.
    Hope this info is helpful, reward points if convinced.
    Regards

  • Define selection screen for ldb_process

    Hi I'm using the call function ldb_process for KDF(lfa1, lfb1, bsik), the trouble is that the information its different than if i do it on a normal report defining the logical database kdf and selection screen 903.
    I find that the difference is because the selection screen, this is because the default selection screen for the kdf database is 1000, and this selection has the "Open items at key date" selection with the current date.
    The question is:
    How can i define the selection screen 903 using the call function ldb_proces?
    Thanks
    Pablo Santos

    Hi,
    You cannot define screen version 903 using function LDB_PROCESS. Instead use table "SELECTIONS" of the function module .
    Cheers.

  • Hr report selection screen ..

    Hi ...
    Is there anybody knows how can change or remove hr report's selection screen .Please find below selection screen but I guess according to usega of logical database it gets additional selection screen .So by this selection screen (log, db) report goes on LDB .

    See the following ex: i have done it for SDF ldb
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SCREEN-GROUP3 = 'IXS'.
          SCREEN-ACTIVE = '0'.
          SCREEN-INVISIBLE = 1.
          MODIFY SCREEN.
          CONTINUE.
        ELSEIF SCREEN-GROUP4 = '023'.
          SCREEN-ACTIVE = '0'.
          SCREEN-INVISIBLE = 1.
          MODIFY SCREEN.
          CONTINUE.
        ELSEIF SCREEN-NAME = 'DD_BUKRS-LOW'.
          SCREEN-REQUIRED = '1'.
          MODIFY SCREEN.
          CONTINUE.
        ELSEIF SCREEN-NAME = 'DD_BUKRS-HIGH'.
          SCREEN-ACTIVE = '0'.
          SCREEN-INVISIBLE = 1.
          MODIFY SCREEN.
          CONTINUE.
        ELSEIF ( SCREEN-GROUP3 = 'VPU'
            AND SCREEN-GROUP4 = '007' ).
          SCREEN-ACTIVE = '0'.
          SCREEN-INVISIBLE = 1.
          MODIFY SCREEN.
          CONTINUE.
        ELSEIF SCREEN-NAME = 'DUEDATE1'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
          CONTINUE.
        ENDIF.
      ENDLOOP.

  • Problem with PNP customized selection screen

    Hi guys,
    I have done a report in R/3 system using logical database PNP with customized selection screen. i have 3 parameters as below:
    1. radiobutton1 group a for current period,
    2. radiobutton2 group a for other period.
    3. personnel number.
    my program works fine in R/3 but not in my portal. i think it couldn't recognize my radiobutton in my customized screen. whichever radiobutton i selected also it would return current month records.
    any idea how to fix this?
    any configuration that i can do?
    thanks.

    try testing it through ITS first.
    in order to do so . Go to sicf transaction and run webgui. Then run the application using the tcode. Check the results.
    Seems wrong paramter are getting passed to the SAP system.
    Your ITS server should be activated first in order to use webgui otherwise you will be getting dump.
    Regards
    Atul Shrivastava

  • Suggest the way while validating fields in selection-screen

    Hi Experts,
    I am not able to open multiple selection screen for select-options because when i tried to open, it triggers AT selection-screen event in which some validations are happened.
    If any of the validation fails, it will give message.
    Please suggest me the way how i can avoid that.
    Thank you very much for your help
    Regards
    Gopal

    Hello,
             I believe you are talking about the Multiple Selections Option.
             There are two cases here. For both the Cases, use the Following Logic in the At-Selection Screen Event.
    If your Select-Options Variable is not declared as OBLIGATORY, then use this Logic.
    In the At Selection-Screen Event, check the following Condition.
          IF SY-UCOMM NE SSCRFIELDS-UCOMM.
              Message 'Enter atleast 1 Value' Type 'E'.
          ENDIF.
          This will avoid throwing an Error when you click on the Multiple Selections Option.
    If your Select-Options Variable is Declared as Mandatory, the above logic does not work. So, what you can do is,
    Do not make it Obligatory. But use the below Logic.
    IF S_MATNR is Initial.
        CHECK NOT SY-UCOMM EQ SSCRFIELDS-UCOMM.
        Message 'Enter atleast 1 Value' Type 'E'.
    ENDIF.
    Hope it was helpful.
    Thanks and Regards,
    Venkat Phani Prasad Konduri
    Edited by: Konduri Venkata Phani Prasad on Sep 12, 2008 2:48 AM

  • Buttons in Selection Screen

    Hi,
    In my module pool program, if I click a button, am calling a selection screen using following statement.
          CALL SELECTION-SCREEN 0105 STARTING AT 10 10 ENDING AT 95 16.
    also, in TOP include, I have designed the selection screen as follows
    SELECTION-SCREEN BEGIN OF SCREEN 0105.
    SELECTION-SCREEN BEGIN OF BLOCK proj_def WITH FRAME TITLE text-100.
    SELECT-OPTIONS pspid FOR proj-pspid.
    SELECTION-SCREEN END OF BLOCK proj_def.
    SELECTION-SCREEN END OF SCREEN 0105.
    when I execute, there are some default buttons are coming. But I want to include my own buttons and I have to write code for that. Is it possible? How can I do that?
    Regards,
    SAP Lover.

    Hi,
    Proceed as follows to achieve your requirement.
    1. Click on the button
    2. According to your logic you'll get a Selection Screen as POP-UP
    3. Now select F1 on that input field
    4. Go with Technical Information Option
    5. You'll get the necessary info and here you can notice GUI DATA
    6. Here you can see the program name as RSSYSTDB and Status as %_CSP
    7. Double click on this status.
    8. It will lead you to that status. Click on Display <-> Change / CTRL + F1.
    9. It will ask for the access key. get the access key from BASIS and then here you go to change according to your requirement.
    Hope this helps. Reward if useful.
    Thanks and Regards,
    Maddineni Bharath.

  • Change selection screen mb25

    Hi all,
    The transaction MB25 uses the DB logic MMIMRKPFRESB,
    At the selection screen I want to see the block KEY (Key Fields) How can I do that ?.
    I create a new programm with attributes:
        logical database MMIMRKPFRESB and s
        selection screen with space
    and works as I want.
    How can I do, so the tx MB25 show that block of the selecction screen???
    Thanks!!!

    hi,
    go through the below attachment it will be useful for u.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0e0039a-0d79-2c10-0aaf-9f6c062c0ffb?quicklink=index&overridelayout=true

  • Reg:Skipping Selection screen

    Hi Experts,
                       My requirement is that i have a executable program with selection screen and the output will be of ALV display.
                       For some users i need to take them directly to the  ALV display without displaying selection parameters .
    Regards,
    Vikram sukumar

    Hi,
    try this logic it works.
    declare a selection screen with number
    SELECTION-SCREEN BEGIN OF SCREEN 100.
    parameter p_matnr type matnr.
    SELECTION-SCREEN END OF SCREEN 100.
    if sy-uname ne 'CHACX074'.
    call the selection screen only if the particular user needs screen.
    call screen 100.
    else.
    p_matnr = '100'.
    endif.
    write : p_matnr.
    When you are creating TCODE dont specify the Selection screen . as its determine by the program.
    by this you can use single TCODE.
    Regards,
    Shanmugavel Chandrasekaran
    Edited by: shanmugavel chandrasekaran on Mar 10, 2010 6:37 AM

  • ADD push button in selection-screen

    Hi Guys,
    I have a requirement.
    In the selection screen on the report, I need a push button "Click".
    When i "Click"  First Time this it should display all the selection screen Blocks B1,B2,B3 from my selection screen.
    For second "Click" it should Hide the Blocks B1,B2,B3.
    I am doing the following code in my report:
    But for first Click it is displaying the Blocks.And for the Second click it is not Hiding.
    Please suggest on this.....
    initialization.
      if screen-group1 = 'A1' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
    I am using " At selection screen:
    at selection-screen.
    if gv_flag = space.
            loop at screen.
              if screen-group1 = 'A1' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 1.
                modify screen.
              endif.
            endloop.
            gv_flag = 'X'.
          elseif gv_flag = 'X'.
                  loop at screen.
              if screen-group1 = 'A1' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A2' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            loop at screen.
              if screen-group1 = 'A3' .
                screen-active = 0.
                modify screen.
              endif.
            endloop.
            gv_flag = space.
    endif.

    You are hiding it in INITIALIZATION block which means it hides only once before PBO. If you want to show/hide it in turn simply place all your code in PAI, not just part of it.
    Regards
    Marcin
    Sorry didn't notice part of the code in the bottom
    The logic should go like
    at selection-screen.
    if gv_flag = space.
    loop at screen.
      case screen-group1.
         when 'A1' or 'A2' or 'A3'    
            screen-active = 1.
            modify screen.
         when others.
       endcase.
    endloop.
    gv_flag = 'X'.
    elseif gv_flag = 'X'.
       loop at screen.
          case screen-group1.
               when 'A1' or 'A2' or 'A3'.
                screen-active = 0.
                modify screen.
             when others.
        endcase.
    endloop.
      gv_flag = space.
    endif.
    Regards
    Marcin
    Edited by: Marcin Pciak on Apr 1, 2011 12:33 PM

  • Need Functionality of F9 of selection screen in button click

    Hello Friends,
    i am working on a report.
    the selection screen have one selection field material.
    1)  if the material is not entered on ss
    2) a popup appears to run program in background. this logic was done in at selection-screen  event.
    3) if we press ok from the popup. then need to run the program in background as it is done in f9.
    i.e. i mean to say is. i need the same functionality as we get in F9.
    Process in F9 :
    1) A printer specification popup appears.
    2) then scheduling batch job appears. where we create a batch job manually.
    you could try going in t.code -- V_V2 and press F9. You could obtain the same functionality as i am trying to describe.
    Note: we need to set the job manually.
    Thanks!!
    Rachit.

    Hello,
    You can implement the background job functionality by manually calling the background job from the program.
    For this you need to implement the following three steps : -
    1) Call the FM "JOB_OPEN" to open the background job. Provide the job_name to the FM and get the job_count.
    2) SUBMIT the same Z program which you are currently running using the below code.
    SUBMIT (sy-repid)
                WITH SELECTION-TABLE lt_rspar
                TO SAP-SPOOL
                SPOOL PARAMETERS ls_print_parameters
                WITHOUT SPOOL DYNPRO
                USER sy-uname VIA JOB job_name NUMBER job_count
                AND RETURN.
    Table  lt_rspar is  TYPE STANDARD TABLE OF rsparams, through which we pass the parameters entered on the selection screen to the background program.
    RSPAR-SELNAME = Name of the select options/ parameters for which you want to pass the value
    RSPAR-LOW         = Low value in case of select options/ values in the parameters
    RSPAR-HIGH        =  High value in case of select options.
    Append all selection screen values to the internal table LT_RSPAR as per the above rule.
    The printer name and the formatting options can be passed via print parameters workarea ls_print_parameters
    ls_print_parameters TYPE  pri_params.
    After this code, we call the FM "JOB_CLOSE" to close the background job.
    Regards,
    Rinkesh Doshi

  • Can you giv me a brief introduction regarding selection screen with one eg:

    Hello
    can you giv me a brief introduction regarding selection screen with one eg:

    Hi Ranjith,
    Selection Screens
    Selection screens are one of the three types of screen in the R/3 System, along with dialog screens and lists. You use them whenever you want the user to enter either a single value for a field or fields, or to enter selection criteria.
    Function
    ABAP programs use screens to obtain input from users. The most general type of screen is a dialog screen, which you create using the ABAP Workbench tools Screen Painter and Menu Painter These tools allow you to create screens for data input and output. However, each of these screens requires its own flow logic.
    Defining and Calling Selection Screens
    You often use screens purely for data input . In these cases, you can use a selection screen. Selection screens provide a standardized user interface in the R/3 System.  Users can enter both single values and complex selections.  Input parameters are primarily used to control the program flow, while users can enter selection criteria to restrict the amount of data read from the database. You can create and save predefined sets of input values in the ABAP Editor for any selection screen. These are called variants.  Texts on the selection screen are stored as language-specific selection texts in the program text elements.  If you start an executable report using the SUBMIT statement, the input fields of the selection screen also serve as a data interface.
    Defining and Calling Selection Screens
    You define selection screens using ABAP statements in a program.  Simple statements allow you to create input fields, checkboxes, and radio buttons, and design the screen layout.  If you want to create a screen exclusively for data input, you do not need to create it using the normal dialog programming tools. When you create a selection screen, the system automatically assumes the tasks of the Screen Painter and Menu Painter.
    The rules for calling and defining selection screens in ABAP programs depend on the program type:
    ·         Executable program (type 1) without logical database
    You can use a single standard selection screen and as many user-defined selection screens as you wish. The standard selection screen is called automatically when you start the program.  User-defined selection screens, on the other hand, are called using the CALL SELECTION-SCREEN statement in a program.  The standard selection screen always has the screen number 1000. User-defined selection screens can have any screen number except 1000.
    ·         Executable program (type 1) with logical database
    The standard selection screen for an executable program linked to a logical database is made up of the logical database selections and the program selections.
    ·         Module pools (type M) and function modules (type F)
    You can only use user-defined selection screens in module pools and function modules. These can have any number apart from 1000. You can only call a selection screen from a function module using the CALL SELECTION-SCREEN statement. You can also define selection screens as Subscreens and incorporate them in screens or tabstrip controls.
    Hope this is useful.
    regards
    Ram
    Message was edited by:
            Ramanujan Chitrakootam

  • Selection screen for HR report with logical database PNP

    Hi All,
       I am writing a HR report. And I use the logical database PNP. Also I create a HR report category for this report. In the report category, I can define the selection screen field. But all these fields are selection option format. My question is How can I add parameters, radiobutton group and checkbox in the selection screen. Thanks.
    Alex

    Hi Alex,
    Sorry for replying so late. Please try this tutorial:
    w w w. s a p t e c h n i c a l. c o m -> tutorials -> ABAP-HR -> Creating HR Report category in PNP logical database
    Sorry, I put it like this, because direct link doens't let me post the answer. Don't know why.
    It can also be something with your custom code in selection screen. Though it works fine for, try to remove COMMENTs and observe the result. Maybe parameters are overlapping somehow. First try this:
    SELECTION-SCREEN begin of BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS RefDate type DATS.
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    parameters days type i.
    PARAMETERS spvsr like PA0001-MSTBR.
    selection-SCREEN end of BLOCK blk2.
    If that works together with the report category, try to extend it with adding a selection-screen comment, but do this in reversed order (comment goes first and FOR FIELD addition is supplied) like this:
    SELECTION-SCREEN begin of BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS RefDate type DATS.
    SELECTION-SCREEN begin of line.
    SELECTION-SCREEN COMMENT 3(10) text-003 for field bflag.  "FOR FIELD, and goes first
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 16(10) text-004 for FIELD fflag.  "here two
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN end of line.
    parameters days type i.
    PARAMETERS spvsr like PA0001-MSTBR.
    selection-SCREEN end of BLOCK blk2.
    If still not working, see if text-003 and text-004 are not too long (you expect them to be 10 chars), This may somehow affect selection screen.
    You may also try with setting cursor position explicity by:
    SELECTION-SCREEN begin of line.
    SELECTION-SCREEN POSITION 3.
    SELECTION-SCREEN COMMENT (10) text-003 for field bflag. 
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN POSITION 16.
    SELECTION-SCREEN COMMENT (10) text-004 for FIELD fflag.  "here two
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN end of line.
    It is really hard to identify where can be a bug as it is working fine for me. Keep trying with different variations, it should finally run with some.
    Regards
    Marcin

  • How to remove spaces at selection screen coming from logical database

    Hi Experties,
    When we hide some selection from the logical database.  The spaces still occupied and this make our selection screen looks awkward.
    How to remove the spaces left by hidden selection ?
    Regards
    Nislina

    Hi,
    I came across your un-answered question while searching for a solution on the similer problem. Though I couldn't fine a solution on SDN, but figured out one myself. Thought its a good idea to share it.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group4 = '003'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Here screen-group4 contains the sequence number of the select-options field starting from 000 onwards.
    You may like to assign points and close the question.
    Kind Regards,
    Khalid Mustafa

Maybe you are looking for

  • Duplicate dock items since upgrading to Mountain Lion

    My upgrade to Mountain Lion has worked well, except for one minor irritating thing: a couple of applications are now duplicated in the dock at every log-in. • I have only one copy of each application (specifically they are TextExpander and Vitamin-R)

  • Append SFW file name in action

    Sorry if this has been answered before. I found a lot of similar questions but no answers. If I record an action that includes Save for Web, I can either leave the name unchanged (and the individual file name will be used when I play the action) or c

  • Byte Corseca headset - Charging problem

    Hi, I am using byte Corseca bluetooth headset for more than one year. Last  2 months back i got an issue in charging the headset. When i connect the headset to power source (USB Charging) usually i will show the red light glowing constantly. But now

  • Connecting G4 to Macbook Pro

    I have a G4 running 10.5 and just bought a used Macbook Pro running 10.6. I can Share the screen in both directions and can connect to the G4 from the Macbook but I cannot connect from the G4 to the Macbook - Error 36. Any ideas? The Macbook has been

  • Pdf showing as picture

    I don't understand how to configure or why it is happening, but I have my company mail installed in both, my iphone and ipad. On the iphone I can see pdf attachments in a normal way. Shows as attachment and I have to click on it in order to open it.