Displaying non existing vendors from lfa1 table..

Hi All..
I have a selection screen range for vendor number: LIFNR.
I want to display all the vendor numbers that are not present in the LFA1 table.. ( If the user gives the vendor range on the selection screen)..
Any idea or suggestions on how to approach would be great..
Thanks a lot..

OK then , pl try thye following piece of code...
report  zlif                                    .
data:  w_num type i.
data: begin of itab occurs 0,
        lifnr type lifnr,
      end of itab.
data itab2 like itab occurs 0 with header line.
data w_lifnr type lifnr.
select-options: s_lifnr for w_lifnr.
ranges: r_lifnr for w_lifnr.
select lifnr into table itab from lfa1.
find the number of entries
w_num = s_lifnr-high - s_lifnr-low.
w_num = w_num + 1.
do w_num times.
  if sy-index = 1.
    w_lifnr = s_lifnr-low.
  else.
    w_lifnr = w_lifnr + 1.
  endif.
  r_lifnr-sign = 'I'.
  r_lifnr-option = 'EQ'.
  r_lifnr-low = w_lifnr.
  append r_lifnr.
enddo.
loop at r_lifnr.
  read table itab with key lifnr = r_lifnr-low.
  if sy-subrc ne 0.
    write:/ r_lifnr-low.
  endif.
endloop.
Regards,
Suresh Datti

