Regards catch statement

Is there any thing worng in my catch statements .because when i do debug the curser not catching the catch statements
TRY.
       CALL METHOD z_co_ifoasy_01_sa_gl=>execute_asynchronous
          EXPORTING
            output = gv_zsafe_mt_acc_gl_posting01.
      CATCH cx_ai_system_fault INTO s_exception.
      CATCH cx_ai_application_fault INTO s_exception_app.
    ENDTRY.
   IF ( s_exception IS  INITIAL AND s_exception_app IS INITIAL )
      MESSAGE i007.
    ELSE.
      PERFORM update_log_table.
      COMMIT WORK.
      MESSAGE i009. "Message sent to XI".
    ENDIF.
  ENDIF.

hi,
    What type of Exceptions you want to catch in Proxy?
     Try to do commit work before you read exception variables for text and code.
Follow this process:
Proxy call
catch exception
commit work.
Use Exception variale to read details.
If you want to check that RFC Destination that pings your PI server is fine or not.
Call FM: BDL_SERVER_PING
to check if your PI server is down.
Regards,
Anurag Garg

Similar Messages

  • Regards Catch statements

    Is there any thing worng in my catch statements .because when i do debug the curser not catching the catch statements
    TRY.
    CALL METHOD z_co_ifoasy_01_sa_gl=>execute_asynchronous
    EXPORTING
    output = gv_zsafe_mt_acc_gl_posting01.
    CATCH cx_ai_system_fault INTO s_exception.
    CATCH cx_ai_application_fault INTO s_exception_app.
    ENDTRY.
    IF ( s_exception IS INITIAL AND s_exception_app IS INITIAL )
    MESSAGE i007.
    ELSE.
    PERFORM update_log_table.
    COMMIT WORK.
    MESSAGE i009. "Message sent to XI".
    ENDIF.
    ENDIF.

    Try like below...
    TRY.
    CALL METHOD z_co_ifoasy_01_sa_gl=>execute_asynchronous
    EXPORTING
    output = gv_zsafe_mt_acc_gl_posting01.
    CATCH cx_ai_system_fault INTO s_exception.
    lv_exception = 'X'.
    CATCH cx_ai_application_fault INTO s_exception_app.
    IF ( lv_exception IS INITIAL AND s_exception_app IS INITIAL )
    MESSAGE i007.
    ELSE.
    PERFORM update_log_table.
    COMMIT WORK.
    MESSAGE i009. "Message sent to XI".
    ENDIF.
    ENDTRY.
    Edited by: Veeranji Reddy on Aug 7, 2009 5:15 PM

  • Exception Handling after the Catch Statement

    Hi every one,
    How to handle the exceptions after Catch Statement.
    What does a catch statement can do?
    Regards,
    Johny

    Hi,
    Check this link:
    http://help.sap.com/saphelp_nw70/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/f2bbce142c11d3b93a0000e8353423/content.htm
    Regards
    Adil

  • Regarding case statement and decode function

    Hi Experts,
    I have question.....regarding case statement and decode statement....
    Can you please explain me that which one will be efficient,to place in insert statement...
    insert statement(
    (case when ........then
                         case when ....then
                         else
                         end)
      else
    end)
    or
    insert statement(
    case when.....then
    decode(....)
    else
    end)
    Can you people explain me which one is more efficient method?
    Thanks in advance.......

    The are major differences to talk about in case of CASE vs DECODE, but performance wise both are pretty much the same.
    Have a look at Tom's thread
    Ask Tom "better performance - case or decode"
    I would suggest to use CASE whenever possible. Don't worry about the performance part.

  • "catch is unreachable" compiler error with java try/catch statement

    I'm receiving a compiler error, "catch is unreachable", with the following code. I'm calling a method, SendMail(), which can throw two possible exceptions. I thought that the catch statements executed in order, and the first one that is caught will execute? Is their a change with J2SE 1.5 compiler? I don't want to use a generic Exception, because I want to handle the specific exceptions. Any suggestions how to fix? Thanks
    try {
    SendMail(....);
    } catch (MessagingException e1) {
    logger.fine(e1.toString());
    } catch (AddressException e2) {
    logger.fine(e2.toString());
    public String SendMail(....) throws AddressException,
    MessagingException {....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I found the problem:
    "A catch block handles exceptions that match its exception type (parameter) and exception types that are subclasses of its exception type (parameter). Only the first catch block that handles a particular exception type will execute, so the most specific exception type should come first. You may get a catch is unreachable syntax error if your catch blocks do not follow this order."
    If I switch the order of the catch exceptions the compiler error goes away.
    thanks

  • 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.

  • Control flow: catch statement

    Hi there!,
    Need to know where the control passes if an error is caught in a catch statement.
    Suppose no alternative error handling code has been specified. Where would control go if a terminal error occured? Would it just carry on to the next statement in the general flow or would it terminate the application/applet. By terminal, i mean something like getParameter() returning null etc..
    Any help that sheds light on this is appreciated greatly.
    To make this clearer, how would the program know when to exit a try catch statement if it falls into a catch statement that gave a nonsensical value?

    You should be careful with your terms, "an error is
    caught" has a very specific meaning in Java. Errors
    (instances of java.lang.Error and it's subclasses)
    should not be caught (that is, with a try-catch
    statement) in your code because they signal more
    serious problems than usual (like ClassNotFoundError,
    LinkageError, VirtualMachineError, and so on), not in
    switch statements or otherwise.In certain situations they should be caught.
    If I create a stand alone app with a client GUI it doesn't matter to the user if a null pointer exception, because of programmer error, occurs in the database layer. But they are going to get real upset if the app just abruptly exits which is what is going to happen if the GUI layer doesn't catch all of the exceptions. And although it is possible that one of those exceptions makes it impossible to do anything at all, it is much more likely that the GUI can at least display a message to the user before exiting. And write the stack trace to a file as well.
    This is true at the interface between any two layers. And some applications will be able to continue. I certainly don't want a J2EE server exiting because one of the new beans isn't working correctly. It won't stop the other beans from working.

  • Catch Statement, Help!!!

    I need help with a catch statement that will give an error message when Letters are put in, i need this as im only working with numebers, Heres what i have done already. When i build the code i always get
    ";" expected
    Thanks for your Help
    jMenuKmperHourMileActionPerformed(java.awt.event.ActionEvent e)
    try
    String Number = ToBeConverted.getText();
    double amount = new Double(Number).doubleValue();
    total = (amount*.621371192);
    Converted.setText("= " + total);
    ToBeConverted.setEditable(false);
    catch(NumberFormatException nfx)
    Converted.setText(Number + " is not a valid number!");
    }

    Your try/catch statement is bad. You have too many { } brackets in there.
    The format should be
    try{
      // code which throws Exceptions
      String Number = ToBeConverted.getText();
      double amount = new Double(Number).doubleValue();
      total = (amount*.621371192);
      Converted.setText("= " + total);
      ToBeConverted.setEditable(false);
    catch(NumberFormatException nfx){
      // error handler
      Converted.setText(Number + " is not a valid number!");
    }

  • Infinite loop in a catch {} statement, should be simple

    Hi, I'm trying to take integer input from the console using a Java Scanner object, and I enter an infinite loop if there is an IO error inside the catch statement. Please let me know if you know what I'm doing wrong:
    do
    try
    Problem = false; //this is a bool
    start = Input.nextInt(); // Input is a Scanner, start is an Intenger
    catch (Exception IOException) {
         Problem = true;
         System.out.println("Bad value.\n");
         //The infinite loop is inside this statement.
    while (Problem == true);
    This code block is intended to take integer input, then, if there's an IO error, try to do it again, indefinitely, until it has successfully given Start a value. As it stands, if executed, if there is not an IO error, it works; if there is an IO error it enters an infinite loop in the catch statement. Please forgive my incompetence, any help is appreciated :)

    Hi, thanks for the advice to both of you, your suggestion that it is stuck seems to be correct.
    I add to the catch statement:
    Input = new Scanner(System.in);
    To reset it, and it works now. This is probably not the best way to do things, but I'm just a student and it's for a homework assignment that does not require try / catch / for so it works for this, thank you for the help! :)

  • Jumping to a catch statement?

    hi, if I have the following code:
         private String getDefaultReportName(){
              String reportFolder = "Data\\Report_Name";
              FileInputStream FIS;
              //File reportNameFile;
              try {
                   File folder = new File(reportFolder); //check to see if the folder exists first!
                   if(folder.exists()){
                                  //then do some stuff
                             }//end if
                             else{
                                 //if this happens, I want to jump to the catch clause automatically...
                              }//end else
              }//end try
              catch (Exception e) {
                   return "Report";
         }I found that, in my code, i have used the 'return "Report";' line often and I would like to
    just jump straight to the catch statement if that is possible. I am sure it is, but I don't
    know how off the top of my head. How can I jump straight to a catch clause from a try
    block? thanks!

    I don't know what that's supposed to be doing, or
    what point you're trying to make, but it looks like
    the wrong way to use/handle exceptions.A coworker at a previous job called exceptions (we were writing in Ada) "glorified GOTO" (complaining about how another coworker used it too liberally). I believe that would apply in this case.

  • Which catch statement, returns null

    just wanted to if there is any catch statement which returns if the file is null
    something like
    catch(NullPointException ex){
    }

    Ashish.Uppin wrote:
    just wanted to if there is any catch statement which returns if the file is null
    something like
    catch(NullPointException ex){
    Can I catch a null pointer exception? Yes.
    Do I? No
    Can you? Probably not.

  • Regarding SUBMIT statement - to process a program in background

    Hi All,
    I have issue of submitting a program in background and also i need to process the no of records come from program by splitting them by 1000(n).
    First of all i have program whose code is like following:
    <b>REPORT  z_update_material_master.</b>
    TYPES: BEGIN OF t_marc,
              matnr LIKE marc-matnr,   "Material Number
              werks LIKE marc-werks,   "Plant
              beskz LIKE marc-beskz,   "Procurement Type
              sobsl LIKE marc-sobsl,   "Special procurement type
              fhori LIKE marc-fhori,   "Scheduling Margin Key for Floats
              dzeit LIKE marc-dzeit,   "In-house production time
              plifz LIKE marc-plifz,   "Planned delivery time in days
              webaz LIKE marc-webaz,   "Goods rcpt processing time
              pwwrk LIKE t460a-wrk02,  "Production plant in planned order
              erhor LIKE t436a-erhor,  "Opening periodr
              zlt   TYPE p DECIMALS 3, "Total replenishment lead time
              ztlt  TYPE p DECIMALS 3, "Total replenishment lead time
              wzeit TYPE p DECIMALS 3, "Total replenishment lead time
              upd(1) TYPE c,            "UPDATE INDICATER
              ind    TYPE c,
         END OF t_marc.
    DATA: i_marc  TYPE SORTED TABLE OF t_marc INITIAL SIZE 0
                   WITH HEADER LINE
                   WITH NON-UNIQUE KEY matnr werks,
          i_marc_rpt LIKE i_marc OCCURS 0 WITH HEADER LINE.
    DATA: l_plantdata  LIKE bapi_marc,
          l_headdata   LIKE bapimathead,
          l_plantdatax LIKE bapi_marcx,
          l_tabix      LIKE sy-tabix.
    CONSTANTS: c_s TYPE c VALUE 'S',
               c_x TYPE c VALUE 'X'.
    DATA i_temp_bapi_return LIKE bapi_matreturn2
                            OCCURS 0 WITH HEADER LINE.
    DATA BEGIN OF i_temp_zppe0091_01 OCCURS 0.
            INCLUDE STRUCTURE zppe0091_01.
    DATA: END OF i_temp_zppe0091_01.
    DATA: l_tab_nam LIKE rstable-tabname VALUE 'ZPPE0091_01'.
    SELECT * FROM zppe0091_01
             INTO CORRESPONDING FIELDS OF TABLE i_temp_zppe0091_01.
    IF sy-subrc EQ 0.
      LOOP AT i_temp_zppe0091_01 WHERE upd = c_x.
        l_tabix = sy-tabix.
        l_headdata-material     = i_temp_zppe0091_01-matnr.
        l_plantdata-plant       = i_temp_zppe0091_01-werks.
        l_plantdata-replentime  = i_temp_zppe0091_01-wzeit.
        l_plantdatax-replentime = c_x.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata       = l_headdata
            plantdata      = l_plantdata
            plantdatax     = l_plantdatax
          TABLES
            returnmessages = i_temp_bapi_return.
        IF NOT i_temp_bapi_return[] IS INITIAL.
          READ TABLE i_temp_bapi_return WITH KEY type = c_s.
          IF sy-subrc EQ 0.
            i_marc_rpt-matnr = i_temp_zppe0091_01-matnr.
            i_marc_rpt-werks = i_temp_zppe0091_01-werks.
            APPEND i_marc_rpt. CLEAR i_marc_rpt.
          ELSE.
            i_temp_zppe0091_01-upd = space.
            MODIFY i_temp_zppe0091_01 INDEX l_tabix TRANSPORTING upd.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
    Now i want to call this program from another program that is already exists by using <b>SUBMIT</b>
    statement in background and i need to process this program by dividing records by <b>1000</b> into seperate session.
    how can i do it. Can any body tell me the solution with syntax.
    I might get lot of records from above program so i want to split them into diffrent sessions based on number of records(1000).
    can any body give me the solution.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Try implementing the following code. Use the code accordingly...
      MOVE 100 TO c_recs_b4_split.
      IF num_src_trans > c_recs_b4_split.
        target_break = num_src_trans / p_thread.
      ELSE.
        target_break = num_src_trans + 1.
      ENDIF.
      wa_subbch  = 1.
      last_index = 1.
    No batch split required if total recrods less than 100
      IF num_src_trans < c_recs_b4_split.
        CLEAR  : range_btch.
        REFRESH: range_btch.
        IF wa_subbch = p_thread.
          target_break = num_src_trans.
        ENDIF.
        MOVE 'S_SRCTRN' TO range_wa-selname.
        MOVE 'S'        TO range_wa-kind   .
        MOVE 'I'        TO range_wa-sign   .
        MOVE 'EQ'       TO range_wa-option .
        LOOP AT itab_src_trans INTO st_src_trans.
          MOVE st_src_trans-src_tran_id TO range_wa-low.
          APPEND range_wa TO range_btch.
        ENDLOOP.
    Step 3 Submit the batch.
        v_job_no = v_job_no + 1.
        PERFORM submit_tp_jobs.
      ELSE.
        DO.
    Step 1 Collect data for the target count
          CLEAR  : range_btch.
          REFRESH: range_btch.
         IF wa_subbch = p_thread.
           target_break = num_src_trans.
         ENDIF.
          MOVE 'S_SRCTRN' TO range_wa-selname.
          MOVE 'S'        TO range_wa-kind   .
          MOVE 'I'        TO range_wa-sign   .
          MOVE 'EQ'       TO range_wa-option .
          IF wa_subbch = p_thread.
            target_break = num_src_trans - v_cnt .
          ENDIF.
          LOOP AT itab_src_trans INTO st_src_trans FROM last_index.
            last_index = sy-tabix.
            batch_total = batch_total + 1.
            IF batch_total <= target_break.
              MOVE st_src_trans-src_tran_id TO range_wa-low.
              APPEND range_wa TO range_btch.
            ELSE.
              EXIT.
            ENDIF.
            v_cnt = v_cnt + 1.
          ENDLOOP.
          CLEAR batch_total.
    Step 2 Submit the batch.
          v_job_no = v_job_no + 1.
          PERFORM submit_tp_jobs.
          ADD 1 TO wa_subbch.
          IF wa_subbch > p_thread.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
    FORM submit_tp_jobs .
      DATA : l_jobcount LIKE tbtcjob-jobcount,
             l_jobrelease LIKE btch0000-char1,
             w_job_flag VALUE 'X',
             w_process_mode,
             w_user_print_params  LIKE pri_params.
      l_jobname = p_batch.
      CONCATENATE 'TP_'  l_jobname '_' v_job_no INTO l_jobname.
      CONDENSE l_jobname NO-GAPS.
      w_process_mode = ' '.
      IF NOT range_btch[] IS INITIAL.
        PERFORM create_post_ctrl.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname  = l_jobname
          IMPORTING
            jobcount = l_jobcount.
        SUBMIT zfi_pc_tran_proc
          AND RETURN
               WITH p_batch  = p_batch
               WITH p_jobid  = p_jobid
               WITH p_mode   = w_process_mode
               WITH p_subbch = wa_subbch
               WITH p_jobq   = p_jobid
               WITH p_cntlmt = p_cntlmt
               WITH p_tpiop  = p_iop
               WITH SELECTION-TABLE range_btch
               USER sy-uname
               VIA JOB l_jobname NUMBER l_jobcount
               TO SAP-SPOOL
               SPOOL PARAMETERS w_user_print_params
               WITHOUT SPOOL DYNPRO.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = l_jobcount
            jobname              = l_jobname
            strtimmed            = 'X'
          IMPORTING
            job_was_released     = l_jobrelease
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            invalid_target       = 8
            OTHERS               = 9.
      ENDIF.
    ENDFORM.                    " submit_tp_jobs
    Pl. add the points....

  • Regarding types statement in ECC 6.0...plz reply..urgent

    Hi,
    I am copying a program which is in<b> 4.7 to ECC 6.0,</b>i am facing error regarding <b>structures with types<b>...
    The following code in<b> 4.7</b>
    <b>DATA:BEGIN OF W_BMM00.
            INCLUDE STRUCTURE BMM00.
    DATA:END OF W_BMM00.
    DATA:BEGIN OF W_BMMH1.
            INCLUDE STRUCTURE BMMH1.
    DATA:END OF W_BMMH1.
    DATA:BEGIN OF W_BMMH7.
            INCLUDE STRUCTURE BMMH7.
    DATA:END OF W_BMMH7.
    DATA : BEGIN OF TAB_TLINE OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA : END OF TAB_TLINE.</b>
    i have written the same in <b>ECC6.0</b> as below
    <b>TYPES:BEGIN OF tw_bmm00.
            INCLUDE STRUCTURE bmm00.
    TYPES:END OF tw_bmm00 ,
          tt_bmm00 TYPE STANDARD TABLE OF tw_bmm00.
    TYPES:BEGIN OF tw_bmmh1.
            INCLUDE STRUCTURE bmmh1.
    TYPES:END OF tw_bmmh1 ,
              tt_bmmh1 TYPE STANDARD TABLE OF tw_bmmh1.
    TYPES:BEGIN OF tw_bmmh7.
            INCLUDE STRUCTURE bmmh7.
    TYPES:END OF tw_bmmh7 ,
          tt_bmmh7  TYPE STANDARD TABLE OF tw_bmmh7.
    TYPES:BEGIN OF tw_TAB_TLINE.
            INCLUDE STRUCTURE TLINE.
    TYPES:END OF tw_TAB_TLINE,
          tt_tab_tline TYPE STANDARD TABLE OF tw_tab_tline.
    lw_bmm00 TYPE tw_bmm00,
          lt_bmm00 TYPE tt_bmm00,
          lw_bmmh1 TYPE tw_bmmh1,
          lt_bmmh1 TYPE tt_bmmh1,
          lw_bmmh7 TYPE tw_bmmh7,
          lt_bmmh7 TYPE tt_bmmh7,
          lw_tab_thead TYPE tw_tab_thead,
          lt_tab_thead TYPE tt_tab_thead,</b>....
    when i check SLIN errors i am getting the following errors<b>...plz resolve</b>..
    <b>The current ABAP command is obsolete
    <b>Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
    types (not "LIKE" or "STRUCTURE").</b></b>
    <b></b>

    include strture not allowed.
    rules.
    ABAP Development under Unicode
    Prior to Unicode the length of a character was exactly one byte, allowing implicit typecasts or memory-layout oriented programming. With Unicode this situation has changed: One character is no longer one byte, so that additional specifications have to be added to define the unit of measure for implicit or explicit references to (the length of) characters.
    Character-like data in ABAP are always represented with the UTF-16 - standard (also used in Java or other development tools like Microsoft's Visual Basic); but this format is not related to the encoding of the underlying database.
    A Unicode-enabled ABAP program (UP) is a program in which all Unicode checks are effective. Such a program returns the same results in a non-Unicode system (NUS) as in a Unicode system (US). In order to perform the relevant syntax checks, you must activate the Unicode flag in the screens of the program and class attributes.
    In a US, you can only execute programs for which the Unicode flag is set. In future, the Unicode flag must be set for all SAP programs to enable them to run on a US. If the Unicode flag is set for a program, the syntax is checked and the program executed according to the rules described in this document, regardless of whether the system is a US or a NUS. From now on, the Unicode flag must be set for all new programs and classes that are created.
    If the Unicode flag is not set, a program can only be executed in an NUS. The syntactical and semantic changes described below do not apply to such programs. However, you can use all language extensions that have been introduced in the process of the conversion to Unicode.
    As a result of the modifications and restrictions associated with the Unicode flag, programs are executed in both Unicode and non-Unicode systems with the same semantics to a large degree. In rare cases, however, differences may occur. Programs that are designed to run on both systems therefore need to be tested on both platforms.
    Other Changes
    1. Bit Statements
    2. Adding Field Sequences
    3. Loops with VARY and VARYING
    4. Creating Subroutines
    5. Saving Programs
    6. Assigning Types for GET/SET PARAMETER
    7. Unreachable Statements
    8. Function Modules with Incorrect Parameter Names
    1. Bit Statements
    Previously, the system checked for the bit statements SET BIT i OF f [TO g] and GET BIT i OF f [INTO g]whether the field f is character-type; X fields, X strings, and flat structures are usually regarded as character-type. For Unicode programs this is no longer useful, because the types X and XSTRING no longer count as character-type and the bit by bit access to character-type fields or structures is no longer platform-independent. Therefore, with these operations in Unicode programs, the field f must be type X or XSTRING.
    For the bit mask operations f O x, f Z x, and f M x you could previously use all number-type and hence all character-type types for the left operand f. In Unicode programs, the f operand must now be type X or XSTRING.
    2. Adding Field Sequences
    When adding field sequences, restrictions apply to the following statements in Unicode:
    ADD n1 THEN n2 UNTIL nz [ ACCORDING TO sel ] GIVING m ...
    ADD n1 THEN n2 UNTIL nz TO m [ RANGE str ].
    1. The operands n1, n2, and nz must be type-compatible with one another.
    2. The distance between nz and n1 must be an integral multiple of the distance between n2 and n1.
    3. A syntax or runtime error occurs if the fields n1, n2, and nz are not in a structure. This structure must be recognizable statically or its valid area must be marked explicitly using the RANGE addition.
    4. At runtime, the system ensures that the RANGE area is not left.
    ADD n1 FROM i1 GIVING m [ RANGE str ].
    1. Field n1 must be within the structure. The structure must be explicitly defined using the RANGE addition if it is not recognizable statically.
    2. For this variant, the system also checks at runtime whether n1 and the addressed values are within the structure.
    3. Loops
    Loops with the VARY or VARYING addition are also problematic in Unicode, since a type-a access to memory contents cannot be ensured and memory can be overwritten inadvertently.
    DO ... VARYING f FROM f1 NEXT f2.
    For this statement, the fields f, f1, and f2 must be type-compatible with each other. To prevent memory contents being overwritten, a RANGE for valid accesses is introduced implicitly or explicitly for the following statements:
    DO ... TIMES VARYING f FROM f1 NEXT f2 [ RANGE f3 ].
    WHILE ... VARY f FROM f1 NEXT f2 [ RANGE f3 ].
    A syntax or runtime error is caused if f1 or f2 are not included in f3. If the RANGE addition is missing, it is defined implicitly from FROM f1 NEXT f2 as follows:
    1. If both f1 and f2 are statically recognizable components of the same structure, the valid RANGE area is defined from the smallest structure that comprises f1 and f2.
    2. A syntax error is triggered if it is recognizable statically that f1 and f2 are not part of the same structure.
    3. A valid area must be defined explicitly using the RANGE addition if the connection between f1 and f2 is not recognizable statically.
    If you specify a deep structure as the RANGE addition, the system checks for every loop pass that there are no field references, object references, tables, or strings in the area read.
    4. Creating Subroutines
    When automatically generating subroutines using the statement GENERATE SUBROUTINE POOL itab NAME name, the generated program inherits the content of the Unicode flag of the generating program.
    5. Saving Programs
    When automatically generating programs using the statement INSERT REPORT prog FROM itab, default values are set for the TRDIR entry as before. Amongst other things, this statement has the new addition UNICODE ENABLING uc, with which the Unicode flag of the inserted report receives the value of uc. If this addition is missing, the following applies:
    1. A Unicode program creates a Unicode program.
    2. A non-Unicode program in turn creates a non-Unicode program.
    3. A non-Unicode program becomes a Unicode program if it is overwritten by a Unicode program.
    4. A Unicode program remains a Unicode program if it is overwritten by a non-Unicode program.
    6. Assigning Types for GET/SET PARAMETER
    For the statements GET PARAMETER ID pid FIELD f and GET PARAMETER ID pid FIELD f, f must be character-type. You can use the EXPORT and IMPORT statements for storing non-character-type fields and structures.
    7. Unreachable Statements
    In Unicode programs, unreachable statements cause a syntax error. In non-Unicode programs, there was previously only a syntax warning.
    8. Function Modules with Incorrect Parameter Names
    In Unicode programs, calling a function module, whose parameter names are specified statically as a literal or constant, causes an exception that can be handled if an incorrect parameter name was specified. This only applies to function modules that are not called via Remote Function Call. In non-Unicode programs, an incorrect name was previously ignored.
    http://service.sap.com/instguides
    --> SAP Business Suite Applications
    --> SAP ERP
    --> mySAP ERP 2005
    --> Upgrade
    --> Upgrade Documentation - mySAP ERP 2005 SR2
    There choose your database and operating system.
    If you're looking for functional details check
    http://service.sap.com/releasenotes

  • Regarding LOOP Statement in ABAP

    Hi,
    I have small question regarding <b>LOOP ..... ENDLOOP</b> statement against <b>SY-SUBRC</b> Check.
    I have a loop as below:
    <b> LOOP AT i_vbap WHERE vbeln = i_vbak-vbeln.
        Some Code
        ENDLOOP.
        IF sy-subrc <> 0.
          APPEND i_sdata.
          CLEAR i_sdata.
        ENDIF.</b>
    Is the above <b>Code/Syntax</b> is correct one.
    Can we use <b>SY-SUBRC</b> Check against <b>LOOP ...  ENDLOOP</b> statement.
    Is this the right way of writing the code as per standards.
    Can anybody give sujjestions regarding the same.
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi Prasad,
    Yes, you could use sy-subrc after the endloop. For example:
    loop at itab1 where kunnr = itab2-kunnr.
    some conditions...
    endloop.
    if sy-subrc = 0.
    write: 'Success!'.
    else.
    leave program.
    endif.
    if you press F1 while highlighting the LOOP statement here are the meaning of sy-subrc in loop...endloop.
    SY-SUBRC = 0:
    At least one loop pass was processed.
    SY-SUBRC = 4:
    The loop was not processed because the table contains no entries or no entries satisfied the conditions.
    Regards!

  • Regarding Bounds Statement in ABAP HR

    Hi Guys!!!!
    I have been trying to work on provide, end provide in an HR program and then when I went into f1 of the statement I found an simple provide,end provide which I am pasting here:
    PROVIDE FIELDS col3 FROM itab1 INTO wa1
                                   VALID flag1
                                   BOUNDS col1 AND col2
            FIELDS col3 FROM itab2 INTO wa2
                                   VALID flag2
                                   BOUNDS col1 AND col2
            BETWEEN 2 AND 14.
    Now, I am really not able to understand the meaning of BOUNDS here, What does it actually do?? Could someone please explain. I searched in SCN and could not find any apt reply actually.
    Regards,
    Vishwa.

    hi,
    PROVIDE FIELDS {*|{comp1 comp2 ...}}
                   FROM itab1 INTO wa1 VALID flag1
                   BOUNDS intliml1 AND intlimu1
                   [WHERE log_exp1]
            FIELDS {*|{comp1 comp2 ...}}
                   FROM itab2 INTO wa2 VALID flag2
                   BOUNDS intliml2 AND intlimu2
                   [WHERE log_exp2]
            BETWEEN extliml AND extlimu
            [INCLUDING GAPS].
    ENDPROVIDE.
    To be able to process internal tables using PROVIDE, all tables itab1 itab2 ... must be fully typed index tables and contain two special columns that have the same data type (d, i, n, or t) for all relevant tables. For every table you must specify the names intliml1 intliml2 ... and intlimu1 intlimu2 ... of these columns using the addition BOUNDS.
    The columns intliml1 intliml2 ... and intlimu1 intlimu2 ... in every row of the relevant internal tables must contain values that can be interpreted as limits of closed intervals. Within a table, the intervals specified in these columns must not overlap and must be sorted in ascending order. The intervals therefore make up a unique key for every row.
    Regards,
    Arjun.

Maybe you are looking for