CX_SY_DYNAMIC_OSQL_SEMANTICS error with dynamic SELECT statement

Hello Gurus,
We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
          SELECT (lt_select_flds)
            FROM (lf_tab_name)
            INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
            FOR ALL ENTRIES IN <lt_source_data>
            WHERE (lf_where).
In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
This code was working fine till we were in BW 3.5 and is causing issues after we moved to BW 7.31 recently. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS. THE ERROR TEXT SAYS 'Unable to interpret '<LT_SOURCE_data>-DOC_NUMBER'.
Can you pleasesuggest what can we do to this code to get is working correctly ? What has changed in ABAP Objects that has been introduced from BI 7.0 that could be causing this issue?
Would appreciate any help we can get here.
Thanks
Arvind

Hi,
Please try this.
data: lv_where type string.
concatenate 'vbeln' 'in' 'r_vbeln' into lv_where separated by space.
select *from table into itab where (lv_where).
Also please check this sample code.
REPORT ZDYNAMIC_WHERE .
TABLES: VBAK.
DATA: CONDITION TYPE STRING.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
INTO CONDITION SEPARATED BY SPACE.
SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
WHERE (CONDITION).
LOOP AT ITAB.
WRITE 'hello'.
ENDLOOP.
Regards,
Ferry Lianto

