How to avoid repeatation of code

hi
My code is as mentioned below.
if l_location ='USA'
insert into location
select f1,f2,f3,f4
from usa_tab
else if l_location = 'FRANCE'
insert into location
select f1,f2,f3,f4
from france_tab f , x1_tab x
where f.id = x.id
else if l_location = 'UK'
insert into location
select f1,f2,f3,f4
from uk_tab u,y1_tab y
where u.id = y.id
end if;
how to avoid the repeatation of code here?

954992 wrote:
it is an existing application. The tables can not be changed.
actually here the insert and select statements are fixed , only the from and where conditions are getting changed.
howf to avoid repeatation of the fixed code?Oracle supports features called "+partition views+" and "+instead of triggers+". This can be used to glue tables (same structure) together and select and insert against these tables via a view.
Basic example:
// tables that constitutes the partition view - a check constraint on
// country is used to specify which cities are in which table, similar
// to a partition key
SQL> create table location_france(
  2          country varchar2(10) default 'FRANCE' not null,
  3          city    varchar2(20) not null,
  4          --
  5          constraint chk_france check (country in 'FRANCE'),
  6          constraint pk_location_france primary key
  7          ( country, city )
  8  ) organization index;
Table created.
SQL> create table location_uk(
  2          country varchar2(10) default 'UK' not null,
  3          city    varchar2(20) not null,
  4          --
  5          constraint chk_uk check (country in 'UK'),
  6          constraint pk_location_uk primary key
  7          ( country, city )
  8  ) organization index;
Table created.
SQL> create table location_spain(
  2          country varchar2(10) default 'SPAIN' not null,
  3          city    varchar2(20) not null,
  4          --
  5          constraint chk_spain check (country in 'SPAIN'),
  6          constraint pk_location_spain primary key
  7          ( country, city )
  8  ) organization index;
Table created.A partition view is a view that uses union all to glue these tables together:
SQL> create or replace view locations as
  2          select * from location_france
  3          union all
  4          select * from location_uk
  5          union all
  6          select * from location_spain
  7  /
View created.To support inserts against the partition view, an instead-of trigger is used:
SQL> create or replace trigger insert_location
  2          instead of insert on locations
  3  begin
  4          case :new.country
  5                  when 'FRANCE' then
  6                          insert into location_france values( :new.country, :new.city );
  7                  when 'UK' then
  8                          insert into location_uk values( :new.country, :new.city );
  9                  when 'SPAIN' then
10                          insert into location_spain values( :new.country, :new.city );
11          else
12                  raise_application_error(
13                          -20000,
14                          'Country name ['||:new.country||'] is not supported.'
15                  );
16          end case;
17  end;
18  /
Trigger created.Rows can now be inserted into the view and the trigger will ensure that the rows wind up in the correct table.
SQL> insert into locations values( 'FRANCE', 'PARIS' );
1 row created.
SQL> insert into locations values( 'UK', 'LONDON' );
1 row created.
SQL> insert into locations values( 'SPAIN', 'BARCELONA' );
1 row created.As with a partition table, a select on a partition view that uses the "partition column" (in this case, the COUNTRY column), the CBO can prune the non-relevant tables from the view and only select against the relevant table. In the following example, the UK is used as country filter and the CBO shows that only table LOCATION_UK is used.
SQL> set autotrace on explain
SQL> select * from locations where country = 'UK';
COUNTRY    CITY
UK         LONDON
Execution Plan
Plan hash value: 1608298493
| Id  | Operation           | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT    |                    |     1 |    19 |     1   (0)| 00:00:01 |
|   1 |  VIEW               | LOCATIONS          |     1 |    19 |     1   (0)| 00:00:01 |
|   2 |   UNION-ALL         |                    |       |       |            |          |
|*  3 |    FILTER           |                    |       |       |            |          |
|*  4 |     INDEX RANGE SCAN| PK_LOCATION_FRANCE |     1 |    19 |     2   (0)| 00:00:01 |
|*  5 |    INDEX RANGE SCAN | PK_LOCATION_UK     |     1 |    19 |     2   (0)| 00:00:01 |
|*  6 |    FILTER           |                    |       |       |            |          |
|*  7 |     INDEX RANGE SCAN| PK_LOCATION_SPAIN  |     1 |    19 |     2   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   3 - filter(NULL IS NOT NULL)
   4 - access("COUNTRY"='UK')
   5 - access("COUNTRY"='UK')
   6 - filter(NULL IS NOT NULL)
   7 - access("COUNTRY"='UK')
