A question About SUBMIT statement

Hi,
By SUBMIT statement, i can trigger another report. If the called report runs into dump, how can i detech/catch the dump in the calling report? I tested. It seems impossible to catch the dump. The calling report will also dump.
My question is, if the called report runs into dump, how to detect the dump and avoid dump in calling report?
Thanks in advance,
Best Regards, Johnney.

hi
you can catch this kind of error or exeption from the respective report
then pass this error or exeception to the calling report
go through the  example I  am giving , ti have done it like this only  
SUBMIT zgurep03 AND RETURN WITH SELECTION-TABLE li_seltab .
then in the called reprot
*Check ledger
  SELECT SINGLE * FROM t881 WHERE rldnr = p_rldnr.
  IF sy-subrc NE 0.
    SET CURSOR FIELD 'P_RLDNR'.
     MESSAGE e448 WITH p_rldnr
      MESSAGE e446 INTO lv_text .
      lv_type = 'E'.
Capturing the error messages.
EXPORT lv_text TO MEMORY ID 'TX'(004).
EXPORT lv_type TO MEMORY ID 'TP'(005).
in calling report
  IMPORT gv_type1 TO gv_type FROM MEMORY  ID 'TP'.
  IMPORT gv_text1 TO gv_text FROM MEMORY ID 'TX'.
preparing error message in the callge report for the calling report
PERFORM prepare_message
        USING sy-msgid
              lv_msgno
              lv_msgv1
              lv_msgv2
              lv_msgv3
              lv_msgv4
        CHANGING gv_text.
preparing  error message
FORM prepare_message  USING    p_sy_msgid
                               p_sy_msgno
                               p_sy_msgv1
                               p_sy_msgv2
                               p_sy_msgv3
                               p_sy_msgv4
                      CHANGING p_gv_text.
  CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      id        = p_sy_msgid
      lang      = 'EN'
      no        = p_sy_msgno
      v1        = p_sy_msgv1
      v2        = p_sy_msgv2
      v3        = p_sy_msgv3
      v4        = p_sy_msgv4
    IMPORTING
      msg       = gv_text
    EXCEPTIONS
      not_found = 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.
I guess this will solve your problem
Regards
Prashant