Similar Messages

  • Dynamic SELECT statement causing CX_SY_DYNAMIC_OSQL_SEMANTICS error.

    Hello Gurus,
    We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:
              SELECT (lt_select_flds)
                FROM (lf_tab_name)
                INTO CORRESPONDING FIELDS OF TABLE <lt_data_tab>
                FOR ALL ENTRIES IN <lt_source_data>
                WHERE (lf_where).
    In this instance, we are selecting 5 fields from Customer Master Data and the WHERE condition for this instance of the run is as below:
    WHERE: DIVISION = <lt_source_data>-DIVISION AND DISTR_CHAN = <lt_source_data>-DISTR_CHAN AND SALESORG = <lt_source_data>-SALESORG AND CUST_SALES = <lt_source_data>-SOLD_TO AND OBJVERS = 'A'
    This code was working fine till yesterday when we encountered serious performance problems and the Basis team had to do some changes at the DB level [Oracle]. Ever since, when we execute our data load, we get the CX_SY_DYNAMIC_OSQL_SEMANTICS.
    Is setting changes at the Oracle level cause issues with how the data is being read at the DB. If yes, can you suggest what can we do to this code to get is working correctly [in case Basis can't revert back their changes]?
    Would appreciate any help we can get here.

    You don't understand - this error comes up when we run specific BEx queries.  It was working yesterday, but today it is not.  Our support package did not change from yesterday.  We did not apply any OSSnotes.
    We are however doing pre-prepare on our Prod system.
    The temporary table is used to store SIDs for use in the join.  the table exists in the dictionary, but not at an Oracle level.

  • How to create a Type Object with Dynamic select query columns in a Function

    Hi Every One,
    I'm trying to figure out how to write a piplined function that executes a dynamic select query and construct a Type Object in order to assigned it to the pipe row.
    I have tried by
    SELECT a.DB_QUERY INTO actual_query FROM mytable a WHERE a.country_code = 'US';
    c :=DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(c,actual_query,DBMS_SQL.NATIVE);
    l_status := DBMS_SQL.EXECUTE(c);
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.DEFINE_COLUMN(c,j,v_val,2000);
    END LOOP;
    FOR j in 1..col_cnt LOOP
    DBMS_SQL.COLUMN_VALUE(c,j,v_val);
    END LOOP;
    But got stuck, how to iterate the values and assign to a Type Object from the cursor. Can any one guide me how to do the process.
    Thanks,
    mallikj2

    Hi Justin,
    First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
    In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
    Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
    Thanks in Advance,
    mallikj2.

  • 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'))

  • Autonumbers through dynamic SELECT statement

    Trying to get an autonumber from an order table. The order_id I need from the table is only uniquely identified by the customer_id and the date/time. I've been advised that you cannot get an autonumber back from access without going via a select statement.
    I've tried to do a dynamic select statement by getting the date (short i.e.DD/MM/YY) from the server using a JSP custom tag and then putting this value into a hidden form field on the previous web page.
    However, when I load the next page the data gets input into the order table okay but the web page displayed is blank i.e. it doesn't display the order_id or the form to input credit card details. There are no error messages
    Code below, any ideas?
    <%@ page language="java" contentType="text/html"
    import="ShoppingBasket,Product,java.util.*"
    errorPage="errorpage.jsp"%>
    <jsp:useBean id="basket" class="ShoppingBasket" scope="session"/>
    <html>
    <head>
    <title>Your Order Has Been Received</title>
    </head>
    <body>
    <%
    String customer_id = request.getParameter("customer_id");
    String total_value = request.getParameter("total_value");
    String order_date = request.getParameter("order_date");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Novbase","","");
    java.sql.Statement Stmt = connection.createStatement();
    String query = ("INSERT INTO Orders (customer_id, total_value) VALUES ("+customer_id+", "+total_value+")");
    Stmt.executeUpdate(query);
    java.sql.Statement Stmt2 = connection.createStatement();
    java.sql.ResultSet RS = Stmt2.executeQuery("SELECT order_id FROM Orders WHERE customer_id = "+customer_id+" AND time_date LIKE '"+order_date+"%'" );
    while(RS.next())
    String order_id = RS.getString("order_id");
    %>
    your order id is <%=order_id %>. Please input your credit card details in the form below:
    <form name="form1" method="post" action="shop-postorder4.jsp">
    <table width="90%" border="0" cellspacing="1" cellpadding="5">
    <tr>
    <td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Credit
    Card Type</font></td>
    <td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <select name="card_type">
    <option value="AMERICAN EXPRESS">American Express</option>
    <option value="MASTER CARD">Master Card</option>
    <option value="SWITCH">Switch</option>
    <option value="VISA">Visa</option>
    </select>
    *</font></td>
    </tr>
    <tr>
    <td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Credit
    Card No.</font></td>
    <td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <input type="text" name="card_number" size=18 maxlength="18">
    *</font></td>
    </tr>
    <tr>
    <td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Issue
    No. <font size="1"><br>
    (Switch card holders<br>
    only)</font></font></td>
    <td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <input type="text" name="issue_no" size="2" maxlength="2">
    </font></td>
    </tr>
    <tr>
    <td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Valid
    From</font></td>
    <td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <input type="text" name="valid_from" size="4" maxlength="4">
    e.g. 0502</font></td>
    </tr>
    <tr>
    <td width="5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width="25%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Validy
    To</font></td>
    <td width="70%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <input type="text" name="valid_to" size="4" maxlength="4">
    * e.g. 0105</font></td>
    </tr>
    </table>
    <input type="submit" name="Submit" value="Submit">
    <input type="hidden" name="order_id" value="<%=order_id %>">
    </form>
    <a href=" <%= response.encodeURL(shop-products.jsp") %">">
    <img src="images\toshop.gif" border="0" alt="Return to the Shop"></a>
    <%
    RS.close();
    Stmt.close();
    Stmt2.close();
    connection.close();
    %>
    </body>
    </html>
    </a>

    String query = ("INSERT INTO Orders (customer_id, total_value) VALUES ("+customer_id+", "+total_value+")");
    the data gets input into the order table okay
    java.sql.ResultSet RS = Stmt2.executeQuery("SELECT order_id FROM Orders WHERE customer_id = "+customer_id+" AND time_date LIKE '"+order_date+"%'" );It is a field name as <B>time_date </B>in Orders table? And should you insert some value ?
    It seems your select return nothing.
    When your RS.next() is false, so you get blank. Add some HTNL code or just <HR> after while {} block so your would see it.

  • 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

  • How to save a variant with dynamic selections parameters

    Anybody knows how to save a variant for an ABAP that uses a Logical database with Dynamic Selections?
    Have a look for example to the following:
    SE38 - DEMO_PROGRAM_GET - Execute - Shift F4 - Connection Number.
    How to save 0820 as Connection Number?
    Function Group SVAR seems good but FREE SELECTIONs are not easy to manage...

    Hello,
      I tried to save the variant of DEMO_PROGRAM_GET with dynamic selection field (Connection Number) filled. It gets saved without any problem. Just click 'SAVE' and enter the variant name and description.
    Thanks,
    Venu

  • DYnamic select statement in JDBC adapter?

    Hi guys,
                 Is it possible so send dynamic select statement in jdbc adapter?
    XIer

    Aamir,
    The poster did not specify whether this was sender or receiver channel, but it would only make sense that a "dynamic query" must be on the receiver communication channel since if it was on the sender channel, the channel would have to intelligently determine how to do dynamic queries.
    Also, the poster asked if there was a way to "send a dynamic query" to the channel.  This seems to imply that the channel is receiving information from somewhere to determine the query, which could only mean it is a receiver channel.
    If you would like more information on the JDBC sender communication channel, please open a new thread.

  • Smart scan not working with Insert Select statements

    We have observed that smart scan is not working with insert select statements but works when select statements are execute alone.
    Can you please help us to explain this behavior?

    There is a specific exadata forum - you would do better to post the question there: Exadata
    I can't give you a definitive answer, but it's possible that this is simply a known limitation similar to the way that "Create table as select" won't run the select statement the same way as the basic select if it involves a distributed query.
    Regards
    Jonathan Lewis

  • Error Msg in Select Statement

    Hi,
        Can you declare an error message under select statement?

    Hi..
    You can use the Message statement for this..
    PARAMETERS: P_MATNR TYPE MARA-MATNR.
    AT SELECTION-SCREEN ON P_MATNR.
       SELECT SINGLE * FROM MARA WHERE MATNR  = P_MATNR.
       IF SY-SUBRC NE 0.
      <b>    MESSAGE E100(ZCLASS).</b>  
    ENDIF.
    <b>Reward if Helpful</b>

  • Update with a select statement

    hi experts,
    I need some help again.. :)
    I have an insert query here with a select statement.. Juz wondering how to do it in update?
    insert into newsmail_recipient
            (IP_RECIPIENTID,NF_LISTID,NF_STATUSID,D_CREATED,D_MODIFIED,C_NAME,C_EMAIL,USER_ID,NEWSMAIL_ID)
            select newsmail_recipientid_seq.nextval
              , liste
              , 1
              , sysdate
              , sysdate
              , null
              , null
              , ru.nf_userid
              , null
            from roleuser ru, unit u, userinfo ui
            where u.ip_unitid = ru.nf_unitid
            and u.ip_unitid = unit_id
            and ui.ip_userid = ru.nf_userid
            and ui.nf_statusid = 1
            and n_internal = 0
            and ui.ip_userid not in (select user_id
                                       from newsmail_recipient
                                      where user_id = ui.ip_userid
                                        and nf_listid = liste
                                        and nf_statusid = 1);let me know your thoughts.
    Regards,
    jp

    Hi,
    924864 wrote:
    ... I have an insert query here with a select statement.. Juz wondering how to do it in update?How to do what, exactly?
    MERGE can UPDATE existing rows, and INSERT new rows at the same time. In a MERGE statement, you give a table or a sub-query in the USING clause, and define how rows from that result set match rows in your destination table. If rows match, then you can UPDATE the matching row with values from the sub-query.
    Very often, MERGE is easier to use, and perhaps more efficient, than UPDATE just for changing existing rows. That is, while MERGE can do both INSERT and UPDATE, it doesn't have to . You can tell MERGE just to do one or the other if you wish.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Since you're asking about a DML statement, such as UPDATE, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • FBL1N with dynamic selection WITHHOLDING TAX CODE is dropping rows

    Using FBL1N with dynamic selection field: WITHHOLDING TAX CODE and noticed that several vendors dropped off the report. Appears FBL1N's filter logic uses LFB1-QSSKZ and not LFBW-WT_WITHCD. Upon examination, I determined that the missing vendors didn't have a WTC assignment (column is BLANK) in table LFB1. Problem is I'm using transaction FK02's WITHHOLDING TAX ACCT tab to assign the WT codes but these rows are written to table LFBW (not LFB1). How is the LFB1-QSSKZ field populated? And why do some of the entries in LFB1-QSSKZ have values while others do not? Would ultimately like to populate the blank assignments with the correct WT code.

    Hi Steve,
    This is due to the limitation due to standard design.
    You can see that a vendor can be assigned to multiple WHT codes and can also have multiple WHT code for a single line item. Hence in FBL1N output it would not be possible to show the WHT code as there is no  one to one relationship.
    You can click on the line item and can then see the WHT information in WHT button. Or alternatively get the data in withholding tax information reports.
    Regards,
    SDNer

  • Reinstalling AE and PP due to an error with dynamic link. Where do i find the program install? And tips on how to reinstall without messing things up? last question is, does my recent files and saves work after the reinstall?

    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    And tips on how to reinstall without messing things up?
    last question is, does my recent files and saves work after the reinstall?
    Thank you

    karianne wrote:
    I have allready bought the programs, but need to reinstall AE and PP due to an error with dynamic link.
    Where do i find the program install?
    Which versions? Which operating system?
    Try Download and Installation Help

  • Dynamic select-statement with ranges

    Good morning experts,
    I just wanted to know if this is possible:
    I had a report with a selection-screen where I can enter a table-name and one ore more filed-names (separated by ;).
    After that, I create a table like my entered (for example MARA)
    CREATE DATA gt_table TYPE TABLE OF (p_tab).
    ASSIGN gt_table->* TO <gt_table>.
    Then I split my entered fields (at and for each filed I made a selection (with function COMPLEX_SELECTIONS_DIALOG).
    Result of this is for each field a range-tab which I write in a new table - first column is the name of the field, second column is a range-tab:
    TYPES: BEGIN OF t_ranges,
              sign TYPE tkeppllevs-sign,
              opt  TYPE tkeppllevs-opt,
              low  TYPE rsdslow,
              high TYPE rsdslow,
            END OF t_ranges.
    DATA: BEGIN OF gs_conditions,
            fieldname TYPE string,
            ranges    TYPE TABLE OF t_ranges.
    DATA: END OF gs_conditions.
    DATA: gt_conditions LIKE TABLE OF gs_conditions.
    Now I want to make a select on the entered table (MARA).
    So I make a loop on my gt_conditions:
    LOOP AT gt_conditions INTO gs_conditions.
      l_index = sy-tabix.
    CONCATENATE 'gt_conditions[' l_index ']-ranges' INTO l_condition.
      CONDENSE l_condition NO-GAPS.
      CONCATENATE gs_conditions-fieldname 'IN' l_condition INTO lt_condition SEPARATED BY space.
      IF sy-tabix > 1.
        CONCATENATE 'AND' lt_condition INTO lt_condition SEPARATED BY space.
      ENDIF.
      APPEND lt_condition.
    ENDLOOP.
    If I look at it after the loop, it looks correct:
    MATNR IN gt_conditions[1]-ranges
    AND ERSDA IN gt_conditions[2]-ranges
    But this wont work because of "gt_conditions[1]-ranges". I know, i can work with the "table in table", because gs_conditions-ranges works (I already tested this).
    Has anybody any idea how to make my idea work?

    @Hymavathi:
    Error is the following:
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
    not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    The current ABAP program has tried to execute an Open SQL statement
    which contains a WHERE, ON or HAVING condition with a dynamic part.
    The part of the WHERE, ON or HAVING condition specified at runtime in
    a field or an internal table, contains the invalid value
    "GT_CONDITIONS[1]-RANGES".
    @Hymavathi, second time:
    This is the whole code for the select:
    LOOP AT gt_conditions INTO gs_conditions.
      l_index = sy-tabix.
      CONCATENATE 'gt_conditions[' l_index ']-ranges' INTO l_condition.
      CONDENSE l_condition NO-GAPS.
      CONCATENATE gs_conditions-fieldname 'IN' l_condition INTO lt_condition SEPARATED BY space.
      IF sy-tabix > 1.
        CONCATENATE 'AND' lt_condition INTO lt_condition SEPARATED BY space.
      ENDIF.
      APPEND lt_condition.
    ENDLOOP.
    SELECT * FROM (p_tab)
       INTO TABLE <gt_table>
            WHERE (lt_condition).
    You can see, the select is after the loop. So gs_conditions-ranges wouldn't be right, then the where statement would only use the last range-tab from my table gt_conditions. (loop at...endloop => gs-conditions-range = last gt_conditions-range).

  • Dynamic select statement

    I have this input field called IO_TABLE and a button. When the user key in the database name into IO_TABLE and press the button, the records/data in the database will be written out.
    Here is my codes:
    REPORT  ZA_FIELD.
    DATA IO_TABLE(30) TYPE C.
    FIELD-SYMBOLS:  <FS_INPUT> TYPE ANY,
                   <FS_ITAB> TYPE ANY TABLE.
    START-OF-SELECTION.
      CALL SCREEN 9000.
    MODULE STATUS_9000 OUTPUT.
    SET PF-STATUS 'SCREEN_9000'.
    SET TITLEBAR 'TITLE_9000'.
    ENDMODULE.                    "STATUS_9002 OUTPUT
    MODULE USER_COMMAND_9000 INPUT.
    IF SY-UCOMM = 'SAVE'.
    ELSEIF SY-UCOMM = 'EXIT' OR SY-UCOMM = 'CANCEL'.
      LEAVE PROGRAM.
    ELSEIF SY-UCOMM = 'PUSH'.
      ASSIGN IO_TABLE TO <FS_INPUT>.
      SELECT * FROM <FS_INPUT> INTO TABLE <FS_ITAB>.
      WRITE <FS_ITAB> .
    "  SUBMIT ZFINAL_2.
    ENDIF.
    ENDMODULE.                    "USER_COMMAND_9002 INPUT
    As shown <FS_INPUT> is the field symbol that store the value of IO_TABLE. What am I suppose to replace my dynamic internal table for my codes?
    dynamic internal table is needed to display out the values in it.
    However, I got this error at my statement as shown at my link http://img337.imageshack.us/img337/3791/screenez4.png
    What am I suppose to do to solve this problem?

    Unfortunately -- it's not not quite that simple although still easy enough.
    In order to use a dynamic table you need to create a field catalog first for the fields, build the dynamic table and then populate it.
    Here's how to do it.
    1) define some data we'll need for the process.
    * Define any structure
    TYPES:  BEGIN OF s_elements,
      vbeln   TYPE vapma-vbeln,
      posnr   TYPE vapma-posnr,
      matnr   TYPE vapma-matnr,
      kunnr   TYPE vapma-kunnr,
      werks   TYPE vapma-werks,
      vkorg   TYPE vapma-vkorg,
      vkbur   TYPE vapma-vkbur,
      status  TYPE c,
    END OF  s_elements.
    * end of your structure
    DATA:wa_elements TYPE s_elements.
    DATA: ord_nr TYPE vapma-vbeln,
          mat_nr TYPE vapma-matnr,
          cus_nr TYPE vapma-kunnr.
    DATA lr_rtti_struc TYPE REF TO cl_abap_structdescr .
    DATA:
    zog                     LIKE LINE OF lr_rtti_struc->components .
    DATA:
    zogt                    LIKE TABLE OF zog,
    wa_it_fldcat TYPE lvc_s_fcat,
    it_fldcat TYPE lvc_t_fcat ,
    dy_line            TYPE REF TO data,
    dy_table           TYPE REF TO data.
    DATA:  dref               TYPE REF TO data.
    FIELD-SYMBOLS: <fs> TYPE ANY,
       <dyn_table>    TYPE  STANDARD TABLE,
       <dyn_wa>.
    2)  now build the fcat, create the dynamic table and populate it.
    START-OF-SELECTION.
    *now I want to build a field catalog
    * First get your data structure into a field symbol
      CREATE DATA dref TYPE s_elements.
      ASSIGN dref->* TO <fs>.
      lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( <fs> ).
    * Now get the structure details into a table.
    * table zogt[] contains the structure details
    * From which we can build the field catalog
      zogt[]  = lr_rtti_struc->components.
      LOOP AT zogt INTO zog.
        CLEAR wa_it_fldcat.
        wa_it_fldcat-fieldname = zog-name .
        wa_it_fldcat-datatype = zog-type_kind.
        wa_it_fldcat-inttype = zog-type_kind.
        wa_it_fldcat-intlen = zog-length.
        wa_it_fldcat-decimals = zog-decimals.
        wa_it_fldcat-coltext = zog-name.
        wa_it_fldcat-lowercase = 'X'.
        IF wa_it_fldcat-fieldname = 'VBELN'.
          wa_it_fldcat-hotspot = 'X'.
        ENDIF.
        APPEND wa_it_fldcat TO it_fldcat.
      ENDLOOP.
    * You can perform any modifications / additions to your field catalog
    * here such as your own column names etc.
    * Now using the field catalog created above we can
    * build a dynamic table
    * and populate it
    * First build the dynamic table
    * the table will contain entries for
    * our structure defined at the start of the program
      CALL METHOD cl_alv_table_create=>create_dynamic_table
             EXPORTING
                  it_fieldcatalog = it_fldcat
             IMPORTING
                  ep_table = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    * Now fill our table with data
      SELECT vbeln posnr matnr kunnr werks vkorg vkbur
             UP TO 200 ROWS
             FROM vapma
             INTO  CORRESPONDING FIELDS OF TABLE <dyn_table>.
    3)  now if you want to say use a "classical" table  all you need to do is
    define a standard table of type s_elements and code something simple like
    my_itab[] =  <dyn_table>.
    Then you could get the <dyn_table>  after creation into yoour own table  for further processing.
    You can also  display the <dyn_table>  in a grid simply  via some type of code such as
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING is_layout =  struct_grid_lset
        CHANGING
                   it_outtab       = <dyn_table>
                   it_fieldcatalog = it_fldcat.
    You'll need to  "instantiate" the class (have grid1 as a ref to cl_gui_alv_grid) and do some other work --that's a topic for another post - however since you now have the field catalog and the table in principle if you need a grid display you've done 90% of the work.
    cheers
    jimbo

