FAGLL03 : Submit syntax for dynamic selections

Hi Experts,
My z report contains following fields in selction screen.
1 . G/ L account
2. Comapny code
3. posting date
4. document type
5. layout
In my z report i used following syntax for passing selection screen values to standard program and getting data.
SUBMIT FAGL_ACCOUNT_ITEMS_GL
                  WITH SD_SAKNR   IN S_SAKNR
                  WITH SD_BUKRS   IN S_BUKRS
                  WITH X_OPSEL    EQ ' '
                  WITH X_CLSEL    EQ ' '
                  WITH X_AISEL    EQ 'X'
                  WITH SO_BUDAT   IN S_BUDAT
                  WITH PA_VARI    EQ P_VAR
                  EXPORTING LIST TO MEMORY
                 AND RETURN. 
The above syntax is not working for dynamic selection field ( document type ), entire document types data is fetching from standard program. I want to fetch document type data based on my z report selection values for document type field.
Expect for document type field , submit syntax is working.
kindly provide submit syntax for my above requirement .
Any suggestions from experts....
thanks & regards,
Hari priya
Edited by: Hari  Priya on Aug 24, 2009 4:33 PM

Hi,
Try like this.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
  exporting
    curr_report = 'FAGL_ACCOUNT_ITEMS_GL'
  tables
    selection_table = i_sel[].
Fill your profit center values in i_sel
Submit FAGL_ACCOUNT_ITEMS_GL with selection-table i_sel and return
WITH FREE SELECTIONS TEXPR AND RETURN
Regards,
Shamma

