Re : select-options in abap-objects program

Dear friends,
                  I want to give select-options in abap-objects program. How to give that.
                             Thanking You
with regards,
Mani

In the transaction SE24, enter your class name, click modify.
in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
" P_SAKNR FOR SKAT-SAKNR".
you've got to declare two types in the class:
a- TYPES:  begin of E_S_SAKNR,
                      sign(1),
                      option(2),
                      low(10),
                      high(10),
                  end of E_S_SAKNR.
b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
method TEST importing ET_SAKNR type E_T_SAKNR.
now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example..

Similar Messages

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • Select-option in ABAP objects

    Hi Guys,
               I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very important

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • How to write text name of parameters / select options in  ABAP list??

    Hi gurus, i must read the text name of parameterd / select options in ABAP program and write it in a list of the same program for log.......how can i do it??
    Thanks in advance!
    Best regards!
    Ferdinando
    Message was edited by:
            Ferdinando Sellitto

    Hello Ferdinandino
    Useful function modules are:
    RS_PRINT_SELECTIONS
    RS_LIST_SELECTION_TABLE (Generates list according to values in selection table(RSPARAMS))
    RS_REFRESH_FROM_SELECTOPTIONS (Current contents of selection screen)
    Function module RS_REFRESH_FROM_SELECTOPTIONS can provide the input for function module RS_LIST_SELECTION_TABLE.
    Regards
      Uwe

  • Select-option field in dialog programming

    hi guys,
    i need to declare field matnr as select-option range in dialog programming..how can i code it in the module program?

    This questions has been answered many times (even in february)
    - search sdn wiki (2 commented samples at [SELECT-OPTIONS on Dialog programming screen|http://wiki.sdn.sap.com/wiki/display/ABAP/SELECT-OPTIONSonDialogprogrammingscreen] and [Select-Options in Module Pool Programming|http://wiki.sdn.sap.com/wiki/display/ABAP/Select-OptionsinModulePoolProgramming])
    - search abap online help ([SELECTION-SCREEN - AS SUBSCREEN |http://help.sap.com/abapdocu_70/en/ABAPSELECTION-SCREEN_SUBSCREEN.htm] with sample at [Selection Screens as Subscreens |http://help.sap.com/abapdocu_70/en/ABENSEL_SCREEN_SUBSCREEN_ABEXA.htm])
    Regards,
    Raymond

  • How can we pass the select-option value to modulepool program?

    hi,
      how can we pass the select-option value to modulepool program ?
      Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
               My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
               How i get select-option values to PAI of call screen for getting the data from database table to my internal table?

    Oh I thought that you have selection-screen and again you are working on dialog programming.
    if you want to use select-option directly in module pool then it is not possible.
    but you can do other way.
    create two varaiables
    data : v_kun_low like kna1-kunnr,
             v_kun_high like kna1-kunnr.
    use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
    and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
    use can enter only low value and high value.
    when you come to program point of view
    declare one range
    ranges r_kunnr for kna1-kunnr.
    do the coding like
    r_kunnr-low = v_kun_low.
    r_kunnr-high = v_kun_high.
    r_kunnr-options = 'BT'.
    r_kunnr-sign = 'I'.
    append r_kunnr.
    now you can use r_kunnr in select query ,it will work like select-option.
    other than this there is no option.
    Thanks
    Seshu

  • How to set default value in select option for ABAP query

    Hi experts,
    What is the way to set up default values for select-options in ABAP query.
    e.g.
    I have one field 'Year' in my ABAP query selection screen.
    I want value of current year to be appeared here whenever user execute report
    Thanks in Advance
    -Harkamal

    Hi Harkamal,
    execute your Query via SQ01. On Selection-Screen
    goto save Variant. Mark your field
    as selection variable an press Button election variable.
    Take variable from TVARV and use it.
    Than save the Variant.
    Look at TVARV if the 'Year' is updated to the actualYear!
    regards, Dieter

  • Select-options in module pool programming

    hi,
       I need to have four fields as part of my layout that are select-options fields with multiple values entry options. Since layout doesnt have 'select-options" functionality, i defined it from the module pool program, ie: I wrote a  selection screen in the PBO module. The problem is if i make any changes to the code, the layout changes back to the previuos format.
    Is there any way in which i can combine selection-screen logic with my layout.
    Thanks,
    Sruthy

    HI
    GOOD
    Selection Screen Version
    Only for Executable Programs
    If you do not specify a selection screen version, the system automatically creates a selection screen based on the selection criteria of the logical database and the parameters and select-options statements in the program.
    If you want to use a different selection screen of the logical database, enter a number in this field. The number must be smaller than 1000 and correspond to an additional selection screen of the logical database. The possible values help displays a list of available selection screens. You can also look in the selection include of the logical database (program DBxxxSEL, where xxx is the name of the logical database).
    Tomislav
    1. In the top include define the selection screen with
    selection-screen begin of screen 9250 as subscreen.
    SELECT-OPTIONS analyt FOR ztv_cc02-zd_mumla .
    selection-screen end of screen 9250.
    2. Using the screen painter create a subscreen area in
    the main screen where you want to have this.
    3. Then, in the screen flow logic code as follows:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1000. etc
    call subscreen SUB1 including 'PROGRAM NAME' '9250'.
    PROCESS AFTER INPUT.
    module exit at exit-command. etc.
    call subscreen SUB1.
    THANKS
    MRUTYUN

  • How to create select-options in module pool program

    Hi
    i am structed at this point could you please tell me
    how to create select-options in module pool program

    Steps to get SELECT-OPTIONS in module pool programs.
    <li>. Start one dialog program with SAPZ_TEST.
    <li>. Place the below code in the TOP include of the dialog program.
    PROGRAM SAPMZ_TEST.
    TABLES mara.
    SELECTION-SCREEN BEGIN OF SCREEN 2100 AS SUBSCREEN.
    SELECT-OPTIONS: matnr FOR mara-matnr.
    SELECTION-SCREEN END OF SCREEN 2100.
    <li>. Create one screen 2000 .
    <li>. Go to Layout of the screen and Define subscreen area on the screen and Name it as g_subscreen.
    <li>. Place the below code in the Flow logic of the screen.
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN g_subscreen INCLUDING 'SAPMZ_TEST' '2100'.
    PROCESS AFTER INPUT.
      CALL SUBSCREEN g_subscreen.
    <li>. Activate all.
    <li>. Create Transaction code for the dialog program SAPZ_TEST.
    <li>. Execute the transaction code. You will see the select-option like we see on Selection-screen.
    I hope that it gets u clear idea.
    Thanks
    Venkat.O

  • How to provide select-option in module pool programming

    Hi all,
    How to provide select-option in module pool programming.
    If any body knows let me immediately.
    Thanks
    sudheer

    Hi Sudheer,
    Unfortunately there is no standard way of having a select-option in a module pool program.
    What you can try is having two fields and creating a range in your program and populating the range at runtime with respective value and trying to simulate some functionality of the select-option.
    Hope it helps.
    Thanks, Debasish

  • Error in TP Abap Objects Programs to MiniWAS 6.20

    Hello,
    I have install the MiniWAS 6.20 to my pc and I am trying to transport the ABAP OBJECTS programs by following the instractions. Unfortunately, the tp ended with error code 8 and the message is:
    Program S_ITAB_ACCESS: Syntax error in line 000060
    You cannot specify the component 'TABLE_LINE' fora generic line type in the current statement. allo
    Can someone tell me what to do in order to complete this transport?
    Thanks in advance

    You can ignore this message, S_ITAB_ACCESS has a syntax error (you can check in se38).
    In 46C the syntax was a little bit different:
    when you paste this code to a 46C system, the syntax check will be ok.
    In higher release it won't be ok. So if you copy it to a customer namerange eg ZS_ITAB_ACCESS and modify like this, it will be ok.
    Since you cannot change program S_ITAB_ACCESS, there is not much you can do with the transport.
    *      READ TABLE tab WITH TABLE KEY table_line = key
        READ TABLE tab WITH KEY table_line = key
    Incho

  • Programming a select option in abap webdynpro

    Dear Gurus,
    I have used a select option in a specific webdynpro, but this select option does not
    enable the same functionalities as select option in SAP GUI.
    As an example, the possibility to upload a file or the clipboard in the multiple
    selection for individual value is not available.
    This is really a problem for my  customer.
    Any solution ?
    Thanks in advance.
    F.Alllut
    Moderator message : Post the question in Web Dynpro forum. Thread locked.
    Edited by: Vinod Kumar on Jul 11, 2011 7:00 PM

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • Select option in module pool program

    Hi,
    I have develop a module pool program. In one of the screen i need select option. so do any one have idea or approach for it.
    Thanks in advance.

    Hi,
    try the following code
    tables : mard.
    data : ok_code_100 type sy-ucomm.
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_werks for mard-werks,
    s_lgort for mard-lgort.
    parameters : p_var like disvariant-variant.
    parameter: p_rb1 radiobutton group rd1 default 'X', " list
    p_rb2 radiobutton group rd1. " grid
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    text
    module status_0100 output.
    set pf-status 'Z11_SUBMIT'.
    set titlebar 'CALL'.
    endmodule. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    module user_command_0100 input.
    case ok_code_100.
    when 'EXIT'.
    leave program.
    when 'SUBM'.
    submit z11_ap_alv_mat using
    selection-screen '1000'
    with s_plant in s_werks
    with s_stor in s_lgort
    with p_var = p_var
    with p_rb_01 = p_rb1
    with p_rb_02 = p_rb2
    and return.
    endcase.
    endmodule. " USER_COMMAND_0100 INPUT
    here u have to design a subscreen area SUB_1010 in the screen painter, there is a option given there for that.
    and also in the flow logic of screen 0100 you have to call the subscreen SUB_1010 both in PBO and PAI like :
    process before output.
    module status_0100.
    call subscreen sub_1010 including sy-repid '1010'.
    process after input.
    call subscreen sub_1010.
    module user_command_0100.
    reward if helpful

  • Check box before select option in a report program.

    Hi All..
    I have a report program with select options..I want to put a checkbox before the select option, aligned with it...Is it possible..
    Regards
    Rudra

    Hi Rudra,
    Take the below help program. In the below program I am disabling the text fields....
    Take the refrence and do it will fix the problem
    &***************************Reward Point if helpful***************************&
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-003.
    PARAMETERS: P1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND Z1.
    SELECT-OPTIONS: S_PMNUX FOR S076-PMNUX MODIF ID MI1.
    PARAMETERS:     P_WENUX LIKE S076-WENUX MODIF ID MI1.
    PARAMETERS: P5 TYPE CHAR15 AS LISTBOX  VISIBLE  LENGTH 15 MODIF ID MI1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 7.
    PARAMETERS: P3 RADIOBUTTON GROUP G2 MODIF ID MI1.
    SELECTION-SCREEN COMMENT 10(10) TEXT-001 MODIF ID MI1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 7.
    PARAMETERS: P4 RADIOBUTTON GROUP G2 MODIF ID MI1.
    SELECTION-SCREEN COMMENT 10(10) TEXT-002 MODIF ID MI1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: P_FILE TYPE RLGRAP-FILENAME MODIF ID MI1.
    PARAMETERS: P2 RADIOBUTTON GROUP G1.
    SELECT-OPTIONS: S_PMNUX1 FOR S076-PMNUX MODIF ID MI2.        " Product Group
    PARAMETERS:     P_WENUX1 LIKE S076-WENUX MODIF ID MI2.       " Plant
    PARAMETERS: P6(15) TYPE C AS LISTBOX VISIBLE LENGTH 10 MODIF ID MI2.
    *PARAMETERS: P_EMAIL(255) TYPE C MODIF ID MI2.
    PARAMETERS: P_EMAIL TYPE SOMLRECI1-RECEIVER.    " Email Address
    SELECTION-SCREEN END OF BLOCK B1.
    *      AT SELECTION-SCREEN OUTPUT                        *
    AT SELECTION-SCREEN OUTPUT.
      IF P1 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF P2 = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'MI2'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
          IF SCREEN-GROUP1 = 'MI1'.
            SCREEN-INVISIBLE = 0.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 1.
            SCREEN-OUTPUT = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Problem in Select-option in Module Pool Programming

    Hi,
    I'm making one module pool programming. In that, I've to make select-option. For that I'm using this command --
    1) In PBO --
    CALL SUBSCREEN sub INCLUDING 'YBOE_PRINT' '5100'.
    2) In PAI --
    CALL SUBSCREEN sub.
    But, Syntax Error is generated as below --
    "." or "ID.........FIELD" expected after "SUBSCREEN"
    Please suggest.
    Thanks.
    Kumar Saurav.

    Hi Ramchander,
    Thanks for replying. But, even if I changed Prog_Name with term 'repid', that same error regarding
    "." or "ID ... FIELD ..." expected after "SUBSCREEN"
    is coming up.
    I guess, there is any step missing.
    Lemme describe what I'm doing in points --
    1) I declared SELECTION-SCREEN with screen no --
    SELECTION-SCREEN BEGIN OF SCREEN 5100 AS SUBSCREEN.
          PARAMETERS : p_bukrs TYPE ekko-bukrs OBLIGATORY DEFAULT '1000'.
          SELECT-OPTIONS: kunnr FOR kna1-kunnr.
          select-options: gjahr for bsid-gjahr.
          select-options: bank for bsed-bank.
          select-options: budat for bsid-budat.
          SELECTION-SCREEN END OF SCREEN 5100.
    2) Then I made a call in PBO as given above.
    3) Finally, a call to that subscreen is made in PAI - again as given above.
    When I checked that, this gave the error.
    Are you looking any erroneous step ...?
    Please guide.
    Thanks.
    Kumar Saurav.