Similar Messages

  • Question about delete statement

    I have question about delete statement...
    i am performing some simple delete statement against one table..but its taking so long..How can we check whether particular delete statements actually deleting records or not..?

    Is the associated select-statement returning rows or not?
    If yes -> delete is deleting
    If no -> delete is just using CPU-cycles
    To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ...

  • Question about 'write' statement

    Hi,
    A question on write statement.
    I have a internal table itab which has field var. I am looping at this itab and writing horizontal heading output like below.
    example on the output heading:
    (3 spaces) itab-var (20 spaces) itab-var (20 spaces) itab-var.
    the coding is:
    loop at itab.
    write: 3 itab-var.
    endloop.
    I want to increase the space by 20 for every loop. How to increase this 3 by 20? Can we accomplish this way?
    Thank you for your time.

    hi krishen,
    just add 20 inside the loop , so that after every loop its value increases by 20
    for example:
    data: v  type i.
    v=3.
    do 3 times.
    write: at v(20).
    v=v+20.
    end do.
    hope it will help you
    regards
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 4, 2008 7:47 AM

  • Need information about SUBMIT statement

    Hi,
        I am submitting program1 in program2 by using SUBMIT keyword.My  requirement  is want to pass selection screen.
      parameters of program2 to program1 without using variant bcz that parameter   
      values are not constant.
    Thanks for ur information in advance..
    hari...

    hI
    <b>SUBMIT - selscreen_parameters</b>
    USING-SELECTION-SET supplies all the selection screen components by means of a Variante variant. If you specify USING-SELECTION-SETS OF PROGRAM , you can use a variant from a different program; if you specify WITH SELECTION-TABLE, values for several selection screen components are transferred as the content of an internal table rspar; WITH sel value supplies individual selection screen components sel with values value. The addition WITH FREE SELECTIONS allows you to transfer dynamic selections to the selection screen for a logical database.
    <b>... USING SELECTION-SET variant</b>
    If you specify this edition, the parameters and selection criteria for the selection screen are supplied with values from a variant. For variant, you must specify a character-like data object that contains the name of a variant for the program accessed when the statement is executed. If the variant does not exist, the system sends an error message. If the variant belongs to a different selection screen, it is ignored.
    You can create and manage variants for every program in which selection screens are defined, either in the ABAP Workbench or during execution of the program by choosing Goto - Variants on a selection screen.
    <b>... USING SELECTION-SETS OF PROGRAM prog</b>
    If you specify this addition, the variants of the program prog are used in the program accessed. For prog, you must specify a character-like data object that contains the name of a program when the statement is executed. The addition has the following effect:
    If a variant variant is specified with USING SELECTION-SET, the system searches for this variant in the program prog.
    If the selection screen is displayed with VIA SELECTION-SCREEN, all the functions that can be accessed by means of the menu path Goto - Variants affect the variants of the program prog. However, these functions are only active if prog is an executable program.
    The program prog should contain a selection screen that has the same parameters and selection criteria as the selection screen used in the program accessed.
    <b>... WITH SELECTION-TABLE rspar</b>
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
    <b>... WITH sel1 value1 WITH sel2 value2 ...</b>
    This addition supplies values to individual parameters or selection criteria sel for the selection screen. For sel, you must specify the name of a parameter or selection criterion directly. Parameters are supplied with single values and selection criteria with selection tables that overwrite values already specified in the program accessed. The selection table to be transferred is compiled from all the WITH sel additions that address the same selection criterion sel. You can specify the following statements for value:
    {EQ|NE|CP|NP|GT|GE|LT|LE} dobj [SIGN sign]
    Transfer of a single value.
    The operators before dobj correspond to the values specified for column OPTION for selection tables. For dobj, you must specify a data object whose data type can be converted to the data type of the selection screen component sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.
    If sel is a selection criterion, the system appends a line in the selection table to be transferred, placing the operator in column OPTION, the content of dobj in column LOW, and the content of sign in column SIGN.
    If sel is a parameter, it is set to the value of dobj in the program accessed. The operator and the value of sign are not taken into account.
    [NOT] BETWEEN dobj1 AND dobj2 [SIGN sign]
    Transfer of an interval.
    In this case, sel must be a selection criterion. For dobj, you must specify data objects whose data type can be converted to that of the columns LOW and HIGH for the selection criterion sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.
    A line is appended in the selection table to be transferred. If NOT is specified, the value 'NB' is placed in column OPTION; otherwise, the value entered is 'BT'. The content of the data objects dobj and sign is placed in the columns LOW, HIGH, and SIGN.
    IN rtab
    Transfer of a ranges table.
    In this case, sel must be a selection criterion. For rtab, you must specify an internal table that has the same structure as the selection table for selection criterion sel. You can create a table like this using the addition RANGE OF to the statements TYPES and DATA.
    The lines in table rtab are appended to the selection table to be transferred.
    You can also use = or INCL instead of the operator EQ.
    You can specify the addition WITH sel value more than once, and you can also specify the same selection screen component more than once.
    <b>Example</b> The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.
    <b>Program accessed</b>
    REPORT report1.
    DATA text(10) TYPE c.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    <b>Calling program</b>
    REPORT report2.
    DATA: text(10)   TYPE c,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    <b>Result</b>
    After report1 has been accessed by report2, the selection tables for the selection criteria selcrit1 and selcrit2 in the program accessed contain the following entries:
      SIGN OPTION LOW HIGH
    selcrit1 I EQ ABAP 
    selcrit2 I BT H K
    selcrit2 E EQ H 
    selcrit2 E EQ K 
    <b>... WITH FREE SELECTIONS texpr</b>
    This addition supplies values to the dynamic selections for the selection screen for a logical database. The program accessed must be linked to a logical database that supports dynamic selections. texpr must be an internal table of the type RSDS_TEXPR from type group RSDS.
    In texpr, the selections for the dynamic selections are specified in an internal format (stack formula). You can use the function modules FREE_SELECTIONS_INIT, FREE_SELECTIONS_DIALOG, and FREE_SELECTIONS_RANGE_2_EX from the function group SSEL to fill texpr in the calling program. While the first two function modules execute a user dialog, you can transfer ranges tables to FREE_SELECTIONS_RANGE_2_EX for each node in the dynamic selection in an internal table of the type RSDS_TRANGE. These are then converted to a table of the row type RSDS_TEXPR. If the calling program contains a selection screen with the same dynamic selections, you can transfer its content beforehand to a table of the type RSDS_TRANGE using the function module RS_REFRESH_FROM_DYNAMICAL_SEL.
    The lines in the internal table type RSDS_TRANGE contain a flat component TABLENAME for each node and a table-like component FRANGE_T of the type RSDS_FRANGE_T for the fields in the node. The lines in RSDS_FRANGE_T contain a flat component FIELDNAME for each field and a table-like component SELOPT_T of the row type RSDSSELOPT from the ABAP Dictionary. RSDSSELOPT contains the four components SIGN, OPTION, LOW, and HIGH and can include the ranges table.
    <b>Example</b> Program report1 is linked to the logical database F1S, which supports dynamic selections for the node SPFLI. Program report2 enters conditions in a nested internal table of the type rsds_trange with selection conditions for field CONNID in node SPFLI; this is then converted to a table of the type rsds_texpr, which is transferred at SUBMIT.
    <b>Program accessed</b>
    REPORT report1.
    NODES: spfli, sflight, sbook.
    <b>Calling program</b>
    REPORT report2.
    TYPE-POOLS rsds.
    DATA: trange TYPE rsds_trange,
          trange_line
            LIKE LINE OF trange,
          trange_frange_t_line
            LIKE LINE OF trange_line-frange_t,
          trange_frange_t_selopt_t_line
            LIKE LINE OF trange_frange_t_line-selopt_t,
          texpr TYPE rsds_texpr.
    trange_line-tablename = 'SPFLI'.
    trange_frange_t_line-fieldname = 'CONNID'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'BT'.
    trange_frange_t_selopt_t_line-low    = '0200'.
    trange_frange_t_selopt_t_line-high   = '0800'.
    APPEND trange_frange_t_selopt_t_line
      TO trange_frange_t_line-selopt_t.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'NE'.
    trange_frange_t_selopt_t_line-low    = '0400'.
    APPEND trange_frange_t_selopt_t_line
      TO trange_frange_t_line-selopt_t.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        field_ranges = trange
      IMPORTING
        expressions  = texpr.
    SUBMIT report1 VIA SELECTION-SCREEN
                   WITH FREE SELECTIONS texpr.
    <b>SUBMIT - selscreen_options</b>
    ... [USING SELECTION-SCREEN dynnr]
        [VIA SELECTION-SCREEN]
        [selscreen_parameters] ... .
    1. ... USING SELECTION-SCREEN dynnr
    2. ... VIA SELECTION-SCREEN
    The addition USING SELECTION-SCREEN specifies the selection screen, VIA SELECTION-SCREEN specifies whether it is displayed. The additions selscreen_parameters provide values for the parameters, selection criteria, and the free selection of the called selection screen.
    The values are transferred to the selection screen between the events INITIALIZATION and AT SELECTION-SCREEN OUTPUT The following hierarchy applies for transferring values:
    First, the variant of the addition USING SELECTION-SET is transferred, which sets all parameters and selection criteria to the values of the variant. The values previously set in the called program are overwritten.
    The values are then transferred to the table of the addition WITH SELECTION-TABLE. All parameters and selection criteria specified there are overwritten accordingly.
    Finally, the values of the additions WITH sel value are transferred. All parameters and selection criteria are overwritten accordingly. If the addition WITH sel value is used more than once for the same parameter, this is overwritten with the last specified value. If the addition WITH sel value is used more than once for the same selection criterion, a selection table with the corresponding number of lines is transferred.
    Providing values for free selections is independent of this hierarchy.
    The options for parameter transfer enable a selection screen to be viewed as a parameter interface of an executable program. This applies particularly for background selection screen processing and for parameters and selection criteria that are defined without screen elements using the addition NO-DISPLAY.
    The additions selscreen_parameters only work the first time the called program is executed. If a selection screen is displayed in the called program, the runtime environment calls the program again after it is finished, thereby replacing the values specified in selscreen_parameters with the previous input values.
    <b>... USING SELECTION-SCREEN dynnr</b>
    This addition specifies which selection screen is called. dynnr is a data object that must contain the screen number of a selection screen defined in the called program when the SUBMIT statement is called.
    If the addition USING SELECTION-SCREEN is omitted or the screen number 1000 is entered, the standard selection screen is called. If no standard selection screen is defined in the called program, no selection screen is called.
    If a screen number that is not 1000 is entered in the addition USING SELECTION-SCREEN, the corresponding independent selection screen is called. If no selection screen with this screen number is defined in the called program, this leads to an untreatable exception.
    <b>... VIA SELECTION-SCREEN</b>
    If this addition is specified, the selection screen is displayed on the screen. Otherwise, background selection screen processing takes place. In background selection screen processing, the selection screen events are triggered without the selection screen being displayed.
    <b>Reward if usefull</b>

  • Beginner question about prepared statements...PLEASE help! :-)

    First let me say thanks for the assistance. This is probably really easy to do, but I'm new to JSP and can't seem to figure it out.
    I want to dynamically populate a table that shows whether a particular person has an appointment at a given date and time with a user. To do this, I want to query the MySQL database for the lastname of the person with the appointment that occurs with the user at the year, month, date, and time, in question.
    THE CODE BELOW DOESN'T WORK (obviously) BUT SOMEWHAT ILLUSTRATES WHAT I'M TRYING TO ACCOMPLISH:
    <%
    Driver DriverTestRecordSet = (Driver)Class.forName(MM_website_DRIVER).newInstance();
    Connection ConnTestRecordSet = DriverManager.getConnection(MM_website_STRING,MM_website_USERNAME,MM_website_PASSWORD);
    PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id='<%=(((Recordset1_data = Recordset1.getObject(user_id))==null || Recordset1.wasNull())?"":Recordset1_data)%>' AND year='<%= yy %>' AND month='<%= months[mm] %>' AND date='<%= dates[dd] %>' AND appttime='16:15:00'");
    ResultSet TestRecordSet = StatementTestRecordSet.executeQuery();
    boolean TestRecordSet_isEmpty = !TestRecordSet.next();
    boolean TestRecordSet_hasData = !TestRecordSet_isEmpty;
    Object TestRecordSet_data;
    int TestRecordSet_numRows = 0;
    %>
    The real problem comes in the prepared statement portion. If I build the prepared statement with static values like below, EVERYTHING WORKS GREAT:
    PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id='1' AND year='2002' AND month='October' AND date='31' AND appttime='16:15:00'");
    But when I try to use dynamic values, everything falls apart. It's not that the values aren't defined, I use the user_id, year <%= yy %>, month <%= months[mm] %>, etc. elsewhere on the page with no problems. It's just that I can't figure out how to use these dynamic values within the prepared statement.
    Thanks for reading this far and thanks in advance for the help!!!!

    Hi PhineasGage
    You are little bit wrong in your
    your preparedStatement.
    Expression tag within scriptlet tag is invalid.
    Whenever you are appending the statement with
    expression tag, append it with "+" and remove
    expression tag.
    Hopefully it will work
    ThanksThanks for the response!
    I know that the expression tag within scriptlet tag is invalid. I just need a workaround for what I want to do.
    I'm unclear what you mean by "Whenever you are appending the statement with expression tag, append it with a "+" and remove expression tag".
    Could you give an example?
    In the meantime, I've been trying to digest the docs on prepared statements and have changed the code to look like:
    PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id= ? AND year= ? AND month= ? AND date= ? AND appttime='13:15:00'");
    StatementTestRecordSet.setInt(1,1);
    StatementTestRecordSet.setInt(2,2002);
    StatementTestRecordSet.setString(3,"October");
    StatementTestRecordSet.setInt(4,31);
    Again, WITH THE STATIC VALUES, THIS WORKS FINE...but when I try to use expressions or variables like below, things don't work:
    StatementTestRecordSet.setInt(2,<%= yy %>);
    Obviously, I'm doing something wrong, but there has to be a way to use variables within the prepared statement.
    ALSO, the values are being passed to this page via URL in the form:
    samplepage?user_id=1&year=2002&month=October&date=31
    Based upon this information, is there another way (outside of stored procedures in the db) to do what I want to do? I'm open to ideas.

  • Question about call statement in trigger

    I faced a question in written exam.
    A CALL statement inside a trigger allow us to call
    a)package
    b)procedure
    c)function
    d)another trigger
    Can anyone give me answer with reason?
    I used CALL statement inside trigger but not allowing to use it. Might be earlier in oracle CALL statement we can use..its only a guess so I am asking in forum..
    plz guide me..
    rgds,
    pc

    You can use CALL in a trigger without resorting to EXECUTE IMMEDIATE
    SQL> create table t1 (
      2    col1 number
      3  );
    Table created.
    SQL> create procedure t1_proc
      2  as
      3  begin
      4    dbms_output.put_line( 'In T1_PROC' );
      5  end;
      6  /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  create trigger trg_t1
      2    before insert on t1
      3    for each row
      4* call t1_proc
      5  /
    Trigger created.
    SQL> set serveroutput on;
    SQL> insert into t1 values( 1 );
    In T1_PROC
    1 row created.I can't think of any reason that you'd actually intentionally structure your code this way in this day and age because it would be rather likely to cause confusion for whoever had to support this in the future. But it is valid syntax that probably made sense back in Oracle 5.
    Justin

  • Question about sql statement

    Hi expert,
    I have following sql statement, function 'hiroc_get_delta_amount1' and 'hiroc_get_delta_amount2' are separately used in select and where subclause. these two function are exactly same, except that there is a inserting log statement inside. for function 'hiroc_get_delta_amount1' , logs are supposed to write into log table1, whereas for function 'hiroc_get_delta_amount2' , logs are supposed to write into log table2. after running this sql, I got data loaded into log table2, however, there is no data loaded into log table1.
    could you please tell me why there is no data in log table2 for function
    1. sql statement;
    select
    pp.policy_premium_pk,
    pp.policy_fk,
    pp.policy_term_fk,
    pp.risk_fk,
    pp.coverage_fk,
    pp.transaction_log_fk,
    pp.coverage_component_code,
    hiroc_rpt_user.hiroc_get_delta_amount1(pp.policy_fk, pp.policy_term_fk, pp.risk_fk, pp.coverage_fk, pp.transaction_log_fk, pp.coverage_component_code),
    pp.rate_period_from_date
    from PRODBKUPDW_MART.rmv_policy_premium pp
    where pp.rate_period_type_code = 'TERM_COVG'
    and pp.coverage_component_code 'NETPREM'
    and hiroc_rpt_user.hiroc_get_delta_amount2(pp.policy_fk, pp.policy_term_fk, pp.risk_fk, pp.coverage_fk, pp.transaction_log_fk, pp.coverage_component_code) != 0
    group by pp.policy_premium_pk,
    pp.policy_premium_pk,
    pp.policy_fk,
    pp.policy_term_fk,
    pp.risk_fk,
    pp.coverage_fk,
    pp.transaction_log_fk,
    pp.coverage_component_code,
    pp.rate_period_from_date;
    2. log inserting statement used for both functions:
    (1) function 'hiroc_get_delta_amount1'
    insert into HIROC_RPT_USER.LOG_TEST1 values (v_start, sysdate,
    p_policy_fk,p_policy_term_history_fk,p_risk_fk,p_coverage_fk,p_transaction_log_fk,p_comp_code);
    COMMIT;
    (2) function 'HIROC_GET_DELTA_AMOUNT_1'
    insert into HIROC_RPT_USER.LOG_ZB_TEST_1 values (v_start, sysdate,
    p_policy_fk,p_policy_term_history_fk,p_risk_fk,p_coverage_fk,p_transaction_log_fk,p_comp_code);
    COMMIT;

    Are your functions using autonomous transactions?
    We also need more information about the log tables etc. as we cannot tell what the problem would be from just that query, and no data.

  • Question about some statement

    Hello Gurus,
           as for a statement "The MBW job BI_BTCH__FX_PAYMENT_DATA=X10M and itu2019s child job ended with completed Abnormally status.", I have some question as follows:
         (1) where does they check out this job " BI_BTCH__FX_PAYMENT_DATA=X10M " ?  what do that "="  and "X10M" and "BI_BTCH__FX_PAYMENT_DATA"   mean ?
        (2) how does " MBW job BI_BTCH__FX_PAYMENT_DATA=X10M "  match some BW object?
        (3) what is  itu2019s child job ?
    Ma

    Is the associated select-statement returning rows or not?
    If yes -> delete is deleting
    If no -> delete is just using CPU-cycles
    To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ...

  • Question about Merge Statement

    Is it possible to use a CASE statement inside the update clause of a merge statement? Also what about a function?
    I have a string (In Source) that needs to be split into multiple columns (In Target) depending on values in other columns (In Source).
    I am on 11iR1

    Hi Chris,
    You can take a look at the below examples :
    SQL>create table t_test
    col1,col2,col3
    ) as
    select 1,2,3 from dual union all
    select 2,3,4 from dual union all
    select 3,4,2 from dual union all
    select 9,10,12 from dual union all
    select 11,23,43 from dual
    create table succeeded.
    SQL>select * from t_test;
    COL1                   COL2                   COL3                  
    1                      2                      3                     
    2                      3                      4                     
    3                      4                      2                     
    9                      10                     12                    
    11                     23                     43    
    SQL>merge INTO t_test t_t USING
      SELECT
        1 AS col1
      FROM
        dual
    ) d_d
    ON
    (d_d.col1 = t_t.col1)
    WHEN matched THEN
      UPDATE set
        col2 = (
          CASE
            WHEN d_d.col1 = 1
            THEN 123
            ELSE -1
          END );
    1 rows merged
    SQL>select * from t_test;
    COL1                   COL2                   COL3                  
    1                      123                    3                     
    2                      3                      4                     
    3                      4                      2                     
    9                      10                     12                    
    11                     23                     43                    

  • Question about changing states

    I have a component based on a skinnableContainer that is hidden in stateA and visible in stateB. The problem is when the container is hidden in stateB the components within the container are still visible. Is there a way to hide the container and all its components? FYI the states are defined at the component level.
    thanks

    Here is the sample code, I removed unrelated code.
    Custom component cod
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx"
             xmlns:components="components.*"
             width="100%" height="100%" creationComplete="group1_creationCompleteHandler(event)">
        <s:states>
            <s:State name="State1"/>
            <s:State name="viewSearch"/>
            <s:State name="viewCart"/>
        </s:states>
        <s:transitions>
            <s:Transition fromState="*" toState="viewCart">
                <s:Parallel>
                    <s:Resize target="{productSearchContainer}" duration="500" />
                    <s:Resize target="{cartContainer}" duration="500" /> 
                </s:Parallel>
            </s:Transition>
            <s:Transition fromState="*" toState="viewSearch">
                <s:Parallel>
                    <s:Resize target="{productSearchContainer}" duration="500" />
                    <s:Resize target="{cartContainer}" duration="500" />
                </s:Parallel>          
            </s:Transition>  
        </s:transitions>
        <fx:Declarations>
        </fx:Declarations>
        <s:layout>
            <s:HorizontalLayout paddingLeft="10" paddingTop="20" paddingRight="10" gap="5"/>
        </s:layout> 
        <components:ProductSearchContainer id="productSearchContainer" width.viewCart="0" width.viewSearch="200"/>
        <components:CartContainer id="cartContainer" width.viewCart="200" width.viewSearch="0"
                                  width.State1="0" alpha.viewSearch="0" alpha.viewCart="1"/>
    </s:Group>
    CartContainer code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:SkinnableContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/mx"
                          xmlns:components="components.*"
                          width="{fixedWidth}" height="100%">
        <s:layout>
            <s:VerticalLayout paddingBottom="0" paddingLeft="5" paddingRight="10" paddingTop="10"/>
        </s:layout>
        <s:Label id="title" text="Your Shopping Cart" styleName="standardBoldText"/>
        <s:List id="cartList" width="100%" height="100%" dropEnabled="true"
                dataProvider="{acCart}" itemRenderer="renderers.CartRenderer"/>
        <mx:Spacer height="10"/>
        <!--<s:HGroup horizontalAlign="right" width="100%">
            <s:Label text="Total:"/>
            <mx:Spacer width="10"/>
            <s:Label text="zzzzz"/>
        </s:HGroup>
        <s:HGroup horizontalAlign="right" width="100%">
            <s:Label text="Shipping:"/>
            <mx:Spacer width="10"/>
            <s:Label text="zzzzz"/>
        </s:HGroup>-->
        <s:HGroup horizontalAlign="right" width="100%">
            <s:Label text="Grand Total:" styleName="standardBoldText"/>
            <mx:Spacer width="10"/>
            <s:Label text="{usdFormatter.format(total)}" styleName="standardBoldText"/>
        </s:HGroup>
        <s:HGroup horizontalAlign="right" width="100%">
            <s:Button label="Submit Order"/>
        </s:HGroup>
    </s:SkinnableContainer>

  • Question about conversational state of Stateless bean....

    Hello all,
    I have a simple stateless bean which parses an XML file and stores the xml content as an list of 2-D arrays in member variables. Here is quick look at design...
    import javax.ejb.Stateless;
    // included other libraries
    import java.util.List;
    import java.util.ArrayList;
    @Stateless
    public class XMLParseBean implements XMLParseBeanInterface {
        public List<String> strParameters;
        public List<String> getStrParameters() {
            return strParameters;
        private void setStrParameters(List<String> strParameters) {
            this.strParameters = strParameters;
        public void parseXML(String strFileName) {
               /* Open the XML file and do initializations for xml parsing here
                setStrParameters(visitNode(doc.getDocumentElement()));
        private List<String> visitNode(Element thisNode) {
                /* Parse the XML here */
                return strNodes; // return the node names and their values
    }My question is : if I inject this bean in another bean, call the method for parsing XML and then call the getParameter method to access the value of member variable, will it work.
    I mean since I am using stateless bean, does the conversation state end when the parseXML method ends?

    sir_edward wrote:
    Hi vikram8jp,
    The session of an stateless bean ends after a method call. If you call a method of your bean, the bean will forget all attributes when the method ends. If you want to save attributes, you have to use a stateful bean.
    Regards
    Sir EdwardHello Sir Edward,
    That answers my query.

  • Newbie question about switch statement

    Lets say you have a loop and inside the loop you have a switch statement, how do you BREAK out of the outer loop?
    for (i=0....) {
    switch {
    case 11:
    .... some stuff
    break; <==== HOW DO I BREAK OUT OF THE for loop here?

    In standard C and standard C++ the break statement terminates the nearest enclosing loop and only that loop; i.e. control transfers to the first statement following the loop. I think there are C or C++ extensions that allow loop tags which may be used with a break to specify which loop to drop through, but I don't think these are supported by gcc, and they would certainly be very non-portable.
    There are several common ways to drop out of one or more outer loops. In many cases, there's nothing else in the loop following the switch so you can simply write
    switch (condition) {
    default:
    case 0:
    break;
    // other case statements here
    break;
    Else you can declare a loop control var and use the continue statement like this:
    for (i=0; i<jMax && !bDone; i++) {
    switch (condition) {
    default:
    case 0:
    bDone++; continue;
    // other case statements
    If you need to escape several loops and/or don't want to use loop control vars, you might consider structuring the code so you can use return to terminate the entire function. In the worst case of a very complex structure that you don't know how to simplify with a helper function, you can always resort to a goto:
    switch (condition) {
    default:
    case 0:
    goto escape;
    // other case statements here
    // remainder of code inside nested loops here
    escape: <first statement following the outermost loop>;
    Note that the statement following the escape label is always executed; i.e. when execution skips the goto it's as if the statement following escape was unlabeled. Use goto sparingly of course, since it's an artifact of unstructured programming. But when you really need a goto, it can make your code much easier to maintain.

  • Hi Experts, a question about Account statement(sapscript)?

    Hi Experts,
    I am working on Account statement, I want to know what is the field for opening balance on the first date of the month, I have a structure(RF140) to use and I found there is final balance(rf140-datu2, rf140-saldo) used in the form, can anyone tell me what is opening balance and final balance? what are the corresponding fields? thank you in advance, thanks.
    Kind regards
    Dawson
    Edited by: dawson wang on Jun 22, 2009 7:00 AM

    Hi,
    U can go to SE11 & give structure name RF140 & press display button. it displays all the fields in struture...
    FYI...field name for Open balance is 'OPBETRAG' & for Final Balance is 'GSALDD'.
    Hope it helps!!
    Rgds,
    Pavan

  • Biginner's question about catch statement

    hi im just a biginner
    normally u guys write catch statement like
    catch (FileNotFouldException exception)
    System.out.println (exception);
    something like that . but what is the exception here
    is it object name? or class name or what
    i mean the word exception after FileNotFoundException
    i just don't understand

    It's the type of the exception to which the catch block should apply.
    You could have this:
    try {
      // stuff
    } catch (FileNotFoundException fnfe) {
      fnfe.printStackTrace();
    } catch (IOException ioe) {
      ioe..printStackTrace();
    } catch (NumberFormatException nfe) {
      nfe.printStackTrace();
    } catch (Exception x) {
      ex..printStackTrace();
    }Note that FNFE extends IOE, so if the IOE is caught first, the FNFE would be caught in that block too. That's why you catch the general Exception last - if you do it at all.

  • Question about network statement in OSPF and BGP

    The network statements in OSPF and BGP can be used to advertise networks. But I'm not clear under what circumstances would make more sense to use network statements to advertise a network than by using other methods to have the network learned by other routers.
    Here is an example: assume I'm running BGP on router A. I want to advertise network 10.1.1.0/24 to other BGP peers. I have a OSPF route for this network. I can do 2 things: one is to use "network 10.1.1.0 mask 255.255.255.0", the other is to do "redistribute OSPF ... route-map OSPF-INTO-BGP", and create a prefix list to permit 10.1.1.0/24.
    Both would work to have this network learned by other BGP peers. But which is better for what purpose?
    Thanks a lot
    Gary

    Hi Gary,
    There is one little difference between the use of the two approaches - the route injected into BGP by using a network statement will carry an Origin attribute of IGP, whereas the route injected using redistribution will have an Origin attribute of Incomplete. Now, that is not a huge issue since you can always change that whatever value you desire both with the use of the network statement and redistribution. The important thing, however, is that in the BGP best path selection process, the Origin attribute comparison is fairly high up and will prefer a route with the attribute of IGP.
    Apart from that, there is absolutely no difference between using the network statement and using redistribution with a route-map that matches exactly on the same route that you would have specified with the network statement.
    I guess one advantage of using the redistribute approach is that it does not clutter up the BGP config. If you wish to add more routes, you simply add them to the prefix list so that you don't really touch the BGP config portion at all..
    Hope that helps - pls do remember to rate posts that help.
    Paresh

Maybe you are looking for