Similar Messages

  • Submit syntax for dynamic selections for T-code FAGLL03

    Hi Experts,
    My z report contains following fields in selction screen.
    1 . G/ L account
    2. Comapny code
    3. posting date
    4. Profit Center
    5. layout
    In my z report i used following syntax for passing selection screen values to standard program and getting data.
    This is for T-code FAGLL03
    SUBMIT FAGL_ACCOUNT_ITEMS_GL
    WITH SD_SAKNR IN S_SAKNR
    WITH SD_BUKRS IN S_BUKRS
    WITH %%DYN001-LOW (Profit Center)
    EXPORTING LIST TO MEMORY
    AND RETURN.
    The above syntax is not working for dynamic selection field ( Profit Center), entire Profit center data is fetching from standard program. I want to fetch profit center data based on my z report selection values .
    Expect for profit center field , submit syntax is working.
    kindly provide submit syntax for my above requirement .
    Any suggestions from experts....
    Edited by: PLP REDDY on Nov 25, 2009 8:59 AM

    Indeed it won't work. Instead of passing parameters one by one use
    [SUIBMIT... WITH SELECTION-TABLE rspar|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_3@3@]
    Here you add one line per parameter (field KIND = 'P' ) and multiple lines per select options (field KIND = 'S' ). For the latter you need also provide SIGN and OPTIONS, i.e SIGN = 'I' , OPTIONS = 'EQ'
    The lin I gave you will explain it more.
    Regards
    Marcin

  • How to add Document group  in t code S_ALR_87012082 for dynamic selection.

    Hi Gurus,
    I Need to add  Document group  in t code S_ALR_87012082  for dynamic selection.
    Currently here two groups are showing , Vender and Comp Code. i need to add Document group  there. Kindly guide me in this.
    Thanks in advance.

    Hi
    Pls follow below report
    *S_ALR_87012103 - List of Vendor Line Items *
    In dynamic selections you can find Document number, there you can give the range
    Reg
    Vishnu

  • Selection variable for dynamic selection in QE51n

    Hi All,
    I have a scenario were we have a repetitive Manufacturing and we create one insp. lot of origin 13 and keep creating insp. points for days, so my user wants the insp. points to be displayed only for the past 3 days based of the Date Insp. point identifier which is one of dynamic selection criteria under insp. points, I see with other transaction I can do selection variable on dates for dynamic selection fields but I cannot do that in QE51n, I can do the same in QE51 but not in QE51n, can some tell me if there is a OSS or other way to get this working.
    I appreciate your help.
    Thanks,

    Hi Srikant,
    I think you can meet the requirement in QE51N also.
    In the screen for QE51N :Result Recording Work list", Follow this Path,,,,,,,,,
    Edit--->Dynamic Selection.
    The system will pop-up new small window for "Dynamic selection for insp. lot and operation" here I there is one folder is available named "Inspection point " which is having the selection criteria "Inspection point",  double click on it and enter the desired values.
    Regards,
    Shyamal

  • Issue with MB25 BDC for Dynamic Selection Screen

    Hi Experts,
    I recorded one BDC for MB25 Tcode regarding to determine Open Reservation(s) in E Mode (Display Mode). I am passing 3 parameters.
    1. Plant,
    2. Requirement Date
    3. Multiple Reservation Numbers i.e. RSNUM from Dynamic Selection i.e. 2nd Button -> Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    But while executing that BDC, I need to manually click every time on 'Header Data for Reservation' Tree and then Multiple Selection for Reservation Icon.
    I want below steps automatically while executing:
    - Open 'Header Data for Reservation' Tree
    - Click Reservation
    - Open Popup for 'Multiple Selection'.
    So no need to click every time on Dynamic Selection Screen i.e. Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    Please find attached screen shot for your reference.
    Please guide.
    Thanks and Regards,
    Emon Master

    Hello Jainam,
    submit (sy-repid) with selection-table v_sp
                             with free selections EXPRESSIONS
                             via selection-screen.
    Without going through the details, dont you think this will cause an inifinite loop as the calling & the called programs are the same.
    Please enlighten me !!
    BR,
    Suhas

  • Set parameters for dynamic selection report

    Hi all,
    Please find below code.. parameters KS7 and KS8 are on static slection parameter and GJR, VPE, BPE are on dynamic selection parameters for transaction KSB2. But, when I run program, values are passing to parameters KS7 and KS8 but not to GJR, VPE, BPE.
            set parameter id 'KS7' field co_podat-low.      "from date
            set parameter id 'KS8' field co_podat-high.     "to date
            set parameter id 'GJR' field P_RYEAR.
            set parameter id 'VPE' field SO_PERIO-LOW.
            set parameter id 'BPE' field SO_PERIO-HIGH.
                 submit rkaep000
                 with p_tcode = 'KSB2'            "non display param
                 with p_kokrs = p_kokrs           "non display param
                 with kostl = it_outputsum-profctr
                 with kstar = it_outputsum-acct
                 with p_disvar = '1SAP'           "non display param
                and return.
    What would be reason?
    Thanks
    Shashi.

    at the time of you code being executed the fields may not be available (Defined)..
    You can put a breakpoint on the same & check the RC (Sy-Subrc) for the SET PARAMETER statement
    Regards,
    Gaurav

  • Submit report with dynamic selections

    Hi All,
    I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
    But the dynamic selections are not getting passed.
    Request you to kindly provide some inputs
    My code is
    DATA: trange TYPE rsds_trange,
          trange_line LIKE LINE OF trange,
          trange_frange_t_line LIKE LINE OF trange_line-frange_t,
          trange_frange_t_selopt_t_line LIKE LINE OF trange_frange_t_line-selopt_t,
          texpr TYPE rsds_texpr.
    trange_line-tablename = 'PA0002'.
    *trange_frange_t_line-tablename = 'PA0002'.
    trange_frange_t_line-fieldname = 'GBJHR'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'EQ'.
    trange_frange_t_selopt_t_line-low    = '1987'.
    trange_frange_t_selopt_t_line-high   = '1987'.
    APPEND trange_frange_t_selopt_t_line TO   trange_frange_t_line-selopt_t.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        field_ranges = trange
      IMPORTING
        expressions  = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
                    WITH SELECTION-TABLE rspar_tab
                    WITH FREE SELECTIONS it_texpr
                    and returN.
    Kindly provide your inputs
    Regards
    Reshma

    Hi Reshma,
    Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
      data: trange  type rsds_trange,
              g_repid type sy-repid.
    g_repid = 'RPCADVQ0'.
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = g_repid
          mode_write_or_move = 'M'
        importing
          p_trange           = trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
      if sy-subrc eq 0.
    " Do the changes to the trange
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
    EXPORTING
    field_ranges = trange
    IMPORTING
    expressions = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
    WITH SELECTION-TABLE rspar_tab
    WITH FREE SELECTIONS it_texpr
    and returN.
    endif.
    Cheers,
    Kothand

  • Addition of field for Dynamic Selection in TCode FBL1N

    Hi,
    We have a requirement to add the field Partner Bank Type in TCode FBL1N on clicking dynamic selection button (under vendor master) in TCode FBL1N. To achieve this we went to TCode SE36 (Logical database) and selected logical databse KDF and then seleted selection views from the extras menu. There we have selected the table LFBK and then entered 01 (function group for Vendor Master) in the box next to the field BVTYP and selected the checbox on the right of BVTYP to enable Preselection. Saved the changes.
    However the field  Partner Bank Type does not show in the dynamic selection in TCode FBL1N under Vendor Master. Please help.
    Thanks in advance.
    Mick

    Thanks Miguel.
    I found this on the web:
    http://joyjitghosh.blogspot.com/2009/05/how-to-add-new-fields-in-dynamic.html
    I have done exactly as per the instructions given in the above link, but still I am unable to see the field in the dynamic selections of TCode FBL1N. Any reason why and how can we add the field in the dynamic selections?
    Mick

  • How to add Business area  in t code S_ALR_87012082 for dynamic selection.

    Hi Gurus,
    I need  to add Business area field in T-code S_ALR_87012082.
    On choosing  dynamic selection, i found that Business area is not there. 
    Can any one please tell me how can i add Business area field  over there.
    Thanks in advance.

    Please check following SAP notes for this.
    188663 and 832997 and 310886

  • Short Dump for Dynamic Select Query

    Hello all,
    I get a short dump for my dynamic select query at the end of the code. The error is "The types of operands "dbtab" and "itab" cannot be converted into one another."
    My code looks like below.
    FORM get_ccnum_2  USING    p_tabname TYPE dd03l-tabname.
    DATA: p_table(30)  TYPE c.
      FIELD-SYMBOLS:  <dyn_wa>,
                                   <t> TYPE table.
      DATA: it_fldcat    TYPE lvc_t_fcat.
      TYPE-POOLS : abap.
      DATA: it_details   TYPE abap_compdescr_tab,
            wa_details   TYPE abap_compdescr.
      DATA: ref_descr    TYPE REF TO cl_abap_structdescr.
      DATA: new_table    TYPE REF TO data,
            new_line     TYPE REF TO data,
            wa_it_fldcat TYPE lvc_s_fcat.
    p_table = p_tabname.
      ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
      it_details[] = ref_descr->components[].
      LOOP AT it_details INTO wa_details.
        CLEAR wa_it_fldcat.
        wa_it_fldcat-fieldname = wa_details-name .
        wa_it_fldcat-datatype  = wa_details-type_kind.
        wa_it_fldcat-intlen    = wa_details-length.
        wa_it_fldcat-decimals  = wa_details-decimals.
        APPEND wa_it_fldcat TO it_fldcat .
      ENDLOOP.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = new_table.
    ASSIGN new_table->* TO <t>.
    CREATE DATA new_line LIKE LINE OF <t>.
      ASSIGN new_line->* TO <dyn_wa>.
    wa_cond = 'CCNUM <> '' '' '.
    APPEND wa_cond TO tab_cond.
          SELECT * INTO TABLE <t>
                   FROM     (p_table)
                   WHERE    (tab_cond)
                   ORDER BY (tab_ord).
    ENDFORM.                    " GET_CCNUM_2

    Hi,
    I tried to execute the code using table BSEGC and it gave a short dump..
    the actual exception that shows in ST22 IS ..UNICODE_TYPES_NOT_CONVERTIBLE..
    I think there is something wrong in the internal table creation..
    Instead of using the method cl_alv_table_create=>create_dynamic_table to create the dynamic table I used the following and it worked..
    CREATE DATA new_table TYPE TABLE OF (p_table).
    * Comment begin  " Naren
    *  ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
    *  it_details[] = ref_descr->components[].
    *  LOOP AT it_details INTO wa_details.
    *    CLEAR wa_it_fldcat.
    *    wa_it_fldcat-fieldname = wa_details-name .
    *    wa_it_fldcat-datatype  = wa_details-type_kind.
    *    wa_it_fldcat-intlen    = wa_details-length.
    *    wa_it_fldcat-decimals  = wa_details-decimals.
    *    APPEND wa_it_fldcat TO it_fldcat .
    *  ENDLOOP.
    *  CALL METHOD cl_alv_table_create=>create_dynamic_table
    *    EXPORTING
    *      it_fieldcatalog = it_fldcat
    *    IMPORTING
    *      ep_table        = new_table.
    * Comment End.  " Naren
    CREATE DATA new_table TYPE TABLE OF (p_table).   " New code by naren
    Please Try this..
    Thanks
    Naren

  • Query Syntax for Dynamic Navigation Menu

    I'm trying to build a Navigation menu from a query using the following syntax:
    select LEVEL,
           LABEL,
           LINK,
           'NO' as IS_CURRENT,
           null as IMAGE
      from V$RC_MENUS
    where CLUB = :APP_CLUB
    start with PID is null
    connect by prior ID = PID
    order by SEQUENCE, LABEL
    The query itself works fine for all values of APP_CLUB but it only generates the menu entries for some values of APP_CLUB, but not others. The SEQUENCE value determines the order of the entries within each level. Is this the correct syntax for a query-based navigation menu? How does it determine which sub-levels belong to a parent?  Does the ordering of the resultset have any impact on how the menu is generated?

    Jritschel-Oracle wrote:
    I'm trying to build a Navigation menu from a query using the following syntax:
    select LEVEL, 
          LABEL, 
          LINK, 
          'NO' as IS_CURRENT, 
          null as IMAGE 
      from V$RC_MENUS 
    where CLUB = :APP_CLUB 
    start with PID is null 
    connect by prior ID = PID 
    order by SEQUENCE, LABEL 
    The query itself works fine for all values of APP_CLUB but it only generates the menu entries for some values of APP_CLUB, but not others. The SEQUENCE value determines the order of the entries within each level. Is this the correct syntax for a query-based navigation menu? How does it determine which sub-levels belong to a parent?  Does the ordering of the resultset have any impact on how the menu is generated?
    As stated in the documentation:
    ...do not specify either ORDER BY or GROUP BY, because they will destroy the hierarchical order of the CONNECT BY results. If you want to order rows of siblings of the same parent, then use the ORDER SIBLINGS BY clause.
    Try:
    select LEVEL,
          LABEL,
          LINK,
          'NO' as IS_CURRENT,
          null as IMAGE
      from V$RC_MENUS
    where CLUB = :APP_CLUB
    start with PID is null
    connect by prior ID = PID
    order siblings by SEQUENCE, LABEL

  • Need to wite pl sql procedure for dynamic select statement

    Need pl sql procedure for a Dynamic select statement which will drop tables older than 45 days
    select 'Drop table'||' ' ||STG_TBL_NAME||'_DTL_STG;' from IG_SESSION_LOG where substr(DTTM_STAMP, 1, 9) < current_date - 45 and INTF_STATUS=0 order by DTTM_STAMP desc;

    I used this to subtract any data older than 2 years, adjustments can be made so that it fits for forty five days, you can see how I changed it from the originaln dd-mon-yyyy to a "monyy", this way it doesn't become confused with the Static data in the in Oracle, and call back to the previous year when unnecessary:
    TO_NUMBER(TO_CHAR(A.MV_DATE,'YYMM')) >= TO_NUMBER(TO_CHAR(SYSDATE - 365, 'YYMM'))

  • Can't figure out the correct syntax for this select statement

    Hello,
    The following statement works great and gives the desired results:
    prompt
    prompt Using WITH t
    prompt
    with t as
       select a.proj_id,
              a.proj_start,
              a.proj_end,
              case when (
                         select min(a.proj_start)
                           from v b
                          where (a.proj_start  = b.proj_end)
                            and (a.proj_id    != b.proj_id)
                        is not null then 0 else 1
              end as flag
         from v a
        order by a.proj_start
    select proj_id,
           proj_start,
           proj_end,
           flag,
           -- the following select statement is what I am having a hard time
           -- "duplicating" without using the WITH clause
            select sum(t2.flag)
              from t t2
             where t2.proj_end <= t.proj_end
           ) s
      from t;As an academic exercise I wanted to rewrite the above statement without using the WITH clause, I tried this (among dozens of other tries - I've hit a mental block and can't figure it out):
    prompt
    prompt without with
    prompt
    select c.proj_id,
           c.proj_start,
           c.proj_end,
           c.flag,
           -- This is what I've tried as the equivalent statement but, it is
           -- syntactically incorrect.  What's the correct syntax for what this
           -- statement is intended ?
            select sum(t2.flag)
              from c t2
             where t2.proj_end <= c.proj_end
           ) as proj_grp
      from (
            select a.proj_id,
                   a.proj_start,
                   a.proj_end,
                   case when (
                              select min(a.proj_start)
                                from v b
                               where (a.proj_start  = b.proj_end)
                                 and (a.proj_id    != b.proj_id)
                             is not null then 0 else 1
                   end as flag
              from v a
             order by a.proj_start
           ) c;Thank you for helping, much appreciated.
    John.
    PS: The DDL for the table v used by the above statements is:
    drop table v;
    create table v (
    proj_id         number,
    proj_start      date,
    proj_end        date
    insert into v values
           ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'),
                to_date('02-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'),
                to_date('03-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'),
                to_date('04-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'),
                to_date('05-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'),
                to_date('07-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'),
                to_date('17-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'),
                to_date('18-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'),
                to_date('19-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'),
                to_date('20-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (10, to_date('21-JAN-2005', 'dd-mon-yyyy'),
                to_date('22-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (11, to_date('26-JAN-2005', 'dd-mon-yyyy'),
                to_date('27-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (12, to_date('27-JAN-2005', 'dd-mon-yyyy'),
                to_date('28-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (13, to_date('28-JAN-2005', 'dd-mon-yyyy'),
                to_date('29-JAN-2005', 'dd-mon-yyyy'));
    insert into v values
           (14, to_date('29-JAN-2005', 'dd-mon-yyyy'),
                to_date('30-JAN-2005', 'dd-mon-yyyy'));

    Hi, John,
    Not that you asked, but as you proabably know, analytic functions are much better at doing this kind of thing.
    You may be amazed (as I continually am) by how simple and efficient these queries can be.
    For example:
    WITH     got_grp          AS
         SELECT     proj_id, proj_start, proj_end
         ,     proj_end - SUM (proj_end - proj_start) OVER (ORDER BY  proj_start)     AS grp
         FROM     v
    SELECT       ROW_NUMBER () OVER (ORDER BY grp)     AS proj_grp
    ,       MIN (proj_start)                         AS proj_start
    ,       MAX (proj_end)               AS proj_end
    FROM       got_grp
    GROUP BY  grp
    ORDER BY  proj_start
    ;Produces the results you want:
      PROJ_GRP PROJ_START  PROJ_END
             1 01-Jan-2005 05-Jan-2005
             2 06-Jan-2005 07-Jan-2005
             3 16-Jan-2005 20-Jan-2005
             4 21-Jan-2005 22-Jan-2005
             5 26-Jan-2005 30-Jan-2005This is problem is an example of Neighbor-Defined Groups . You want to GROUP BY something that has 5 distinct values, to get the 5 rows above, but there's nothing in the table itself that tells you to which group each row belongs. The groups are not defined by any column in hte table, but by relationships between rows. In this case, a row is in the same group as its neighbor (the row immediatly before or after it when sorted by proj_start or proj_end) if proj_end of the earlier row is the same as proj_start of the later row. That is, there is nothing about 03-Jan-2005 that says the row with proj_id=2 is in the first group, or even that it is in the same group with its neighbor, the row with proj_id=3. Only the relation between those rows, the fact that the earlier row has end_date=03-Jan-2005 and the later row has start_date=03-Jan-2003, that says these neighbors belong to the same group.
    You're figuring out when a new group starts, and then counting how many groups have already started to see to which group each row belongs. That's a prefectly natural procedural way of approaching the problem. But SQL is not a procedural language, and sometimes another approach is much more efficient. In this case, as in many others, a Constant Difference defines the groups. The difference between proj_end (or proj_start, it doesn't matter in this case) and the total duratiojn of the rows up to that date determines a group. The actual value of that difference means nothing to you or anybody else, so I used ROW_NUMBER in the query above to map those distinct values into consecutive integers 1, 2, 3, ... which are a much simpler way to identify the groups.
    Note that the query above only requires one pass through the table, and only requires one sub-query. It does not need a WITH clause; you could easily make got_grp an in-line view.
    If you used analytic functions (LEAD or LAG) to compute flag, and then to compute proj_grp (COUNT or SUM), you would need two sub-queries, one for each analytic function, but you would still only need one pass through the table. Also, those sub-queries could be in-line views; yiou would not need to use a WITH clause.

  • I need to know the proper syntax for my SELECT query, please.

    Hello All,
    Quick one for you:
    Let's say that I have several columns in a table with names such as subject_1, subject_2, subject_3, etc. The table's name is subject_names.
    The number in each of the three column name examples is also a value passed along a query string, the user can select choices, 1, 2 or 3. That query string's variable is $qs.
    So, what I want is a SELECT query that uses the query string value as follows (KEEP IN MIND, I know this is not the proper syntax):
    "SELECT subject_[$qs]
    FROM subject_names";
    I have tried all sorts of cominations of quotes (single and double), dots, brackets, braces and parenthesis. I just want to know how to include such a variable within this code.
    Any and all help is sincerely appreciated!
    Cheers,
    wordman

    Well, I did give you the syntax though.
    $query = 'SELECT ' . $qs . ' FROM tbl_name';
    I put spaces between the periods this time to make it more clear.
    If you put the actual word 'subject' in there and just want your form to name it's options as the numbers available you could do this:
    $query = 'SELECT subject_' . $qs . ' FROM tbl_name';
    In PHP you can use either single or double quotes around your query string, I always just use single quotes. I see a lot of other use double quotes.
    Double quotes would look like:
    $query = "SELECT subject_' . $qs . ' FROM tbl_name";
    Or when using double quotes you can actually just place the variable right in the string without having to concatenate multiple strings like above.
    Since you mentioned that you are good with passing variables I probably don't have to mention that you need to set the value attribute of your option tags (if you are using a select) to the value you want them to pass.
    Ex:
    <select name="choices">
         <option value="1">1</option>
         <option value="2">2</option>
         <option value="3">3</option>
    </select>
    If you have that part all figured out then you can use the syntax above for your query string.
    Good luck.

  • Help for dynamic selection

    Hello guy,
    I want to dynamically search for the occurrence of certain words in each data record(each field) in each table. Below is my code
    Parameters: p_tabname like dd02l-tabname.
    SELECT * FROM dd02l
      INTO  TABLE itab
      WHERE as4local = 'A'
       AND tabname = p_tabname
    LOOP AT itab INTO w_tab.
    CREATE DATA ref_itab TYPE STANDARD TABLE OF (w_tab-tabname).
        ASSIGN ref_itab->* TO <fs_itab>.
    CREATE DATA ref_wa TYPE (w_tab-tabname).
        ASSIGN ref_wa->* TO <fs_wa>.
    SELECT * FROM (w_tab-tabname)
        INTO CORRESPONDING FIELDS OF TABLE <fs_itab>.
       DESCRIBE TABLE  itab. "check if the table contains entries.
       IF sy-tfill > 0.
    LOOP AT <fs_itab> INTO <fs_wa>. " loop at each table that contains entries and search for the strings or characters
    SEARCH <fs_wa> for 'bbbb_' and '3456*' and '8970*' and '2980*'  "this is not working
    * If any of the entries exist in a table, I would like to give out the table name, the field which contains this entry and the dataelement
    * of the field that contain the entry
          ENDLOOP.
    ENDIF.
    ENDLOOP.
    Can some one please show me how to move forward to achieve this?
    Thank you
    Nadin

    Thank you so much Micky. It works perfectly. I really much appreciate your help. I will award points.
    Now I want to do some thing more. I want to output the data element and description,fieldname  tabledescription for example. I know that the dataelement of a field and the description can be found in the TABLE dd04t OR FM: DDIF_FIELDINFO_GET but you need to know the exact position of the field element dynamically. My problem now is I want to get the table description of SPFLI from dd02t, all the dataelements and the descriptions of the field 'TOKYO' and perhaps AIRPTO 'KIX'. Have adjusted my code as follows but still have trouble: Could you please Micky or any body show me how to achieve this?
    It is kind of tricky because the sy-tabix can be 2 but the TOKYO is at the 5th field. Thank you.
    Parameters: p_tabname like dd02l-tabname default 'spfli'.
    DATA: t_dd02l   TYPE STANDARD TABLE OF dd02l.
    DATA: t_dd03l   TYPE STANDARD TABLE OF dd03l.
    DATA: t_dfies   TYPE STANDARD TABLE OF dfies.
    DATA: ref_itab   TYPE REF TO data.
    DATA: ref_wa    TYPE REF TO data.
    DATA: ref_itab_temp TYPE REF TO data.
    DATA: ref_wa_temp   TYPE REF TO data.
    DATA: w_dd02l  TYPE dd02l.
    DATA: w_dd03l  TYPE dd03l.
    DATA: w_dfies   TYPE  dfies.
    DATA: w_string  TYPE string.
    DATA: w_fieldname   TYPE string.
    DATA: w_fieldnamestring  TYPE string.
    DATA: w_tabix TYPE sy-tabix.
    DATA: w_dd02t  TYPE dd02t.
    DATA: w_dd04t     TYPE dd04t.
    DATA: w_datenelement TYPE rollname.
    DATA: w_dfies_tmp TYPE dfies.
    FIELD-SYMBOLS:
    <fs_itab>          TYPE ANY TABLE,
    <fs_itab_temp> TYPE ANY TABLE,
    <fs_wa_temp>  TYPE ANY,
    <fs_wa>           TYPE ANY,
    <component>  TYPE ANY.
      CLEAR t_dd02l.
      SELECT * FROM dd02l
      INTO  TABLE t_dd02l
      WHERE as4local = 'A'
      AND tabclass   = 'TRANSP'
        AND tabname IN so_tab.
      LOOP AT t_dd02l INTO w_dd02l.
        CREATE DATA ref_itab TYPE STANDARD TABLE OF (w_dd02l-tabname).
        ASSIGN ref_itab->* TO <fs_itab>.
        ASSIGN ref_itab->* TO <fs_itab_temp>.
        CREATE DATA ref_wa TYPE (w_dd02l-tabname).
        ASSIGN ref_wa->* TO <fs_wa>.
        ASSIGN ref_wa->* TO <fs_wa_temp>.
        SELECT * FROM dd03l
        INTO  TABLE t_dd03l
       WHERE tabname = w_dd02l-tabname
       AND  as4local      = 'A'
       AND   datatype    = 'CHAR'.
        CLEAR: w_dd03l, w_fieldnamestring.
        LOOP AT t_dd03l INTO w_dd03l.
          CLEAR w_fieldname.
          w_fieldname = w_dd03l-fieldname.
          CONCATENATE w_fieldname w_fieldnamestring INTO
        w_fieldnamestring SEPARATED BY space IN CHARACTER MODE.
        ENDLOOP.
        CREATE DATA ref_itab_temp TYPE STANDARD TABLE OF (w_dd03l-tabname).
        ASSIGN ref_itab_temp->* TO <fs_itab_temp>.
        CREATE DATA ref_wa_temp TYPE (w_dd03l-tabname).
        ASSIGN ref_wa_temp->* TO <fs_wa_temp>.
        SELECT (w_fieldnamestring) FROM (w_dd03l-tabname)
        INTO CORRESPONDING FIELDS OF TABLE <fs_itab_temp>.
        DESCRIBE TABLE <fs_itab_temp>.
        IF sy-tfill > 0.
          CLEAR w_tabix.
          CLEAR w_nut.
          LOOP AT <fs_itab_temp> INTO <fs_wa_temp>.
            CLEAR w_longstring.
            w_tabix = w_tabix + 1.
            IF <fs_wa_temp> IS NOT INITIAL.
              DO.
                ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa_temp> TO <component>.
                CLEAR w_string.
                IF sy-subrc <> 0.
                  EXIT.
                ENDIF.
                CLEAR: w_string.
                IF NOT <component> IS INITIAL.
                  MOVE <component> TO w_string.
                  CONCATENATE w_string w_longstring INTO w_longstring
                  SEPARATED BY ';'.
                  IF w_string CS 'TOKYO'.
                    CLEAR w_dd02t.
                    SELECT SINGLE * FROM dd02t INTO w_dd02t
                    WHERE tabname    =  w_dd03l-tabname
                      AND ddlanguage = 'DE'.
                    CLEAR t_dfies.
                    CALL FUNCTION 'DDIF_FIELDINFO_GET'
                      EXPORTING
                        tabname        = w_dd03l-tabname
                      TABLES
                        dfies_tab      = t_dfies
                      EXCEPTIONS
                        not_found      = 1
                        internal_error = 2
                        OTHERS         = 3.
                    IF sy-subrc = 0.
                      CLEAR w_dfies.
                      READ TABLE t_dfies INTO w_dfies
                      WITH KEY tabname = w_dd03l-tabname.
                      READ TABLE t_dfies INDEX  w_tabix INTO w_dfies_tmp.
                      SELECT SINGLE * FROM dd04t INTO w_dd04t
                      WHERE rollname    = w_dfies_tmp-rollname
                      AND   ddlanguage  = 'EN'
                      AND    as4local   = 'A'.
                      WRITE:/ w_dfies-tabname, w_dd02t-ddtext, w_string, w_dd04t-rollname, w_dd04t-ddtext, w_longstring.
                    ENDIF.
                  ENDIF.
                ENDIF.
              ENDDO.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    Edited by: nadin ram on Apr 11, 2008 7:06 PM

Maybe you are looking for

  • How do I share photos and music between different user accounts on the same macbook

    How do I share photos and music between different user accounts on the same Macbook? i.e. I want all to be able to access family photos when logged into their respective accounts. Same goes for the iTunes library. Hope this is possible... Thanks!

  • Serial Number does not work. Help needed!

    Hello! I am attempting to reinstall CS4 on my machine at work. Initially I experienced error 147:20 a few weeks ago, and I ran their LicenseRecovery.exe tool, and that did not clear anything up. So, then I ran the Adobe CS Cleaner Tool and uninstalle

  • BPM not sending Message to First Task ?

    Hi @, I ahave completed one BPM process following End2End demo and deployed the same CE Ehp1 system on my laptop. BUt when I am starting the process from NWA the first process user is not getting any entry in the Tasks whereas I am able to see the Ta

  • How to batch change multiple adjusted images by a fixed amount?

    Anyone know of a way to change the adjustment values of multiple previously adjusted images by a fixed amount? For example, if, after adjusting exposure of multiple images by various amounts, I want to lighten them all by 0.5, is there a way to do th

  • What is the BADI to create a new tab in ME21N transaction

    Hi, I have created a new document type zbr with the transaction spro. I wanted to add a new tab for the given document type zbr. How to create a new tab for the document type. How to create a new tab using BADI. what is BADI used to create the tab