Execute the expression in select statement

CREATE TABLE TEST1
  OFFICE_PRODUCTS     NUMBER,
  OFFICE_ELECTRONICS  NUMBER
Insert into TEST1 (OFFICE_PRODUCTS, OFFICE_ELECTRONICS) Values(1, 0);
COMMIT;
CREATE TABLE TEST2
  EXPORT_FIELD_NAME         VARCHAR2(100 BYTE),
  EXPORT_COLUMN_EXPRESSION  VARCHAR2(100 BYTE)
Insert into TEST2
   (EXPORT_FIELD_NAME, EXPORT_COLUMN_EXPRESSION)
Values ('A1', 'least(OFFICE_PRODUCTS, OFFICE_ELECTRONICS)');
COMMIT; I want to be execute the expression should run in select statement how to do?
and tried as like below,it's not working.
select (select EXPORT_COLUMN_EXPRESSION from test2 where EXPORT_FIELD_NAME='A1') FROM TEST1;

968892 wrote:
CREATE TABLE TEST1
OFFICE_PRODUCTS     NUMBER,
OFFICE_ELECTRONICS  NUMBER
Insert into TEST1 (OFFICE_PRODUCTS, OFFICE_ELECTRONICS) Values(1, 0);
COMMIT;
CREATE TABLE TEST2
EXPORT_FIELD_NAME         VARCHAR2(100 BYTE),
EXPORT_COLUMN_EXPRESSION  VARCHAR2(100 BYTE)
Insert into TEST2
(EXPORT_FIELD_NAME, EXPORT_COLUMN_EXPRESSION)
Values ('A1', 'least(OFFICE_PRODUCTS, OFFICE_ELECTRONICS)');
COMMIT; I want to be execute the expression should run in select statement how to do?
and tried as like below,it's not working.
select (select EXPORT_COLUMN_EXPRESSION from test2 where EXPORT_FIELD_NAME='A1') FROM TEST1;
Your problems are many...
a) it's very poor design to be storing expressions or sql statements or any 'executable' style code as data in the database.
b) what you're storing is a string of characters. Oracle isn't going to miraculously know that that is some expression that has to be evaluated, so why should it decide to treat it as such?
c) this poor design can lead to security issues especially around SQL injection.
d) to actually perform what you want would require you to build a dynamic SQL statement and then execute that using EXECUTE IMMEDIATE or DBMS_SQL (or for a 3rd party client, a Ref Cursor), but then there are numerous issues around doing dynamic SQL, aside from SQL injection, in that you are producing code that is not validated at compile time and can thus lead to bugs showing only at run-time and sometime only under certain conditions; the code is harder to maintain; the code can potentially be avoiding the use of bind variables, impacting on resources and performance on the database; the final query can be difficult to know just from reading the code, making further development or debugging a pain in the posterior. Essentially, dynamic SQL is considered very poor design and is 99.9% of the time used for the wrong reasons.
So, why are you trying to do this? What is the business requirement you are trying to solve?

