Hi.i want to select only rows with no child rows

Hi.i want to select only rows with no child rows in hierarchical queries.

http://www.rampant-books.com/10g_80.htm
bye
TPD

Similar Messages

  • Select only words with capitals

    If I have data stored in my Database much like this Sentence, with Some words containing uppercase letters and some not, what is the simplest Way to select only those words which contain upperCase letters?
    From the above sentence, for example, I would want to see the result :
    If I Database Sentence Some Way upperCase
    Note that the uppercase letter(s) will not always be at the start of a word.
    Is there a simple way to achieve this? I started dabbling with REGEXP_LIKE, but my regular expressions are pretty hopeless at the best of times :-(

    I've seen more regular expression syntax explanation documents in my time than you've had hot dinners, probably. I'm afraid I still plead complete ignorance and find constructing anything other than the very simplest incredibly difficult, even with the help of various freebie utilities and tools you can download to help you do the job. It's a blind spot I have, and it's not going away any time soon. So yes, I have seen before at least the first of those pages you linked to, but I can't say it's helped me much.
    For the rest, I gave an example of the input and output I'd like to achieve. Your suggestion regarding the lastname column from the EMP table doesn't help in that regard, and even when I translate it into something approaching my actual situation, it doesn't do what I need it to do:
    create table test_t1 (col1 varchar2(4000));
    insert into test_t1 values ('If I have data stored in my Database much like this Sentence, with Some words containing uppercase letters and some not, what is the simplest Way to select only those words which contain upperCase letters?');
    commit;
    SQL> select * from test_t1 where col1 like '^[A-Z]%';
    no rows selectedAlso, you've apparently used the "^" character to indicate that it's the beginning of the string that should be checked for containing an uppercase character, but as I mentioned, my uppercase characters can appear anywhere within the string.
    Anyone else, please?

  • How to select only rows which column has a null value?

    Hi,
    I adds rows to my table with data field set to null;
    "INSERT INTO administrator.subzamowienia (subzamowienia.id_zamowienia,subzamowienia.id_transakcji,subzamowienia.nazwa_o,subzamowienia.nazwa_produktu,subzamowienia.ilosc,subzamowienia.nip_d,subzamowienia.data_realizacji) VALUES (administrator.id_zamowienia.curval,'0','PRAGA','Witaminy','2','43224','0');"
    Then i would like to update this field after a time with new date.
    To do this i need to know which rows has still data field set to null, i try sth like this but it doesn't work
    "SQL> select * from administrator.subzamowienia where subzamowienia.data_realizacji='null';
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='null'
    BŁĄD w linii 1:
    ORA-01841: (pełny) rok musi być pomiędzy -4713 i +9999 i nie może być 0
    or
    "SQL> select * from administrator.subzamowienia where subzamowienia.data_realizacji='0';
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='0'
    BŁĄD w linii 1:
    ORA-01840: wartość wejściowa jest za krótka dla formatu daty
    how to choose this rows?

    Hi,
    VALUES (administrator.id_zamowienia.curval,'0','PRAGA','Witaminy','2','43224','0');I don't see null value...
    select * from administrator.subzamowienia where subzamowienia.data_realizacji='null'Should be :
    select * from administrator.subzamowienia where subzamowienia.data_realizacji is nullNicolas.

  • Help with this sql. Select only employees from a distinct Org??

    Hi guys, simple query.
    create table balancetest(emp_id number, balance_id number, balance number, org number);
    insert into balancetest values (111, 1, 1, 0);
    insert into balancetest values (111, 1, 1, 0);
    insert into balancetest values (111, 2, 1, 1);
    insert into balancetest values (222, 1, 2, 1);
    insert into balancetest values (333, 3, 4, 3);
    insert into balancetest values (333, 3, 4, 2);
    commit;
    SQL> select * from balancetest;
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          1          1          0
           111          1          1          0
           111          2          1          1
           222          1          2          1
           333          3          4          3
           333          3          4          2
    6 rows selected.As you can see, emp_id 111 appears on different Org (0 and 1). I need to calculate the balance but the requirement says that I need to retrieve employees appearing only in 1 org.. It won't matter which org is selected (the business rules ensure balance will be the same), as long as if an employee is in multiple org, this employee is selected only once for an org. So, my result will be something like:
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          1          1          0
           111          1          1          0
           222          1          2          1
           333          3          4          3
           333          3          4          2or,
        EMP_ID BALANCE_ID    BALANCE        ORG
           111          2          1          1
           222          1          2          1
           333          3          4          3
           333          3          4          2In other words, an employee must appear only in 1 org in my result.
    any ideas? I tried:
    select * from balancetest bal1
    where not exists ( select bal2.emp_id from
                               balancetest bal2
                               where bal2.emp_id = bal1.emp_id
                               and bal2.org <> bal1.org
                               );But I guess it won't be that simple!!

    Hi,
    You can find the lowest-numbered org for each employee like this:
    SELECT    emp_id
    ,         MIN (org)  AS min_org
    FROM      balancetest
    GROUP BY  emp_id;You can get the results you want by selecting only rows from balancetest that match a row in this the result set above. There are many ways to do that, such as a join:
    WITH  g  AS
        SELECT    emp_id
        ,         MIN (org)  AS min_org
        FROM      balancetest
        GROUP BY  emp_id
    SELECT  b.*
    FROM    balancetest  b
    JOIN                 g  ON  b.emp_id = g.emp_id
                            AND b.org    = g.min_org;

  • When selecting a row from a view with a nested table I want just ONE entry returned

    Does a nested table in a view "EXPLODE" all values ALWAYS no matter the where clause for the nested table?
    I want to select ONE row from a view that has columns defined as TYPE which are PL/SQL TABLES OF other tables.
    when I specify a WHERE clause for my query it gives me the column "EXPLODED" with the values that mathc my WHERE clause at the end of the select.
    I dont want the "EXPLODED" nested table to show just the entry that matches my WHERE clause. Here is some more info:
    My select statement:
    SQL> select * from si_a31_per_vw v, TABLE(v.current_allergies) a where a.alg_seq
    =75;
    AAAHQPAAMAAAAfxAAA N00000 771 223774444 20 GREGG
    CADILLAC 12-MAY-69 M R3
    NON DENOMINATIONAL N STAFF USMC N
    U
    E06 11-JUN-02 H N
    05-JAN-00 Y Y
    USS SPAWAR
    353535 USS SPAWAR
    SI_ADDRESS_TYPE(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NUL
    L, NULL)
    SI_ADDRESS_TAB()
    SI_ALLERGY_TAB(SI_ALLERGY_TYPE(69, 'PENICILLIN', '11-JUN-02', NULL), SI_ALLERGY
    TYPE(74, 'SHELLFISH', '12-JUN-02', NULL), SIALLERGY_TYPE(68, 'PEANUTS', '13-J
    UN-02', NULL), SI_ALLERGY_TYPE(75, 'STRAWBERRIES', '13-JUN-02', NULL))
    SI_ALLERGY_TAB()
    75 STRAWBERRIES 13-JUN-02
    *******Notice the allergy entry of 75, Strawberries, 13-JUN-02 at the
    end. This is what I want not all the other exploded data.
    SQL> desc si_a31_per_vw
    Name Null? Type
    ........ Omitted uneeded previous column desc because of metalink
    character limit but the view is bigger then this.......
    DEPT_NAME VARCHAR2(20)
    DIV_NAME VARCHAR2(20)
    ADDRESSES SI_ADDRESS_TAB
    CURRENT_ALLERGIES SI_ALLERGY_TAB
    DELETED_ALLERGIES SI_ALLERGY_TAB
    SQL> desc si_allergy_tab
    si_allergy_tab TABLE OF SI_ALLERGY_TYPE
    Name Null? Type
    ALG_SEQ NUMBER
    ALG_NAME VARCHAR2(50)
    START_DATE DATE
    STOP_DATE DATE
    SQL> desc si_allergy_type
    Name Null? Type
    ALG_SEQ NUMBER
    ALG_NAME VARCHAR2(50)
    START_DATE DATE
    STOP_DATE DATE

    Can you explain what do you mean by the following?
    "PL/SQL tables (a.k.a. Index-by tables) cannot be used as the basis for columns and/or attributes"There are three kinds of collections:
    (NTB) Nested Tables
    (VAR) Varrying Arrays
    (IBT) Index-by Tables (the collection formerly known as "PL/SQL tables")
    NTB (and VAR) can be defined as persistent user defined data types, and can be used in table DDL (columns) and other user defined type specifications (attributes).
    SQL> CREATE TYPE my_ntb AS TABLE OF INTEGER;
    SQL> CREATE TABLE my_table ( id INTEGER PRIMARY KEY, ints my_ntb );
    SQL> CREATE TYPE my_object AS OBJECT ( id INTEGER, ints my_ntb );
    /IBT are declared inside stored procedures only and have slightly different syntax from NTB. Only variables in stored procedures can be based on IBT declarations.
    CREATE PROCEDURE my_proc IS
       TYPE my_ibt IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;  -- now you see why they are called Index-by Tables
       my_ibt_var my_ibt;
    BEGIN
       NULL;
    END;That sums up the significant differences as it relates to how they are declared and where they can be referenced.
    How are they the same?
    NTB and VAR can also be (non-persistently) declared in stored procedures like IBTs.
    Why would you then ever use IBTs?
    IBTs are significantly easier to work with, since you don't have to instantiate or extend them as you do with NTB and VAR, or
    Many other highly valuable PL/SQL programs make use of them, so you have to keep your code integrated/consistent.
    There's a lot more to be said, but I think this answers the question posed by Sri.
    Michael

  • Selecting only required number of rows in an external table

    Hi,
    I have an external table with many flat files as source.. I know I can skip rows using the keyword 'SKIP'. I want to select only first 'n' rows from all the flat files as the rows available in my oracle external table. Is this Possible?...
    eg..
    Flat file 1
    c1,c2
    123,45
    132,56
    'ahgh',34
    'dfd',22
    Flat file 2
    c1,c2
    56,1212
    545,45
    'ahcsd',4
    'dds',24
    I want to create a file which contains the rows, means only the 2nd and 3rd rows from each flat files
    123,45
    132,56
    56,1212
    545,45
    Thanks in Advance
    Poulose

    If this means selecting from all these flat files at the same time then it might get a bit cumbersome. Basically you will have to create an external table for each flat file and then do something like this:
    SELECT * FROM
      ( select c1, c2 from
         ( select c1, c2, rownum as rn from ext_table_1 )
        where rn in (2, 3)
       union all
        select c1, c2 from
         ( select c1, c2, rownum as rn from ext_table_2 )
        where rn in (2, 3)
       union all
      select c1, c2 from
         ( select c1, c2, rownum as rn from ext_table_3 )
        where rn in (2, 3)
       union all
    /Cheers, APC

  • Select specific row

    Dear all,
    I have a table containing 50 rows and I would like to select only rows between 20 and 30. Can you help me to do this with only one select statement or whatever you suggest. Also is it possible to do it without using rownum
    Thanks
    SL

    I do want want any specific criteriaSo in fact you should have called this thread Select unspecific rows, hmmm?
    If you're really not bothered about the precise number of rows then the SAMPLE cause is a very performant way of getting a random subset of rows...
    SQL> SET TIMING ON
    SQL> SELECT count(*) FROM big_t
      2  /
      COUNT(*)
         31764
    Elapsed: 00:00:01.04
    SQL> SELECT count(*) FROM
      2  ( SELECT *  FROM big_t SAMPLE (0.1) )
      3  /
      COUNT(*)
            33
    Elapsed: 00:00:00.03
    SQL> SELECT count(*) FROM
      2  ( SELECT *  FROM big_t SAMPLE (0.1) )
      3  /
      COUNT(*)
            32
    Elapsed: 00:00:00.01
    SQL> Cheers, APC

  • JDBC: How  to select only those records which contains col1 is NULL

    Hi All,
    In JDBC SELECT scenario.
    I wants to select only those records which contains col1 is NULL.
    I am trying as follows:
    <key>
    <col1 isNull="TRUE" />
    </key>
    but in moni/monitoring i am getting Following Error
    006-12-01 19:35:20 Error Unable to execute statement for table or stored procedure. 'BG_SALARY_SEND_SAP_D' (Structure 'SELECT') due to java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
    2006-12-01 19:35:20 Error Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'BG_SALARY_SEND_SAP_D' (structure 'SELECT'): java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
    Please suggest how to do select rows with col1 is null.
    Regards

    Rohan,
    isNull= true is used to make the KEY element not mandatory.
    In your case, if the select query is
    select emp from emptest where empno is null
    , then the datatype will be,
    <root>
    <StatementName>
    <dbTableName action=”SELECT”>
      <table>emptest</table>
    <access>
    <emp></emp>
    </access>
    <key1>
    <b><empno hasQuot="NO">is null</empno></b>
    </key1>
    </dbTableName> 
    </StatementName>
    </root>
    I dont have a DB access to try this, but I think this should work.
    If this doesnt work, then you would need to use SQL_QUERY,
    <root>
    <StatementName>
    <anyName action=” SQL_QUERY”>
    <access>select emp from emptest where empno is null</access>
    </anyName > 
    </StatementName>
    </root>
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Regards,
    Bhavesh

  • How to select multiple rows from List Of Values

    Hello,
    I use ADF 11g to create my list of values (LOV). I want to select multiple rows from it. but i can't.
    so how i can select many rows to set them in my adf table.
    Thank in advance

    Hi,
    LOV is map to an attribute in the viewObject so it will return only one value or more values from selected row. You can't select multiple rows from LOV.
    But you can do this by using popup which you can select multiple rows and insert the selected rows to another table.
    This blog post explain how to achieve this :
    http://husaindalal.blogspot.com/2009/11/search-from-popup-and-add-to-new-table.html#comments
    Sameh Nassar

  • How can i select some row from multiple row in the same group of data

    I want to select some row from multiple row in the same group of data.
    ColumnA        
    Column B
    1                  OK
    1                   NG
    2                   NG
    2                          NG
    3                          OK
    3                          OK
    I want the row of group of
    ColumnA if  ColumnB contain even 'NG'
    row , select only one row which  Column B = 'NG'
    the result i want = 
    ColumnA         Column B
    1                         NG
    2                   NG
    3                          OK
    Thank you

    That's some awful explanation, but I think this is what you were driving at:
    DECLARE @forumTable TABLE (a INT, b CHAR(2))
    INSERT INTO @forumTable (a, b)
    VALUES
    (1, 'OK'),(1, 'NG'),
    (2, 'NG'),(2, 'NG'),
    (3, 'OK'),(3, 'OK')
    SELECT f.a, MIN(COALESCE(f2.b,f.b)) AS b
    FROM @forumTable f
    LEFT OUTER JOIN @forumTable f2
    ON f.a = f2.a
    AND f.b <> f2.b
    GROUP BY f.a

  • How to select perticular row in table control for BDC

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

  • Select all rows in af:table

    Hi,
    I need to select all rows in af:table, not only on current page.
    I have following code on custom select all action:
    getTable2().getSelectionState().addAll()and on button that needs to perform some action on selected rows I have this code
            Set selectedRowSet = getTable2().getSelectionState().getKeySet();
            if (!selectedRowSet.isEmpty()) {
                Iterator it = selectedRowSet.iterator();
                while(it.hasNext()) {
                    Key key = (Key)it.next();
           }selectedRowSet.iterator() method throws java.lang.ClassCastException: oracle.jbo.Key.
    When I select rows with af:tableSelectMany, which is inside selection facet and selects only rows on current page, this works fine.
    Any ideas?
    Thanks

    Hi,
    you can only access those data that is queried and part of the CollectionModel to the time you select all
       RichTable _table = employeesBackingBean.getEmployeeTable1();
       RowKeySet rks = new RowKeySetImpl();
      CollectionModel model = (CollectionModel)_table.getValue();
      int rowCount = model.getRowCount();
          for (int i = 0; i < rowCount; i++) {
               model.setRowIndex(i);
               //note that in the simple POJO case, the row key is the same
               //as the index. However, it would be wrong to just rely on this
               //because other models or custom table models my return a more
               //comples key. Therefore we iterate over the available rows to
               //obtain the keys.
               Object key = model.getRowKey();
               //add the row keys to the RowKeySet to mark selected
               rks.add(key);
       _table.setSelectedRowKeys(rks);
       AdfFacesContext.getCurrentInstance().addPartialTarget(_table);Frank
    Frank

  • How to select a row from duplicate set of records?

    I want to select a row from a duplicate set of records.
    below is the explanation of my requirement.
    select * from test_dup;
    COL_BILL     COL_SERV     COL_SYS
    b1     s1     c
    b1     s1     g
    b1     s2     c
    b1     s2     g
    b2     s2     g
    b2     s3     c
    b2     s3     g
    b3     s3     c
    Here what I want is, for a distinct col_sys if col_bill and col_serv is same then I need the row where col_sys='c'
    from the above result set I need the following:
    b1     s1     c
    b1     s2     c
    b2     s3     c
    I am using the following SQL query which is giving me the correct result set. But it will hamper the performance because there are total 45 columns in the table and total volume is around 50 million.
    select * from test_dup where col_bill||col_serv in (
    select col_bill||col_serv from (
    select col_bill,col_serv,count(*) from test_dup
    where col_sys in ('c','g')
    group by col_bill,col_serv having count(*) >1)) and
    col_sys='c';
    Can anyone please provide me the optimize SQL query for the same.

    Hi,
    Another way,
    SQL> with test_dup
    as
         select 'b1' col_bill, 's1' col_serv, 'c' col_sys from dual union all
         select 'b1', 's1', 'g' from dual union all
         select 'b1', 's2', 'c' from dual union all
         select 'b1', 's2', 'g' from dual union all
         select 'b2', 's2', 'g' from dual union all
         select 'b2', 's3', 'c' from dual union all
         select 'b2', 's3', 'g' from dual union all
         select 'b3', 's3', 'c' from dual
      select col_bill, col_serv, min(col_sys) col_sys
        from test_dup
       where col_sys in ('c', 'g')
    group by col_bill, col_serv
      having count( * ) > 1
         and count(nullif(col_sys, 'g')) > 0;
    CO CO C
    b1 s1 c
    b2 s3 c
    b1 s2 c
    3 rows selected.Regards
    Peter
    Edited by: Peter on Feb 18, 2009 1:10 AM
    - Added test data, thanks Karthick

  • BDC : to select different rows in table control

    Hi,
    I have to fill many rows in table control and want to select different row one by one  in increasing order which rows are filled in BDC.
    Can anybody suggest me with coding...
    thanks
    naresh

    Hi ,
    I am attaching sample code for BDC transaction code is : FV11 , This code is also contains poage down concepts . By using this page down concept you can add number of item fields
    Program Name        : ZFV11_NEW
    Program Description : To Upload Condition Records-FV11
    Author              : Jagadish
    Start Date          : 11/06/2007
    REPORT zfv11
           NO STANDARD PAGE HEADING LINE-SIZE 255.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    TABLES : t100.
    DATA: BEGIN OF record OCCURS 0,
    data element: KSCHA
            kschl(004),               "Condition Type
    data element: SELKZ_LIST
          selkz(001),
    data element: WERKS_D
            werks(004),               "Plant
    data element: ELIFN
            lifnr(010),               "Vendor
    data element: MATNR
            matnr(018),               "Material No.
    data element: KBETR_KOND
            kbetr(016),               "Amount
    data element: KODATAB
            datab(010),               "Condition Validity Date from
    data element: KODATBI
            datbi(010),               "Condition Validity To
    data element: MWSKZ
            mwsk1(002),
          END OF record.
    DATA : BEGIN OF it_new OCCURS 0,                    " Internal Table for Header Data
           kschl(004),
           werks(004),
           lifnr(010),
           END OF it_new.
    DATA : BEGIN OF it_item OCCURS 0,                  " Internal table for Item Data
          werks(004),
          lifnr(010),
          matnr(018),
          kbetr(016),
          datab(010),
          datbi(010),
          mwsk1(002),
          END OF it_item.
    DATA : cnt(2) TYPE n,
           fld(25) TYPE c.
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    DATA : n TYPE n.
    DATA:
         BEGIN OF t_data OCCURS 0,
               data TYPE string,
         END   OF t_data.
    DATA:BEGIN OF it_mess OCCURS 0,
      msgtyp(5),
       lms(200),
       msgv1(50),
        END OF it_mess.
    DATA : p_mode    TYPE c.
    DATA:it_msgtab TYPE STANDARD TABLE OF  bdcmsgcoll WITH HEADER LINE,
       it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
    DATA :  l_mstring(150).
    DATA : BEGIN OF bdcdata OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdcdata.
    PARAMETERS : p_file1 LIKE rlgrap-filename.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      PERFORM file_selection.
      PERFORM data_upload.
      PERFORM table_control.
      LOOP AT it_new.
        REFRESH bdcdata.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RV13A-KSCHL'
                                      it_new-kschl.
        PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV130-SELKZ(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=WEIT'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KONP-KBETR(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'KOMG-WERKS'
                                      it_new-werks.
        PERFORM bdc_field       USING 'KOMG-LIFNR'
                                      it_new-lifnr.
    DATA: "X(5) TYPE N,
             N(5) TYPE N.
       N = 0.
       LOOP AT it_item.
         N = N + 1.
       ENDLOOP.
       "X = 1.
       CNT = 1.
       DO N TIMES.
         IF CNT > 19.
           perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
           perform bdc_field       using 'BDC_OKCODE' '=P+'.
           PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
           CNT = 1.
         ENDIF.
        cnt = 1.
        LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
          CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-matnr.
          CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
          PERFORM bdc_field USING fld it_item-kbetr.
          CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-datab.
          CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-datbi.
          CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
          PERFORM bdc_field USING fld it_item-mwsk1.
          cnt = cnt + 1.
          if cnt = 20.
            perform bdc_field       using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
            perform bdc_field       using 'BDC_OKCODE' '=P+'.
            PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
            CNT = 1.
           endif.
    CLEAR it_item.
        ENDLOOP.
       ENDDO.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1363'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KONP-MWSK1(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SICH'.
        CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
                                            UPDATE 'S'
                                           MESSAGES  INTO it_msgtab.
        CLEAR bdcdata[].
        PERFORM error.
      ENDLOOP.
           Start new screen   -Subroutine     for screen s                                      *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
           Insert field        -Subroutine   for field s                                         *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  file_selection
    FORM file_selection .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE1'
        IMPORTING
          file_name     = p_file1.
    ENDFORM.                    " file_selection
    *&      Form  data_upload
    FORM data_upload .
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
        I_FIELD_SEPERATOR        =
           i_line_header            =  'X'
           i_tab_raw_data           =  it_raw
           i_filename               =  p_file1
         TABLES
           i_tab_converted_data     = record
        EXCEPTIONS
           conversion_failed        = 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.                    " data_upload
    *&      Form  error
    FORM error .
      LOOP AT it_msgtab.
        IF it_msgtab-msgtyp = 'E'.
          SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
                                    AND   arbgb = it_msgtab-msgid
                                    AND   msgnr = it_msgtab-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
              REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
           WRITE: / it_msgtab-msgtyp, l_mstring(150).
          ELSE.
           WRITE: / it_msgtab.
            it_mess-msgtyp = it_msgtab-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = it_msgtab-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " error
    *&      Form  table_Control
    FORM table_control .
    SORT record BY lifnr matnr.
      LOOP AT record.
        ON CHANGE OF record-lifnr.
          MOVE-CORRESPONDING record TO it_new.
          APPEND it_new.
        ENDON.
        MOVE-CORRESPONDING record TO it_item.
        APPEND it_item.
      ENDLOOP.
    ENDFORM.                    " table_Control
    Reward if useful
    Thanks
    Jagadeesh.G

  • Select only first 10 chars from the field in a table while writlng a selec

    hi experts,
    In a table  one field contains a value of above 10 characters (ex 10 or 15 or 20 characters).But i want to select
    only first 10 characters from this field while writing a select statement.
    This logic should be included in select statement.
    please gime immediate solution.
    My question is understood.

    Hi,
    Try this one
    data : begin of itab occurs 0,
            maktx(10) type c,
    end of itab.
    " though the length of MAKTX is 40 you only get 10 chars
    select maktx from makt into table itab up to 10 rows.
    if sy-subrc is initial.
    endif.
    " Suppose the field name of table you want to select is MAKTX then declare
    " Your internal table in the above manner, it will automatically fit into it and will get 10 Chars only
    " Instead of burding the select query / DB interface use the above.
    Cheerz
    Ram

Maybe you are looking for

  • How do I get rid of the contact bar on my FaceTime screen

    How do I get rid of the contact bar off my FaceTime screen. I went to add a contact and the bar comes up. Now I can't figure out how to get it off my screen. I am tapping everywhere.

  • IDVD Preference setting for NTSC/PAL

    I now understand that DVD's encoded to NTSC will almost certainly playback in UK on modern DVD Players. My question is this (iLife'06): If I have an iMovie encoded as NTSC, what will changing the setting in iDVD Preferences from NTSC to PAL actually

  • Raw material transfer

    hi all i have a query on transfer of raw material from one plant to another plant. my question is: when we transfer raw material from one plant to another plant in sales are we going to create delivery? can anyone please give the process flow for thi

  • SCSM 2012 - Reporting on resolution details

    I am trying to create a report showing the resolution using the cubes available to me in SCSM. I have been able to find within the pivot table field list the name for the field where you enter the resolution details, I want the full text in my report

  • Lens list and help

    Hi all, I bought and downloaded my LR3 upgrade yesterday and installed it on my Win7 64-bit box. However I have a few issues that I'm not sure whether they're expected or not :-) If I click on Help > Lightroom Help or hit F1, I get a dialog box that