Maybe you are looking for

  • ?fo:page-number? in if statement in the header section

    Hi, is it possible to put the <?fo:page-number?> in if statements?? like <?if:fo:page-number>1?>STOP<?end if?> i have a requirement that the column should not be displayed in the succeeding page except for page 1. also the column have the table prope

  • How to select record in mulitple rows based on another field's values?

    Hi, sorry about the bad title, really not sure how to explain this Have the following data: Cost_center       Activity_type 1005009401     CLBR0 1005009401     CLBR1 1005009401     TLBR0 1005009401     TLBR1 1005009401     VEH00 1005009402     CLBR3

  • Can't find paid song on computer

    I paid for and can hear my song on my iPhone 5 BUT I'm unable to find it on my computer at iTunes.com What am I doing wrong?  Is it possible to email somebody else the song? so they can help me figure out where to start it (lots of instrumental befor

  • Made an appointment in Outlook, shows on iCloud calendar on my PC not showing on my iphone

    Made an appointment in Outlook - shows in the the icloud calendar on my PC does not show on my phone.  Appointment was made last week - so should have shown by now.  Other appoinments entered the same way are showing in my phone.  I have tried loggin

  • Date Labels in Keynote compared to Power Point

    I am used to Power Point where when I create a that has dates on the X axis I can have the labels shown for each 1 year or each 1 week. In Keynote, it seems like I can only either auto select or select each "x" categories. This is OK except when ther