Issue with Select options in select statement - ABAP Question

Hi
I am facing an issue with select options. Select statement is returning sy-subrc as 4.
I wrote the program as below:
SELECT-OPTIONS:
s_kunnr FOR bsad-kunnr,
s_lifnr FOR bsak-lifnr,
s_gjahr FOR bsad-gjahr,
s_bukrs FOR bsad-bukrs,
s_saknr FOR bsad-saknr,
s_budat FOR bsak-budat.
In start of selection I have written the select statement as
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs AND lifnr = s_lifnr AND gjahr IN s_gjahr AND budat IN s_budat AND saknr IN s_saknr.
In selection screen I have not entered any values and executed the program. I am not getting any result. When I debug that, sy-subrc is 4 at above select statement. But table has records.
If am removing the "lifnr = s_lifnr " condition in select then select is returning values.
I am not getting where I made the mistake. Please suggest.
Thank you
Hanu

Hi,
The problem here with where condition select option lifnr = s_lifnr.
Use below select query.
SELECT * FROM bsak INTO TABLE lt_bsak
WHERE bukrs IN s_bukrs
    AND lifnr     IN s_lifnr
    AND gjahr   IN s_gjahr
    AND budat  IN s_budat
    AND saknr  IN s_saknr.
s_lifnr is a select option and you are passing it as parameter lifnr = s_lifnr.
if you want to pass this s_lifnr as single vale then pass in below mentioned way.
lifnr = s_lifnr-low
BR,
Vijay