Maybe you are looking for

  • TS2972 Since upgrading Apple TV to 5.1, home sharing works for 2 minutes

    My setup has been working for ages, but ever since I upgraded my living room Apple TV to 5.1, it looses it's connection to home sharing after 2 minutes. Running OS-X 10.7.3 with iTunes 10.6.  Netgear N600 (WNDR7300 v2) router on Comcast. This is happ

  • Using a remote Ejb as a datacontrol for ADF

    Hi, I am trying to create an EJB 3.0 Data Control on top of remote deployed EJB. Difficulty is that I have no control over the EJB, and all I've been given is a Client jar file containing the remote interface and the entities used in the interface. W

  • Reduce publishing time for Air iOS apps?

    Hi, Currently it's taking my machine up to  4 minutes to publish an Air iOS app. Are there any settings or hacks I could try to reduce the time? I'm using Flash CS 6 + AIR SDK 16 on a Windows 8.1 laptop. Stats: - Intel Pentium Prozessor (1,5 GHz, Int

  • Make wise material list

    I have a material "A" which is procured from vendor "V1" and vendor "V2" Vendor "V1" supplies "A"  which can be of make "Siemens" OR "L&T" Vendor "V2" supplies "A"  which can be of make "ABC" OR "XYZ" Can I maintain a similar master list in SAP ? I w

  • [ISE] What is the best Authorization rules sequence ?

    Hello, like a FW set of rules, I think that ISE's authZ rules should also be ordered with care ? What are the best practices ? Most used first ? Guest, MAB and Webauth at the end ? Tell me... Any screencap is welcome Regards.