Coding performance

Hi
I have two questions regarding the performance issue:
Q1.
I have a "Collection" object, each element inside the "Collection" is a class object, then I am going to tranverse the "Collection" to an array object and pass an array object to the function. In terms of performance issue, is it a good way to do so?
Collections c = Obj.getCollection();
//calling a function
function((Obj[]) c.toArray());
Q2.
Which way is better to parse an object?
Obj a = obj.getA();
//calling function
setA(a);
or
setA(obj.getA());
Thanks!

user978043 wrote:
Hi
I have two questions regarding the performance issue:
Q1.
I have a "Collection" object, each element inside the "Collection" is a class object, then I am going to tranverse the "Collection" to an array object and pass an array object to the function. In terms of performance issue, is it a good way to do so?
Collections c = Obj.getCollection();
//calling a function
function((Obj[]) c.toArray());
It almost certainly won't matter. In the general case, tiny little things like that have no visible effect on performance.
The real question here is not "how will it affect performance?" but "what do I need?" or "what's the sensible deisgn?" Do you need an array? If so, then you have no choice, and you have to call toArray(). But if you don't need an array--that is, if you control function()--why not just have it take a Collection instead?
In other words, the choice to use a collection or an array is a design choice, not a performance choice. (There are exceptions to this, but you'll know them when you run across them, which won't happen during your early academic career.)
Q2.
Which way is better to parse an object?
Obj a = obj.getA();
//calling function
setA(a);
or
setA(obj.getA());There's no parsing going on there.
Again, you will never see a performance difference here. If you're going to use the result of getA() more than once, then store it in a variable. If you're only going to use it once, you can just call setA(obj.getA()) if you find its compactness easier to read. Note that in some cases this can make debugging more difficult, and for all but very simple expressions like that, it gets hard to read very quickly.
Don't worry about piddly little microoptimizations for performance. That's a waste of time, and it teaches you to focus on the wrong things. Performance comes from appropriate design, data structures, and algorithms, not from counting CPU cycles for variable assignments.