Similar Messages

  • Displaying a non existent column from a Table.

    Hi
    I have an SQL Query that returns back a count of all the
    entities
    select count(*)'COUNTER',
    id_entity 'ENTITY'
    from  claim 
    where id_status = 'O'
    group by id_status,id_entity 
    order by id_entity ASC
    Output
    COUNTER ENTITY
    169     AGL
    6       DBC
    28      DELI would like to put a non existent column called 'Type' with a counter
    of 0,so that the output looks like :
    COUNTER ENTITY
    0       TYP
    169     AGL
    6       DBC
    28      DELIs this possible ? What do I need to change in my select clause
    for this?
    Please help

    monalalwani, do you mean something like this?
    you have -
    1 select count(*) as counter, deptno
    2 from emp
    3* group by deptno
    UT1 > /
    COUNTER DEPTNO
    5 10
    5 20
    6 30
    -- but want counter = 0 for dept 0
    UT1 > select count(*) as counter, deptno
    2 from emp
    3 group by deptno
    4 union
    5 select 0, 00
    6 from dual
    7 /
    COUNTER DEPTNO
    0 0
    5 10
    5 20
    6 30
    HTH -- Mark D Powell --

  • Delet the vendor from LFA1 table in SAp

    hi,
    i have working in SAP IS-retail,
    i have creating wrong vendor, is it possible to delete the vendor from the system
    please guide me.
    thanx in advance,

    Dear Chirpa
    Kindly please open the thread in a IS Forum. Solution Manager cannot help answer your question and hence the thread is closed.

  • Rollup and Display Non Existing Rows

    This query produces the results except that I would like to have a final total and overal average (excluding the "No GPA"). Shown as XXX in the output sample. Can this be done in one query or do I need to union for the summary?
    Additionally, if possible, how can I write some statements so that rows that may not exist can be displayed on the output? Example: there are no GPAs in the range of 0.1 thru 0.9. My query results do not show the first two rows, however, the users would like to see these rows displayed regardless of the existence or not.
    GPARange            Count  Avg
    0.1 - 0.6  (F )            0      0.00
    0.7 - 0.9  (D-)            0      0.00
    1.0 - 1.2  (D )            1     
    1.3 - 1.6  (D+)            1    
    1.7 - 1.9  (C-)            4     
    2.0 - 2.2  (C )           20   
    2.3 - 2.6  (C+)           81
    2.7 - 2.9  (B-)          189
    3.0 - 3.2  (B )          387
    3.3 - 3.6  (B+)          452
    3.7 - 4.9  (A )          316
    NO GPA                   271
    TOTAL                   XXXX    X.XX
    SELECT academic_period,
           stu_population,
           College, 
            CASE
                WHEN ((MBA_GPA)) <= 0.6 then '0.1 - 0.6 (F )'
                WHEN ((MBA_GPA)) <= 0.9 then '0.7 - 0.9 (D-)'
                WHEN ((MBA_GPA)) <= 1.2 then '1.0 - 1.2 (D )'
                WHEN ((MBA_GPA)) <= 1.6 then '1.3 - 1.6 (D+)'
                WHEN ((MBA_GPA)) <= 1.9 then '1.7 - 1.9 (C-)'
                WHEN ((MBA_GPA)) <= 2.2 then '2.0 - 2.2 (C )'
                WHEN ((MBA_GPA)) <= 2.6 then '2.3 - 2.6 (C+)'
                WHEN ((MBA_GPA)) <= 2.9 then '2.7 - 2.9 (B-)'
                WHEN ((MBA_GPA)) <= 3.2 then '3.0 - 3.2 (B )'
                WHEN ((MBA_GPA)) <= 3.6 then '3.3 - 3.6 (B+)'
                WHEN ((MBA_GPA)) >  3.6 then '3.7 - 4.9 (A-)'
                WHEN ((MBA_GPA)) is null then 'No GPA'
            ELSE
                'What Happened'
           END as GPARange,
           count(id), round(avg(mba_gpa),2) AVG_GPA
    FROM gpa_stat
    where stu_population='F'
    and academic_period ='200940'
    GROUP BY  stu_population, 
              academic_period,
            CASE
                WHEN ((MBA_GPA)) <= 0.6 then '0.1 - 0.6 (F )'
                WHEN ((MBA_GPA)) <= 0.9 then '0.7 - 0.9 (D-)'
                WHEN ((MBA_GPA)) <= 1.2 then '1.0 - 1.2 (D )'
                WHEN ((MBA_GPA)) <= 1.6 then '1.3 - 1.6 (D+)'
                WHEN ((MBA_GPA)) <= 1.9 then '1.7 - 1.9 (C-)'
                WHEN ((MBA_GPA)) <= 2.2 then '2.0 - 2.2 (C )'
                WHEN ((MBA_GPA)) <= 2.6 then '2.3 - 2.6 (C+)'
                WHEN ((MBA_GPA)) <= 2.9 then '2.7 - 2.9 (B-)'
                WHEN ((MBA_GPA)) <= 3.2 then '3.0 - 3.2 (B )'
                WHEN ((MBA_GPA)) <= 3.6 then '3.3 - 3.6 (B+)'
                WHEN ((MBA_GPA)) >  3.6 then '3.7 - 4.9 (A-)'
                WHEN ((MBA_GPA)) is null then 'No GPA'
            ELSE
                'What Happened'
           END,
              rollup(college)
    order by 1, 2, 3, 4;

    Hi,
    user1069723 wrote:
    This query produces the results except that I would like to have a final total and overal average (excluding the "No GPA"). Shown as XXX in the output sample. Can this be done in one query or do I need to union for the summary?Yes, you can do that in one query, using ROLLUP. You don't need a UNION.
    Additionally, if possible, how can I write some statements so that rows that may not exist can be displayed on the output? Example: there are no GPAs in the range of 0.1 thru 0.9. My query results do not show the first two rows, however, the users would like to see these rows displayed regardless of the existence or not.That's exactly what outer joins do: they display data from one table with matching data from a second table, if any matching data is found. The data from the first table is displayed whether or not there is a match. If there is no match, all columns from the second table are NULL. If you want to treat those NULLs as 0's, use NVL, as I did when displayijng the average, below.
    In this problem, what is the first table, the table that has one row per grade range, and will be displayed even if no row in the result set falls into that grade range?
    You ought to have such a table. The information about where the ranges begin and end, what letter grades are associated with each, and so on, is data. Data belongs in tables, not hard-coded into queries. If, next year, they decide to change where the boundary between D+ and C- falls, or to add an A group, an authorized user can make the change to one table. No matter how many queries use grade ranges, no programmer will have to change any query.
    Here's how you might create such a table:
    CREATE TABLE     GPA_Range
    AS
    SELECT  0.0 AS low_gpa, 0.7 AS high_gpa, '0.1 - 0.6 (F)'  AS display_txt, 'F'  AS letter_txt     FROM dual     UNION ALL
    SELECT  0.7 AS low_gpa, 1.0 AS high_gpa, '0.7 - 0.9 (D-)' AS display_txt, 'D-' AS letter_txt     FROM dual     UNION ALL
    SELECT  1.0 AS low_gpa, 1.3 AS high_gpa, '1.0 - 1.2 (D)'  AS display_txt, 'D'  AS letter_txt     FROM dual     UNION ALL
    SELECT  1.3 AS low_gpa, 1.7 AS high_gpa, '1.3 - 1.6 (D+)' AS display_txt, 'D+' AS letter_txt     FROM dual     UNION ALL
    SELECT  1.7 AS low_gpa, 2.0 AS high_gpa, '1.7 - 1.9 (C-)' AS display_txt, 'C-' AS letter_txt     FROM dual     UNION ALL
    SELECT  2.0 AS low_gpa, 2.3 AS high_gpa, '2.0 - 2.2 (C)'  AS display_txt, 'C'  AS letter_txt     FROM dual     UNION ALL
    SELECT  2.3 AS low_gpa, 2.7 AS high_gpa, '2.3 - 2.6 (C+)' AS display_txt, 'C+' AS letter_txt     FROM dual     UNION ALL
    SELECT  2.7 AS low_gpa, 3.0 AS high_gpa, '2.7 - 2.9 (B-)' AS display_txt, 'B-' AS letter_txt     FROM dual     UNION ALL
    SELECT  3.0 AS low_gpa, 3.3 AS high_gpa, '3.0 - 3.2 (B)'  AS display_txt, 'B'  AS letter_txt     FROM dual     UNION ALL
    SELECT  3.3 AS low_gpa, 3.7 AS high_gpa, '3.3 - 3.6 (B+)' AS display_txt, 'B+' AS letter_txt     FROM dual     UNION ALL
    SELECT  3.7 AS low_gpa, 999 AS high_gpa, '3.7 - 4.9 (A-)' AS display_txt, 'A-' AS letter_txt     FROM dual     UNION ALL
    SELECT  NULL,            NULL,             'No GPA',                         NULL             FROM dual;As always, document everything, especially non-intuitive or potentially misleading things:
    COMMENT ON COLUMN gpa_range.low_gpa IS 'Lowest numerical grade inside this range.';
    COMMENT ON COLUMN gpa_range.low_gpa IS 'Lowest numerical grade in THE NEXT range.  This value is OUTSIDE of the range';You might prefer to assign impossible low_gpa and high_gpa values (like -2 and -1) to the 'No GPA' row. It's completely arbitrary, non-intutive and potentially confusing, but it would make joining easier.
    If you can't create such a table, you can use a sub-query almost identical to the CREATE TABLE statement above in every query that needs it.
    Here's the main query to do what you requested:
    WITH      interesting_gpa_stat     AS
         SELECT     college
         ,     mba_gpa
         FROM     gpa_stat
         WHERE     stu_population     = 'F'
         AND     academic_period     = '200940'
    ,     all_colleges     AS
         SELECT DISTINCT     college
         FROM             interesting_gpa_stat
    SELECT        c.college
    ,        r.display_txt           AS gparange
    ,        COUNT (s.college)             AS count
    ,        NVL ( AVG (s.mba_gpa)
                , 0
                )               AS avg
    FROM                all_colleges          c
    CROSS JOIN        gpa_range          r
    LEFT OUTER JOIN        interesting_gpa_stat     s     ON (     c.college     =  s.college
                                                AND     r.low_gpa     <= s.mba_gpa
                                              AND     r.high_gpa     >  s.mba_gpa
                                  OR (     c.college     =  s.college
                                     AND     r.low_gpa     IS NULL
                                           AND     s.mba_gpa     IS NULL
    GROUP BY  ROLLUP ( c.college
                      , r.display_txt
    ORDER BY  c.college
    ,            r.display_txtWithout any sample data and the results you want from that data, I had to make several assumptions.
    For example, I assumed you wanted to have several colleges in the same result set. For each college, there will be one row of output for every grade range in the gpa_range table, regardless of whether any matches are found in the gpa_stat table. It's okay if there happens to be only one college if the result set.
    The query includes a total for each college, and a grand total for the entire result set.
    Any filtering (such as stu_population='F') should be done in the interesting_gpa_stat sub-query. You could get by without this sub-query, but any filtering conditions that would be in the WHERE clause would have to be added to outer-join conditions.
    NULL values are ignored in all aggregate funcitons, so nothing special has to be done to keep rows in the 'No GPA' group from distorting the averages. The NVL function that presents 0 as the average when no grades were found in the other ranges always causes this average to apperar as 0 in the 'No GPA' rows, too. If you would prefer NULL in that column, then put the NVL inside a CASE expression.
    Edited by: Frank Kulash on Jun 28, 2009 5:03 AM

  • Importing and Updating Non-Duplicate Records from 2 Tables

    I need some help with the code to import data from one table
    into another if it is not a duplicate or if a record has changed.
    I have 2 tables, Members and NetNews. I want to check NetNews
    and import non-duplicate records from Members into NetNews and
    update an email address in NetNews if it has changed in Members. I
    figured it could be as simple as checking Members.MembersNumber and
    Members.Email against the existance of NetNews.Email and
    Members.MemberNumber and if a record in NetNews does not exist,
    create it and if the email address in Members.email has changed,
    update it in NetNews.Email.
    Here is what I have from all of the suggestions received from
    another category last year. It is not complete, but I am stuck on
    the solution. Can someone please help me get this code working?
    Thanks!
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    </cfquery>
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber
    FROM NetNews
    </cfquery>
    <cfif
    not(listfindnocase(valuelist(newsMember.MemberNumber),qryMember.MemberNumber)
    AND isnumeric(qryMember.MemberNumber))>
    insert into NetNews (Email_address, First_Name, Last_Name,
    MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')-
    </cfif>
    </cfloop>
    </cfquery>
    ------------------

    Dan,
    My DBA doesn't have the experience to help with a VIEW. Did I
    mention that these are 2 separate databases on different servers?
    This project is over a year old now and it really needs to get
    finished so I thought the import would be the easiest way to go.
    Thanks to your help, it is almost working.
    I added some additional code to check for a changed email
    address and update the NetNews database. It runs without error, but
    I don't have a way to test it right now. Can you please look at the
    code and see if it looks OK?
    I am also still getting an error on line 10 after the routine
    runs. The line that has this code: "and membernumber not in
    (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#
    cfsqltype="cf_sql_integer">)" even with the cfif that Phil
    suggested.
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber, Email_Address
    FROM NetNewsTest
    </cfquery>
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and membernumber not in (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#"
    cfsqltype="cf_sql_integer">)
    </cfquery>
    <CFIF qryMember.recordcount NEQ 0>
    <cfloop query ="qryMember">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    insert into NetNewsTest (Email_address, First_Name,
    Last_Name, MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')
    </cfquery>
    </cfloop>
    </cfif>
    <cfquery datasource="#application.dsrepl#"
    name="qryEmail">
    SELECT distinct Email
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and qryMember.email NEQ newsMember.email
    </cfquery>
    <CFIF qryEmail.recordcount NEQ 0>
    <cfloop query ="qryEmail">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    update NetNewsTest (Email_address)
    values ('#trim(qryMember.Email)#')
    where email_address = #qryEmail.email#
    </cfquery>
    </cfloop>
    </cfif>
    Thank you again for the help.

  • One can create an index on a non-existent column in a table

    I am using Oracle 10.2.0.3 on Windows 2003. I wanted to create an index on columnb of
    Tablea. When I use statement like:
    Create index index1 on tablea (‘columnb’) …
    Oracle created index: index1. However, when I looked tat the column in user_ind_columns it had some weird colculn like SYS_NCxxxx. For sometime, I had
    No idea what was going on. My index was not being used in queries at all. Then it dawned on me that I should not put single quotes around columnb. Once I removed quotes, things worked as expected.
    But why does Oracle allow index on a non-existent column?

    we cannot create the index on nonexistent column of table We can. Its called a function-based index. Here's how we do it.
    Also read Howard's reply, right above yours.
    SQL> desc t
    Name                                      Null?    Type
    OWNER                                     NOT NULL VARCHAR2(30)
    OBJECT_NAME                               NOT NULL VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_ID                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                   NOT NULL DATE
    LAST_DDL_TIME                             NOT NULL DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    SQL> create index t_idx on t( substr(object_name, 1, 5));
    Index created.
    SQL> select column_name from user_ind_columns where index_name = 'T_IDX';
    COLUMN_NAME
    SYS_NC00014$
    SQL> select index_type from user_indexes where index_name = 'T_IDX';
    INDEX_TYPE
    FUNCTION-BASED NORMAL
    SQL>

  • User exit for ME21N for displaying the tax code from custom table

    Hi,
      I have a requirement, in our system, the inforecord is not maintain for all the material and vendor combination,  we have a custom table in which we have maintain the
    Compnay code, Pur. Org., Vendor code  Tax code,  juridiction code
    now we want that when a Po is created with ME21 or ME21N  the tax code and jurisdiction code should be come from this table  and if entry not found in this table then it should search as per the regular process like from last Po or info record.  then which user exit we can use for this.
    regards,
    zafar

    CLOSE

  • Generic function to display a specific row from any table

    Hi all,
    I need some help to write a function in PL/SQL or Dynamic SQL (or both), to write a function that would take in parameters only the unique ID of the row to display and the name of the table to display (that could be any table with any format).
    Actually we don't know in advance which table will be accessed, so we don't know the columns and their types until the function is called.
    Once I get the row, I want to return a small table with a size of only one line containing the details of the row I looked for.
    So the signature of the function would be something like: CREATE function displayDetailedRowFromAnyTable(uniqId in varchar2(25), tableName in varchar2(25)).
    Hope the description is clear. I found in some forums some details about this kind of problems; however, the structure of the tables (ie. the columns name and their types) is always known in advance. In my case, I don't know those details until run time.
    Any help would be greatly appreciated.

    There is a built in "function" to do this. It's called "SELECT" and it's available through the SQL engine. You give it the table name and the ID you want and it can return you all the columns from that table...
    e.g.
    SELECT *
    FROM <table_name>
    WHERE id = <required_id>If you truly want a generic dynamic SQL then you'll have to code it as an ANYTYPE (as already mentioned above). Although this will make your code very complex and difficult to maintain.
    e.g. of defining your own dynamic pipelined function using anytype ...
    create or replace type NColPipe as object
      l_parm varchar2(10),   -- The parameter given to the table function
      rows_requested number, -- The parameter given to the table function
      ret_type anytype,      -- The return type of the table function
      rows_returned number,  -- The number of rows currently returned by the table function
      static function ODCITableDescribe( rtype out anytype, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      static function ODCITablePrepare( sctx out NColPipe, ti in sys.ODCITabFuncInfo, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      static function ODCITableStart( sctx in out NColPipe, p_parm in varchar2, p_rows_req in number := 1 )
      return number,
      member function ODCITableFetch( self in out NColPipe, nrows in number, outset out anydataset )
      return number,
      member function ODCITableClose( self in NColPipe )
      return number,
      static function show( p_parm in varchar2, p_rows_req in number := 1 )
      return anydataset pipelined using NColPipe
    create or replace type body NColPipe as
      static function ODCITableDescribe( rtype out anytype, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
        atyp anytype;
      begin
        anytype.begincreate( dbms_types.typecode_object, atyp );
        atyp.addattr( to_char(to_date(p_parm,'MONYYYY'),'MONYY')
                    , dbms_types.typecode_varchar2
                    , null
                    , null
                    , 10
                    , null
                    , null
        atyp.endcreate;
        anytype.begincreate( dbms_types.typecode_table, rtype );
        rtype.SetInfo( null, null, null, null, null, atyp, dbms_types.typecode_object, 0 );
        rtype.endcreate();
        return odciconst.success;
      exception
        when others then
          return odciconst.error;
      end;  
      static function ODCITablePrepare( sctx out NColPipe, ti in sys.ODCITabFuncInfo, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
        elem_typ sys.anytype;
        prec pls_integer;
        scale pls_integer;
        len pls_integer;
        csid pls_integer;
        csfrm pls_integer;
        tc pls_integer;
        aname varchar2(30);
      begin
        tc := ti.RetType.GetAttrElemInfo( 1, prec, scale, len, csid, csfrm, elem_typ, aname );
        sctx := NColPipe( p_parm, p_rows_req, elem_typ, 0 );
        return odciconst.success;
      end;
      static function ODCITableStart( sctx in out NColPipe, p_parm in varchar2, p_rows_req in number := 1 )
      return number
      is
      begin
        return odciconst.success;
      end;
      member function ODCITableFetch( self in out NColPipe, nrows in number, outset out anydataset )
      return number
      is
      begin
        anydataset.begincreate( dbms_types.typecode_object, self.ret_type, outset );
        for i in self.rows_returned + 1 .. self.rows_requested
        loop
          outset.addinstance;
          outset.piecewise();
          outset.setvarchar2( self.l_parm );
          self.rows_returned := self.rows_returned + 1;
        end loop;
        outset.endcreate;
        return odciconst.success;
      end;
      member function ODCITableClose( self in NColPipe )
      return number
      is
      begin
        return odciconst.success;
      end;
    end;
    And to use it
    SQL> select * from table( NColPipe.show( 'JAN2008' ) );
    JAN08
    JAN2008

  • Images not displaying when selecting it from real table

    Case is, I have some HTML in a table, help texts for that matter. It has some images in it defined like that:
    ... <img src="&COMPANY_IMAGES.picture.gif"> ...
    But the &COMPANY_IMAGES. substitution does not take place. When testing, I found out that
    select '&COMPANY_IMAGES.<br><br>#COMPANY_IMAGES#' as working
    , col as not_working
    from TEST_TABLE where ID = 1
    working column had both strings replaced, while not_working had not. Now the question is, whether this is an intended behaviour or not? I got my report working with the workaround of
    select replace(col, '&'||'COMPANY_IMAGES.', :COMPANY_IMAGES) as col
    from TEST_TABLE where ID=1
    but I would like to know the exact limitations to know while planning ahead not discover afterwards... Or is there a better way to get them substituted from db columns (without the replace)?

    Kaja,
    Looks like intended behavior to me. There is no reason for the engine to do substitutions on data you select from a table. Your method should be fine.
    Scott

  • Evolution Calendar displays old, non-existing events from Google Calen

    I attached a screen shot of evolution calendar for an easy explanation of the issue. Most of the events on that day are repeated events which ended very long ago (i.e.they are not in the Google calendar for that particular day). Does anybody know how to tell Evolution not to show those already-ended events?
    Thanks.

    Found the bug report, here it is in Gnome Bugzilla:
    https://bugzilla.gnome.org/show_bug.cgi?id=710683

  • Datatable wackiness - JSF trying to read a non-existant field from a bean

    I am having a very strange problem in JSF. I currently have one links page with four commandLinks in it, and one JSF page witha datatable in it, and an IBM <hx:pagerDeluxe> in it to page through the data. Each command link fires off a different action, as shown below:
         <h:commandLink action="UM02">
              <h:outputText value="UM02" />
         </h:commandLink>
         <h:commandLink action="UM03">
              <h:outputText value="UM03" />
         </h:commandLink>          ..........etc ........
    My Navigation rules all point to one JSP file, but with a different param appended to the URL:
              <from-view-id>/index.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>UM02</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM02</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-outcome>UM03</from-outcome>
                   <to-view-id>/jsp/mappings/listViewUM02.jsp?tbl=UPD_MAP_UM03</to-view-id>
              </navigation-case>     So as you can see, I have one JSF file to display a list from any given table name. I also dynamically populate the dataTable through my code, by reading through a list of columns for each table, and creating a "UIColumn":
              while( itr.hasNext() ){
                   String fieldName = (String) itr.next();                                                  
                   ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{var." + fieldName + "}");
                   HtmlOutputText header = new HtmlOutputText();               
                   header.setValue(fieldName);               
                   UIColumn col = new UIColumn();
                   UIOutput out = new UIOutput();
                   out.setValueBinding("value", vb);
                   col.setHeader( header );
                   col.getChildren().add(out);               
                   dataTable.getChildren().add(col);               
              }          And that dataTable is shown in the JSF page. So i can go back to the main links page, click on another table name, and it will populate the datatable with the correct columns, data, etc. The problem happens when I go to one table, say UM02, and hit ">" on the pager, to go to the next page, which works, THEN i go back to the links page, and hit "UM03" and the first page displays fine. When I try to go to the next page, I get an error saying that the backing bean UM03Bean does not have field "subProductCd". Basically, values from the old dataTable objects are being used for smoe reason when I page. Not sure why this is happening.
    My datatable is defined like this:
         <h:form id="dataTableForm"><h:dataTable id="dataTable1" border="0" cellpadding="2"
              cellspacing="0" columnClasses="columnClass1"
              headerClass="headerClass" footerClass="footerClass"
              rowClasses="rowClass1, rowClass2, rowClass3"
              styleClass="dataTableEx" width="70%" rows="10"
              value="#{TestAction.list}" var="var"
              binding="#{TestAction.listDataTableUI}">
              <f:facet name="footer">
                   <hx:panelBox styleClass="panelBox" id="pagerbox">
                        <hx:pagerDeluxe styleClass="pagerDeluxe" id="deluxe1" for="dataTable1"/>                              
                        <h:commandLink action="home">
                             <h:outputText value="Back Home"></h:outputText>
                        </h:commandLink>
                   </hx:panelBox>     
              </f:facet>
         </h:dataTable>
         </h:form>

    BalusC wrote:
    It is comparing the selected value against the List<SelectItem> returned by getSetoresOrigem() as it is during the apply request values phase of the form submit request.Ok. That's what I supposed JSF was doing.
    BalusC wrote:
    If the selected value isn't in there, then you will get this error.I can understand this, but is this right? As I said, the old value isn't really there because I changed the list values to new ones. But the new value (the value of fSetorOrigem ) corresponds to a value that exist in the new list items, so a valid value. So JSF is not considering that I also changed the list, not just the value. It is comparing the new value with the old list, not the new one. Acting like this JSF is making the page looks like a static HTML page, not a dynamic one. If I can't change the list and the value, what's the point of that? In my point of view I'm not doing anything wrong, I'm not violating any JSF rules.
    Marcos

  • Displaying Information on PLD from Other tables.

    Hi All
    I'll like to know if its possible to display Sales Order information in the Stock Posting List by Ware house .
    I want to pull information from the UDT linked to the Sales Order.
    Thanks

    I am not really sure if this can be achieved. Some times in the PLD when you add a database field the list of tables available for selection might have the tables you need to link and other cases where they are not displayed you could hold the Alt key and press the table selection drop down where all database tables are listed. 
    You may select your table this way. But the problem here is you need to use the relate to link in this newly added field to provide reference a already existing column on a form.
    Suda

  • Joins b/w Vendors from Suppliers tables and Territory (jtf) tables R12

    Hi,
    I m trying to get the details of vendors using ap_suppliers & ap_supplier_sites_all.
    once i get vendor details, I should see if these vendors exist in Territory tables ( jtf_terr_rsc_all  jtf_terr_qual_all  jtf_terr_values_all  jtf_terr_all)
    Could you let me know logic and joins.
    Thanks.

    FSKB     G/L Account Posting
    this transaction is not working

  • How to display Top-5 earners from the table,there should be no duplication

    Hi All
    Can you give me some idea about this query,
    i want a query like
    1)How to dispaly top-N earners from the Emp Table ( i want to dispaly top 5 sal )
    2)There should be no duplicaion in the sal.
    3)If Two emp's earn the same sal,the sal should be picked up only once....!!
    select distinct (sal) from emp order by sal desc;
    select distinct (sal) from emp order by sal desc;
    SAL
    5000
    3000
    2975
    2850
    2450
    1600
    1500
    1300
    1250
    1100
    950
    800
    I want to display only first 5 rows !!
    That first 5 rows i have to insert into other table..!! Please How to display only first 5 rows..!!
    Please can you give me some idea..!!
    Thank in Advance

    USE THIS QUERY
    SELECT SAL FROM (SELECT DISTINCT SAL FROM SCOTT.EMP ORDER BY SAL DESC) WHERE ROWNUM <= 5
    IF U WANT TO FIND 3 SAL OR 4 0R ANY USE THIS QUERY
    SELECT SAL FROM SCOTT.EMP A WHERE &N = (SELECT COUNT(DISTINCT B.SAL) FROM SCOTT.EMP B WHERE B.SAL <= A.SAL)
    FOR &N = GIVE UR VALUE

  • ITunes displaying non-existing TV-Shows on iPhone

    Hi,
    when I connect my iPhone4 (5.0.1) to iTunes, it displays two old TV-Shows on my iPhone. But the TV-Shows don't show up in my iTunes library (I have no TV-Show at all in my library) and they don't show up on my iPhone when I open the Videos app (no TV-Show at all on my iPhone). But iTunes still displays them as grayed out items on my iPhone. I can delete them from there, but as soon as I sync my iPhone they reappear as grayed out items in the TV-Shows section of my iPhone in iTunes. I even tried to remove them with CopyTrans. It seemed to work. Disconnected the iPhone from my computer, reconnected it, reopend CopyTrans and the TV-Shows don't show up anymore. But as soon as I open iTunes, these two TV-Shows show up again... I tried everything to get rid of these two ghost items, but they reappear again and again. Btw. these were two TV-Shows I downloaded through the 12 days of christmas app one year ago.
    Best regards,
    Donato

    Select the iPod.
    At the bottom, you have options such as Songs, Playlists, Albums, etc.
    Select Videos.
    If Videos isn't available, select More and then select Videos.

Maybe you are looking for