Similar Messages

  • Problem with table-indexes when using select-options in select

    Hello experts,
    is it right that table-indexes will not be used if you take select-options to select data from the database?
    in detail:
    i have build up an table-index for one of our db-tables and test it via an test-programm. The first test with '=' comparisons worked fine. Every key of the index was used; checked via ST05!
    e.g.:    SELECT * FROM TABLEA INTO ITAB WHERE keya = '1' AND keyb = '2' AND keyc = '3'.
    Now i startet the test with select-options
    e.g.:   SELECT * FROM TABLEA INTO ITAB WHERE keya IN seltabA  AND keyb IN seltabB AND keyc IN seltabC.
    First of all i just filled the seltabs with only 1 value:    eg:  seltabA=      SIGN = 'I'   OPTION = 'EQ'   LOW = '1'     etc.
    Everything worked fine. Every key of the index was used.
    But now, I putted more than one entries in the seltabs e.g.
    seltabA:      SIGN = 'I'   OPTION = 'EQ'   LOW = '1'
                       SIGN = 'I'   OPTION = 'EQ'   LOW = '2'   
                       SIGN = 'I'   OPTION = 'EQ'   LOW = '3'
    From now on, the indexed was not used completely (with all keys).
    Isn't that strange? How can i use select-options or sel-ranges with using the complete table-indexes?
    Thanks a lot,
    Marcel

    Hi Hermann,
    i hope this helps:
    this is the first one, which uses the complete index:
    SELECT                                                                     
      "KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,   
      "GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,    
      "HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,      
      "TERDAT"                                                                 
    FROM                                                                       
      "/dbcon/01_con"                                                       
    WHERE                                                                      
      "MANDT" = ? AND "LIFNR" = ? AND "ORGID" = ? AND "KOART_BASIS" = ? AND    
      "STATUS" = ? AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR "STATUS" = ? OR
      "STATUS" = ? )  WITH UR                 
    RESULT: 5 IXSCAN /dbcon/01_con05 #key columns:  4
    And the second one, which does not use the complete index! The 3 ranges are filled each with 2 values. Remember; when i fill them each with only one value, the result is the same as you can see above(/dbcon/01_con05 #key columns:  4):
    SELECT                                                                     
      "KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,   
      "GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,    
      "HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,      
      "TERDAT"                                                                 
    FROM                                                                       
      "/dbcon/01_con"                                                       
    WHERE                                                                      
      "MANDT" = ? AND "LIFNR" IN ( ? , ? ) AND "ORGID" IN ( ? , ? ) AND        
      "KOART_BASIS" IN ( ? , ? ) AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR 
      "STATUS" = ? OR "STATUS" = ? )  WITH UR                                  
    and here the access-plan
       0 SELECT STATEMENT ( Estimated Costs =  5,139E+01 [timerons] )                                                                               
    5     1 RETURN                                                                               
    5     2 NLJOIN                                                                               
    5     3 [O] TBSCAN                                                                               
    5     4 SORT                                                                               
    5 TBSCAN GENROW                                                                               
    5     6 <i> FETCH /dbcon/01_con                                                                               
    7 IXSCAN /dbcon/01_con05 #key columns:  2   
    As you can see, only 2 keys were taken for indexed selection!
    Any idea?
    Kind regards,
    MArcel
    Edited by: Marcel Ebert on Jul 28, 2009 5:25 PM

  • Web Dynpro Abap: Select-Options: Save Selection Data

    Hello,
    I am using select-options in web dynpro abap.  Need to add a feature where the user can save his selection values as a variant. 
    All I can think of is getting all the selection values and saving these into a Z table.
    Can you suggest a better way?
    Thank you.
    Irene

    Hi Irene,
    Alas, it's currently not possible. You could write your own wrapper though adding a save button. Inside of the action handler you could retrieve the range tables of all fields, convert their content to a structure you like and save it a fitting db table. My suggestion is to use XML and a DB table with a XSTRING field in the data section to store the range table values.
    Using personalization will allow you to customize your ui and to hide certain select option fields.
    Best regards,
    Thomas

  • PS:Copy of MBBS report with Date(GR) selection option in selection screen.

    Hi,
    We are developing a report, which is Copy of MBBS report, addition as Date(GR) selection option in selection screen to view historical data {i.e.Project Stock(Q) on back dates}.
    MBBS is showing Project Stock w.r.t. WBS. So pls suggest Table, which can fulfill the requirement to show the Project Stock from GR w.r.t. Purchase and Production order in back date w.r.t. that WBS.
    Pls do the needful.
    Thanks,
    Amit Jain.

    Hi Amit ,
    The Project Stock Table is MSPR , and the Project stock history table is MSPRH .
    Though not through with your actual requirement , There is a standard Report MB5B -- Stock on Posting Date . In the selection screen , we can have the Special Stock Q (Project Stock ) .
    If you can develop copying this report instead of MBBS , it would take care of receipts as well as issues ,and from the material Document you can build a relation to the account assignment  WBS/Network Activity through MSEG Table .
    Hope it helps .
    thanks and regards
    Kish

  • Using select-option in webdynpro for ABAP where I have two separate pages

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

    Hi Experts,
             I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
    Second page is opened on the clicking the 'Submit' button in first page.
    How to design a ABAP webdynpro component for this scenario?
    How to pass select-option values to the next page?
    What nodes/attributes should I have to create in component controller?
    Please provide me the step by step info.
    I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
    But it has only one page. So I am not able to recreate my scenario based on this.
    Thanks
    Gopal

  • Length of select-options in selection screen.

    Hi,
    I was able to give the lemgth of select-options only upto 8 characters.
    Select-options :S_Mtrial for mara-matnr.
    But my requirement is I want total name which is more than 8 characters.
    Select-options:Material_numberl for mara-matnr.
    Can any one help how to do.
    Thanks in advance.

    The Statement...
    Select-options :S_Mtrial for mara-matnr
    The selection screen length depends on the type that you are assigning to it. Since the length of type
    mara-matnr is less, the selection option S_Mtrial  will be displayed with short length in the selection screen.
    The alternate to do this is...
    selection-screen begin of line.
    selection-screen comment 2(10) text-001.
    select-options : <ur select option name>
    selection-screen end of line.
    Text element,text-001 contains the select option text to be displayed in the screen
    Hope it helps.

  • I have an issue with disappearing option for 1920x1080 in Preferences / Displays.

    Recently updated to 10.9 - have all updates installed - Mid 2010 iMac 21.5.
    I have an issue with disappearing option for 1920x1080 in Preferences / Displays. - After overnight shutdown, my iMac woke up and the screen resolution of my 2nd was set at 800 x 600 - the display a Samsung S22B150 was previously working properly at 1920 x 1080.  This option is no longer available in the system preferences - highest resolution available 1600 x 1200.
    I use my mMac for Photography and use the second monitor for the interface, leaving the iMac screen as a full work area for the photos.
    I have tried:
    Power down Monitor & restart
    Shutdown & restart
    Shutdown & restart in Safe Boot Mode (options same in Prefs)
    Power down Monitor & restart in Safe Boot Mode
    Ran Disc Utility - Repaired Permissions, verified both HDD & Mac OSX
    Udated Pram
    I am now at a loss, I guess I could try a recovery, and download/install  Mavericks again, but do not wish to do this if I can help it.
    I have searched the net to see if there are any Terminal commands to enable the resolution, but can find nothing.
    Anyone out there have any ideas, please.

    Back up all data. Quit System Preferences if it's running.
    Triple-click anywhere in the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination command-C:
    ~/Library/Preferences/ByHost
    In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar. Paste into the box that opens (command-V), then press return. A folder should open. If it does, look for a file with a long name that begins "com.apple.preference.displays2". There may be several such files. Move them to the Trash.
    Test.

  • Select option in select list and navigate to different page

    Hello,
    I have a tabular form.One of the item is a select list with 2 options. Selecting option one should take the user to page10(just an example) and display all the values of that particular row. Similarly selecting option 2 should take the user to page 20 and display all the values of that row.
    Can some one guide me how to do above mentioned job.
    Thanks in advance.
    Pravish

    @Avinash
      if f_cat-seltext_m = 'Select'.
        f_cat-col_pos = 1.
        f_cat-seltext_l = 'EDIT'.
        f_cat-Checkbox = 'X'.
        f_cat-EDIT = 'X'.
      endif.
    I am already passing f_cat-checkbox = 'X'.
    Thanks
    Kumar.

  • Side by side select options in selection screen

    Hai Gurus,
    In a report, I need to place Period From and Period To date select-options in selection screen.
    In one line (i.e side by side).
    Appreciate your immediate response.
    Thanks and Regards,
    Kiran.

    Thanks to all,
    I got it.
    my code here.
    SELECTION-SCREEN: BEGIN OF BLOCK sel1 WITH FRAME TITLE text-sel.
    PARAMETERS: SUMMARY AS CHECKBOX USER-COMMAND SUMMARY.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(13) text-pfr.
    SELECT-OPTIONS: VALID_FR FOR ZZUTIL_RATE-VALID_FR MODIF ID RAM no intervals NO-EXTENSION. "changed
    SELECTION-SCREEN COMMENT 30(13) text-pto.
    SELECT-OPTIONS: VALID_TO FOR ZZUTIL_RATE-VALID_TO no intervals NO-EXTENSION. "changed
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK SEL1.

  • Select-Options in Webdynpro for Abap with onAction

    Hello,
    I need your help. I have a Webdynpro with 6 Select-Options. I used a button to start the selection. Can the Selection be started with return key.
    Thanks.

    I would expect in any case that there is no problem when you transport WDA build from ehp3 to ehp5 (Backward compatibility ).

  • Performance issues with query input variable selection in ODS

    Hi everyone
    We've upgraded from BW 3.0B to NW04s BI using SP12.
    There is a problem encountered with input variable selection. This happens regardless of using BEx (new or old 3.x) or using RSRT. When using the F4 search help (or "Select from list" in BEx context) to list possible values, this takes forever for large ODS (containing millions of records).
    Using ST01 and SM50 to trace the code in the same query, we see a difference here:
    <u>NW04s BI SQL command</u>
    SELECT                                                                               
    "P0000"."COMP_CODE" AS "0000000032" ,"T0000"."TXTMD" AS "0000000032_TXTMD"                             
    FROM                                                                               
    ( "/BI0/PCOMP_CODE" "P0000" ) LEFT OUTER JOIN "/BI0/TCOMP_CODE" "T0000" ON  "P0000"."COMP_CODE" = "T0000
      "."COMP_CODE"                                                                               
    WHERE                                                                               
    "P0000"."OBJVERS" = 'A' AND "P0000"."COMP_CODE" IN ( SELECT "O"."COMP_CODE" AS "KEY" FROM              
      "/BI0/APY_PP_C100" "O" )                                                                               
    ORDER BY                                                                               
    "P0000"."COMP_CODE" ASC#                                                                               
    <u>BW 3.0B SQL command:</u>
    SELECT ROWNUM < 500 ....
    In 3.0B, rownum is limited to 500 and this results in a speedy, though limited query. In the new NW04s BI, this renders the selection screen unusable as ABAP dumps for timing out will occur first due to the large data volume searched using sequential read.
    It will not be feasible to create indexes for every single query selection parameter (issues with oerformance when loading, space required etc.). Is there a reason why SAP seems have fallen back on a less effective code for this?
    I have tried to change the number of selected rows to <500 in BEx settings but one must reach a responsive screen in order to get to that setting and it is not always possible or saved for the next run.
    Anyone with similar experience or can provide help on this?

    here is a reason why the F4 help on ODS was faster in BW 3.x.
    In BW 3.x the ODS did not support the read mode "Only values in
    InfoProvider". So If I compare the different SQL statements I propose
    to change the F4 mode in the InfoProvider specific properties to
    "About master data". This is the fastest F4 mode.
    As an alternative you can define indexes on your ODS to speed up F4.
    So would need a non-unique index on InfoObject 0COMP_CODE in your ODS
    Check below for insights
    https://forums.sdn.sap.com/click.jspa?searchID=6224682&messageID=2841493
    Hope it Helps
    Chetan
    @CP..

  • 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.

  • F4 for employee select options in WD for abap application

    Hi,
    I have defined a select option for employee selection in my WD for abap application. The only problem is that I cannot get a f4 help button to be displayed. I have defined the select option using the following code :
    wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
    init the select screen
    wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
    create a range table that consists of this new data element
    lt_range_table = wd_this->m_handler->create_range_table(
    i_typename = 'PERNR_D' ).
    add a new field to the selection
    wd_this->m_handler->add_selection_field(
    i_id = 'PERNR_D'
    it_result = lt_range_table
    i_read_only = read_only ).
    I have tried adding entries for the parameter help_id but still cannot get a f4 button.
    Thank you in advance for any assistance provided.

    Hi,
    Try this.
    DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
    lo_interfacecontroller = wd_this->wd_cpifc_select_options( ).
    DATA lo_r_helper_class TYPE REF TO if_wd_select_options.
    lo_r_helper_class = lo_interfacecontroller->init_selection_screen( ).
    Creating range table
    DATA lt_range TYPE REF TO data.
    CALL METHOD lo_r_helper_class->create_range_table
    EXPORTING
    i_typename = ''PERNR_D'
    RECEIVING
    rt_range_table = lt_range.
    Disabling the global options
    CALL METHOD lo_r_helper_class->set_global_options
    EXPORTING
    i_display_btn_cancel = abap_false
    i_display_btn_check = abap_false
    i_display_btn_reset = abap_false
    i_display_btn_execute = abap_false.
    Adding the selection field
    CALL METHOD lo_r_helper_class->add_selection_field
    EXPORTING
    i_id = 'PERNR_D'
    I_OBLIGATORY = ABAP_TRUE
    i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_SEARCHHELP
    I_VALUE_HELP_ID = 'PREM'
    it_result = lt_range.
    Check this artcle for more details which uses VBELN as select option with search help.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/103e43d5-fdb8-2d10-90ab-b5e8532cbc04

  • Select options and loop statement

    Dear forum,
    I have the scenario where i need to restrict the loop from the select-options.
    in the select-options, user enter currency.
    then in the loop i need to loop base on the currency user enter.
    may i know what steps should i use for the loop as loop cannot support where.
    thanks

    HI Gengis
    I have the scenario where i need to restrict the loop from the select-options.
    in the select-options, user enter currency.
    then in the loop i need to loop base on the currency user enter.
    may i know what steps should i use for the loop as loop cannot support where.
    as per your requirement.
    you have some data in your internal table also you have a select-options to input values.
    on the basis of the values in your select option you want to fetch the values from your internal table. right???
    then there should be a field like your select option in your internal table.
    select-option: s_matnr for mara-matnr.
    let assume you have an internal table with matnr and other fields also and your select-options is for mara-matnr.
    then you need to select the values in your internal table according to the values in your select-options like below.
    SELECT MATNR field1 field2........ from dbtable into table itab where matnr = s_matnr.
    the above code will give you the values matching the values in your select-options.
    you need not to apply loop becasue you already have only those values for which yo u have found records in the DBTABLE.
    in case you want to apply loop on an internal table on the basis of s_matnr's values, then you can write.
    in this scenario you need to define 2 internal table one with already fethced values and another in which we will fetch the values according to select-options.
    loop at itab into wa_itab.
    read table itab1 into wa_itab1 where matnr = wa_itab-matnr.
    write statement........
    endloop.
    before that youwill have to fetch values in itab according to s_matnr.
    I hope this will clear your query.
    Thanks
    Lalit Gupta.

  • [PERSISTENCE CLASS] SELECT OPTION in WHERE statement

    Hi Gurus,
    I would like to know how could I code the WHERE statement with a SELECT OPTION, in Persistence Class ?
    Currenlty, I would like to code this kind of request :
              DELETE FROM      ziTab
                             WHERE   zdate IN so_date.      
    Do you know, how could I code it ?
    Many thx for helps.
    Best regards.
    Rachid.

    Sorry Glen,
    Unfortunately, I am trying to find the correct syntax to use a SELECT OPTION in a Query Request of Persistence Class:
    Something like that:
    SELECT-OPTIONS so_date     FOR    sy-datum                      .
    DATA lo_query_manager TYPE REF TO if_os_query_manager           .
    DATA lo_query         TYPE REF TO if_os_query                   .
    DATA lo_agent         TYPE REF TO zca_persistence_zint_rsbankinv.
    DATA lo_base          TYPE REF TO zcb_persistence_zint_rsbankinv.
    DATA lo_rsbankinv     TYPE REF TO zcl_persistence_zint_rsbankinv.
    DATA lo_table         TYPE        osreftab                      .
    DATA ls_table         TYPE REF TO zcl_persistence_zint_rsbankinv.
    DATA ls_tmp           TYPE REF TO object                        .
    DATA lv_string        TYPE        string                        .
    DATA lo_exception     TYPE REF TO cx_root                       .
    TRY .
       lo_agent    = zca_persistence_zint_rsbankinv=>agent.
    * Create Query
       lo_query_manager = cl_os_system=>get_query_manager( ).
       lo_query         = lo_query_manager->create_query( i_filter     = 'ZEXDAT IN PAR1' ).
       lo_table         =
       lo_agent->if_os_ca_persistency~get_persistent_by_query(
       i_query = lo_query
       i_par1  =  so_date
       LOOP AT lo_table INTO ls_tmp.
         ls_table ?= ls_tmp        .
         lv_string = ls_table->zget_all_fields( ).
         WRITE lv_string.
       ENDLOOP.
    CATCH cx_root INTO lo_exception.
       lv_string = lo_exception->get_text( ).
       WRITE lv_string.
    ENDTRY.
    But I have an error message :
    Syntax error when parsing a query : Excepected symbol 'IN' (row: O, column: 7)
    Any idea ?

Maybe you are looking for

  • Can not see two fields in Crystal 2008 Developer explorer/designer view

    I am currently developing crystal 2008 reports against the salesforce.com database using version 12.0.0.683 CR Developer Full version. I am using an updated driver that was provided in July or Aug 08 in order to view self referencing fields. The prob

  • Partial Multibyte Character Error

    Hi All, I am getting following error while running a report in OBIEE 11 G. State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Fa

  • Questions on Un do Management.

    Howdy all. I havae a couple questions on this utility that I am hoping someone could assist with. 1; The location of the Undo Management Screen can be found here: http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14196/storage003.htm#CHDB

  • Oascript (not repsonding)?  What does this mean?

    I've only recently begun using Time Machine and, thinking a backup every hour was excessive, I downloaded and installed TimeMachineScheduler, and set it to backup every two hours, just to see how it would work. Around the time it should have started

  • Windows 7, adobe reader crashing, uninstall, reinstall, crashes opening (error #150210) help?

    I have installed and uninstalled adobe reader several times now, it crashed when opening a PDF file.  The error code is #150210, and I have followed some of the messages online with no luck.  Actually I did do one, and it lasted for one day but when