Note
   - dynamic sampling used for this statement (level=2)
SQL>Oracle provides a number of methods to address flawed data models and problematic client code. However, despite this flexibility on Oracle's part, you should still consider fixing the flawed design and code - as that flaws invariable mean reducing flexibility, performance and scalability.

Similar Messages

  • How to avoid repeated emails using send email tasks in package?

    Hi,
    I have package with two sqeuence containers which are not connected.So when I was using send email tasks I was getting repeated emails like 5 to 6 emails.So, can someone hep me on this.How can we avoid repeated emails.
    Regards,
    Sudha
    sudha

    See this example on preventing executing a task within an Event Handler:
    http://microsoft-ssis.blogspot.com/2014/07/prevent-events-executing-multiple-times.html
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • How to avoid disassembling of code from an ipa file?

    Hi,
    I have developed a new version of my app which is already in the appstore. We have released our app for security testing team in my company. They have reported that from the ipa file one can disassemble the code. How can I avoid this disassembling code? Could someone please help me.
    Thanks in advance.

    If folks have the runnable application, they can "disassemble the code", generally this does not mean much because the assembler code that results is an obfuscated mess.
    Did you include debugging information that might include source code?

  • How to avoid repeating fields

    Hi,
    I have data like this in my tables,
    Table1,
    ITEM_NO ITEM_MADE
    1 A
    1 B
    2 A
    3 A
    Table2
    ITEM_NO ITEM_GRAM_WT ITEM_METAL_WT
    1 12gm 14gm
    1 10gm 12gm
    2 15gm 21gm
    Table3
    ITEM_NO ITEM_SIZE ITEM_SHAPE
    1 7mgm OVAL
    1 9mgm RING
    2 3mgm RECT
    Table4
    ITEM_NO ITEM_ACC_SIZE ITEM_ACC_SHAPE
    1 0987 Round
    2 8765 Rectangle
    Table5
    ITEM_NO ITEM_MOVE_CURRLOC ITEM_MOVE_JOBNO
    5 jack 6543
    Using the below query to retrive the data,
    select * from table1 a, table2 b, table3 c, table4 d, table5 e
    where a.item_made = 'A'
         and b.item_no(+) = a.item_no
    and c.item_no(+) = a.item_no
    and d.item_no(+) = a.item_no
    and e.item_no(+) = a.item_no
    when i'm creating a report with group left format some of the data is repeating, right now i'm adding item_no and item_made as group fields in the report. how can i avoid the repetition and get a good report
    thanks for your help
    Bcj

    Hi Bcj,
    First, just wanted to ask if you are really using * in your select statement as opposed to naming each field that you uses? I asked this because, i know it's tidious to type in each and every columns but in this way you don't have to repeat the primary key column (item_no) in your report unless there is a need for you to do it that way, just a thought.
    Now, for you question. You should be able to group table 2 the same way as grouping table1. if you have the following field item in your report
             a.item_no,
             a.item_made,
             b.item_gram_wt,
             b.item_metal_wt,
             c.item_size,
             c.item_shape,
             d.item_acc_size,
             d.item_acc_shape,
             e.item_move_currloc,
             e.item_move_jobnoand you said you grouped table1, i assume your data model looks somewhat as follows:
    | G_table1            |
    | a.item_no,          |
    | a.item_made,        |
              |
    | G_other             |
    | b.item_gram_wt,     |
    | b.item_metal_wt,    |
    | c.item_size,        |
    | c.item_shape,       |
    | d.item_acc_size,    |
    | d.item_acc_shape,   |
    | e.item_move_currloc,|
    | e.item_move_jobno   |
    -----------------------To group it by table2, you can just drag the columns out of G_others to create another group. Just as follows:
    | G_table1            |
    | a.item_no,          |
    | a.item_made,        |
              |
    | G_table2            |
    | b.item_gram_wt,     |
    | b.item_metal_wt,    |
              |
    | G_others            |
    | c.item_size,        |
    | c.item_shape,       |
    | d.item_acc_size,    |
    | d.item_acc_shape,   |
    | e.item_move_currloc,|
    | e.item_move_jobno   |
    -----------------------Hope this helps. Let me know if you are still having problem grouping your report. I would also help if you could post a sample of your actual data.
    -Marilyn

  • How to avoid repeat where clause in oracle sql

    Hi,
    Please find my query below, I need a help to avoid duplication of **where** clause in my query.
    In my below query, **JOIN** condition is same for both the queries and **WHERE** condition also same except this clause "and code.code_name="transaction_1"
    In **IF ** condition only credit and debit is swapped on both queries, due to this **Credit and Debit** and this where clause "and code.code_name="transaction_1" I am duplicating the query. Can you please give some solution to avoid this duplication. I am using oracle 11g
    select DAY as business_date,sum(amount) as AMOUNT, type_amnt as amount_type,test_code as code_seg
    from
    select table1_alias.date as DAY,code.code_numb as test_code,
    CASE
    WHEN qnty_item > 0 THEN 'credit'
    ELSE 'debit'
    END as type_amnt,
    "25.55" as amount
    from
    code_table code,
    table1 table1_alias
    join table2 table2_alias on table1_alias.id = table2_alias.id
    where
    table1_alias.state="OK"
    and table1_alias.type="R"
    and code.code_type="Movie"
    and code.code_name="transaction_1"
    UNION ALL
    select table1_alias.date as DAY,code.code_numb as test_code,
    CASE
    WHEN qnty_item > 0 THEN 'debit'
    ELSE 'credit'
    END as type_amnt,
    "25.55" as amount
    from
    code_table code,
    table1 table1_alias
    join table2 table2_alias on table1_alias.id = table2_alias.id
    where
    table1_alias.state="OK"
    and table1_alias.type="R"
    and code.code_type="Movie"
    and code.code_name="transaction_2"
    group by DAY, test_code,type_amnt
    Thanks

    user10624672 wrote:
    Hi,
    Please find my query below, I need a help to avoid duplication of **where** clause in my query.
    In my below query, **JOIN** condition is same for both the queries and **WHERE** condition also same except this clause "and code.code_name="transaction_1"
    In **IF ** condition only credit and debit is swapped on both queries, due to this **Credit and Debit** and this where clause "and code.code_name="transaction_1" I am duplicating the query. Can you please give some solution to avoid this duplication. I am using oracle 11g
    select DAY as business_date,sum(amount) as AMOUNT, type_amnt as amount_type,test_code as code_seg
    from
    select table1_alias.date as DAY,code.code_numb as test_code,
    CASE
    WHEN qnty_item > 0 THEN 'credit'
    ELSE 'debit'
    END as type_amnt,
    "25.55" as amount
    from
    code_table code,
    table1 table1_alias
    join table2 table2_alias on table1_alias.id = table2_alias.id
    where
    table1_alias.state="OK"
    and table1_alias.type="R"
    and code.code_type="Movie"
    and code.code_name="transaction_1"
    UNION ALL
    select table1_alias.date as DAY,code.code_numb as test_code,
    CASE
    WHEN qnty_item > 0 THEN 'debit'
    ELSE 'credit'
    END as type_amnt,
    "25.55" as amount
    from
    code_table code,
    table1 table1_alias
    join table2 table2_alias on table1_alias.id = table2_alias.id
    where
    table1_alias.state="OK"
    and table1_alias.type="R"
    and code.code_type="Movie"
    and code.code_name="transaction_2"
    group by DAY, test_code,type_amnt
    ThanksA very brief glance and it looks to me like the only difference between the 2 queries are
    and code.code_name="transaction_1"In the first portion and
    and code.code_name="transaction_2"So if that's all that is difference, you'd just want to use a single query (no union's) with
    and code.code_name in ('transaction_1', 'transaction_2')Cheers,

  • How to avoid repeating printing in oracle applications

    we have a report which is printing repeatedly for a particular report, what could be the reason?

    Hi,
    Is this concurrent program scheduled?
    Do you mean it keeps printing after the request is completed normally every 10 minutes?
    Is this a standard or custom concurrent program? Can you reproduce the issue with other programs?
    Regards,
    Hussein

  • How to avoid repeat values in two tables

    hi there,
    I have two tables. SUPPLIERS and MANUFACTURERS. SUPPLIERS has more than one MANUFACTURERS. In normalization rule, a field must have single piece of data. SUPPLIERS_ID is repeating for every MANUFACTURERS. pls help me out to normalize these two tables.
    Thank u...

    Ideally you need to have 2 master tables SUPPLIER & MANUFACTURER.
    Then you need an intermediate transaction table to hold the relationship bet SUPPLIED & MANUFACTURER. Here the records will be repeated.

  • How to avoid duplicates values from alvgird see below code

    how to avoid duplicates values from alvgird see below code
    in below query docno no is repeated again and again
    how i can avoid duplication in this query.
    select * into corresponding fields of table itab
             from  J_1IEXCHDR
                     inner join  J_1IEXCDTL
                        on  J_1IEXCDTLlifnr =  J_1IEXCHDRlifnr
                     where  J_1IEXCHDr~status = 'P'.

    Hi Laxman,
    after that select statement
    select * into corresponding fields of table itab
    from J_1IEXCHDR
    inner join J_1IEXCDTL
    on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
    where J_1IEXCHDr~status = 'P'.
    <b>if sy-subrc = 0.
    delete adjucent duplicates from itab comparing <field name of itab internal table>
    endif.</b>
    this will delete your duplicate entries.once you done with this call the alv FM.
    <b>  call function 'REUSE_ALV_GRID_DISPLAY'</b>
    exporting
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = v_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'IT_USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       i_grid_title                      = 'Purchase Order Details'
      I_GRID_SETTINGS                   = I_GRID_SETTINGS
       is_layout                         = wa_layout
       it_fieldcat                       = it_fieldcat
      IT_EXCLUDING                      = IT_EXCLUDING
      IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
       it_sort                           = it_sort
      IT_FILTER                         = IT_FILTER
      IS_SEL_HIDE                       = IS_SEL_HIDE
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        = IS_VARIANT
       it_events                         = it_event
      IT_EVENT_EXIT                     = IT_EVENT_EXIT
      IS_PRINT                          = IS_PRINT
      IS_REPREP_ID                      = IS_REPREP_ID
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
      IT_HYPERLINK                      = IT_HYPERLINK
      IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
      IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
      IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER
        tables
    <b>      t_outtab                          = ITAB</b>
    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.
    Thanks
    Vikranth Khimavath

  • How to avoid the event has been repeated many times in the background

    Application, the main screen is divided into two containers:left and  right container,
    The right side of the container is divided into two containers:top and  bottom container,
    There is a button in the left container.
    Click the button, the container at lower right will using ModuleManager  load Module,  The following container load of the right of the screen  has been monitoring the container above the action.
    Problem:
    When you click the button repeatedly to load the container in the lower  right, it will create multiple instances, and can not be freed  immediately. When the above container do an action or event, there are  multiple instances of monitoring exist.
    The background will be repeat the action or event many times.
    How to avoid the event has been repeated many times in the background?
    Thanks

    Flex harUI
    multiple instances of a mxml, maybe ?

  • How to avoid invalid data entering in LOV through code

    hi
    1)i have developed lov in table region, but user easily can enter invalid data and saved into the database tables.
    2)i created one formvalue and mapping into that return item , still its not working in table region LOV.
    3)how to avoid invalid data entering in LOV through code. i have tried this below code in EOimpl set value method. but some how its not wokring.
    if (value!=null)
    throw new OAAttrValException(OAAttrValException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(),
    getPrimaryKey(),
    "ProcurementCategory",
    getProcurementCategory(),
    "FND",
    "FND_LOV_SELECT_VALUE");
    Thanks.
    krish.

    Thanks reetesh and gourav for your help.
    i followed below mapping details
    LOV Item Properties
    ID -PurcCommodity
    ViewInstance -VendorVO1
    ViewObject -PurcCommodity
    map1 properties
    LOV Region Item - segment1
    Return Item -PurcCommodity
    CriteriaItem -PurcCommodity
    Usefor Validation -Default
    map2 properties
    LOV Region Item - segment1
    Return Item -validation(formvalue)
    CriteriaItem -
    Usefor Validation -yes
    form value properties
    ID -validation
    ViewInstance -VendorVO1
    ViewObject -PurcCommodity
    Gourav- i double checked multiple rows it is not working, some times it is not working for single row too.
    Thanks
    krish.

  • How can avoid the  problem of Parameter Prompting when I submitting ?

    I am developing web application in visual studio 2008 in csharp.How can avoid the issue or problem of  Parameter Prompting when I send parameters programaticaly or dyanmicaly?  I am sending the values from .net web form to crystal report but it is still asking for parameters. so when i submit second time that is when the reports is being genereated. How can i solve this problem. Please help. The code Iam using is below.
       1. using System; 
       2. using System.Collections; 
       3. using System.Configuration; 
       4. using System.Data; 
       5. using System.Linq; 
       6. using System.Web; 
       7. using System.Web.Security; 
       8. using System.Web.UI; 
       9. using System.Web.UI.HtmlControls; 
      10. using System.Web.UI.WebControls; 
      11. using System.Web.UI.WebControls.WebParts; 
      12. using System.Xml.Linq; 
      13. using System.Data.OleDb; 
      14. using System.Data.OracleClient; 
      15. using CrystalDecisions.Shared; 
      16. using CrystalDecisions.CrystalReports.Engine; 
      17. using CrystalDecisions.Web; 
      18.  
      19.  
      20. public partial class OracleReport : System.Web.UI.Page 
      21. { 
      22.     CrystalReportViewer crViewer = new CrystalReportViewer(); 
      23.     //CrystalReportSource crsource = new CrystalReportSource(); 
      24.     int nItemId; 
      25.  
      26.     protected void Page_Load(object sender, EventArgs e) 
      27.     { 
      28.         //Database Connection 
      29.         ConnectionInfo ConnInfo = new ConnectionInfo(); 
      30.         { 
      31.             ConnInfo.ServerName = "127.0.0.1"; 
      32.             ConnInfo.DatabaseName = "Xcodf"; 
      33.             ConnInfo.UserID = "HR777"; 
      34.             ConnInfo.Password = "zghshshs"; 
      35.         } 
      36.         // For Each  Logon  parameters 
      37.         foreach (TableLogOnInfo cnInfo in this.CrystalReportViewer1.LogOnInfo) 
      38.         { 
      39.             cnInfo.ConnectionInfo = ConnInfo; 
      40.  
      41.         } 
      42.  
      43.  
      44.  
      45.  
      46.  
      47.  
      48.         //Declaring varibles 
      49.          nItemId = int.Parse(Request.QueryString.Get("ItemId")); 
      50.         //string strStartDate = Request.QueryString.Get("StartDate"); 
      51.         //int nItemId = 20; 
      52.         string strStartDate = "23-JUL-2010"; 
      53.  
      54.         // object declration 
      55.         CrystalDecisions.CrystalReports.Engine.Database crDatabase; 
      56.         CrystalDecisions.CrystalReports.Engine.Table crTable; 
      57.  
      58.  
      59.         TableLogOnInfo dbConn = new TableLogOnInfo(); 
      60.  
      61.         // new report document object 
      62.         ReportDocument oRpt = new ReportDocument(); 
      63.  
      64.         // loading the ItemReport in report document 
      65.         oRpt.Load("C:
    Inetpub
    wwwroot
    cryreport
    CrystalReport1.rpt"); 
      66.  
      67.         // getting the database, the table and the LogOnInfo object which holds login onformation 
      68.         crDatabase = oRpt.Database; 
      69.  
      70.         // getting the table in an object array of one item 
      71.         object[] arrTables = new object[1]; 
      72.         crDatabase.Tables.CopyTo(arrTables, 0); 
      73.  
      74.         // assigning the first item of array to crTable by downcasting the object to Table 
      75.         crTable = (CrystalDecisions.CrystalReports.Engine.Table)arrTables[0]; 
      76.  
      77.         dbConn = crTable.LogOnInfo; 
      78.  
      79.         // setting values 
      80.         dbConn.ConnectionInfo.DatabaseName = "Xcodf"; 
      81.         dbConn.ConnectionInfo.ServerName = "127.0.0.1"; 
      82.         dbConn.ConnectionInfo.UserID = "HR777"; 
      83.         dbConn.ConnectionInfo.Password = "zghshshs"; 
      84.  
      85.         // applying login info to the table object 
      86.         crTable.ApplyLogOnInfo(dbConn); 
      87.  
      88.  
      89.  
      90.  
      91.  
      92.  
      93.         crViewer.RefreshReport(); 
      94.          
      95.                 // defining report source 
      96.         crViewer.ReportSource = oRpt; 
      97.         //CrystalReportSource1.Report = oRpt; 
      98.          
      99.         // so uptill now we have created everything 
    100.         // what remains is to pass parameters to our report, so it 
    101.         // shows only selected records. so calling a method to set 
    102.         // those parameters. 
    103.      setReportParameters();  
    104.     } 
    105.  
    106.     private void setReportParameters() 
    107.     { 
    108.       
    109.         // all the parameter fields will be added to this collection 
    110.         ParameterFields paramFields = new ParameterFields(); 
    111.          //ParameterFieldDefinitions ParaLocationContainer = new ParameterFieldDefinitions(); 
    112.        //ParameterFieldDefinition ParaLocation = new ParameterFieldDefinition(); 
    113.         
    114.         // the parameter fields to be sent to the report 
    115.         ParameterField pfItemId = new ParameterField(); 
    116.         //ParameterField pfStartDate = new ParameterField(); 
    117.         //ParameterField pfEndDate = new ParameterField(); 
    118.  
    119.         // setting the name of parameter fields with wich they will be recieved in report 
    120.        
    121.         pfItemId.ParameterFieldName = "RegionID"; 
    122.  
    123.         //pfStartDate.ParameterFieldName = "StartDate"; 
    124.         //pfEndDate.ParameterFieldName = "EndDate"; 
    125.  
    126.         // the above declared parameter fields accept values as discrete objects 
    127.         // so declaring discrete objects 
    128.         ParameterDiscreteValue dcItemId = new ParameterDiscreteValue(); 
    129.         //ParameterDiscreteValue dcStartDate = new ParameterDiscreteValue(); 
    130.         //ParameterDiscreteValue dcEndDate = new ParameterDiscreteValue(); 
    131.  
    132.         // setting the values of discrete objects 
    133.          
    134.  
    135.           dcItemId.Value = nItemId; 
    136.          
    137.         //dcStartDate.Value = DateTime.Parse(strStartDate); 
    138.         //dcEndDate.Value = DateTime.Parse(strEndDate); 
    139.          
    140.         // now adding these discrete values to parameters 
    141.           //paramField.HasCurrentValue = true; 
    142.  
    143.        
    144.  
    145.           //pfItemId.CurrentValues.Clear(); 
    146.          int valueIDD = int.Parse(Request.QueryString.Get("ItemId").ToString()); 
    147.           pfItemId.Name = valueIDD.ToString();  
    148.            
    149.         pfItemId.CurrentValues.Add(dcItemId); 
    150.         //ParaLocation.ApplyCurrentValues; 
    151.         pfItemId.HasCurrentValue = true; 
    152.         
    153.         //pfStartDate.CurrentValues.Add(dcStartDate); 
    154.         //pfEndDate.CurrentValues.Add(dcEndDate); 
    155.  
    156.         // now adding all these parameter fields to the parameter collection 
    157.         paramFields.Add(pfItemId); 
    158.          
    159.         //paramFields.Add(pfStartDate); 
    160.         //paramFields.Add(pfEndDate); 
    161.         ///////////////////// 
    162.         //Formula from Crystal 
    163.        //crViewer.SelectionFormula = "{COUNTRIES.REGION_ID} = " + int.Parse(Request.QueryString.Get("ItemId")) + ""; 
    164.         crViewer.RefreshReport(); 
    165.         // finally add the parameter collection to the crystal report viewer 
    166.         crViewer.ParameterFieldInfo = paramFields; 
    167.         
    168.          
    169.      
    170.     } 
    171. }

    Keep your post to under 1200 characters, else you loose the formatting. (you can do two posts if need be).
    Re. parameters. First, make sure yo have SP 1 for CR 10.5:
    https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe
    Next, see the following:
    [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
    CR Dev help file:
    http://msdn2.microsoft.com/en-us/library/bb126227.aspx
    Samples:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • How do I repeat the same row more than once in report 10g

    How do I repeat the same row more than once in report 10g
    So I can print the bar code more than once
    in report;
    Edited by: user11106555 on May 9, 2009 5:50 AM

    GREAT THAN X MAN
    It is already working, but with the first ROW
    select ename from emp
    CONNECT BY ROWNUM<=5
    ENAME
    SMITH
    SMITH
    SMITH
    SMITH
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    BUT I want this result
    Item1
    Item2
    Item3
    to
    Item1
    Item1
    Item1
    Item2
    Item2
    Item2
    Item3
    Item3
    Item3

  • How to avoid short dump in ECC 5.0

    Hi
    Can anyone tell me how to avoid short dump in ECC 5.0
    I'm told we can avoid program going to short dump, instead IT WILL GRACEFULLY EXIT..

    Hi
      By implementing the code as for every unsuccess/failure conditions control has come out of the program. then only u can avoid dumps even though u code the not perfect functionality.
    Regards,
    kumar

  • How to avoid ERROR_MESSAGE_STATE exception?

    Hi gurus,
    in our wda application, we call an abap funcion module,under certain cases, the funciton module will issue a statement like
    message exxx.
    then our webdynpro will dump ,with message show:
    termination &#65306;ERROR_MESSAGE_STATE
    could you please tell me how to avoid this?
    thanks and best regards.
    Jun

    There are couple of way you can avoid the ERROR_MESSAGE_STATE exception.
    1. Handle all the exception when you call the FM. For example:
    Sample code:
    <div class="jive-quote">
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    id = im_textid
    language = im_textlanguage
    name = l_textname
    object = 'TEXT'
    ARCHIVE_HANDLE = 0
    LOCAL_CAT = ' '
    IMPORTING
    header = ex_header
    TABLES
    lines = li_tline
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found  4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    </div>
    2. If it doesnt have exception: If its custom FM, make it as remote enabled, In case of SAP FM, try to wrap up the FM into remote enabled FM.
    Hope this helps you.
    Raja T

  • How to avoid version information in http response

    Hi,
    We have a SAP java web application in webdynpro framework developed using SAP NetWeaver.
    If I right click on broswer and see View Source of the page, it is displaying information related to Development components, java version, SAP version etc..
    I am very new to SAP and would like to know how to avoid the information.
    I have already tried setting useServerHeader to false and DevelopmentMode to False in SAP J2EE engine.
    Below is the information displayed in the view source.
    This page was created by SAP NetWeaver. All rights reserved.
    Web Dynpro client:
    HTML Client
    Web Dynpro client capabilities:
    User agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E), client type: msie7, client type profile: ie6, ActiveX: enabled, Cookies: enabled, Frames: enabled, Java applets: enabled, JavaScript: enabled, Tables: enabled, VB Script: enabled
    Accessibility mode: false
    Web Dynpro runtime:
    Vendor: SAP, build ID: 7.0026.20120524121557.0000 (release=NW04S_26_REL, buildtime=2012-05-24:14:38:29[GMT+00:00], changelist=141071, host=VMW4330.wdf.sap.corp), build date: Fri Nov 16 03:56:13 CET 2012
    Web Dynpro code generators of DC
    SapDictionaryGenerationCore: 7.0021.20091119120521.0000 (release=NW04S_21_REL, buildtime=2009-12-11:15:55:08[UTC], changelist=76328, host=PWDFM114.wdf.sap.corp)
    J2EE Engine:
    7.00 PatchLevel 129925.450
    Java VM:
    SAP Java Server VM, version: 4.1.024 21.1-b02, vendor: SAP AG
    Operating system:
    Linux, version: 2.6.32-131.17.1.el6.x86_64, architecture: amd64
    Hope I explained the issue and thank you so much in advance..

    Or
    Have a look and these query on WD and portal
    refer; Disabling the Right click functionality in the Detailed Navigation?
    Disable WD ABAP default context menu
    Remove / Hide standard right click menu in Web Dynpro ABAP application
    Regd Right click functionality in portal

Maybe you are looking for