Similar Messages

  • Can we handle exceptions for the expressions in select query?

    Hi all,
    Can we handle exceptions for the expressions in select query.
    I created a view, there I am extracting a substring from a character data and expected that as a number.
    For example consider the following query.
    SQL> select to_number( substr('r01',2,2) ) from dual;
    TO_NUMBER(SUBSTR('R01',2,2))
    1
    Here we got the value as "1".
    Consider the following query.
    SQL> select to_number( substr('rr1',2,2) ) from dual;
    select to_number( substr('rr1',2,2) ) from dual
    ORA-01722: invalid number
    For this I got error. Because the substr returns "r1" which is expected to be as number. So it returns "Invalid number".
    So, without using procedures or functions can we handle these type of exceptions?
    I am using Oracle 10 G.
    Thanks in advance.
    Thank you,
    Regards,
    Gowtham Sen.

    SQL> select decode(ltrim(rtrim(translate(substr('r21', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('r21', 2, 2)), null) from dual;
    DE
    21
    SQL> ed a
    SQL> select decode(ltrim(rtrim(translate(substr('rr1', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('rr1', 2, 2)), null) from dual;
    D
    -

  • Execute an string as select statement

    Hi,
    I have a problem:
    I'm working with an older oracle verion (7.x??). I want to create a dynamic select statement. I create a string, e.g. v_sql_string, and want the database to execute it. What possibilities do I have to do this?
    Thanks in advance
    Mathias

    Yes,
    I went through the documentation, but it's only working with cursors.
    For better comprehension:
    This is the string:
    'select count(*) from invoice where sup_no ' || op_sup_no || ' v_sup_no and trpt_code ' || op_trpt_code || ' v_trpt_code and ship_no ' || op_ship_no || ' v_ship_no'
    I want to set the operators (op_xxx) dynamiclly. Isn't there something like RUN or EXECUTE, where I only have to pass a string, and the statement is executed ...
    But I don't know how ...
    Mathias

  • Executing String which  has SELECT statement

    String stmt:='Select * from Table a';
    How do I execute the select statement present in the string.
    Thanks for the help in advance

    In most cases this is something you should not be doing on a regular basis. Also when using dynamic sql, take care to use bind variables.
    SQL> create or replace function f (p_stmt varchar2)
      2  return sys_refcursor as
      3    c sys_refcursor;
      4  begin
      5    open c for p_stmt;
      6    return c;
      7  end;
      8  /
    Function created.
    SQL> var c refcursor
    SQL> exec :c := f('select * from emp')
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          MGR HIREDATE     SAL   COMM DEPTNO
      7369 SMITH      CLERK       7902 17-DEC-80    800            20
      7499 ALLEN      SALESMAN    7698 20-FEB-81   1600    300     30
      7521 WARD       SALESMAN    7698 22-FEB-81   1250    500     30
      7566 JONES      MANAGER     7839 02-APR-81   2975            20
      7654 MARTIN     SALESMAN    7698 28-SEP-81   1250   1400     30
      7698 BLAKE      MANAGER     7839 01-MAY-81   2850            30
      7782 CLARK      MANAGER     7839 09-JUN-81   2450            10
      7788 SCOTT      ANALYST     7566 09-DEC-82   3000            20
      7839 KING       PRESIDENT        17-NOV-81   5000            10
      7844 TURNER     SALESMAN    7698 08-SEP-81   1500      0     30
      7876 ADAMS      CLERK       7788 12-JAN-83   1100            20
      7900 JAMES      CLERK       7698 03-DEC-81    950            30
      7902 FORD       ANALYST     7566 03-DEC-81   3000            20
      7934 MILLER     CLERK       7782 23-JAN-82   1300            10
    14 rows selected.
    SQL>Given the example in the question, execute immediate wouldn't work, unless the table only had one row or bulk collect was used.

  • F4 on LIFNR fails to capture the values in SELECT statement

    Hi all,
    In the last 3 days Ive faced two issues on F4 Helps and its freaking me out.
    The first issue I chose to ignore because of time-constraints and able to find a work-around.
    On the second issue Ive hit a brick-wall.
    Anyways here are my two issues.
    Issue I:
    I developed a custom report and in that Ive defined a selection-field(among half a dozen others) as follows:
    select-options: s_matnr for ekpo-matnr.
    On execution when I press F4 on matnr field I get the standard F4 Help. And then when i select the Material I want and hit Enter, the selected value fails to reflect in the Input Screen field. I continues to show blank as if Ive not selected anything. Not surprisingly the Report output was fetching the undesired results.
    Later I changed the declared to:
    select-options: s_matnr for mara-matnr.
    And it worked. However because of time constraints I did not dwelve into it anymore.
    This bring me to the Issue II:
    For a different Custom Report Ive defined Select_Options on LIFNR as follows:
    select-options: s_lifnr for lfa1-lifnr.
    Now the issue I face here is slighly different.
    On hitting F4 on the LIFNR field Im getting the standard F4 Help, and on selection Im getting the desired Vendor Number on the input screen.
    But the problem is while executing the report its not fetching me the records relevant to the selected LIFNR. In debugging it does show me that LIFNR contains the value but surprisingly its not returning any values to the Internal Table.
    Im out of ideas at this point of time, trying to figure out whats wrong.
    Any ideas on what could be wrong??
    pk
    PS: Im not using any function modules for the F4 help. Just the straight-forward Standard F4 functionality.

    >
    Eric Cartman wrote:
    > I meant here that you can exclude values in select options, for example you told there are 8 items for the vendor in the Z... table, let's say all these 8 items use the same material number, but (whatever reason) this material number is excluded from the selection in s_matnr (it is just an example, there could be many variations, you have a number of select options)
    What you say makes sense, but firstly I dont have a MATNR in my table and from the looks of it, its not advisable to use any other common field either. A vendor-wise search is of primary importance in this table. So cant really exclude that.
    if Rob's advise was helpful, than it looks like that the domain in the custom table for the field is not lifnr
    Well the Domain has always been LIFNR regardless of which Data Element I used.
    And the domain should probably be changed, but this might cause compatability issues.
    Rob,
    What kind of compatibility issues are you talking about? What I have right now is a custom table with some test data. So I guess its ok to change the Domain and Data Elements as I wish and Adjust the Table. Right?
    @Amit: I will look at your inputs a little more carefully and get back to you. Right now Im a little tied-up with other issues.
    Thanks everyone.
    pk
    Update:
    So... as I said earlier, when I used CONVERSION_EXIT_ALPHA_OUTPUT on LIFNR the selection on LIFNRs worked just fine. But unfortunately the rest of the select-options returned zero results(if I left the LIFNR select-option blank). I found the reason to be that because of the conversion routine the LIFNR values are taken as space. So i guess its looking into the database table for blank values of LIFNR, which is never the case and hence no values returned. Anyways, I found a work-around for this and for the moment its working fine...to some extent.
    Only constraint being that I cannot enter a range of values for LIFNR.
    Heres the code Im using right now. Thought it might be useful for future references or somebody wants to fine-tune it, is welcome to do so.
    if s_lifnr-low = space.
    select * from zpst001 into corresponding fields of table ist_zpst001
           where tno     IN s_tno
           and   ebelp   IN s_ebelp
           and   pspid   IN s_pspid
           and   werks  IN s_werks
           and   pick    IN s_pick
           and   pstatus IN s_status.
    else.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        INPUT         = s_lifnr-low
    IMPORTING
       OUTPUT        = s_lifnr1-low
    select * from zpst001 into corresponding fields of table ist_zpst001
           where tno     IN s_tno
           and   ebelp   IN s_ebelp
           and   pspid   IN s_pspid
           and   lifnr   eq s_lifnr1-low
           and   werks   IN s_werks
           and   pick    IN s_pick
           and   pstatus IN s_status.
    endif.
    pk
    Edited by: prashanth kishan on Nov 20, 2008 5:08 PM

  • What is the change occured by using the package in select statement

    Hi all,
    Can some one please tell me using the following package in the select statement of the view does it restricts the data or fetches the data
    what is the change occurred using the package for fetching the date column
    hr_discoverer.check_end_date (per_assignments_f.effective_end_date)
    Thanks in advance

    You can check the code -
    -- this function checks to see if a date is equivalent to the end of time(31-Dec-4712)
    -- if this is true it will return null else the actual end-date
    Cheers,
    Vignesh

  • How to avoid the below nested select statement

    Please any one help me how this select statemet is working and      how to avoid the nesetd select statement .
    if we avoid below nested , does it improve performace ?
    select field1 field2                                  
               into table w_feeds                                 
               from ZTable as t                         
               where field2 in r_feedf1                       
               and  POSITION_POSTDT =                           
               ( SELECT MAX( position_postdt ) FROM zTable 
                      where position_postdt le r_pdate-high    
                      and   field1 = t~field1 ).
    Thanks in Advace.

    Hi,
    Instead of nested query go for two separate queries. I see you are querying on the same table...so better go by this approach
    select field1 field2 POSITION_POSTDT
    into table w_feeds
    from ZTable
    where field2 in r_feedf1.
    Remove the where condition on POSITION_POSTDT
    Sort the table w_feeds by POSITION_POSTDT  Descending; So you will get data pertaining to Max Position_Postdt.
    Finally delete the other entries which are not Max.
    This will enhance the performance over the nested query.
    Regards
    Shiva
    Edited by: Shiva Kumar Tirumalasetty on Apr 27, 2010 7:00 PM
    Edited by: Shiva Kumar Tirumalasetty on Apr 27, 2010 7:00 PM

  • Regular Expression.  Select Statement.  Carriage Return

    Oracle 9i
    Using SQLPLUS
    I've read about regular expression and need some translation/explanation.
    I have a large table containing a varchar2 (free text) column. Users may have inserted carriage returns when they entered the data. I need to locate rows that contain carriage returns, select and display them. Later I'll need to update those rows to replace the carriage returns with a space.
    Can you assist with syntax. I believe use of a regular expression is required.
    Thanks

    for single characters like <CR> TRANSLATE() Doh. Never post at the end of a long day.
    As the other posters have pointed out, one-for-one single character substitution is normally done with REPLACE(), although TRANSLATE() also works. The more normal role for TRANSLATE() is situations where you want to substitute multiple characters, e.g.
    SQL> update <your table> set <your column> = replace (<your column> , chr(13)||chr(10), ' ');This substitutes a space for a carriage return and line feed combination.
    Cheers, APC

  • System memory isn't available afer the execution of select statement.

    hi experts, i have written the following query.
         SELECT BUKRS BLART BUDAT BLDAT MONAT
                 FROM BKPF INTO CORRESPONDING FIELDS OF TABLE IT_BKPF
                     WHERE BUKRS IN BKRS AND BUDAT IN DATE.
           IF SY-SUBRC EQ 0.
           SELECT BUKRS BELNR GJAHR DMBTR PSWSL ZUONR SGTXT AUFNR ALTKT SHKZG HKONT
              FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG FOR ALL ENTRIES IN IT_BKPF
                 WHERE BUKRS = IT_BKPF-BUKRS AND BELNR IN DOC AND HKONT IN GLE.
             IF SY-SUBRC EQ 0.
               SELECT BUKRS KTEXT FROM AUFK INTO CORRESPONDING FIELDS OF TABLE IT_AUFK
                  FOR ALL ENTRIES IN IT_BKPF WHERE BUKRS = IT_BKPF-BUKRS.
                 SELECT TXT50 TXT20 FROM SKAT INTO CORRESPONDING FIELDS OF TABLE IT_SKAT
                 FOR ALL ENTRIES IN IT_BSEG WHERE SAKNR = IT_BSEG-ALTKT.
                   ENDIF.
                   ENDIF.
    and transfering tha data into final table like this
    IT_FINAL[] = IT_BKPF[].
    LOOP AT IT_FINAL.
       READ TABLE IT_BSEG WITH KEY BUKRS = IT_FINAL-BUKRS.
       IF SY-SUBRC EQ 0.
      MOVE-CORRESPONDING IT_BSEG TO IT_FINAL.
       IT_FINAL-BELNR = IT_BSEG-BELNR.
       IT_FINAL-GJAHR = IT_BSEG-GJAHR.
       IT_FINAL-DMBTR = IT_BSEG-DMBTR.
       IT_FINAL-PSWSL = IT_BSEG-PSWSL.
       IT_FINAL-ZUONR = IT_BSEG-ZUONR.
       IT_FINAL-SGTXT = IT_BSEG-SGTXT.
       IT_FINAL-AUFNR = IT_BSEG-AUFNR.
       IT_FINAL-SHKZG = IT_BSEG-SHKZG.
       IT_FINAL-HKONT = IT_BSEG-HKONT.
       IT_FINAL-ALTKT = IT_BSEG-ALTKT.
         ENDIF.
         APPEND IT_FINAL.
       ENDLOOP.
       LOOP AT IT_FINAL.
         READ TABLE IT_AUFK WITH KEY BUKRS = IT_FINAL-BUKRS.
             IF SY-SUBRC EQ 0.
               IT_FINAL-KTEXT = IT_AUFK-KTEXT.
               ENDIF.
               APPEND IT_FINAL.
      ENDLOOP.
      LOOP AT IT_FINAL.
        READ TABLE IT_SKAT WITH KEY SAKNR = IT_FINAL-ALTKT.
         IF SY-SUBRC EQ 0.
           IT_FINAL-TXT50 = IT_SKAT-TXT50.
           IT_FINAL-TXT20 = IT_SKAT-TXT20.
           ENDIF.
           APPEND IT_FINAL.
      ENDLOOP.
    i am getting an runtime error'the system is configured incorrectly' even for the value of bukrs between 0001& 0005 and for budat 28.08.2006 & 28.05.2009.
    what happened?
    the current program had to be terminated because of an error when installing the R/3 system.
    the program had already reuested 399201216 bytes from the operating system with 'malloc' when the OS reported after a further memory request that there was no more memory space available.
    plz help....is there any problem in my query or do i need to change something from logic?
    thnks n regards,
    Ashmita

    Hi Ashmita,
    1. Whenever we use FOR ALL ENTRIES, we should check the content of the main table.
       BCOS if it empty, then ALL records will be fetched (in this case, from BSEG).
    2. When just put a IF condition
    if  IT_BKPF[] is not initial.
    select..... from BSEG... for all entries.....
    endif.
    3. This error may be coming because many many records are getting selected from BSEG and the memory on server is not available. Hence, one option is you may restrict your search. But before that please make sure the above check is in place.
    (You have already used if sy-subrc = 0, that may also work, but better to use the above)
    regards,
    amit m.

  • Change the default select statement in the execute_query function

    I want to list all records where c1 like '%ABD%'. So I set the following in the 'when_button_pressed' tigger:
    set_block_property ('block_name',DEFAULT_WHERE,'upper(c1) like '''||'%'||:block_name.blk_col_name||'%'||'''');
    execute_query;
    When I click on the button the :system.last_query holds the following select statement:
    select c1, c2, .. cn from t_n where upper(c1) like '%ABD%' and (upper(c1) = 'ABD' and (c1 like 'ab%' or c1 like 'aB%' or c1 like 'Ab%' or c1 like 'AB%')) order by c1
    Since the condition upper(c1) = 'ABD' is not satisfied oracle does not return any rows.
    My question is how to overcome this or is it possible to change the built-in select statement of execute_query.

    Have you tried this :
    'upper(c1) like upper('''||'%'||:block_name.blk_col_name||'%'||''''));

  • Performance Issue in Select Statement (For All Entries)

    Hello,
    I have a report where i have two select statement
    First Select Statement:
    Select A B C P Q R
         from T1 into Table it_t1
              where ....
    Internal Table it_t1 is populated with 359801 entries through this select statement.
    Second Select Statement:
    Select A B C X Y Z
         from T2 in it_t2 For All Entries in it_t1
              where A eq it_t1-A
                 and B eq it_t1-B
                 and C eq it_t1-C
    Now Table T2 contains more than 10 lac records and at the end of select statement it_t2 is populated with 844003 but it takes a lot of time (15 -20 min) to execute second select statement.
    Can this code be optimized?
    Also i have created respective indexes on table T1 and T2 for the fields in Where Condition.
    Regards,

    If you have completed all the steps mentioned by others, in the above thread, and still you are facing issues then,.....
    Use a Select within Select.
    First Select Statement:
    Select A B C P Q R package size 5000
         from T1 into Table it_t1
              where ....
    Second Select Statement:
    Select A B C X Y Z
         from T2 in it_t2 For All Entries in it_t1
              where A eq it_t1-A
                 and B eq it_t1-B
                 and C eq it_t1-C
    do processing........
    endselect
    This way, while using for all entries on T2, your it_t1, will have limited number of entries and thus the 2nd select will be faster.
    Thanks,
    Juwin

  • Query regarding Oracle SQL select statement

    Hi,
    How does Oracle ensures a consistent snapshot with the select statement
    without locking the table. My question is summarized with an example below:
    1. At time T1, Oracle select statement is fired and is fetching the result.
    2. At time T2, some DML operation is performed on the same table on which
    the select was executed and a commit was fired.
    3. At time T3, The Oracle select statement (Step 1) completes.
    My question is whether the records of transaction at time T2 will be visible at time T3 or not?
    If "not", then does it mean that Oracle retrieves the rows from the time of last commit.
    I would also like to know if for the above mechanism, Oracle would make use of the rollback segemt to access the rows at a particular instant of time.
    TIA
    Regards,
    Raj

    This is called Read Consistency in the oracle. Its all about SCN before starting the transaction.
    Lets say
    1. T1 executs SELECT statement on EMP table.
    2. T2 made an update on the EMP and commited.
    But, T1 only still sees only old image of the data not the new one. This is called read consistency.
    You will be having two images in the buffer, one is consistent and changed image.
    When the T1 give SELECT statement it notes the SCN of the transaction. Read oracle document about read consistency.
    SJH.

  • How: making column value as column of select statement

    Hi
    Quickly I have searched in this forum for following solution but not able to find it.
    I need to make a query in such a way that the value of one column in one table should act as a column-name of another table
    Eg:-
    tab1
    col1,col2,*col3*,col4
    tab2
    col11 col22 col33 col44
    row1 a b col3 d
    row2 aa bb cc dd
    So the query should be something like --- in row2 if the value is col3 then from tab1 I should pick the col3 in select statement (basically there will be some join in tab1 and tab2 )
    Hope I am able to make u all understand my query.
    regards

    Hi all,
    Sorry for late response.Just now I checked all the replies.
    Actually I tried in this way.
    CREATE OR REPLACE function Proc_caption (in_tan varchar2, in_order in number)
    return varchar2
    is
    d varchar2(100) ;
    begin
    SELECT col1 into d
    from tab1
    Where
    col2 = in_tanid
    AND col3 = 'Y'
    AND col4 = in_order ;
    return d ;
    Exception
    WHen No_DATA_FOund then
    return 'N' ;
    end ;
    create or replace procedure proc_generate_view(in_tan varchar2, in_soc varchar2)
    is
    x varchar2(2000);
    v4 varchar2(50) ;
    v5 varchar2(50) ;
    cnt number ;
    begin
    v4:= PROC_Caption (in_tan,4) ;
    v5:= PROC_Caption (in_tan,5) ;
    x := ' Create view v_generate as '
    || ' SELECT a , b, c, d ' ;
    if v4 <> 'N' THEN
    x := x || ' , ' || PROC_Caption (in_tan,4) || ' as Caption4 ' ;
    end if;
    if v5 <> 'N' THEN
    x := x || ' , ' || PROC_Caption (in_tan,5) || ' as Caption5 ' ;
    end if;
    x := x || ' FROM tab2 WHERE col1 = ''' || in_socid || ''''
    || ' AND col2 = ''' || in_tan || '''' ;
    select count(1) into cnt from USER_OBJECTS where OBJECT_NAME = 'V_GENERATE'
    and OBJECT_TYPE = 'VIEW' ;
    if cnt > 0 then
    EXECUTE IMMEDIATE ' DROP view V_GENERATE' ;
    END IF ;
    execute immediate x ;
    end ;
    NOTE:- I have just renamed the table name and column names in order to make it non confedential...
    I have created this successfully with actual table name and column names and able to get the result as per my requirement.
    regards

  • Plsql procedure containing select statement to fill page items

    I would like to fill items :P200_A and :P200_B and so on
    with the result of a SELECT which depends on the different values of many select lists.
    E.G. :P200_list_alpha with the list of values
    STATIC:less than 10;less,equal than 10;equal,above 10;above,indifferent;indiff
    :P200_list_beta with the list of values
    STATIC:active;active,passiv;passiv,excluded;excluded
    How do I write the select statement ? I think it has to be executed in an anonymous PLSQL Procedure (after submit).
    What is a convenient way to write the select statement ?
    I could imagine to use lots of IF , ELSIF, ELSE statements and in each branch (here 12 ) the whole/complet SELECT statement is written.
    How to solve this problem in an elegant way ?
    In my opinion the CASE statement could be helpful, but how to use it in the WHERE clause with this nested conditions ?

    I think I got it:
    SELECT col1, col2, col3, ...
    INTO :P200_A , :P200_B , ....
    FROM mytable_1, mytable_2
    WHERE mytable_1.col1 = mytable_2.col1
    AND (
    CASE
    WHEN :P200_LIST_ALPHA = 'less' AND NVL(TO_COL_WITH_ALPHA, 0) < 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'equal' AND NVL(TO_COL_WITH_ALPHA, 0) = 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'above' AND NVL(TO_COL_WITH_ALPHA, 0) > 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'indiff' THEN 1
    ELSE 0
    END = 1 )
    AND
    ( CASE
    WHEN :P200_LIST_BETA = 'active' AND TO_COL_WITH_BETA IN ( 'a', 'A', 'akt', 'AKT' ) THEN 1
    WHEN :P200_LIST_BETA = 'passive' AND TO_COL_WITH_BETA IN ( 'p', 'P' ) THEN 1
    WHEN :P200_LIST_BETA = 'excluded' AND TO_COL_WITH_BETA = 'X' THEN 1
    ELSE 0
    END = 1 )
    ;Edited by: wucis on Oct 24, 2011 4:09 PM

  • Short dump during select statement

    hi,
    i have to display 1 alv list output using REUSE_ALV_HIERSEQ_LIST_DISPLAY function module...so i have populated the data using select statement
    select EXIDV
        brgew meabm
               vegr1 erlkz vhilm erdat aenam
               ernam from vekp
                    into corresponding fields of table  gt_master
                    up to gs_test-select_amount rows.
    so the data is also getting populated to gt_master table before the function module...but after executing the function module..it is giving short dump...due to some standard program....any idea

    hi,
    my coding is
    Report       : ZBCALV                                                 *
    Author       :                                                       *
    SAP-User     :                                                       *
    Requester    :                                                       *
    Date         :                                                       *
    Specification:                                                       *
    Description  :                                                       *
    Changes      :                                                       *
    Change No    :                                                       *
    Author       :                                                       *
    SAP-User     :                                                       *
    Date         :                                                       *
    Reason / Desc:                                                       *
    REPORT   ZBCALV.
    **& Report  BCALV_TEST_HIERSEQ_LIST_EVENTS                              *
    *report  bcalv_test_hierseq_list_events.
    types: g_ty_t_exidv  type standard table of vekp,
           g_ty_t_brgew  type standard table of vekp,
           g_ty_t_vegr1  type standard table of vekp,
           g_ty_t_vekp    type standard table of vekp,
           g_ty_t_curr    type standard table of alv_cur,
          g_ty_s_vekp type alv_t_t2,
           g_ty_s_exidv  type alv_tab,
           g_ty_s_brgew   type alv_tab,
           g_ty_s_vegr1  type alv_chck,
           g_ty_s_vekp    type vekp,
           g_ty_s_curr    type alv_cur.
    constants:
    *con_vekp type lvc_fname value 'ALV_T_T2',
               con_scarr   type lvc_fname value 'ALV_TAB',      "#EC *
               con_spfli   type lvc_fname value 'ALV_CHCK',     "#EC *
               con_vekp    type lvc_fname value 'VEKP',
               con_scurx   type lvc_fname value 'ALV_CUR'.      "#EC *
    DATA                                                                 *
    tables: sscrfields.   " for processing the FCODEs in Selektion screens
    type-pools: slis, kkblo.
    class lcl_events_d1001 definition deferred.
    types: begin of g_ty_s_test,
             select_amount      type i,
             selected_recs_m    type i,
             selected_recs_s    type i,
             no_info_popup      type char1,
             info_popup_once    type char1,
             events             type lvc_fname occurs 0,
             events_exit        type slis_t_event_exit,
             events_info_popup  type lvc_fname occurs 0,
             list_append        type char1,
             list_amount        type i,
             list_append_status type i,
             layo_expand_field  type char1,
             layo_expand_all    type char1,
             vari_default       type char1,
             vari_save          type char1,
             bypassing_buffer   type char1,
             buffer_active      type char1,
           end   of g_ty_s_test,
           begin of g_ty_s_evt_exit.
    include type slis_event_exit.
    types:   text    type string,
           end   of g_ty_s_evt_exit,
           g_ty_t_evt_exit type standard table of g_ty_s_evt_exit.
    constants: con_true     type char1 value 'X',
               con_ok   type sy-ucomm value 'OK',
               con_exit type sy-ucomm value 'EXIT',
               con_canc type sy-ucomm value 'CANC',
               con_back type sy-ucomm value 'BACK',
               con_event_01 type lvc_fname value 'PF_STATUS_SET',
               con_event_02 type lvc_fname value 'USER_COMMAND',
               con_event_03 type lvc_fname value 'CALLER_EXIT',
               con_event_04 type lvc_fname value 'LIST_MODIFY',
               con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',
               con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',
               con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',
               con_event_08 type lvc_fname value 'REPREP_MODIFY',
               con_event_09 type lvc_fname value 'TOP_OF_PAGE',
               con_event_10 type lvc_fname value 'END_OF_PAGE',
               con_event_11 type lvc_fname value 'TOP_OF_LIST',
               con_event_12 type lvc_fname value 'END_OF_LIST',
               con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',
               con_event_14 type lvc_fname value 'END_OF_COVERPAGE',
               con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',
               con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',
               con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE',
               con_event_18 type lvc_fname value 'ITEM_DATA_EXPAND'.
    data: gs_test type g_ty_s_test.
    data: g_okcode type sy-ucomm.
    data: g_repid type sy-repid.
    data: gt_evt_exit type g_ty_t_evt_exit.
    data: gr_container_d1001   type ref to cl_gui_custom_container,
          gr_grid_d1001        type ref to cl_gui_alv_grid,
          gr_events_d1001      type ref to lcl_events_d1001.
    data: g_start_listinfo type slis_lineinfo.
    *addition for extra
    DATA: fieldcatalog  TYPE slis_t_fieldcat_alv with header line.
    types  : BEGIN OF gt_output ,
           EXIDV TYPE VEKP-EXIDV,
          VGBEL TYPE LIPS-VGBEL,
           BRGEW TYPE VEKP-BRGEW,
           VEGR1 TYPE VEKP-VEGR1,
           MEABM TYPE VEKP-MEABM,
           ERLKZ TYPE VEKP-ERLKZ,
          VSTAT TYPE NAST-VSTAT,
           VHILM TYPE VEKP-VHILM,
           ERDAT TYPE VEKP-ERDAT,
           AENAM TYPE VEKP-AENAM,
           VBELN TYPE VBELN_GEN,
           ERNAM TYPE VEKP-ERNAM,
            END OF gt_output.
    data: ls_output type gt_output,
          lt_output type gt_output occurs 0 WITH HEADER LINE .
    types  : BEGIN OF gt_item_output ,
           EXIDV TYPE VEKP-EXIDV,
           BRGEW TYPE VEKP-BRGEW,
            vEGR1 TYPE VEKP-VEGR1,
           TARAG TYPE VEKP-TARAG,
           NTGEW TYPE VEKP-NTGEW,
           MEABM TYPE VEKP-MEABM,
           BREIT TYPE VEKP-BREIT,
           HOEHE TYPE VEKP-HOEHE,
          ANW_STATUS TYPE VEKP-ANW_STATUS,
           MATNR TYPE VEPO-MATNR,
           VEGR2 TYPE VEKP-VEGR2,
           VSTEL TYPE VEKP-VSTEL,
           WERKS TYPE VEKP-WERKS,
           END OF gt_item_output.
    data: ls_ITEM_output type gt_ITEM_output,
           lt_ITEM_output type gt_ITEM_output occurs 0 with header line.
    types:       begin of g_ty_s_master.
    include type gt_output.
    types:   box                  type char1,
            lights               type char1,
             checkbox             type char1,
             expand               type char1,
             help                 type i,
             end   of g_ty_s_master,
           g_ty_t_master type standard table of g_ty_s_master,
           begin of g_ty_s_slave.
    include type gt_item_output.
    types:   box                  type char1,
            lights               type char1,
             checkbox             type char1,
             expand               type char1,
             help                 type i,
             end   of g_ty_s_slave,
           g_ty_t_slave type standard table of g_ty_s_slave.
    data: gt_master type g_ty_t_master with header line,
          gt_slave  type g_ty_t_slave with header line,
          gs_master type g_ty_s_master.
          CLASS lcl_events_d1001 DEFINITION
    class lcl_events_d1001 definition.
      public section.
        methods:
        data_changed         for event data_changed
                             of cl_gui_alv_grid
                             importing er_data_changed
                                       e_onf4
                                       e_onf4_before
                                       e_onf4_after,
        data_changed_finished
                             for event data_changed_finished
                             of cl_gui_alv_grid.
    endclass.                    "lcl_events_d1001 DEFINITION
          CLASS lcl_events_d1001 IMPLEMENTATION
    class lcl_events_d1001 implementation.
      method data_changed.
      endmethod.                    "data_changed
      method data_changed_finished.
      endmethod.                    "data_changed_finished
    endclass.                    "lcl_events_d1001 IMPLEMENTATION
    SELECTION-SCREEN                                                     *
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 30.
    selection-screen end of block gen.
    at selection-screen.
    AT SELECTION-SCREEN                                                  *
      case sscrfields-ucomm.
        when 'PB01'.
          call screen 1001 starting at 1 1 ending at 80 20.
      endcase.
    START-OF-SELECTION                                                   *
    start-of-selection.
      g_repid = sy-repid.
      gs_test-select_amount = p_amount.
    END-OF-SELECTION                                                     *
    end-of-selection.
      perform f01_call_list.
    *&      Form  f01_call_list
          text
    form f01_call_list.
      data: l_callback_program type sy-cprog,                   "#EC NEEDED
            ls_layo            type slis_layout_alv,
            lt_fcat            type slis_t_fieldcat_alv,
            ls_keyinfo         type slis_keyinfo_alv.
      data: ls_master type g_ty_s_master,
            ls_slave  type g_ty_s_slave.
      l_callback_program = sy-repid.
      perform f01_alv_get_outtab.
      perform f01_alv_set_layout changing ls_layo.
      perform f01_alv_set_fcat   changing lt_fcat.
      perform f01_alv_set_keyinfo changing ls_keyinfo.
      if gs_test-list_append_status ne 0.
        ls_layo-list_append = gs_test-list_append.
      endif.
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        exporting
          i_callback_program             = g_repid
          is_layout                      = ls_layo
          it_fieldcat                    = lt_fcat
          i_tabname_header               = 'GT_MASTER'
          i_tabname_item                 = 'GT_SLAVE'
          is_keyinfo                     = ls_keyinfo
        tables
          t_outtab_header                = gt_master
          t_outtab_item                  = gt_slave
        exceptions
          program_error                  = 1
          others                         = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " f01_call_list
    FORM f01_alv_set_fcat
    form f01_alv_set_fcat changing ct_fcat type slis_t_fieldcat_alv.
      data: lt_fcat_master type slis_t_fieldcat_alv,
            lt_fcat_slave  type slis_t_fieldcat_alv.
      clear ct_fcat[].
      perform f01_alv_set_fcat_master changing lt_fcat_master.
      perform f01_alv_set_fcat_slave  changing lt_fcat_slave.
      append lines of lt_fcat_master to ct_fcat.
      append lines of lt_fcat_slave  to ct_fcat.
    endform.                               " F01_ALV_SET_FCAT
    *&      Form  f01_alv_set_fcat_master
          text
    form f01_alv_set_fcat_master changing ct_fcat type slis_t_fieldcat_alv.
      data: ls_fcat type slis_fieldcat_alv,
            l_char(3) type c.
    get fieldcatalog
      fieldcatalog-fieldname   = 'EXIDV'.           "Field name in itab
      fieldcatalog-seltext_l  = 'HU-NR'.  "Column text
      FIELDCATALOG-KEY         = 'X'.
      FIELDCATALOG-TECH        = 'X'.
      fieldcatalog-col_pos     = 1.  "Column position
       fieldcatalog-ref_tabname     = 'VEKP'.
      fieldcatalog-outputlen   = 05.                "Column width
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VGBEL'.
      fieldcatalog-seltext_L   = 'SALES ORDER'.
      fieldcatalog-outputlen   = 15.
       fieldcatalog-ref_tabname     = 'LIPS'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'BRGEW'.
      fieldcatalog-seltext_l   = 'WEIGHT'.
      FIELDCATALOG-KEY         = 'X'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 3.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEABM'.
      fieldcatalog-seltext_l   = 'DIMENSION'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 4.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VEGR1'.
      fieldcatalog-seltext_l   = 'IPPC NR'.
      fieldcatalog-outputlen   = 15.
      FIELDCATALOG-KEY         = 'X'.
      fieldcatalog-col_pos     = 5.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'ERLKZ'.
      fieldcatalog-seltext_l   = 'STATUS'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 6.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VSTAT'.
      fieldcatalog-seltext_l   = 'PRINT STATUS'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 7.
       fieldcatalog-ref_tabname     = 'VSTAT'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VHILM'.
      fieldcatalog-seltext_l   = 'PACKING MATERIAL'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 8.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'ERDAT'.
      fieldcatalog-seltext_l   = 'CREATED FROM'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 9.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AENAM'.
      fieldcatalog-seltext_l   = 'LAST CHANGE'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 10.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VBELN'.
      fieldcatalog-seltext_l   = 'DELIVERY'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 11.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'ERNAM'.
      fieldcatalog-seltext_l   = 'CREATED BY'.
      fieldcatalog-outputlen   = 12.
      fieldcatalog-col_pos     = 8.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      ls_fcat-tabname = 'GT_MASTER'.
      modify ct_fcat from ls_fcat transporting tabname
                     where tabname ne ls_fcat-tabname.
      loop at ct_fcat into ls_fcat.
        if    ls_fcat-fieldname eq 'BRGEW'.
          or ls_fcat-fieldname eq ''.
    *§1.Set status of columns PLANETYPE and SEATSOCC to editable.
          ls_fcat-edit = 'X'.
          modify ct_fcat from ls_fcat.
        endif.
      endloop.
    endform.                    " f01_alv_set_fcat_master
    *&      Form  f01_alv_set_fcat_slave
          text
    form f01_alv_set_fcat_slave changing ct_fcat type slis_t_fieldcat_alv.
      data: ls_fcat   type slis_fieldcat_alv,
            l_char(3) type c.
      fieldcatalog-fieldname   = 'EXIDV'.           "Field name in itab
      fieldcatalog-seltext_l  = 'HU-NR'.  "Column text
      FIELDCATALOG-KEY         = 'X'.
       FIELDCATALOG-TECH        = 'X'.
      fieldcatalog-col_pos     = 1.  "Column position
       fieldcatalog-ref_tabname     = 'VEKP'.
      fieldcatalog-outputlen   = 05.                "Column width
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
    fieldcatalog-fieldname   = 'TARAG'.           "Field name in itab
      fieldcatalog-seltext_l  = 'HU-NR'.  "Column text
      fieldcatalog-col_pos     = 1.  "Column position
       fieldcatalog-ref_tabname     = 'VEKP'.
      fieldcatalog-outputlen   = 05.                "Column width
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NTGEW'.
      fieldcatalog-seltext_L   = 'WEIGHT HU'.
      fieldcatalog-outputlen   = 15.
       fieldcatalog-ref_tabname     = 'VEKP'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'BRGEW'.
      fieldcatalog-seltext_l   = 'WEIGHT'.
    FIELDCATALOG-KEY         = 'X'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 3.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'LAENG'.
      fieldcatalog-seltext_l   = 'LENGTH'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 4.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'BREIT'.
      fieldcatalog-seltext_l   = 'WIDTH'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 5.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'HOEHE'.
      fieldcatalog-seltext_l   = 'HEIGHT'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 6.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VEGR1'.
      fieldcatalog-seltext_l   = 'HU GR1'.
      FIELDCATALOG-KEY         = 'X'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 7.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VEGR2'.
      fieldcatalog-seltext_l   = 'HU GR2'.
      FIELDCATALOG-KEY         = 'X'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 8.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_l   = 'MAT NO'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 9.
       fieldcatalog-ref_tabname     = 'VEPO'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'VSTEL'.
      fieldcatalog-seltext_l   = 'SHIPPING'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 10.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'WERKS'.
      fieldcatalog-seltext_l   = 'PLANT'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-col_pos     = 11.
       fieldcatalog-ref_tabname     = 'VEKP'.
      APPEND fieldcatalog TO ct_fcat.
      CLEAR  fieldcatalog.
      ls_fcat-tabname = 'GT_SLAVE'.
      modify ct_fcat from ls_fcat transporting tabname
                     where tabname ne ls_fcat-tabname.
    endform.                    " f01_alv_set_fcat_slave
    FORM f01_alv_set_layout
    form f01_alv_set_layout changing cs_layout type slis_layout_alv.
    *... Display options
      cs_layout-colwidth_optimize      = con_true.
      cs_layout-no_colhead             = space.
      cs_layout-no_hotspot             = space.
      cs_layout-zebra                  = space.
      cs_layout-no_vline               = space.
      cs_layout-cell_merge             = space.
      cs_layout-no_min_linesize        = space.
      cs_layout-min_linesize           = space.
      cs_layout-max_linesize           = space.
      cs_layout-window_titlebar        = space.
      cs_layout-no_uline_hs            = space.
      cs_layout-no_sumchoice           = space.
      cs_layout-no_totalline           = space.
      cs_layout-totals_before_items    = space.
      cs_layout-totals_only            = space.
      cs_layout-totals_text            = space.
      cs_layout-no_subchoice           = space.
      cs_layout-no_subtotals           = space.
      cs_layout-subtotals_text         = space.
      cs_layout-numc_sum               = space.
      cs_layout-no_unit_splitting      = space.
    *... Interaction
      cs_layout-box_fieldname          = 'BOX'.
      cs_layout-box_tabname            = space.
      cs_layout-box_rollname           = space.
      if gs_test-layo_expand_field eq con_true.
        cs_layout-expand_fieldname       = 'EXPAND'.
      endif.
      cs_layout-hotspot_fieldname      = space.
      cs_layout-f2code                 = space.
      cs_layout-key_hotspot            = space.
      cs_layout-flexible_key           = space.
      cs_layout-reprep                 = space.
      cs_layout-group_buttons          = space.
      cs_layout-no_keyfix              = space.
      cs_layout-get_selinfos           = con_true.
      cs_layout-group_change_edit      = con_true.
      cs_layout-no_scrolling           = space.
      cs_layout-expand_all             = gs_test-layo_expand_all.
    *... Detailed screen
      cs_layout-detail_popup           = space.
      cs_layout-detail_initial_lines   = space.
      cs_layout-detail_titlebar        = space.
    *... PF-status
      cs_layout-def_status             = space.
    *... Display variants
      cs_layout-header_text            = space.
      cs_layout-item_text              = space.
      cs_layout-default_item           = space.
    *... colour
      cs_layout-info_fieldname         = space.
      cs_layout-coltab_fieldname       = space.
    *... others
      cs_layout-list_append            = space.
    endform.                               " F01_ALV_SET_LAYOUT
    *&      Form  f01_alv_set_keyinfo
          text
    form f01_alv_set_keyinfo changing cs_keyinfo type slis_keyinfo_alv.
      cs_keyinfo-header01 = 'EXIDV'.
      cs_keyinfo-item01   = 'EXIDV'.
      cs_keyinfo-header02 = 'BRGEW'."'CARRID'.
      cs_keyinfo-item02   = 'BRGEW'."."'CARRID'.
      cs_keyinfo-header03 = 'VEGR1'."'CONNID'.
      cs_keyinfo-item03   = 'VEGR1'."'CONNID'.
      cs_keyinfo-header04 = space.
      cs_keyinfo-item04   = 'VEGR2'."'FLDATE'.
      cs_keyinfo-header05 = space.
      cs_keyinfo-item05   = space.
    endform.                    " f01_alv_set_keyinfo
    FORM f01_alv_event_pf_status_set
    form f01_alv_event_pf_status_set using rt_extab type slis_t_extab.
                                                                "#EC *
      data: l_event type lvc_fname.                             "#EC NEEDED
      if gs_test-info_popup_once eq con_true.
        read table gs_test-events_info_popup into l_event
                   with key table_line = 'PF_STATUS_SET'.
        if sy-subrc ne 0.
          insert 'PF_STATUS_SET' into gs_test-events_info_popup index 1.
          message i000(0k) with text-t01.
        endif.
      elseif gs_test-no_info_popup eq space.
        message i000(0k) with text-t01.
      endif.
      set pf-status 'STANDARD' excluding rt_extab.
      set titlebar 'STANDARD'.
    endform.                               " F01_ALV_EVENT_PF_STATUS_SET
    *&      Form  F01_ALV_EVENT_BEFORE_LINE_OUTP
          text
    form f01_alv_event_before_line_outp
                          using rs_lineinfo type slis_lineinfo. "#EC *
      data: l_event type lvc_fname.                             "#EC NEEDED
      if gs_test-info_popup_once eq con_true.
        read table gs_test-events_info_popup into l_event
                   with key table_line = 'BEFORE_LINE_OUTPUT'.
        if sy-subrc ne 0.
          insert 'BEFORE_LINE_OUTPUT' into gs_test-events_info_popup
                                      index 1.
          message i000(0k) with text-t05.
        endif.
      elseif gs_test-no_info_popup eq space.
        message i000(0k) with text-t05.
      endif.
      format color off
             intensified off
             inverse off
             hotspot off
             input off.
      if rs_lineinfo-tabname eq 'GT_MASTER'.
        if
       gs_master-exidv ne gt_master-exidv or
           gs_master-brgew ne gt_master-brgew.
          write: / text-t05.
          write: /
         gt_master-exidv,
                   gt_master-brgew.
          gs_master = gt_master.
        endif.
        if gs_test-selected_recs_m eq rs_lineinfo-tabindex.
          clear gs_master.
        endif.
      endif.
    endform.                               " F01_ALV_EVENT_BEFORE_LINE_OUTP
    *&      Form  f01_alv_get_outtab
          text
    form f01_alv_get_outtab .
      field-symbols: .
       select
       exidv BRGEW VEGR1
        TARAG NTgew  meabm  BREIT HOEHE  VEGR2 VSTEL weRKS
                           from
                          (con_vekp) into corresponding fields of table
                           lt_slave up to gs_test-select_amount rows
                           where
                          exidv eq <ls_master>-exidv and
                           brgew eq -vegr1.
    append lines of lt_slave to gt_slave.
    endloop.
      sort gt_slave by exidv brgew vegr1.
    endif.
      describe table gt_master lines gs_test-selected_recs_m.
      describe table gt_slave  lines gs_test-selected_recs_s.
      clear gt_master.
      clear gt_slave.
    endform.                    " f01_alv_get_outtab
    *&      Module  d1001_pbo  OUTPUT
          text
    module d1001_pbo output.
    perform d1001_pbo.
    endmodule.                 " d1001_pbo  OUTPUT
    *&      Module  d1001_pai  INPUT
          text
    module d1001_pai input.
    perform d1001_pai.
    endmodule.                 " d1001_pai  INPUT

Maybe you are looking for

  • Unable to create web app items if Proximity Search is Enabled.

    I am using BC API to create web app items because I am getting the data from a third party website and wanted to save the data into web app by using BC API. I have a web app ( Name: "Map Overview" ) and the proximity search is enabled. When I test my

  • IPhone not recognized by iTunes

    For some reason my iPhone is no longer being recognized by iTunes. I'm running 8.2 and 3.0 firmware. I've tried different cables, ports, reinstalling iTunes, rebooting the computer, rebooting the phone and nothing. The phone is charging when connecte

  • Suddenly very slow export

    Hi.  Basically, my export has gone very slow.  I will give what details I can, but the main thing here is that I am doing what I have always done, but suddenly it is going very slow.  I export to MPEG2 DVD as that goes straight onto a DVD without fur

  • I pre-ordered Snow Leopard - and CS4 ?

    Amazon is taking pre-orders for the September release of Mac OS 10.6 - Snow Leopard.  Mine is now on order. And - my question is - will Photoshop CS4 (and related Creative Suite programs) work on 10.6 ????? I will make the swap on my least-used compu

  • Matrix in combox ?

    i want to retrive  data from  table matrix in coloum combo (dd no) . but value not coming my code Private Sub DrawRAKELDForm(ByVal oForm As SAPbouiCOM.Form)         '// Adding a Matrix item         oItem = oForm.Items.Add("Matrix2", SAPbouiCOM.BoForm