Similar Messages

  • Performance tuning in Smart form

    Hi,
    How to performance tuning in Smart form level
    Any tips available kindly send me any one .
    Thanks&Regards,
    Maya

    Hi,
    If you are using a customized print program to call the Smart Form...it is better to fetch most of the data as much as possible within it and pass it useing form interface/functional module interface.
    Then in the ABAP code where ever used, fallowing the ABAP coding performance tuning options like avoiding the MOVE-CORRESPONDING, INTO CORRESPONDING, using binary search for READ statement...etc...
    Regards,
    Bharat.

  • Performance analysis in WF area

    Hello there,
    I'm quite new in the workflow area. I would like to ask for some information on how to do a proper performance anaysis (what to look on, useful transactions,...) The Scenario is about the use of Standard Workflow with WebDynpro interface. The Portal is being used for authentication.
    Where can I find some useful information on this? Any information is helpful.
    Thanks in advance
    Tim.

    Hi Tim,
    On preliminary basis, areas where you will actually do the custom coding will come under consideration for performance.
    e.g. 1. Coding in Methods of Business Objects.
           2. Use of Virtual attributes in Business Objects.
           3. In case of web dynpro, if it is ABAP web dynpro, then again ABAP coding
               performance standards will prevail here also.
    Hope this helps.
    Regds,
    Akshay

  • Concatenating sy-tabix with field name

    While doing BDC I need to concatenate the sy-tabix with the field as the BDC is on item level.
    LOOP AT request INTO wa_request.
        PERFORM dynpro USING:
            'X'     'SAPMV50A'              '1000',
            ' '     'BDC_OKCODE'            '=CHSP_T',
            ' '     'BDC_CURSOR'            'LIPS-POSNR('& sy-tabix &')',
            ' '     'BDC_OKCODE'            '=CHSP_T',
            ' '     'BDC_CURSOR'            'LIPS-POSNR(01)',
    ENDLOOP.
    As you can see I am trying to concatenate the sy-tabix so it will appear as LIPS-POSNR(01) and then LIPS-POSNR(02) .. How to accomplish this. Thank you

    Hi,
    You need to use a specific field for that :
    data : text_field(14) type c,
           idx(2) type n.
    idx = sy-tabix.
    concatenate 'LIPS-POSNR(' idx ')' into text_field.
    and then you can use it in your BDC coding :
        PERFORM dynpro USING:
            'X'     'SAPMV50A'              '1000',
            ' '     'BDC_OKCODE'            '=CHSP_T',
            ' '     'BDC_CURSOR'            text_field,
            ' '     'BDC_OKCODE'            '=CHSP_T',
            ' '     'BDC_CURSOR'            'LIPS-POSNR(01)',
    Regards,
    Nicolas.

  • How to put the sender name in the wf-system

    Hi,
    Can anybody pls tell me how to give the sender address in stead of WF-SYSTEM
    When ever a mail is triggered the mail is send to the mail inbox.in the mail inbox it is showing in the sender option : WF-SYSTEM...
    I want to put any name their .
    can i put any name their.
    please help me.....very urgent.
    For any clarification pls revert back.
    Thnks

    Hi,
    I've put the steps again here but this time I've put in Bold the lines that needs to be added in the different sources.
    • Copy the BO SOFM to ZSOFM
    And add to the method Send an import parameter
    SENDER like PA0105-USRID_LONG
    Then change the method SEND
    begin_method send changing container.                             
    data: result_object type swc_object.                              
    data: document_data  like sodocchgi1,                             
          document_type  like sofolenti1-obj_type,                    
          receivers      like somlreci1 occurs 1 with header line,    
          object_para    like soparai1  occurs 0 with header line,    
          object_parb    like soparbi1  occurs 0 with header line,    
          object_header  like solisti1 occurs 1 with header line,     
          object_content like solisti1 occurs 10 with header line.    
    data  folder_id      like soobjinfi1-object_id.                   
    data  new_object_id  like soobjinfi1-object_id.                   
    data  document_id    like sofolenti1-doc_id.                      
    data low_len like sy-tabix.                                       
    data  rcode          like sonv-rcode.                             
    <b>data : SENDER like pa0105-usrid_long.                             
    DATA : packinglist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.     
    DATA: tab_lines TYPE sy-tabix.                                    
    DATA : sender_address like SOEXTRECI1-RECEIVER.                   
    swc_get_element container 'SENDER' SENDER.       </b>
    * get receivers out of container                 
    perform extract_receivers tables receivers         
                                     container.        
    if object-key = space.                             
      * get document data out of the container       
      perform extract_document tables object_para      
                                      object_parb      
                                      object_header    
                                      object_content   
                                      container        
                               using  document_type    
                                      document_data.   
    <b>DESCRIBE TABLE object_content LINES tab_lines.     
    Packing List                                     
    CLEAR packinglist-transf_bin.                      
    packinglist-head_start = 1.                        
    packinglist-head_num = 0.                          
    packinglist-body_start = 1.                        
    packinglist-body_num = tab_lines.                  
    packinglist-doc_type = 'RAW'.                      
    APPEND packinglist.                                                                               
    move sender to sender_address. 
    * send document                                               
      call function 'SO_DOCUMENT_SEND_API1'                         
        exporting                                                   
          put_in_outbox = ''                                        
          document_data = document_data                             
          sender_address = sender_address                           
          sender_address_type        = 'SMTP'                       
          commit_work                = ''                           
       tables                                                       
          packing_list   = packinglist                              
          receivers      = receivers                                
          contents_txt   = object_content                           </b>   exceptions                                                    
          parameter_error = 23                                      
          too_many_receivers =  1                                   
          x_error =              1000                               
          operation_no_authorization =  13                          
          enqueue_error =     2                                     
          document_type_not_exist = 3                               
          document_not_sent =  15.                                  
      if sy-subrc ne 0.                                             
        exit_return 1023  document_data-obj_descr space space space.
      endif.                                                        
    * create now SOFM object of sent document                     
      if sy-subrc = 0.       
        perform insert_document_with_data using new_object_id        "870566
                                                document_data               
                                       changing folder_id                   
                                                rcode.                      
      else.                                                                 
        move sy-subrc to rcode.                                             
        exit_return 1900 'Document Insert' space space space. "#EC NOTEXT   
      endif.                                                                
    * create result element with object key                               
      if rcode = 0.                                                         
        perform create_result tables container                              
                              using folder_id                               
                                    new_object_id                           
                                    result_object.                          
        perform create_object using folder_id                               
                                    new_object_id.                          
      endif.                                                                
    else.                                                                   
      move object-key to document_id.                                       
      call function 'SO_OLD_DOCUMENT_SEND_API1'                             
           exporting                                                        
                document_id                =  document_id                   
                PUT_IN_OUTBOX              =                              
           IMPORTING                                                      
                SENT_TO_ALL                =                              
           tables                                        
                receivers                  =  receivers  
           exceptions                                    
                too_many_receiver          = 1           
                document_not_sent          = 2           
                document_not_exist         = 14          
                operation_no_authorization = 13          
                parameter_error            = 23          
                x_error                    = 6           
                enqueue_error              = 7           
                others                     = 1000.       
      if sy-subrc ne 0.                                  
        exit_return 1023  document_id space space space. 
      endif.                                             
    endif.                                               
    end_method.                                                                               
    • Copy the function SWW_SRV_MAIL_SEND to ZSWW_SRV_MAIL_SEND
    And add as import parameter SENDER TYPE COMM_ID_LONG.
    In this function it will create an object SOFM and call the method Send and link the container for this method. So now we’ll create our copy of SOFM and add SENDER as container.
    Set the object.
      swc_create_object office_object 'ZSOFM' space.
      swc_set_element local_container 'DocumentName' documentname.
      swc_set_element local_container 'DocumentTitle' documenttitle.
      swc_set_element local_container 'SENDER' SENDER.
      swc_set_table local_container 'DocumentContent' documentcontent[].
      swc_set_table local_container 'Receivers' t_receivers.
      swc_set_element local_container 'Express' express.
      IF NOT documentexpirydate IS INITIAL.
                  swc_set_element local_container 'DocumentExpiryDat'
                  documentexpirydate.
         ENDIF.
    •Create a subtype for BO SELFITEM
    Example : ZSELFWI
    Create a method “SendWithSender”
    Tab General : Check Synchronous & Result parameter
    Tab Result type : Object type SOFM
    Tab ABAP :  SWO_INVOKE
    Then you’ll have to copy all the parameter from the original function
    “SendTaskDescription” and add a new one
    SENDER(import like PA0105-USRID_LONG)
                Then copy the method “SendTaskDescription” to the code of “SendWithSender”
    Now you’ll have to do some modifications to call the copy of the function
    SWW_SRV_MAIL_SEND  and then delegate ZSELFWI &#61664; SELFITEM
    And now in your task call the method SendWithSender of Selfitem and bind an address to Sender.
    BEGIN_METHOD SENDWITHSENDER CHANGING CONTAINER.                  
    <b>DATA: WORKITEMID LIKE SWWWIHEAD-WI_ID.                           </b>
    DATA: receivers TYPE swc_object OCCURS 0.                        
    DATA: BEGIN OF address_objects OCCURS 3,                         
           a_object TYPE swc_object,                                 
          END OF address_objects.                                    
    DATA: return TYPE STANDARD TABLE OF swotreturn WITH HEADER LINE. 
    DATA: text_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE.  
    DATA: document_content TYPE so_txttab.                           
    DATA: ls_document_content TYPE LINE OF so_txttab.                
    DATA: workitem_task LIKE swwwihead-wi_rh_task,                   
          workitem_language LIKE swwwihead-wi_lang,                  
          workitem_short_text LIKE swwwihead-wi_text,                
          express LIKE sos04-l_***,                                  
          send_type LIKE sos04-l_art,                                
          send_language LIKE sy-langu,                               
          rc LIKE syst-subrc.                                        
    <b>DATA: SENDER like PA0105-USRID_LONG.                             </b>
    DATA: BEGIN OF address_strings OCCURS 3,                         
           a_string LIKE soxna-fullname,                             
         END OF address_strings.                                     
    DATA: attachments TYPE swc_object OCCURS 0 WITH HEADER LINE.     
    DATA: line_width LIKE thead-tdlinesize.                          
    DATA: wi_handle TYPE REF TO if_swf_run_wim_internal.             
    DATA: wi_container TYPE REF TO if_swf_cnt_container.             
    DATA: lv_excp TYPE REF TO cx_swf_run_wim.                               
    DATA: l_subrc TYPE sysubrc.                                             
    DATA: l_expiry_date TYPE sydatum.                                       
    DATA: l_settings TYPE swp_admin.                                                                               
    ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    PERFORM trc_init <b>in program SWWSI</b> .                                     
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                               
    swc_container addr_crea_container.                                                                               
    Get the input parameters.                                             
    swc_get_table container 'AddressStrings' address_strings.               
    swc_get_element container 'TypeId' send_type.                           
    swc_get_table container 'Receivers' receivers.                          
    swc_get_element container 'Express' express.                            
    swc_get_element container 'Language' send_language.                     
    swc_get_table container 'Attachments' attachments.                      
    swc_get_element container 'LineWidth' line_width.                       
    <b>SWC_GET_ELEMENT CONTAINER 'SENDER' SENDER.                              
    SWC_GET_PROPERTY SELF 'WorkitemId' WORKITEMID.                          </b> ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    PERFORM trc_after_import_params <b>in program SWWSI</b>                        
                                    TABLES container                        
                                           address_strings                 
                                           receivers                       
                                           attachments                     
                                    USING send_type                        
                                          express                          
                                          send_language                    
                                          line_width.                      
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    Get some attributes of the object.                                   
    TRY.                                                                   
        CALL METHOD cl_swf_run_wim_factory=>find_by_wiid                   
          EXPORTING                                                        
            im_wiid     = <b>WorkitemId</b>                                       
          RECEIVING                                                        
            re_instance = wi_handle.                                       
        workitem_task = wi_handle->m_sww_wihead-wi_rh_task.                                                                               
    IF send_language IS INITIAL.                                       
          send_language = wi_handle->m_sww_wihead-wi_lang.                 
        ENDIF.                                                                               
    wi_container = wi_handle->get_wi_container( ).                     
      Perform variable substitution for task description.                
        CLEAR text_lines[].        
        IF line_width IS INITIAL.                      
         line_width = 75.                            
          line_width = 132.                            
        ENDIF.                                         
        CALL FUNCTION 'SWU_GET_TASK_TEXTLINES'         
          EXPORTING                                    
            task              = workitem_task          
            usage             = 'W'                    
            linewidth         = line_width             
            language          = send_language          
            container_handle  = wi_container           
          TABLES                                       
            ascii_text_lines  = text_lines             
          EXCEPTIONS                                   
            wrong_usage       = 01                     
            text_not_found    = 02                     
            text_system_error = 03.                    
        IF sy-subrc NE 0.                              
          exit_return 1004 space space space space.    
        ENDIF.                                                                               
    get work item text                               
        CALL METHOD wi_handle->get_witext              
          EXPORTING                                    
            im_language = send_language                
          RECEIVING                                                             
            re_witext   = workitem_short_text.                                                                               
    ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
        PERFORM trc_after_text_generation <b>in program SWWSI</b>                      
                                          TABLES                                
                                             text_lines                         
                                          USING                                 
                                              wi_handle->m_sww_wihead           
                                              workitem_short_text               
                                              send_language                     
                                              line_width.                       
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                               
    Fill the document content.                                                
        LOOP AT text_lines.                                                     
          ls_document_content-line = text_lines-tdline.   "note 510198          
          APPEND ls_document_content TO document_content.                       
        ENDLOOP.                                                                               
      * note 881594 - determine default expiry date for office documents      
        CALL FUNCTION 'SWP_ADMIN_DATA_READ'                                     
          IMPORTING                                                             
            wf_settings = l_settings.                                           
        IF NOT l_settings-doc_expiry IS INITIAL.                           
          l_expiry_date = sy-datum + l_settings-doc_expiry.                
        ENDIF.                                                                               
    *- There problems with the implementation of persistence service       
    *- of objects. The symptom of this problems is that sendorders         
    *- (SCOT) are not saved if an object pool exists. Therefore we         
    *- create a new session in this environments.                          
        DATA: t_receivers_por TYPE tswotobjid.                             
        DATA: t_attachments_por TYPE tswotobjid.                           
        DATA: receiver_object TYPE swc_object.                             
        DATA: attachment_object TYPE swc_object.                           
        DATA: por TYPE swotobjid.                                          
        DATA: result_por TYPE swotobjid.                                   
        DATA: rfcdest TYPE rfcdest.                                        
        DATA: documentname TYPE sodocchgi1-obj_name.                       
        DATA: documenttitle TYPE sodocchgi1-obj_descr.                     
        DATA: t_address_strings type swfstrtab.                                                                               
    LOOP AT receivers INTO receiver_object.                            
          swc_object_to_persistent receiver_object por.                    
          IF sy-subrc EQ 0.                                                
            swc_free_object receiver_object.                               
            APPEND por TO t_receivers_por.                                 
          ENDIF.                                                           
        ENDLOOP.                                          
        LOOP AT attachments INTO attachment_object.       
          swc_object_to_persistent attachment_object por. 
          IF sy-subrc EQ 0.                               
            swc_free_object attachment_object.            
            APPEND por TO t_attachments_por.              
          ENDIF.                                          
        ENDLOOP.                                          
        LOOP AT address_strings.                          
          append address_strings to t_address_strings.    
        endloop.                                                                               
    rfcdest = space.                                  
        IF cl_object_pool=>instance_exists( ) EQ 'X'.     
          rfcdest = 'NONE'.                               
        ENDIF.                                                                               
    documentname = 'Notiz'(001).                      
        documenttitle = workitem_short_text.              
        CALL FUNCTION <b>'ZSWW_SRV_MAIL_SEND'                </b>
          DESTINATION rfcdest                             
          EXPORTING                                       
            send_type               = send_type           
            send_language           = send_language       
            documentname            = documentname        
            documenttitle           = documenttitle                
            documentcontent         = document_content             
            receivers               = t_receivers_por              
            express                 = express                      
            documentexpirydate      = l_expiry_date                
            attachments             = t_attachments_por            
            address_strings         = t_address_strings            
            <b>SENDER                  = SENDER    </b>                   
          IMPORTING                                                
            result_por              = result_por                   
          EXCEPTIONS                                               
            document_not_send       = 1                            
            not_specified           = 2                            
            error_during_send       = 3                            
            error_during_attachment = 4                            
            OTHERS                  = 2.                           
        l_subrc = sy-subrc.                                        
    *~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~       
        PERFORM trc_after_send <b>in program SWWSI</b> USING l_subrc.     
    *~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~       
      Check the result of the method call.                       
        CASE l_subrc.                                              
          WHEN 0.                                                  
            Set the return element (the SOFM object).               
            swc_set_element container result result_por.           
            commit work.                                           
          WHEN 1.                                                  
            exit_return 1001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
          WHEN 2.                                                  
            exit_return 1002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
          WHEN 4.                                                  
            exit_return 1005 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
            WHEN OTHERS.                                           
              exit_return 1003 space space space space.            
          ENDCASE.                                                                               
    CATCH cx_swf_run_wim INTO lv_excp .                          
        exit_return 1006 <b>workitemid</b> space space space.                                                                               
    ENDTRY.                                                                               
    END_METHOD.

  • Where is the code to avoid invoice split using multiple delivery numbers

    My functional consultant is asking me to debug because while trying to created invoice using the 2 deliveries are not commingling into a single invoice.  Means not able to create single invoice using both delivery notes.
    He said, u201CThe split is happening in include RV60C901 based upon the vbrk-zukri value which is being populated in the perform "split_on_header_text". The thing is I do not know why this is the case - both of these DNs do not have any header text that is different.
    Can you please help me look into why these split.
    You can use VF01 and enter these 2 DN #s 6073122213  and 6073122212 in 2 different lines and choose the save icon. This will allow you to get to this code.
    If you execute all the way through you will create an invoice. You can cancel this using VF11 (with the # that came up after full execution and the number 1 before that number) again by putting in the 2 new #s and choosing save.
    Once this is cancelled you can go back to the VF01 step with the  6073122213  and 6073122212  doc #su201D.
    Ho can I find out why ?
    The coding perform split_on_header_text includes ztable selection :
    *Get a list of text elements the program should check for
      select *
        appending corresponding fields of table t_zsplittext
      from zsplittext           " Texts ID's checked for splitting/combining
        where vkorg       =  vbrk-vkorg and" Sales Organisation
              zzenhancno  = 'VD-06'     and" Enhancement name
              tdobject    = 'VBBK'      and" Texts used within VD-06
              zzactive    <> ''.           " The record should be active

    Hi SAM ,
    first thing is u need to debug that program , and find out which enhancements it is using  t_zsplittext ?.
    as per my knowledge Splitting will happens based on the config.
    regards
    Prabhu

  • Problem in Sapscript , After creating a copy of Standard Script

    Hello friends,
                       I have copied a standard script WASCHEIN into ZWASCHEIN, now all the data is coming from driver program SAPM07DR. Now there is one field which is not coming from the standard program,
                      Is there any way i can capture the field in my script without making changes in the standard driver program like a select statement in the script.
    Thanks.
    Edited by: Vijay Babu Dudla on Dec 16, 2008 3:24 AM

    Hello Poonam,
    Sorry i think you are not aware of using PERFORM stmts in SAPScripts !!!
    @ Amit you can try this bit of coding:
    /:           PERFORM F_GET_KTEXT IN PROGRAM ZPROGRAM
    /:           USING &MSEG-NPLNR&
    /:           CHANGING &V_KTEXT&
    /:           ENDPERFORM
    Create a Subroutine-Pool Program: ZPROGRAM where you write the FORM for the above PERFORM.
    FORM f_get_cust_details
    TABLES fp_it_input  STRUCTURE itcsy
                  fp_it_output STRUCTURE itcsy.
    DATA:
      l_v_nplnr TYPE nplnr,
      l_v_ktext TYPE auftext. 
      READ TABLE fp_it_input WITH KEY name = 'MSEG-NPLNR'.
      IF sy-subrc = 0.
        l_v_nplnr = fp_it_input-value.
      ENDIF.
      SELECT SINGLE KTEXT
      INTO l_v_ktext
      FROM aufk
      WHERE aufnr = l_v_nplnr.
      LOOP AT fp_it_output.                                     "#EC *
        IF fp_it_output-name EQ 'V_KTEXT'.
    *     Modifying the output table with the customer number
          fp_it_output-value = l_v_nplnr.
          MODIFY fp_it_output.
      ENDLOOP.
    ENDFORM.
    Please note that passing the USING / CHANGING parameters through tables of ITCSY structures is a standard way of doing this & you cannot change this )
    Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Dec 16, 2008 9:39 AM

  • Prores 4444 Problems

    Hi there,
    I'm digitizing video from a 4:4:4 HDSR through an AJA Kona 3 card (ver 6.0.3) to Final Cut trying to create ProRes 4444 files. However when I look at these files on the scopes my black level does not sit at 0 but rather it seems to add a setup to 7.5. My white levels also seem to have dropped. This shows up on the FCP scopes and on outboard calibrated scopes (back out through the Kona card).
    I've tried the same material with various other compressions (10 bit, Prores 422, etc) and all of those show the blacks at 0. As soon as I use ProRes 4444 the levels are raised. I've tried using Millions of Colors and Millions of Colors+ (although I don't need the Alpha channel) and I've turned the Gamma Correction off.
    Is there anything else I could be missing? Is this just what ProRes 444 does? I can't find much documentation on this subject. Thanks so much for any help.
    Ryan

    From the ProRes white paper:
    • Apple ProRes 4444: The new Apple ProRes 4444 codec preserves motion image sequences originating in either 4:4:4 RGB or 4:4:4 Y’CBCR color spaces. At its remarkably low data rate as compared to uncompressed 4:4:4 HD, Apple ProRes 4444 supports 12-bit pixel depth with an optional, mathematically lossless alpha channel for true 4:4:4:4 support. Apple ProRes 4444 preserves visual quality at the same high level as does Apple ProRes 422 (HQ), but for 4:4:4 image sources, which can carry the highest possible color detail.
    Apple ProRes 4444 is ideal for next-generation video and the most pristine computer graphics sources for cinema-quality compositing. For projects that previously required the Animation codec, Apple ProRes 4444 is a modern replacement with real-time playback support in Final Cut Pro. Because color detail is preserved, Apple ProRes 4444 is ideal for color grading with 4:4:4 image sources.
    • Apple ProRes 422 (HQ): Boasting widespread adoption across the video post- production industry, Apple ProRes 422 (HQ) offers visually lossless preservation of the highest-quality professional HD video that a (single-link) HD-SDI signal can carry. This codec supports full-width, 4:2:2 video sources at 10-bit pixel depths, while retaining its visually lossless characteristic through many generations of decoding and re-encoding.
    Apple ProRes 422 (HQ) can be used both as an intermediate codec to accelerate workflows for complex, compressed video sources and as an affordable, high- performance alternative to uncompressed 4:2:2 video.
    • Apple ProRes 422: Apple ProRes 422 offers nearly all the benefits of its big brother, Apple ProRes 422 (HQ), but at a significantly lower data rate. It provides visually lossless coding performance for the same full-width, 10-bit, 4:2:2 sequences as Apple ProRes 422 (HQ) with even better multistream RT editing performance.
    • Apple ProRes 422 (LT): Like Apple ProRes 422 (HQ) and Apple ProRes 422, the new Apple ProRes 422 (LT) codec supports full-width 10-bit video sequences, but at a target data rate even lower than these siblings. Apple ProRes 422 (LT) weighs in at 100 Mbps or less, depending on the particular video format. It balances incredible image quality with small file sizes, and is perfect for digital broadcast environments where storage capacity and bandwidth are often at a premium.
    Apple ProRes 422 (LT) is ideal for live multi-camera and on-location productions where large amounts of footage are acquired to disk. The low data rate of Apple ProRes 422 (LT) also makes it an excellent choice for transcoding complex camera codecs like AVCHD.
    • Apple ProRes 422 (Proxy): The third new member of the Apple ProRes family is Apple ProRes 422 (Proxy). This codec maintains HD data rates below 36 Mbps, yet like its higher-rate Apple ProRes 422 siblings, it supports full-frame, 10-bit, 4:2:2 video.
    Apple ProRes 422 (Proxy) is intended for draft-mode or preview uses where low data rates are required, yet full-resolution video is desired. It is the ideal format for use in offline editing workflows with Final Cut Server. The traditional offline-to-online workflow with Final Cut Pro has relied on the Offline RT codec, but today’s HD workflows demand offline video formats that support native frame size and aspect ratio. Apple ProRes 422 (Proxy) supports full 1920 x 1080 and 1280 x 720 resolutions, enabling full HD resolution while editing, and accurate representation of FCP motion effects from the creative stages through finishing.

  • Problems running servlet due to missing classes?

    Hi everyone,
    I am doing a project which requires me to convert a java coding into a servlet. This java coding I am working on is some kind of location based service which tracks people (receiving an argument of a string as IP). It imports an external SDK called Ekahau SDK (some off the shelve product). Now I wish to convert it into a servlet so that the function that the java coding performs can be run from a webpage i created.
    I have previously posted a thread on this forum called "Converting java coding into servlets?" when I had trouble compiling the servlet. Now that I could compile the servlet already, I still have problems running the servlet from my browser.
    The webserver I am using is Apache Tomcat. Previously I was trying Apache HTTP server but since now I need to use servlet, I have shifted to Tomcat instead. I have been getting these "java.lang.NoClassDefFoundError:" when running the servlet from the browser. From the previous thread, I got suggestions from the replies saying that I need to put the jar files I need into my "C:\Tomcat\webapps\try\WEB-INF\lib" directory. I have been looking for the missing jar files from the internet and putting them into my "C:\Tomcat\webapps\try\WEB-INF\lib", but each time after adding a new jar file, I get another new "java.lang.NoClassDefFoundError:". Are the missing jar files really the problems? Cause it seems a bit weird to me that I need some many jar files which I dont even know why I need them for.
    The HTTP status 500 error look like this:
    description
    The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: org/apache/excalibur/configuration/CascadingConfiguration
    com.ekahau.G.N.A(Unknown Source)
    com.ekahau.G.N.<init>(Unknown Source)
    com.ekahau.sdk.imp.yax.D.<init>(Unknown Source)
    com.ekahau.sdk.imp.yax.E.connect(Unknown Source)
    com.ekahau.sdk.PositioningEngine.connect(Unknown Source)
    coreservlets.testing.find(testing.java:75)
    coreservlets.testing.doGet(testing.java:36)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Here are the series of jar files I have been looking from the internet to add them into my "C:\Tomcat\webapps\try\WEB-INF\lib" directory:
    1) org/apache/commons/collections/Closure
    2) org/apache/log4j/Logger
    3) org/apache/commons/lang/Validate
    4) org/apache/excalibur/configuration/CascadingConfiguration
    Please help~~ Thanks a lot.
    My servlet coding is like this:
    package coreservlets;
    import java.io.*;
    import java.util.*;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.ekahau.sdk.*;
    public class testing extends HttpServlet
         String ipAddress;
         int result;
           public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
                  ipAddress = request.getParameter("deviceIP");
              try
                   result = find();     
              catch (IOException e)
                   System.out.println("Error..." + e.toString());
              catch (EngineException e)
                   System.out.println("Error..." + e.toString());
              response.setContentType("text/html");
                  PrintWriter write = response.getWriter();
              write.println("<HTML>\n" +
    "<HEAD><TITLE>Tryget</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    result +
    "</BODY></HTML>");
           public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
                  doGet(request, response);
         public int find() throws EngineException, IOException
              PositioningEngine.connect();
                  // Find the given device:
                  Device[] devices = PositioningEngine.findDevice("NETWORK.IP-ADDRESS", ipAddress);
                  if (devices.length == 0)
                         System.err.println("Device with IP address " + ipAddress + " not found.");
                   PositioningEngine.disconnect();
                   return 0;
              else
                         TrackedDevice device = new TrackedDevice(devices[0]);
                         // Create a simple handler for locations for one-time usage:
                         LocationEstimateListener estimateListener = new LocationEstimateListener()
                           public void handleLocationEstimate(LocationEstimate locationEstimate, TrackedDevice device)
                                  // Change getLatestLocation to getAccurateLocation if you want
                                  // a bit more accurate but a few seconds delayed location.
                                  Location loc = locationEstimate.getLatestLocation();
                             final double coX = loc.getX();
                             final double coY = loc.getY();
                             try{
                             FileWriter file = new FileWriter ("C:\\Documents and Settings\\xamule\\Desktop\\Testing\\output\\output.txt");
                             String x = Double.toString(coX);
                             String y = Double.toString(coY);
                             String coor = x + "\t" + y;
                             file.write(coor);
                             file.close();
                             catch (IOException e){
                             System.out.println("Error..." + e.toString());
                   StatusListener statusListener = new StatusListener()
                           public void handleStatus(Status status, TrackedDevice device)
                                  System.err.println(new Date()+"\tStatus for device: " + status);
                         // Add listeners and start tracking
                         device.addLocationEstimateListener(estimateListener);
                         device.addStatusListener(statusListener);
                         device.setTrackingParameter("EPE.LOCATION_UPDATE_INTERVAL","6000");
                         device.setTracking(true);
                         // Wait until user inputs something. When he/she does, stop tracking and quit application
                         //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                         //in.readLine();
                         // Stop tracking and disconnect from the positioning engine:
                         device.setTracking(false);
                         PositioningEngine.disconnect();
                   return 1;
    }

    Well, it's kind of logical that as you put more jar files (classes) in Tomcat, it changes the error to ask for the classes (inside a jar) it cannot find.
    There was a good class->jar finder on the internet some years ago, but i don't remember the address. Try looking for that and search all the missing classes (NotDefined) and their correspondig jar files.
    Good Luck!

  • ABAP code issue

    Hello Team,
    We are facing ABAP coding performance issue in BW production and quality system. This is holding under production data loading.
    There is piece of code written in BW while loading data from one target to other
    Code:
    DELETE SOURCE_PACKAGE WHERE recordmode = 'X' OR recordmode = 'R'
    OR recordmode = 'D'.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_new_source
    FROM /bic/afao06pa100
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
    and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    * Since the preceding tranformation in the data flow already aggregates
    *multiple occurences of single SO into one record the deletion of
    *duplicates
    * is obsolete
    *    SORT SOURCE_PACKAGE BY doc_number ASCENDING s_ord_item ASCENDING
    *    record DESCENDING.
    *    delete ADJACENT DUPLICATES FROM SOURCE_PACKAGE COMPARING doc_number
    *    s_ord_item.
    SORT SOURCE_PACKAGE BY /bic/fcckjobno /bic/fcckjitid.
    LOOP AT it_new_source INTO wa_new_source.
    READ TABLE SOURCE_PACKAGE WITH KEY
    /bic/fcckjobno = wa_source-/bic/fcckjobno
    /bic/fcckjitid = wa_source-/bic/fcckjitid
    BINARY SEARCH
    INTO wa_source.
    IF sy-subrc = 0.
    MOVE-CORRESPONDING wa_new_source TO ls_target_key.
    MOVE-CORRESPONDING wa_source TO wa_new_source.
    MOVE-CORRESPONDING ls_target_key TO wa_new_source.
    MODIFY it_new_source FROM wa_new_source.
    ENDIF.
    ENDLOOP.
    REFRESH SOURCE_PACKAGE.
    SOURCE_PACKAGE[] = it_new_source[].
    REFRESH it_new_source.
    Above code takes long time for execution.
    In production for 3930891 number or records it runs for an hour an hour and goes into infinite loop without loading any data.
    We have tried same data load in quality system. (BR1)
    For 68293 records load has executed for 8-9 hours and then completed successfully.
    I have tried editing code in BR1 system by removing  ‘INTO CORRESPONDING FIELDS OF TABLE’ and written plain selection of all fields. Performed ST05 trace by commenting other code. But still found it is taking time at select statement and not improvement in load run time at start routine.
    Also tried editing select statement like below but it took same time:
    SELECT /BIC/FCCKCANC PCA_DOCTYP PCA_DOCNO PCA_ITEMNO CHRT_ACCTS MATERIAL
    ACCOUNT COMP_CODE CO_AREA PROFIT_CTR VERSION PART_PRCTR FISCPER
    FISCVARNT /BIC/FCCKJITID /BIC/FCCKJOBNO RECORDMODE /BIC/FCCKCNTR
    /BIC/FCCKCNTN /BIC/FCCKEXIMP /BIC/FCCKJOBTP
    /BIC/FCCKINTST /BIC/FCCKMAJBN /BIC/FCCKALST /BIC/FCCHUBIND
    /BIC/FCCSFCLDT /BIC/FCCHDCLDT /BIC/FCCKETADT /BIC/FCCKETDDT
    /BIC/FCCFULFDT /BIC/FCCKHBL /BIC/FCCKCBL /BIC/FCCKJCRBY /BIC/FCCKLCRBY
    INTO TABLE it_new_source
    FROM /bic/afao06pa100
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    where /bic/fcckjobno = SOURCE_PACKAGE-/bic/fcckjobno
    and /bic/fcckjitid = SOURCE_PACKAGE-/bic/fcckjitid.
    Please suggest code improvement.
    Any data base improvement for tables?
    Any indexing improvement for tables?
    If required please get in touch with data base team for same.

    LOOP AT it_new_source INTO wa_new_source.
    do.
    READ TABLE SOURCE_PACKAGE
         INDEX W_TABIX
         INTO wa_source.
    IF SY-SUBRC NE SPACE.
       EXIT.
    ENDIF.
    IF     wa_new_source-/bic/fcckjobno lt wa_source-/bic/fcckjobno.
      exit.
    elseif wa_new_source-/bic/fcckjobno EQ wa_source-/bic/fcckjobno.
      MOVE-CORRESPONDING wa_new_source TO ls_target_key.
      MOVE-CORRESPONDING wa_source TO wa_new_source.
      MOVE-CORRESPONDING ls_target_key TO wa_new_source.
      MODIFY it_new_source FROM wa_new_source.
       EXIT.
    elseif wa_new_source-/bic/fcckjobno gt wa_source-/bic/fcckjobno.
      w_tabix = w_tabix + 1.
    endif.
    ENDIF.
    DONE.
    ENDLOOP.
    I put only for one field control, you must add the second field in the logic.
    With this kind of code you read only 1 time the two tables.
    This code comes from an old age name : R/2  
    regards
    Fred

  • Dynamic programming by defining one structure

    Dear all,
    I have a problem to define a dynamic programm. Its easyer to show you the coding:
    PERFORM my_perform TABLES lt_vbak.
    PERFORM my_perform TABLES lt_vbap.
    PERFORM my_perform TABLES lt_bkpf.
    FROM my_perform TABLES pt_any_table.
    LOOP AT pt_any_table ASSIGNING <fs_any_structure>.
    ENDLOOP.
    ENDFORM.
    My problem is to define  <fs_any_structure>. I want to do only one loop for each tables who coming throw the PERFOM.
    How can I define the <fs_any_structure> (<fs_any_structure> TYPE ANY???). And its possible to get the structure of the individuell table like this coding?
    Thank u very much

    Hi,
    Try this way.
    PERFORM my_perform TABLES it_vbak USING wa_vbak.
    PERFORM my_perform TABLES it_vbap USING wa_vbap.
    PERFORM my_perform TABLES it_bkpf USING wa_bkpf.
    FORM my_perform TABLES pt_any_table USING pt_any_wa.
    LOOP AT pt_any_table INTO pt_any_wa.
    ENDLOOP.
    ENDFORM.
    Hope this may help you.
    Regards,
    Smart Varghese

  • Some changes we need in the Java language

    Dear Java language makers,
    I'm actually coding a fairly complex program, and I'm facing several issues c++ does solve while Java doesn't handle them. I strongly wish these features could be included in next editions of the Java language, and I think I'm not the only one...
    1) Friend Class access
    Say I have a parser and a Data structure. The parser reads a file, and updates another class (being a data structure) as it parses line by line an input text file.
    I want my parser to fill up the data structure step by step, that is field after field, rather than using a constructor, because the information appears sequentialy in my text input file.
    Using a constructor to intitialize my data structure (rather than field by field access on a void object)would require me creating several variables in my parser for buffering the information, then create my object. This results in a loss of coding performance, and execution performance (spending time allocating and killing buffer values).
    On the other hand, I don't want these field values to be exposed to the users of my SDK, I want them to be accessed thru accessor methods.
    You would answer me : put both classes in the same package, and declare the fields of the data structure "protected", and accessors "public".
    Yes, that is a solution...but if you do really think Object Oriented, this sucks. Because a data structure and a parser are not the same thing, and I want to have them in separate packages.
    one being named myApp.Datasets, the other being named myApp.Parsers.
    And this can't be done with Java.
    If only I could declare in my data structure class the Parser class as a Friend Class, this would solve the issue and be CLEAN for Object Oriented programming !
    2) Operators
    This very annoying the Java language doesn't support operators
    Say you have a Vector3D class and you want to make a calculation :
    in c++, you can define operators for your class, and make a calculation like this :
    float a;
    Vector3D v1,v2,v3;
    //calculation
    v1 = v2 - v3 * a; //clean and easy to read
    Now in Java, not having operators, you have to deal with functions :
    float a;
    Vector3D v1,v2,v3, tmpv;
    v1=new Vector3D();
    tmpv=new Vector3D();
    //calculation
    tmpv.sub(v2,v3);
    tmpv.mul(a);
    v1=tmpv; //dirty and unreadable
    In Java you get 3 lines for a basic calculation. This is the way it's implemented in JAVA3D, and this is the best you can do in Java to my opinion.
    Just imagine how math code looks in java when you code a 3D Physics engine, regarding the previous exemple, and having to deal with matrices, vectors, quaternions...Well I give you a taste, a simple slice of the code :
    vtmp.cross(Airplane.vAngularVelocity,Element.vCGCoords); // rotational part
    vLocalVelocity = add(Airplane.vVelocityBody , vtmp);
    fLocalSpeed = magnitude(vLocalVelocity);
    if(fLocalSpeed > 1) vDragVector = div(negate(vLocalVelocity),fLocalSpeed);
    Vector3f v = new Vector3f();
    v.cross(vDragVector,Element[i].vNormal);
    vLiftVector.cross(v,vDragVector);
    tmp = magnitude(vLiftVector);
    vLiftVector=normalize(vLiftVector);
    v=new Vector3f(vDragVector);
    tmp = v.dot(Element[i].vNormal);
    Got it ? :)

    Because a data structure and a parser are not the same thing,
    and I want to have them in separate packages.Because a data structure and a parser are not the same thing, you should not jave them as the same type (class or interface), that is right. But this does not prevent us from putting them into the same package!
    java. lang.Integer and java.lang.String are not the same thing, but I am quite happy with them as classes in the same package.
    Put both classes in the same package, and declare the fields
    of the data structure "protected", and accessors "public".Protected access would allow access for inheriting classes as well. The default (package-wide) access would be better.

  • Unicode problem: Converting operations on type X operands

    I've got a problem converting a function module to unicode functionality: the original coding performs MOVE and SHIFT operations on operands of type X. The extended syntax check after unicode flag is set fails as X or XSTRING are not considered character-like anymore, of course, as these operations wouldn't delivery a stable result due to the variable lengths in UTF-8. Simply using type C, String or any other character-like operand type instead wouldn't help either, of course, because all  bytestream information would be lost. Does anyone have recommandation on how I can solve this issue?
    Thanks in advance!
    Andy
    Here's an example for the original coding (importhash = import parameter):
    DATA: OP1(10) TYPE X,
    SLEN TYPE I.
    DATA: OP2(12) TYPE X,
    DATA: T_OP2 TYPE SOMEINTEGER WITH HEADER LINE,
    T_OP1 TYPE SOMEINTEGER WITH HEADER LINE,
    OP1 = SOMECHARACTER.
    SLEN = STRLEN( OP1 ) / 2.
    MOVE SLEN TO THE_OP1.
    APPEND THE_OP1.
    DO SLEN TIMES.
    MOVE OP1+0(1) TO T_OP1.
    APPEND T_OP1.
    SHIFT OP1.
    ENDDO.
    MOVE IMPORTHASH+0(2) TO SLEN.
    MOVE SLEN TO T_OP2.
    APPEND T_OP2.
    OP2 = IMPORTHASH.
    SHIFT OP2.
    DO SLEN TIMES.
    MOVE OP2+0(1) TO T_OP2.
    APPEND T_OP2.
    SHIFT OP2.
    ENDDO.

    Hi,
    Especially for Unicodes, it is recommended to separate the Data declarations into a separate Type pool.
    DATA: OP1(10) TYPE X,
    SLEN TYPE I.
    DATA: OP2(12) TYPE X,
    Mark the type pool as unicode active. Then, use this type pool in your program.
    The class variables in CL_ABAP_CHAR_UTILITIES may also help you.
    Cheers,
    Bhanu

  • How to reduce the code while passing.

    hi,
    I am passing the below statemnt to pass the field name and description to the sub_fieldcat.
    since the report has got 100 fields i need to write for all the 100 fields like this, is there any possiblity to pass the field name and the description with less coding
    PERFORM SUB_FIELDCAT USING '' 'BUDAT' 'Posting Date' G_COL 'X'.
    ADD 1 TO G_COL.
    FORM SUB_FIELDCAT USING L_TABNAME TYPE SLIS_TABNAME
                            L_FNAME TYPE SLIS_FIELDNAME
                            L_SEL TYPE DD03P-SCRTEXT_L
                            L_COL TYPE I
                            L_KEY TYPE C.
      I_FIELDCATTAB_WA-REF_TABNAME = L_TABNAME.
      I_FIELDCATTAB_WA-FIELDNAME   = L_FNAME.
      I_FIELDCATTAB_WA-SELTEXT_L   = L_SEL.
      I_FIELDCATTAB_WA-COL_POS     = L_COL.
      I_FIELDCATTAB_WA-KEY         = L_KEY.
      APPEND I_FIELDCATTAB_WA TO I_FIELDCATTAB.
    ENDFORM.             " SUB_FIELDCAT

    Hi Anitha,
    1. To the FM
       we just need to pass the
       internal table Name
    ( There is no need to use the parameter
    I_STRUCTURE_NAME )
    I_INTERNAL_TABNAME Is very important.
    2. While declaring the internal table,
       u can use any number of fields.
       But make sure they are
       declare using LIKE
      eg.
       bukrs like t001-bukrs
      (do not use type)
    3. Rest the FM will take care !
    PS:
    Important parameters are:
    i_program_name,
    i_internal_tabname     = 'ITAB'
    i_inclname             = prg
    where prg is sy-repid
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = prg
          i_internal_tabname     = 'ITAB'
          i_inclname             = prg
        CHANGING
          ct_fieldcat            = alvfc
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    regards,
    amit m.
    Message was edited by: Amit Mittal
    Message was edited by: Amit Mittal

  • Performance Issue in ABAP part as suggested by SE30 for the below coding

    Dear Abapers,
    The below coding was done by my seniors and having performance issue i.e in SE30 the abap part is consuming 98% of time.
    Pl. help us to solve this situation.
    With best regards,
    S. Arunachalam.
    the code is:
    REPORT ZOBJLIST LINE-SIZE 320 NO STANDARD PAGE HEADING. "280 to 320
    TABLES: MARA, MAKT, A916, KONP, MVKE, ZSAI_PARAM.
    Input parameters *****************************************************
    DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
    DATA T_CLASS LIKE SCLASS OCCURS 0 WITH HEADER LINE.
    DATA T_CLOBJDAT LIKE CLOBJDAT OCCURS 0 WITH HEADER LINE.
    DATA FLG_COLOR TYPE C.
    DATA WRK_CLASS LIKE KLAH-CLASS.
    DATA WRK_PERCENT TYPE I. " Progress percentage
    DATA WRK_LINES LIKE SY-TABIX. " To store the no. of lines in int.table
    DATA WRK_PROGRESSTEXT(72) . " Progress indicator text
    DATA : BEGIN OF IT_MATNR OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
    END OF IT_MATNR.
    DATA : BEGIN OF IT_HEADER OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    CLART LIKE SCLASS-KLART,
    CLASS LIKE SCLASS-CLASS,
    BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
    SCMNG(4) TYPE I, "Thanikai-03.10.2002
    END OF IT_HEADER.
    DATA : BEGIN OF IT_DETAILS OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ZAEHL LIKE CLOBJDAT-ZAEHL,
    ATNAM LIKE CLOBJDAT-ATNAM,
    AUSP1 LIKE CLOBJDAT-AUSP1,
    END OF IT_DETAILS.
    DATA : BEGIN OF IT_DETAILS1 OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ATNAM LIKE CLOBJDAT-ATNAM,
    ZAEHL LIKE CLOBJDAT-ZAEHL,
    END OF IT_DETAILS1.
    DATA: IT_DETAILS2 LIKE IT_DETAILS1 OCCURS 0 WITH HEADER LINE.
    DATA TMP_MATNR LIKE AUSP-OBJEK.
    DATA WRK_FIELD(25).
    DATA WRK_TABNAME(40). " Name of the int.table from wrk_fldname
    DATA WRK_FIELDNAME(40). " Name of the fld name from wrk_fldname
    DATA WRK_FLDNAME(40).
    DATA T_CLOBJDAT_LINES LIKE SY-TABIX.
    DATA WRK_LINES1 LIKE SY-TABIX.
    DATA WRK_FIRST_TIME.
    DATA TMP_STR.
    DATA WRK_AUSP1 LIKE CLOBJDAT-AUSP1.
    DATA: WRK_KBETR LIKE KONP-KBETR. "Thanikai-03.10.2002
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
    *PARAMETERS:
    SELECT-OPTIONS:
    P_MATKL FOR MARA-MATKL DEFAULT 'DIAL' OBLIGATORY NO INTERVALS.
    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MATCHCODE OBJECT MAT1.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: P_CLASS LIKE KLAH-CLASS,
    P_KLART LIKE KLAH-KLART DEFAULT '001' OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : REQ RADIOBUTTON GROUP RGRP ,
    NREQ RADIOBUTTON GROUP RGRP .
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN.
    IF NOT P_CLASS IS INITIAL.
    WRK_CLASS = P_CLASS.
    ELSE.
    WRK_CLASS = SPACE.
    ENDIF.
    TOP-OF-PAGE.
    IF SY-BATCH NE 'X'.
    PERFORM PRINT_TOP.
    ENDIF.
    START-OF-SELECTION.
    SET PF-STATUS '9000'.
    SELECT * INTO TABLE IT_MARA
    FROM MARA CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATKL IN P_MATKL
    AND MATNR IN S_MATNR.
    DESCRIBE TABLE IT_MARA LINES WRK_LINES.
    MOVE 'Selecting Material Description' TO WRK_PROGRESSTEXT.
    PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
    LOOP AT IT_MARA.
    SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MARA-MATNR
    AND SPRAS = 'E'.
    IF SY-SUBRC = 0.
    IT_MATNR-MATNR = IT_MARA-MATNR.
    IT_MATNR-MAKTX = MAKT-MAKTX.
    IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
    ENDIF.
    APPEND IT_MATNR.
    CLEAR IT_MATNR.
    ENDLOOP.
    CLEAR WRK_LINES.
    DESCRIBE TABLE IT_MATNR LINES WRK_LINES.
    MOVE 'Selecting Class / characteristics for the Material'
    TO WRK_PROGRESSTEXT.
    PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
    LOOP AT IT_MATNR.
    CLEAR: TMP_MATNR, T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
    REFRESH: T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
    TMP_MATNR = IT_MATNR-MATNR.
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
    EXPORTING
    CLASS = WRK_CLASS
    CLASSTEXT = 'X'
    CLASSTYPE = '001'
    CLINT = ' '
    FEATURES = 'X'
    LANGUAGE = SY-LANGU
    OBJECT = TMP_MATNR
    OBJECTTABLE = 'MARA'
    KEY_DATE = SY-DATUM
    INITIAL_CHARACT = 'X'
    NO_VALUE_DESCRIPT = 'X'
    CHANGE_SERVICE_CLF = 'X'
    INHERITED_CHAR = ' '
    TABLES
    T_CLASS = T_CLASS
    T_OBJECTDATA = T_CLOBJDAT
    EXCEPTIONS
    NO_CLASSIFICATION = 1
    NO_CLASSTYPES = 2
    INVALID_CLASS_TYPE = 3
    OTHERS = 4.
    IF SY-SUBRC = 0.
    READ TABLE T_CLASS INDEX 1.
    IT_HEADER-MATNR = IT_MATNR-MATNR.
    IT_HEADER-MAKTX = IT_MATNR-MAKTX.
    IT_HEADER-BISMT = IT_MATNR-BISMT."Thanikai-17.05.2002
    IT_HEADER-CLART = T_CLASS-KLART.
    IT_HEADER-CLASS = T_CLASS-CLASS.
    PERFORM PKG_DLVY_UNIT.
    APPEND IT_HEADER.
    CLEAR: IT_HEADER.
    Code Start by Thanikai on 16.08.2002
    LOOP AT T_CLOBJDAT.
    IT_DETAILS-MATNR = IT_MATNR-MATNR.
    IT_DETAILS-ZAEHL = T_CLOBJDAT-ZAEHL.
    IT_DETAILS-ATNAM = T_CLOBJDAT-ATNAM.
    IT_DETAILS-AUSP1 = T_CLOBJDAT-AUSP1.
    APPEND IT_DETAILS.
    ENDLOOP.
    CLEAR: IT_DETAILS.
    LOOP AT T_CLOBJDAT.
    IT_DETAILS1-MATNR = IT_MATNR-MATNR.
    IT_DETAILS1-ATNAM = T_CLOBJDAT-ATNAM.
    IT_DETAILS1-ZAEHL = T_CLOBJDAT-ZAEHL.
    APPEND IT_DETAILS1.
    ENDLOOP.
    CLEAR: IT_DETAILS1.
    DESCRIBE TABLE IT_DETAILS1 LINES T_CLOBJDAT_LINES.
    IF WRK_FIRST_TIME NE 'X'.
    WRK_LINES1 = T_CLOBJDAT_LINES.
    WRK_FIRST_TIME = 'X'.
    IT_DETAILS2[] = IT_DETAILS1[].
    ELSE.
    IF T_CLOBJDAT_LINES GT WRK_LINES1.
    WRK_LINES1 = T_CLOBJDAT_LINES.
    IT_DETAILS2[] = IT_DETAILS1[].
    ENDIF.
    ENDIF.
    CLEAR: T_CLOBJDAT_LINES.
    CLEAR: IT_DETAILS1. REFRESH: IT_DETAILS1.
    ENDIF.
    Code end by Thanikai on 16.08.2002
    ENDLOOP.
    CLEAR: WRK_LINES1, WRK_FIRST_TIME.
    Print Details *********************************
    PERFORM PRINT_DETAILS.
    AT USER-COMMAND.
    GET CURSOR FIELD WRK_FIELD.
    SPLIT WRK_FIELD AT '-' INTO WRK_TABNAME WRK_FLDNAME.
    IF NOT WRK_FLDNAME IS INITIAL.
    CASE SY-UCOMM.
    WHEN 'SORA'.
    IF SY-LSIND > 0.
    SY-LSIND = SY-LSIND - 1. "To print in the same window
    ENDIF.
    PERFORM PRINT_REPORT_ASCENDING.
    WHEN 'SORD'.
    IF SY-LSIND > 0.
    SY-LSIND = SY-LSIND - 1. "To print in the same window
    ENDIF.
    PERFORM PRINT_REPORT_DESCENDING.
    ENDCASE.
    ELSE.
    MESSAGE S000(38) WITH 'Selete Material Number / Description'.
    ENDIF.
    *& Form SAPGUI
    text
    -->P_WRK_PERCENT text *
    -->P_WRK_PROGRESSTEXT text *
    FORM SAPGUI USING P_WRK_PERCENT
    P_WRK_PROGRESSTEXT.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = WRK_PERCENT
    TEXT = WRK_PROGRESSTEXT
    EXCEPTIONS
    OTHERS = 1.
    ENDFORM. " SAPGUI
    *& Form PRINT_REPORT_ASCENDING
    text
    --> p1 text
    <-- p2 text
    FORM PRINT_REPORT_ASCENDING.
    IF WRK_TABNAME = 'IT_HEADER'.
    SORT IT_HEADER BY (WRK_FLDNAME).
    PERFORM PRINT_TOP.
    PERFORM PRINT_DETAILS.
    ENDIF.
    ENDFORM. " PRINT_REPORT_ASCENDING
    *& Form PRINT_DETAILS
    text
    --> p1 text
    <-- p2 text
    WRK_AUSP1 width chged below from (7)to(9) by Nagaraj/MKRK 24.11.05
    FORM PRINT_DETAILS.
    SORT IT_HEADER BY MATNR.
    IF SY-BATCH EQ 'X'.
    PERFORM PRINT_TOP.
    ENDIF.
    IF REQ = 'X'.
    LOOP AT IT_HEADER.
    IF FLG_COLOR = 'X'.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    CLEAR FLG_COLOR.
    ELSE.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    FLG_COLOR = 'X'.
    ENDIF.
    WRITE :/ SY-VLINE NO-GAP,
    (18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
    SY-VLINE NO-GAP,
    (40) IT_HEADER-MAKTX NO-GAP,
    SY-VLINE NO-GAP,
    (18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
    SY-VLINE NO-GAP.
    Code started by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS2.
    CLEAR: TMP_STR, WRK_AUSP1.
    IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM
    AND ZAEHL = IT_DETAILS2-ZAEHL.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ELSE.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ENDIF.
    ENDLOOP.
    WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
    IF SY-LINNO > 25.
    IF SY-BATCH EQ 'X'.
    NEW-PAGE.
    PERFORM PRINT_TOP.
    ENDIF.
    ENDIF.
    Code end by Thanikai on 16.08.2002..
    ENDLOOP.
    ELSEIF NREQ = 'X'.
    LOOP AT IT_HEADER.
    IF FLG_COLOR = 'X'.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    CLEAR FLG_COLOR.
    ELSE.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    FLG_COLOR = 'X'.
    ENDIF.
    WRITE :/ SY-VLINE NO-GAP,
    (18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
    SY-VLINE NO-GAP,
    (18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
    SY-VLINE NO-GAP.
    Code started by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS2.
    CLEAR: TMP_STR, WRK_AUSP1.
    IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM
    AND ZAEHL = IT_DETAILS2-ZAEHL.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ELSE.
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
    AND ATNAM = IT_DETAILS2-ATNAM.
    TMP_STR = 'X'.
    WRK_AUSP1 = IT_DETAILS-AUSP1.
    EXIT.
    ENDLOOP.
    IF TMP_STR EQ 'X'.
    WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
    ELSE.
    WRITE : ' ', SY-VLINE NO-GAP.
    ENDIF.
    ENDIF.
    ENDLOOP.
    WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
    IF SY-LINNO > 25.
    IF SY-BATCH EQ 'X'.
    NEW-PAGE.
    PERFORM PRINT_TOP.
    ENDIF.
    ENDIF.
    Code end by Thanikai on 16.08.2002
    ENDLOOP.
    ENDIF.
    ULINE.
    ENDFORM. " PRINT_DETAILS
    *& Form PRINT_REPORT_DESCENDING
    text
    --> p1 text
    <-- p2 text
    FORM PRINT_REPORT_DESCENDING.
    IF WRK_TABNAME = 'IT_HEADER'.
    SORT IT_HEADER BY (WRK_FLDNAME) DESCENDING.
    PERFORM PRINT_TOP.
    PERFORM PRINT_DETAILS.
    ENDIF.
    ENDFORM. " PRINT_REPORT_DESCENDING
    *& Form PRINT_TOP
    text
    --> p1 text
    <-- p2 text
    IT_DETAILS2-ATNAM width chged below from 7 to 9. Nagaraj/MKRK 24.11.05
    FORM PRINT_TOP.
    FORMAT COLOR COL_HEADING INTENSIFIED OFF.
    ULINE.
    IF REQ = 'X'.
    READ TABLE IT_HEADER INDEX 1.
    WRITE :/ SY-VLINE NO-GAP,(17) 'Material No' ,SY-VLINE NO-GAP.
    SET LEFT SCROLL-BOUNDARY.
    WRITE :(39) ' Material Description', SY-VLINE NO-GAP,
    (17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
    Comments made by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
    LOOP AT IT_DETAILS2.
    WRITE : (9) IT_DETAILS1-ATNAM NO-GAP,SY-VLINE NO-GAP.
    WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
    ENDLOOP.
    WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
    ELSEIF NREQ = 'X'.
    READ TABLE IT_HEADER INDEX 1.
    WRITE :/ SY-VLINE NO-GAP, (17) 'Material No' ,SY-VLINE NO-GAP,
    (17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
    Comments made by Thanikai on 16.08.2002
    LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
    LOOP AT IT_DETAILS2.
    WRITE : (9) IT_DETAILS-ATNAM NO-GAP,SY-VLINE NO-GAP.
    WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
    ENDLOOP.
    WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
    ENDIF.
    ULINE.
    FORMAT RESET.
    ENDFORM. " PRINT_TOP
    *& Form PKG_DLVY_UNIT
    text
    --> p1 text
    <-- p2 text
    FORM PKG_DLVY_UNIT.
    SELECT SINGLE KONP~KBETR INTO WRK_KBETR
    FROM ( A916 INNER JOIN KONP
    ON KONP~MANDT = SY-MANDT
    AND KONPKNUMH = A916KNUMH
    AND KONP~KOPOS = '01' ) CLIENT SPECIFIED
    WHERE A916~MANDT = SY-MANDT
    AND A916~KAPPL = 'V'
    AND A916~KSCHL = 'PR00'
    AND A916~VKORG = 'WTCH'
    AND A916~VTWEG = '01'
    AND A916~SPART = '01'
    AND A916~MATNR = IT_MATNR-MATNR
    AND A916~DATBI >= SY-DATUM
    AND A916~DATAB <= SY-DATUM.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM ZSAI_PARAM CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND PMFID = 'ZPKG_PRICE'
    AND PMVL1 = '01'.
    IF SY-SUBRC EQ 0.
    IF WRK_KBETR BETWEEN 1 AND ZSAI_PARAM-PMVL2.
    SELECT SINGLE * FROM MVKE CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MATNR-MATNR
    AND VKORG = 'WTCH'
    AND VTWEG = '01'.
    IF SY-SUBRC EQ 0.
    IF MVKE-SCMNG GE 1.
    IT_HEADER-SCMNG = MVKE-SCMNG.
    ELSE.
    In the absence of delivery unit for a material,
    delivery unit is considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    If the price for a material is either below 1 or above 2499, then
    the delivery unit is considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    ELSE.
    In the absence of price for a material, delivery unit is
    considered as one.
    IT_HEADER-SCMNG = 1.
    ENDIF.
    CLEAR: WRK_KBETR.
    ENDFORM. " PKG_DLVY_UNIT

    The first point would be to change the following:
    LOOP AT IT_MARA.
    SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
    WHERE MANDT = SY-MANDT
    AND MATNR = IT_MARA-MATNR
    AND SPRAS = 'E'.
    IF SY-SUBRC = 0.
    IT_MATNR-MATNR = IT_MARA-MATNR.
    IT_MATNR-MAKTX = MAKT-MAKTX.
    IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
    ENDIF.
    APPEND IT_MATNR.
    CLEAR IT_MATNR.
    ENDLOOP.
    I would sort IT_MARA by matnr then select for all entries into new table IT_matnr and only read when you are actuallygoing to use it for your final table.
    This however will not make much difference to your problem. I suggest you put more of the code into subroutines and look at the se30 output as tyo which subroutines are actually taking most of the time. Please post the results and the subroutines which take the longest.

Maybe you are looking for

  • How to configure sync with my local ftp server?

    I have used XMarks since now because it hallow me to synchronize my bookmarks with my local server. Now XMarks don't work anymore because it's not more possible to synchronize the passwords. Any other alternative imposes to use an external server and

  • Sony Mobile Indonesia: Bad Service Quality

    Greetings to you all. My name is Giovan Pangku from Indonesia, an owner of Sony Ericsson Xperia ray ST18i. I am also a member of a facebook group, "Xperia Community", a group where we share everything about Xperia devices. On this thread, I'm going t

  • Display thunderbolt alimentation cable problem

    Hello I recently met a strange problem with my Thunderbolt screen. I use a Retina MacBook Pro with the supplied adapter to the power cable. Here's the problem: When I plug in my computer, the power supply doesn't connect itself as before. The LED doe

  • My Illustrator CS5 freezes when I open the programme or a file

    I have a MacBook Pro 5 with Mac OS X 10.6.8, I use Adobe MasterSuite CS5, although the only programs fully installed from it are Photoshop, Illustrator, InDesign and Flash. I rarely use Flash, but rely on the other three heavily for work. I opened an

  • Xsd:list using complex type ??

    Hello, I have modified world.xsd from (www.manojc.com... sample8) My customer wants to return a list of complex types. In this case list of Country (CountryList) Here is my schema and I run autotype target. produces errors <xsd:schema xmlns:xsd="http