Improving the perspective control grid

The perspective control for photos is for me the best thing that has happened to LR. I can ( just ) about cope with the speed reduction, but the control for verticals, for rotation and for horizontals is superb.
At the moment it appears that the centre of the photograph is the point where the rotation and the vertical and horizontal transforms reference from.
As soon as you select the Vertical / horizontal / rotate / distort, the grid appears that aids you in setting the verticals etc.
There is no way of seeing the central point, where these transformations occur, you ony have the grid, so I am thinking that when you press the modifier keysthe control / shift  / alt keys, a cross appears over the central point of the grid. This would give you the location of the central point. Plain and simple.
As soon as you release the modifier keys, this disappears, so you can just see the grid.
This would speed up rotation tremendously, as this is your reference  point, at the moment, I juggle the rotation and vertical to get where I  want to be.
Alternatively, like the Crop has various layouts, so pressing "O" could  scan through these same grids, but we will need a central point because  at the moment the crop does not have a grid to mark the centre of the  image.
LR 4 may enable you to pick your reference point to do the transformations from, then, apply the same principal to that point with the overlaid rotation marking cross.
Any thoughts?

function(){return A.apply(null,[this].concat($A(arguments)))}
hamish niven wrote:
Would be an interesting combination, however, none of lightrooms controls use any controls like the PS transform controls, so I think its unlikely they will do that.
Good luck, but try the arrows and expecially zoomed in and see if learning a new trick works for you
Using the arrows is old hat.  I agree this helps for small adjustments.  I use it all the time.  I also like your idea of establishing a reference point.
Regarding your statement that no LR controls are like the PS transform - I disagree.  The LR crop tool is similar (size, aspect and rotation).  All I am suggesting is that the vertical and horizontal transforms be added to the LR crop tool, similar to how the PS crop tool (not the PS transform tool) works.  There is no reason why zooming into the image could not be supported.
Consider this example.  You are copying a document that is rectangular and located on a desk.  You cannot place your camera directly over the document, so you take it at an angle.  Then you want to correct in post processing.  Using the PS crop tool, all you have to do is drag the four corners of the crop rectangle to the four corners of the document.  Done.  Try that in the current LR implementation.  It can be done, but takes a ton of fiddling.
So, I still want both ways of correcting perspective, and I do not think this is against the "LR way of doing things".  Adobe modified the crop tool, based on beta tester feedback, and they may well again.  At least I know they will look at this carefully and come up with improvements based on their track record.
Cheers
Rory

Similar Messages

  • Problem in handling double click in the second alv grid control

    Hi all,
    I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
    I need to handle double click event for both of alv grid controls in my screen.
    I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
    In the first Alv grid double click works fine , everything is ok, world is peaceful.
    But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
    All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
    I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
    I tried everything but nothing works.
    Please help. Your answers will be appreciated.

    Hello Eagle
    I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
    *& Report  ZUS_SDN_THREE_ALV_GRIDS_01
    *& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
    **    PROCESS BEFORE OUTPUT.
    **      MODULE STATUS_0100.
    **    PROCESS AFTER INPUT.
    **      MODULE USER_COMMAND_0100.
    *& Thread: problem in handling double click in the second alv grid control
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
    REPORT  zus_sdn_three_alv_grids_01.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_splitter_2    TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      go_grid3         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_outtab        TYPE STANDARD TABLE OF vbak,
      gt_outtab_2      TYPE STANDARD TABLE OF vbap,
      gt_outtab_3      TYPE STANDARD TABLE OF vbep.
    **PARAMETERS:
    **  p_bukrs          TYPE bukrs  DEFAULT '1000'.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          ms_row      TYPE lvc_s_row,
          ms_col      TYPE lvc_s_col.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_outtab      TYPE vbak,
          ls_outtab_2    TYPE vbap,
          ls_outtab_3    TYPE vbep.
        "   Initialize class data
        CLEAR: ms_row,
               ms_col.
        CASE sender.
          WHEN go_grid1.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_ITEMS'
    *          IMPORTING
    *            rc       =
          WHEN go_grid2.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_SCHEDULE_LINES'
    *          IMPORTING
    *            rc       =
          WHEN go_grid3.
    **        READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
    **        CHECK ( ls_vbap-matnr IS NOT INITIAL ).
    **        SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
    **        CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  vbak INTO TABLE gt_outtab UP TO 100 ROWS.
      PERFORM init_controls.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAK'
        CHANGING
          it_outtab        = gt_outtab
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_2.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAP'
        CHANGING
          it_outtab        = gt_outtab_2    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_outtab_3.
      CALL METHOD go_grid3->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBEP'
        CHANGING
          it_outtab        = gt_outtab_3    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro:
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "ORDERS"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Refresh display of detail ALV list
      CALL METHOD go_grid3->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        " Double-click on first or second ALV grid
        WHEN 'GET_ITEMS'  OR
             'GET_SCHEDULE_LINES'.
          PERFORM get_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create 2nd splitter container
      CREATE OBJECT go_splitter_2
        EXPORTING
          parent            = go_cell_left
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent = go_cell_top
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent = go_cell_bottom
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid3
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          OTHERS   = 5.
      IF sy-subrc NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  GET_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_details .
    * define local data
      DATA: ls_row      TYPE lvc_s_row,
            ls_col      TYPE lvc_s_col.
      data: ls_outtab   type vbak,
            ls_outtab_2 type vbap,
            ls_outtab_3 type vbep.
      BREAK-POINT.
      CASE gd_okcode.
        WHEN 'GET_ITEMS'.
          CALL METHOD go_grid1->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          read TABLE gt_outtab into ls_outtab index ls_row-index.
          refresh: gt_outtab_2,
                   gt_outtab_3.
          SELECT        * FROM  vbap into TABLE gt_outtab_2
                 WHERE  vbeln  = ls_outtab-vbeln.
        WHEN 'GET_SCHEDULE_LINES'.
          CALL METHOD go_grid2->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
          refresh: gt_outtab_3.
          SELECT        * FROM  vbep into TABLE gt_outtab_3
                 WHERE  vbeln  = ls_outtab_2-vbeln
                 AND    posnr  = ls_outtab_2-posnr.
        WHEN OTHERS.
          RETURN.
      ENDCASE.
      IF ( lcl_eventhandler=>ms_row = ls_row  AND
           lcl_eventhandler=>ms_col = ls_col ).
        MESSAGE 'Current cell identical'  TYPE 'I'.
      ELSE.
        MESSAGE 'Current cell NOT identical'  TYPE 'I'.
      ENDIF.
    ENDFORM.                    " GET_DETAILS
    Regards
      Uwe

  • I have illustrator cs5, and I have plans, the side, rear, front elevations of  vehicles,. I did a line trace of these elevations and projected them using the  perspective selection tool to the perspective grid, but I get distorted image on it, I am trying

    I have illustrator cs5. I have front, side, rear, plans of vehicles. I need to create 3D illustrations. I did a line trace of these elevations and projected them to the perspective grid using the perspective tool.  I got distorted image on each side of the grid.  What do I need to do?

    Please show.

  • How to improve the performance of this code

    Hi gurus
    code is given below with LDB
    this code look big but most of lines are commented
    plz help its urgent
    thanks in advance
    *& Report  ZSALES_RECON
    REPORT  ZSALES_RECON.
    TYPE-POOLS : SLIS.
    nodes: bseg , bkpf.
    data : begin of zbseg occurs 0,
    kunnr like bseg-kunnr,
    *lifnr like bseg-lifnr,
    dmbtr like bseg-dmbtr,
    *shkzg like bseg-shkzg,
    *gsber like bseg-gsber,
    bschl like bseg-bschl,
    *sgtxt like bseg-sgtxt,
    total like bseg-dmbtr,
    hkont like bseg-hkont,
    BUDAT LIKE Bkpf-BUDAT,
    belnr LIKE BSEG-belnr,
    cash like bseg-dmbtr,
    credit like bseg-dmbtr,
    abn_voucher like bseg-dmbtr,
    barista_voucher like bseg-dmbtr,
    accor like bseg-dmbtr,
    sodexho like bseg-dmbtr,
    gift like bseg-dmbtr,
    corp like bseg-dmbtr,
    card like bseg-dmbtr,
    miscellaneous like bseg-dmbtr,
    werks like bseg-werks,
    gjahr like bseg-gjahr,
    SR_NO TYPE I,
    shkzg like bseg-shkzg,
          end of zbseg,
          TP_TBL_DATA like ZBSEG.
        DATA  : idx TYPE sy-tabix.
    Report data to be shown.
    data: it_data like ZBSEG.
    Heading of the report.
    data: t_heading type slis_t_listheader.
    AT SELECTION-SCREEN.
    get bkpf.
    START-OF-SELECTION.
    data : sum_mis like bseg-dmbtr,
           sum_abn like bseg-dmbtr,
           sum_cash like bseg-dmbtr,
           sum_credit like bseg-dmbtr,
           sum_card like bseg-dmbtr,
           sum_barista_voucher like bseg-dmbtr,
           sum_accor like bseg-dmbtr,
           sum_sodexho like bseg-dmbtr,
           sum_gift like bseg-dmbtr,
           sum_corp like bseg-dmbtr.
    data : wa1_total like bseg-dmbtr.
    data : wa_belnr like bseg-belnr,
           wa_kunnr like bseg-kunnr,
           wa_werks like bseg-werks,
           belnr1 like bseg-belnr,
           wa_sr_no type i.
    GET BSEG.
    data : wa like line of zbseg.
    data : count type i,
           count1 type i.
    move-corresponding bseg to zbseg.
    *idx = sy-tabix.
    on change of zbseg-belnr.
    wa_kunnr = zbseg-kunnr.
    wa_kunnr = wa_kunnr+6(4).
    select single werks into wa_werks from bseg where belnr = zbseg-belnr
    and kunnr = '' and gjahr = zbseg-gjahr.
    if wa_kunnr = wa_werks.
    if zbseg-bschl <> '01'.
    clear: sum_mis,wa1_total,sum_abn,sum_cash,sum_credit,sum_card,
    sum_barista_voucher,sum_accor,sum_sodexho,sum_gift,sum_corp.
    wa-BUDAT = BKPF-BUDAT.
    wa-bschl = zbseg-bschl.
    wa-hkont = zbseg-hkont.
    wa-belnr = zbseg-belnr.
    wa_belnr = wa-belnr.
    wa-shkzg = zbseg-shkzg.
    wa-kunnr = zbseg-kunnr.
    count = wa-sr_no.
    *wa-sr_no = count + 1.
    idx = idx + 1.
    append wa to zbseg.
    **count = wa-sr_no.
    *wa-sr_no = wa-sr_no + 1.
    clear wa-total.
    endif.
    endif.
    endon.
    *clear : wa1_total.
    if wa_belnr = zbseg-belnr.
    loop at zbseg into wa.
    wa-total = wa1_total.
    wa-bschl = zbseg-bschl.
    wa-hkont = zbseg-hkont.
    count = sy-tabix.
    wa-sr_no = count.
    count1 = count.
    *wa_sr_no = count.
    modify zbseg from wa transporting sr_no.
    IF wa-bschl eq  '40' and wa-hkont eq '0024013020'.
    if sy-tabix = 1.
    wa-cash  = zbseg-dmbtr.
    sum_cash = sum_cash + wa-cash.
    wa-cash = sum_cash.
    modify zbseg index idx from wa transporting cash.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060010'.
       if sy-tabix = 1.
    wa-credit  = zbseg-dmbtr.
    sum_credit = sum_credit + wa-credit.
    wa-credit = sum_credit.
    modify zbseg index idx from wa transporting credit.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060015'.
    if sy-tabix = 1.
    wa-abn_voucher  = zbseg-dmbtr.
    sum_abn = sum_abn + wa-abn_voucher.
    wa-abn_voucher = sum_abn.
    modify zbseg index idx from wa transporting abn_voucher.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060017'.
    if sy-tabix = 1.
    wa-barista_voucher  = zbseg-dmbtr.
    sum_barista_voucher = sum_barista_voucher + wa-barista_voucher.
    wa-barista_voucher = sum_barista_voucher.
    modify zbseg  index idx from wa transporting barista_voucher.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060020'.
    if sy-tabix = 1.
    wa-sodexho  = zbseg-dmbtr.
    sum_sodexho = sum_sodexho + wa-sodexho.
    wa-sodexho = sum_sodexho.
    modify zbseg index idx from wa transporting sodexho.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060030'.
    if sy-tabix = 1.
    wa-accor  = zbseg-dmbtr.
    sum_accor = sum_accor + wa-accor.
    wa-accor = sum_accor.
    modify zbseg  index idx from wa transporting accor.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026070040'.
    if sy-tabix = 1.
    wa-gift  = zbseg-dmbtr.
    sum_gift = sum_gift + wa-gift.
    wa-gift = sum_gift.
    modify zbseg index idx from wa transporting gift.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060070'.
    if sy-tabix = 1.
    wa-card  = zbseg-dmbtr.
    sum_card = sum_card + wa-card.
    wa-card = sum_card.
    modify zbseg index idx from wa transporting card.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060018'.
    if sy-tabix = 1.
    wa-corp  = zbseg-dmbtr.
    sum_corp = sum_corp + wa-corp.
    wa-corp = sum_corp.
    modify zbseg index idx from wa transporting corp.
    endif.
    endif.
    *IF wa-bschl eq  '11' .
    *wa-total  = zbseg-dmbtr.
    *modify zbseg index idx from wa transporting total.
    *endif.
    IF wa-bschl EQ  '40'  or wa-bschl = '01' .
    if sy-tabix = 1.
    wa-total = zbseg-dmbtr.
    wa1_total = wa1_total + wa-total.
    wa-total = wa1_total.
    *if idx = 2.
    *modify zbseg index 1 from wa transporting total.
    *else.
    modify zbseg  index idx from wa transporting total.
    *endif.
    endif.
    endif.
    *IF zbseg-TOTAL NE zbseg-DMBTR.
    IF wa-BSCHL NE '11' AND wa-BSCHL NE '40'. "AND wa-BSCHL NE '01'.
    if sy-tabix = 1.
    if wa-shkzg = 'S'.
    wa-miscellaneous = - wa-miscellaneous.
    endif.
    wa-miscellaneous =  ZBSEG-DMBTR.
    sum_mis = sum_mis + wa-miscellaneous.
    wa-miscellaneous = sum_mis.
    modify zbseg index idx from wa transporting miscellaneous.
    endif.
    ENDIF.
    *wa1-miscellaneous = wa-miscellaneous.
    *modify zbseg index idx from wa.
    *ENDIF.
    *append wa to zbseg.
    *clear:zbseg-dmbtr.
    endloop.
    endif.
    *****endif.
    *****endon.
    *ENDFORM.
    *append zbseg.
    *endloop.
    End-of-selection.
      perform build_alv using zbseg t_heading.
    *&      Form  build_alv
          Builds and display the ALV Grid.
    form build_alv using t_data
    *tp_tbl_data
                         t_heading  type slis_t_listheader.
    ALV required data objects.
    data: w_title   type lvc_title,
          w_repid   type syrepid,
          w_comm    type slis_formname,
          w_status  type slis_formname,
          x_layout  type slis_layout_alv,
          t_event    type slis_t_event,
          t_fieldcat type slis_t_fieldcat_alv,
          t_sort     type slis_t_sortinfo_alv.
    refresh t_fieldcat.
    refresh t_event.
    refresh t_sort.
    clear x_layout.
    clear w_title.
    Field Catalog
      perform set_fieldcat2 using:
    1 'SR_NO' 'SR_NO' 'BKPF' '5' space  space  'SR NO'  space  space space
    space space space space space t_fieldcat ,
    2 'BELNR' 'BELNR' 'BKPF' '10' space  space  'Document No'  space  space
    space space space space space space t_fieldcat ,
    3 'BUDAT' 'BUDAT' 'BKPF' '10' space  space  'Document Date'  space
    space space space space space space space t_fieldcat ,
    4 'KUNNR' space space  space space  space  'Site'  space  space
    space space space space space space t_fieldcat ,
    5 'TOTAL' space 'BSEG' space space  space  'Total'  space  space space
    space space space space 'X' t_fieldcat ,
    6 'CASH' 'CASH' 'BSEG' space space  space  'Cash Sales'
      space  space space space space space space 'X' t_fieldcat ,
    7 'CREDIT' 'CREDIT' 'BSEG' space space  space  'Credit Card'
    space space space space space space space 'X' t_fieldcat ,
    8 'ABN_VOUCHER' space 'BSEG' space space  space  'ABN Voucher'  space
    space
    space space space space space 'X' t_fieldcat ,
    9 'BARISTA_VOUCHER' space 'BSEG' '15' space  space  'BARISTA Voucher'
    space  space
    space space space space space 'X' t_fieldcat ,
    10 'CORP' 'CORP' 'BSEG' space space  space  'ABN Corp'  space  space
    space space space space space 'X' t_fieldcat ,
    11 'SODEXHO' 'SODEXHO' 'BSEG' space space  space  'Sodexho'  space
    space space space space space space 'X' t_fieldcat ,
    12 'ACCOR' 'ACCOR' 'BSEG' space space  space  'Accor'
    space  space space space space space space 'X' t_fieldcat ,
    13 'GIFT' 'GIFT' 'BSEG' space space  space  'Gift Coupon'
    space  space space space space space space 'X' t_fieldcat ,
    14 'CARD' 'CARD' 'BSEG' space space  space  'Diners Card'  space
    space space space space space space 'X' t_fieldcat ,
    15 'MISCELLANEOUS' space 'BKPF' '18' space  space
    'Miscellaneous Income' space space space space space space space 'X'
    t_fieldcat .
    *14 'KBETR' 'KBETR' 'KONP' '10' space  space  'Tax %age'  space  space
    *space space space space space space t_fieldcat ,
    *15 'MWSKZ1' 'MWSKZ1' 'RBKP' space space  space  'Tax Type'  space
    *space
    space space space space space space t_fieldcat ,
    *16 'AMT' 'AMT' 'RBKP' space space  space  'Amount Payable'  space
    *space
    space space space space space 'X' t_fieldcat ,
    *17 'WERKS' 'SITE' 'RSEG' space space  space  'State'  space  space
    *space space space space space space t_fieldcat .
    *18 'GSBER' 'GSBER' 'RBKP' space space  space  'Business Area'  space
    *space space space space space space space t_fieldcat .
    Layout
    x_layout-zebra = 'X'.
    Top of page heading
      perform set_top_page_heading using t_heading t_event.
    Events
      perform set_events using t_event.
    GUI Status
      w_status = ''.
      w_repid = sy-repid.
    Title
    w_title = <<If you want to set a title for
                the ALV, please, uncomment and edit this line>>.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = w_repid
          it_fieldcat              = t_fieldcat
          is_layout                = x_layout
          it_sort                  = t_sort
          i_callback_pf_status_set = w_status
          i_callback_user_command  = w_comm
          i_save                   = 'X'
          it_events                = t_event
          i_grid_title             = w_title
        tables
          t_outtab                 = zbseg
         t_data
        exceptions
          program_error            = 1
          others                   = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    form set_top_page_heading using t_heading type slis_t_listheader
                                    t_events  type slis_t_event.
    data: x_heading type slis_listheader,
          x_event   type line of slis_t_event.
    Report title
      clear t_heading[].
      clear x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'SALES RECONCILIATION REPORT'(001).
      append x_heading to t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      append x_event to t_events.
    endform.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    form set_events using t_events type slis_t_event.
    data: x_event   type line of slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    endform.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
                         t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-up = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
       p_colpos: Column position.
       p_fieldname: Field of internal table which is being described by
    *            this record of the field catalog.
       p_ref_fieldname: (Optional) Table field / data element which
    *                describes the properties of the field.
    *                If this field is not given, it is copied from
    *                the fieldname.
       p_ref_tabname: (Optional) Table which holds the field referenced
    *              by <<p_ref_fieldname>>.
                      If this is not given, the parameter
                      <<p_ref_fieldname>> references a data element.
       p_outputlen: (Optional) Column width.
       p_noout: (Optional) If set to 'X', states that the field is not
    *           showed initially. If so, the field has to be
                included in the report at runtime using the display
                options.
       p_seltext_m: (Optional) Medium label to be used as column header.
       p_seltext_l: (Optional) Long label to be used as column header.
       p_seltext_s: (Optional) Small label to be used as column header.
       p_reptext_ddic: (Optional) Extra small (heading) label to be
    *                used as column header.
       p_ddictxt: (Optional) Set to 'L', 'M', 'S' or 'R' to select
                  whether to use SELTEXT_L, SELTEXT_M, SELTEXT_S,
                  or REPTEXT_DDIC as text for column header.
       p_hotspot: (Optional) If set to 'X', this field will be used
    *             as a hotspot area for cursor, alolowing the user
    *          to click on the field.
       p_showasicon: (Optional) If set to 'X', this field will be shown
                     as an icon and the contents of the field will set
    *             which icon to show.
       p_checkbox: (Optional) If set to 'X', this field will be shown
                   as a checkbox.
       p_edit: (Optional) If set to 'X', this field will be editable.
       p_dosum: (Optional) If set to 'X', this field will be summed
                (aggregation function) according to the grouping set
                by the order functions.
       t_fieldcat: Table which contains the whole fieldcat.
    FORM set_fieldcat2 USING
          p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-hotspot = p_hotspot.
      wa_fieldcat-checkbox = p_checkbox.
      wa_fieldcat-icon = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given
       is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a
       field of a table.
    In case ref_fieldname is not given,
       it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF NOT p_edit IS INITIAL.
        wa_fieldcat-input     = 'X'.
        wa_fieldcat-edit     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    ======================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
        i_logo             = <<If you want to set a logo, please,
                             uncomment and edit this line>>
          it_list_commentary = t_heading.
    endform.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    form user_command using r_ucomm     like sy-ucomm
                            rs_selfield type slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_selfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    endform.                    "user_command
    *********************************ldb code start from here *************************************************************
         DATABASE PROGRAM OF LOGICAL DATABASE ZBRM_3
      top-include and nxxx-include are generated automatically
      Do NOT change their names manually!!!
    *include DBZBRM_3TOP . " header
    *include DBZBRM_3NXXX . " all system routines
    include DBZBRM_3F001 . " user defined include
    PROGRAM SAPDBZBRM_3 DEFINING DATABASE ZBRM_3.
    TABLES:
        BKPF,
        BSEG.
    Hilfsfelder
    DATA:
       BR_SBUKRS LIKE BKPF-BUKRS,
        BR_SBELNR LIKE BKPF-BELNR,
        BR_SGJAHR LIKE BKPF-GJAHR,
        BR_SBUDAT LIKE BKPF-BUDAT,
        BR_SGSBER LIKE BSEG-GSBER.
       BR_SBUZEI LIKE BSEG-BUZEI,
       BR_SEBELN LIKE BSEG-EBELN,
       BR_SEBELP LIKE BSEG-EBELP,
       BR_SZEKKN LIKE BSEG-ZEKKN.
    working areas for the authority check                     "n435991
    for the company code                                      "n435991
    *TYPES : BEGIN OF STYPE_BUKRS,                               "n435991
             BUKRS              LIKE  T001-BUKRS,              "n435991
             WAERS              LIKE  T001-WAERS,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_BUKRS.                                 "n435991
                                                               "n435991
    *DATA : G_S_BUKRS             TYPE  STYPE_BUKRS,             "n435991
          G_T_BUKRS             TYPE  STYPE_BUKRS   OCCURS 0.  "n435991
                                                               "n435991
    for the document type                                     "n435991
    *TYPES : BEGIN OF STYPE_BLART,                               "n435991
             BLART              LIKE  BKPF-BLART,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_BLART.                                 "n435991
                                                               "n435991
    *DATA : G_S_BLART             TYPE  STYPE_BLART,             "n435991
          G_T_BLART             TYPE  STYPE_BLART   OCCURS 0.  "n435991
                                                               "n435991
    for the business area                                     "n435991
    *TYPES : BEGIN OF STYPE_GSBER,                               "n435991
             GSBER              LIKE  BSEG-GSBER,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_GSBER.                                 "n435991
                                                               "n435991
    *DATA : G_S_GSBER             TYPE  STYPE_GSBER,             "n435991
          G_T_GSBER             TYPE  STYPE_GSBER   OCCURS 0.  "n435991
                                                               "n435991
    for the purchasing organization                           "n435991
    *TYPES : BEGIN OF STYPE_EKORG,                               "n435991
             EKORG              LIKE  EKKO-EKORG,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_EKORG.                                 "n435991
                                                               "n435991
    *DATA : G_S_EKORG             TYPE  STYPE_EKORG,             "n435991
          G_T_EKORG             TYPE  STYPE_EKORG   OCCURS 0.  "n435991
                                                               "n435991
    for the plant                                             "n435991
    *TYPES : BEGIN OF STYPE_WERKS,                               "n435991
             WERKS              LIKE  EKPO-WERKS,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_WERKS.                                 "n435991
                                                               "n435991
    *DATA : G_S_WERKS             TYPE  STYPE_WERKS,             "n435991
          G_T_WERKS             TYPE  STYPE_WERKS   OCCURS 0.  "n435991
                                                               "n435991
    *DATA : G_F_TABIX             LIKE   SY-TABIX.               "n435991
                                                               "n435991
    working tables for array database access                  "n934526
    *types : begin of stype_key,                                 "n934526
             bukrs              type  bkpf-bukrs,              "n934526
             belnr              type  bkpf-belnr,              "n934526
             gjahr              type  bkpf-gjahr,              "n934526
           end of stype_key,                                   "n934526
                                                               "n934526
           stab_key             type  standard table of        "n934526
                                      stype_key                "n934526
                                      with default key.        "n934526
    Initialwerte setzen
    FORM INIT.
    ENDFORM.
    Selection Screen: Process before output
    FORM PBO.
    ENDFORM.
    Selection Screen: Process after input
    FORM PAI USING FNAME MARK.
      CHECK MARK = SPACE.
    ENDFORM.
    Lesen BKPF und Uebergabe an den Selektionsreport
    FORM PUT_BKPF.
    define locla working areas                                "n934526
    data : l_t_key             type  stab_key,                "n934526
            l_t_key_block       type  stab_key,                "n934526
            l_t_bkpf            type  standard table of bkpf.  "n934526
                                                               "n934526
    ----------------------------------------------------------"n934526
                                                                "n934526
    database seletion improved                                "n934526
    at first read all FI doc keys into a lean table           "n934526
    data: wa like bkpf-belnr.
      SELECT * FROM BKPF
    where budat in br_budat
          AND GJAHR EQ BR_GJAHR-LOW
          AND BLART = 'RV'.
         AND BLART IN BR_BLAR                               "n934526
                                                                "n934526
    check sy-subrc is initial.                                "n934526
                                                               "n934526
    then process the found FI doc keys in small blocks        "n934526
    do.                                                       "n934526
       if  l_t_key[] is initial.                               "n934526
         exit.        " no more keys -> leave this DO loop     "n934526
       endif.                                                  "n934526
                                                               "n934526
      form small blocks with 100 FI docs each                 "n934526
       refresh                  l_t_key_block.                 "n934526
       append lines of l_t_key  from 1 to 100                  "n934526
                                to  l_t_key_block.             "n934526
       delete l_t_key           from 1 to 100.                 "n934526
                                                               "n934526
      read the complete FI doc headers for the block          "n934526
       SELECT *                 FROM BKPF                      "n934526
         into  corresponding fields of table l_t_bkpf          "n934526
           for all entries in l_t_key_block                    "n934526
             WHERE BUKRS = l_t_key_block-BUKRS                 "n934526
               AND BELNR = l_t_key_block-BELNR                 "n934526
               AND GJAHR = l_t_key_block-GJAHR.                "n934526
                                                               "n934526
      provide the complete structure for the PUT              "n934526
       loop at l_t_bkpf         into  bkpf.                    "n934526
        process this company code  : authority and read T001  "n934526
         PERFORM                F1000_COMPANY_CODE.            "n934526
                                                               "n934526
        go on if the first authority check was successful     "n934526
         CHECK : G_S_BUKRS-RETCODE IS INITIAL.                 "n934526
                                                               "n934526
        set the currency key and save the keys                "n934526
         MOVE : G_S_BUKRS-WAERS TO  T001-WAERS,                "n934526
                BKPF-BUKRS      TO  BR_SBUKRS,                 "n934526
               MOVE  BKPF-BELNR       TO  BR_SBELNR.
               MOVE  BKPF-GJAHR      TO  BR_SGJAHR .               "n934526
                BKPF-GJAHR      TO  BR_SGJAHR.                 "n934526
          PUT                    BKPF.                          "n934526
       endloop.                                                "n934526
    enddo.                                                    "n934526
    ENDSELECT.
    ENDFORM.
    Lesen BSEG und Uebergabe an den Selektionsreport
    FORM PUT_BSEG.
    define local working areas                                "n934526
      data : l_t_bseg            type  standard table of bseg.  "n934526
                                                                "n934526
    ----------------------------------------------------------"n934526
    BR_SGSBER = BR_GSBER-LOW.
                                                                "n934526
      SELECT * FROM BSEG                                        "n934526
          WHERE  BELNR EQ BR_SBELNR
          AND GJAHR EQ BR_SGJAHR
          AND GSBER EQ BR_SGSBER.
    check sy-subrc is initial.                                "n934526
                                                                "n934526
    loop at l_t_bseg           into  bseg.                    "n934526
       MOVE BSEG-BUZEI TO BR_SBUZEI.
       MOVE BSEG-EBELN TO BR_SEBELN.
       MOVE BSEG-EBELP TO BR_SEBELP.
       MOVE BSEG-ZEKKN TO BR_SZEKKN.
        PUT BSEG.
      endSELECT.                                                  "n934526
    ENDFORM.
    "n435991
          FORM AUTHORITYCHECK_BKPF                            "n435991
    "n435991
                                                                "n435991
    *FORM AUTHORITYCHECK_BKPF.                                   "n435991
                                                                "n435991
    the authority-check for the company code was successful;  "n435991
    check authority for the document type here                "n435991
                                                                "n435991
    does the buffer contain this document type ?              "n435991
    READ  TABLE  G_T_BLART     INTO  G_S_BLART                "n435991
            WITH  KEY  BLART = BKPF-BLART  BINARY SEARCH.      "n435991
                                                               "n435991
    CASE  SY-SUBRC.                                           "n435991
       WHEN  0.       "document type is known                  "n435991
                                                               "n435991
       WHEN  4.       "docment type is new --> insert          "n435991
         MOVE  SY-TABIX         TO  G_F_TABIX.                 "n435991
         PERFORM                F1200_CREATE_BLART_ENTRY.      "n435991
         INSERT  G_S_BLART      INTO  G_T_BLART                "n435991
                                INDEX  G_F_TABIX.              "n435991
                                                               "n435991
       WHEN  8.       "document type is new --> append         "n435991
         PERFORM                F1200_CREATE_BLART_ENTRY.      "n435991
         APPEND  G_S_BLART      TO  G_T_BLART.                 "n435991
    ENDCASE.                                                  "n435991
                                                               "n435991
    set the return code                                       "n435991
    MOVE  G_S_BLART-RETCODE    TO  SY-SUBRC.                  "n435991
                                                               "n435991
    *ENDFORM.                     "authoritycheck_bkpf           "n435991
                                                               "n435991
    "n435991
          FORM AUTHORITYCHECK_BSEG                            "n435991
    "n435991
                                                                "n435991
    *FORM AUTHORITYCHECK_BSEG.                                   "n435991
                                                               "n435991
    does the buffer contain this document type ?              "n435991
    READ  TABLE  G_T_GSBER     INTO  G_S_GSBER                "n435991
            WITH  KEY  GSBER = BSEG-GSBER  BINARY SEARCH.      "n435991
                                                               "n435991
    CASE  SY-SUBRC.                                           "n435991
       WHEN  0.       "business area is known                  "n435991
                                                               "n435991
       WHEN  4.       "business area is new --> insert         "n435991
         MOVE  SY-TABIX         TO  G_F_TABIX.                 "n435991
         PERFORM                F1300_CREATE_GSBER_ENTRY.      "n435991
         INSERT  G_S_GSBER      INTO  G_T_GSBER                "n435991
                                INDEX  G_F_TABIX.              "n435991
                                                               "n435991
       WHEN  8.       "business area is new --> append         "n435991
         PERFORM                F1300_CREATE_GSBER_ENTRY.      "n435991
         APPEND  G_S_GSBER      TO  G_T_GSBER.                 "n435991
    ENDCASE.                                                  "n435991
                                                               "n435991
    set the return code                                       "n435991
    MOVE  G_S_GSBER-RETCODE    TO  SY-SUBRC.                  "n435991
                                                               "n435991
    *ENDFORM.                     "authoritycheck_bseg           "n435991
                                                               "n435991

    ABAP provides few tools to analyse the perfomance of the objects, which was developed by us.
    Run time analysis transaction SE30
    This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
    SQL Trace transaction ST05
    by using this tool we can analyse the perfomance issues related to DATABASE calls.
    Perfomance Techniques for improve the perfomance of the object.
    1) ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
    2) Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out.
    3) Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
    4) Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
    5) Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
    6) Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space.
    Use as many table keys as possible in the WHERE part of your select statements.
    7)Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
    8) Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
    9) Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
    10) Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
    11) Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
    12) If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
    13) Know how to use the 'collect' command. It can be very efficient.
    14) Use the SELECT SINGLE command whenever possible.
    15) Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
    Some tips:
    1) Use joins where possible as redundant data is not fetched.
    2) Use select single where ever possible.
    3) Calling methods of a global class is faster than calling function modules.
    4) Use constants instead of literals
    5) Use WHILE instead of a DO-EXIT-ENDDO.
    6) Unnecessary MOVEs should be avoided by using the explicit work area operations
    see the follwing links for a brief insifght into performance tuning,
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
    1. Debuggerhttp://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    2. Run Time Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    3. SQL trace
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    4. CATT - Computer Aided Testing Too
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    5. Test Workbench
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    6. Coverage Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    7. Runtime Monitor
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    8. Memory Inspector
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    9. ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Performance tuning for Data Selection Statement
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm

  • Tuning 12c Cloud Control (Grid).

    Hello All.
    Ive installed the latest version of 12c Cloud Control and since I was previously using 11gr2 Grid, I can tell you its amazingly improved!
    It still has the system moving window, but i like the way things are layed out and categorized now.
    I got it running on that patchset 11.2.0.3 and the database is humming right along after adding larger redo logs and pumping up the sga/pga, ect.
    But when i start oms, it literally sucks up all the ram on the svr.
    Its ridiculous.....
    Is there a way to actually tune the oms itself??
    Thanks,
    Xevv.

    Hi,
    Would recommend to have the below patches in place for your setup
    Applying Enterprise Manager 12c Recommended Patches (Doc ID 1664074.1)
    Please note : the doc also covers patch recommendation for repos DB which should also help
    Also you can refer to below doc which covers some important tuning tips
    12c EM: Steps to Tune the Cloud Control 12c Agent Performance When Monitoring a Large Number of Targets (Doc ID 1349887.1)
    Regards,
    Rahul

  • Correcting Perspective with grid

    Adobe TV is my training. Under Correcting Perspectuve. just so you know Im a newbie. I tryed to use the grid to correct my image only in one corner but it pulls the whole right side. What Im I doing wrong.  http://tv.adobe.com/watch/learn-photoshop-cs6/correcting-perspective/#community

    Hi there, will you please send us a screenshot of your project? Are you holding down the command (control for PC) key when you click on the corner?

  • CS5.5 Gripes/CS6 Wish List (from the perspective of an FCP switcher)

    I have been a Final Cut Pro user for more than 10 years (starting with version 1.2 on a 500 MHz G4).  Final Cut Pro X is a disaster, but that’s a well-covered topic for a different forum.  After experimenting with Premiere Pro CS5.5 for a few months, I am ready to make the switch for all of my future projects.
    I make a living editing video.  I don’t, however, work for a big company, and I don’t have a lot of money to spend on third-party software or hardware.  Much of my work is shot on DSLRs and delivered online.  That may put me in the category of “pro-sumer” to some, but I wouldn’t be making the switch if I didn’t require a more professional alternative to FCPX to do my job.
    I also don’t think “pro” has to be synonymous with clunky and ugly.  (I’m looking at you, Avid.)  When Final Cut was young, it was fun, intuitive, and sturdy.  It became a robust, professional NLE over time.  I think Premiere Pro is on that path now.
    I like the look, the feel, and the functionality of CS5.5.  It’s not quite Apple-slick, but it’s very much at home on a Mac.  Overall, it’s an upgrade to FCP7 and a very strong alternative to FCPX.  I have high hopes for CS6.
    But this is not a comprehensive review.  It is just a list of negatives:  my gripes, wishes, and personal preferences.  My list of positives would be much longer, but my concern right now is with CS6 and the improvements that I hope it delivers.  As I am new to Premiere, it's quite possible that I am mistaken about certain functionalities or lack thereof, but I thoroughly researched each point in the help docs and forums before posting this.
    My primary system is a 3.2 GHz iMac 21” (2010) with 8 GB RAM, 512MB VRAM (ATI Radeon HD), running Mac OS X 10.7 with external Firewire 800 drives and a DisplayPort-to-HDMI external display.
    MAJOR ISSUES
    Hardware acceleration support for ATI GPUs
    There are rumors that Apple will be switching back to nVidia, but all recent iMacs have ATI and only ATI cards.
    Background rendering (or at least improved rendering options)
    Background rendering is probably FCPX’s most impressive feature and Adobe needs to catch up.  However, even if true background rending can’t be achieved, there should be an auto-render option (after a set idle time), partial rendering (if you cancel a render, keep everything that has been rendered up until that point), and more render options (e.g. render all and render selected). Regarding that last point, I think the whole work area concept should be dropped.  It makes sense for other apps, particularly for animation, but it just gets in the way of more important timeline functions while offering little functionality beyond being a clumsy way to control the area to be rendered.  At the very least, have a way to hide it.
    Full-screen preview
    Maximizing the program frame just isn’t the same (although the grave accent key function may be reason enough to switch to Premiere).  Full-screen preview isn’t just a nifty function for demo-ing sequences.  It’s a big part of the way I work.
    DisplayPort/Thunderbolt out to HDMI
    It may be that a third-party card is required for proper color correction on an external display, but there’s no reason this feature shouldn’t exist.
    Thumbnail images/show frames bug
    This one drives me crazy. I’ve tested this on 3 different Mac systems with various hardware configurations. Thumbnail images in the bins and frame images in the timeline seem to be recreated every time a project is opened, even though the thumbnail image files in the media cache folder don’t actually appear to get rewritten. It’s as if there is no cache at all (even for the most recently viewed bins and timelines segments).  It can’t be an intentional functionality for saving hard drive space because the cache files continue to take up more and more space.
    Open multiple projects simultaneously
    I know that you can cut and paste between projects but being able to open multiple projects at the same time is a very useful feature of FCP7.
    Magic Mouse/Magic Trackpad scrolling
    Premiere Pro is a cross-platform system and impressively so, but there need to be a few Mac-specific interface adjustments, the most important of which is support for the Magic Mouse and Magic Trackpad scrolling.  I use a Magic Mouse.  (It’s an irritating device sometimes, but once you get used to it, it’s hard to live without it.)  When I’m in a window, I expect a flick up or down to scroll up or down -- in every situation, every time, including the timeline.  Unless I stop using all other Mac apps, I will never get accustomed to the timeline suddenly flying left or right when I want to scroll up or down. Also, here’s a chance for Adobe to fix a problem that FCP7 shared:  When you scroll up or down in the effect control window using the mouse, the drop-down effect controls sometimes twirl all over the place if the mouse happens to float over them. As it is, it very easy to throw settings into random disarray without even realizing it just by scrolling through the pane.
    The timeline:  selection indication, icons, and general improvements
    It is very difficult to discern at a glance what, if anything, is selected in the timeline. Transitions always look selected!  Audio tracks should be a different color or otherwise more distinct. There should be an option to show frames only without any text. The icons for track options are small, crowded, and ugly.  Some of the editing icons are too similar, namely edit and ripple edit, although the excellent status bar at the bottom of the application goes a long way towards making up for this.  Simply put, the timeline could use some polish.  Don’t be afraid to steal from Apple on this one.  Keep the tracks; just make it easier on the eyes!
    Conforming audio
    The ability of CS5.5 to work natively with DSLR footage is awesome, but it’s not fully DSLR native if it has to pre-render a major component of the footage before it can play, even if it’s just the audio.
    Media loading
    When launching a project, it can take a long time for all the media in the project to “load” as tracked in the status bar.  I’m sure there’s a reason for this, but since the program is able to determine which source media files are missing before this step (and gives you the option to reconnect them), what is it doing and why must it load every clip in the project, even those not in use by any sequences?
    Page up/page down and arrow key commands
    For starters, the current page up/page down key functions should take the CTI to the next cut in the sequence, not the next cut in the track that happens to be targeted, which can be way down timeline.  In FCP7, I frequently navigated cut to cut with the up and down arrow keys.  I’ve avoided customizing the keyboard commands to match FCP7 --  I would rather endure some hardship and learn the proper Adobe commands -- but this one is flat-out backwards.  The page up/down keys should page through the timeline (left to right and right to left), while the up and down arrow keys should take over the clip to clip function (assuming the targeted track issue is fixed).  Currently, the down arrow takes you to the very end of the timeline, a function already duplicated by and better suited for the “end” key.
    Bin management and clip relationships
    Deleting an item from a bin should not delete it from the timeline, but this is part of a bigger problem, which is the whole master file versus instance versus subclip versus dup clip thing. There aren’t any good indicators regarding the relationships of these clips, and there are few ways to adjust them.  If clips are going to be connected, then they should be fully connected.  For instance, changing the name of a clip in the bin should change it in the timeline.  Adding an effect or trimming should affect the corresponding clips between bin and timeline.  Otherwise, the clips should just be completely separate instances.  I haven’t been able to find an option to turn a clip into an independent instance, although I have to think it exists.  Also, editing an instance of a title does change every other instance of that title throughout the sequence.  I would prefer to be able to edit them separately without having to duplicate them in the title editor.
    Bin effects
    Related to the above, it should be possible to add effects to clips in bins or keep effects on clips added to bin from timeline.  It would also be nice to be able to group effects together in bins for a specific project.  The effects window is better suited for global collections.
    Clearer visual indicators that a clip has been adjusted in the effect controls panel
    Even with the effects panel visible, you have to take a close look to see if there have been any adjustments to the standard settings. An indicator on the clip in the timeline itself would be useful.
    Snapping should include the CTI
    It should also include the blade tool, although the Cmd-K option to cut at the CTI position does make this less of an issue.
    Smoother scrubbing
    Scrubbing is pretty awful.  While this is understandable with native footage, FCPX somehow manages to make this silky smooth at full resolution.
    Color correction shape mask and better color correction in general
    Simplify the primary functions of the 3-way color correction effect.  Keep all the rarely used adjustments out of the way.  I use Magic Bullet for some purpose, but I’ve always done most of my color correction within FCP.  Put the most common adjustments front and center (or up top, as it may be).  The highlights/mid-tone/shadows drop-down is inconsistent in what controls it pertains to.
    FCPX’s color correction is actually one of its more underrated features.  The way it allows you to layer corrections is dead-simple yet as powerful as anything in FCP7 or Premiere.  Stick with the 3 wheels, but rely less on hard to control tonal ranges and add simple keyframe-able shape masks for secondary color correction.
    Better support for shared media access
    AVID is king in this arena and Adobe needs to improve.  It should be possible for multiple editors to safely work on the same project files and share media over a server.
    MINOR ISSUES
    More vertically compact playback/edit control area in source and program panes
    Make room for either a taller timeline or bigger previews.  The virtual scrubber and shuttle controls are the nifty things you drag with the mouse the first time you ever use an NLE and never touch again.
    Larger icons in icon view
    Remember size and position of bin windows
    Playback resolution setting indicator
    There should be an always-visible indicator of the playback res setting in the preview pane that’s easy to adjust without right-clicking.
    Better markers for sequences and clips
    Include colors and more keyboard shortcut control.
    Clip sliding with keyboard commands
    “Opt-,” (that’s Option-comma) should cause a clip collision, not overwrite.  Either that, or “,” and “.” should slide, while “Opt-,” should overwrite.  Opt-arrow should only extend an adjoining clip if in the middle of two clips.  Basically, this whole arrangement should be re-thought.
    Project browser should auto refresh/sort.
    Option-drag on a Mac should always be copy, not move.
    Copy is currently command-drag in the project browser.
    Stop auto-save from interrupting adjustments in timeline.
    Ideally, the auto-save should just be a background function, but it should at least wait until you’re not in the middle of dragging something.
    Add ability to select a cut directly and add default transition.
    CTI control
    If you move the CTI while it’s in play mode, it should continue to play from that spot after you release the mouse, not stop there.
    Show number of frames being adjusted during keyframe adjustments.
    Enable/disable specific effect parameters/keyframes.
    Clearing an effect should clear keyframes as well.
    Or have an option to clear both.
    Position controls
    There should be a preference to make the default position 0.0 x 0.0 (as opposed to 50% of whatever the resolution happens to be), and include a reset button.
    Through-edit indicator in timeline
    And a quick way to join clips, such as a right-click menu option.
    Border controls for images
    Auto save location preference and functionality
    In FCP7 I set the number of auto saves to keep to the maximum of 100 and Premiere can go even higher.  I have always used this feature as an additional backup and archive system, which has come in very handy.  Those files add up, however.  So, I prefer to auto-save to an external drive.  Also, auto saves in Premiere continue to occur whenever there are unsaved changes.  This means that if you make a small adjustment and then leave Premiere for a while, it will keep auto saving the same iteration, which is not only inefficient but leads to my next point….
    Tame the bouncing dock icon on auto save
    While using other apps, there’s no need for the dock icon to bounce every time Premiere performs an auto save.
    More/clearer control over cache locations
    There should also be an option to reset the cache/render file locations to their defaults.
    Export source range
    When exporting, remember the last-used setting of the export source range (or just dump the whole work area thing as I previously suggested).  It’s too easy to cut off a portion of the video when the export defaults back to the work area every time.
    Larger timecode display
    After spending hours and hours editing, the current timecode for clips and sequences is something you want to be able to track without squinting.  Use the letters h,m,s and f instead of colons.
    Simple slug
    Creating a black matte works okay, but it involves a few extra steps.
    Snapping toggle
    FCP allows you to quickly toggle snapping while dragging a clip.  Upon releasing the clip, the snap toggle returns to its original state.  Premiere could use this fucntion, but I suggest something simpler.  Holding down the “S” key should always turn snapping on regardless of toggle state, while releasing it returns it to however it was set before.
    Ability to dock the audio meters along top
    I like to give my timeline as much horizontal space as possible.  I’ve noticed a lot of users keep the toolbar up there, myself included.  I think it would be a good place horizontally aligned audio meters as well.
    More detailed tool tips or hover explanations in preferences
    For example:  The options regarding XMP data should make it clear that the original files will be modified by Premiere.  This caused me problems in other applications.  (After researching these settings, I understand that various Adobe applications use this information to share resources, but it’s still very unclear what the specific benefits are or what functions are lost without this option.)
    More detailed support documents
    The online support documents on the Adobe site very good.  They are nicely arranged and easy to search, but they could be more detailed and offer fuller explanations.  (Peruse the support forums and you will discover all kinds of debates that could have been easily cleared up with one concise line in a help document.)
    Icons and button design
    Icons and buttons are often too small, too similar, and too crowded throughout the interface.  Take some style tips from Apple on this one.
    NEW FEATURE WISH LIST
    Footage auto-analysis:  shot recognition, color correction, and color match
    If only Apple had just added these features and others to the FCP7 framework.  Adobe can do it better though, by using smart folders in addition to the traditional bins that we know and trust (anything besides those dreadful iMovie-style “events”).
    Effect previews
    In the 64-bit era, there has to be a quicker way to preview effects.
    Ability to render in alternate formats
    Namely ProRes or DNxHD.  This would save me considerable time on exports by allowing me to select the “use preview files” option.
    PluralEyes functionality
    Okay, I suppose I should just purchase PluralEyes...again.
    Many, many more effects!
    How about starting with the missing vignette effect?  Just because an app is “pro” doesn’t mean you should have to custom build every effect.
    Many, many more looks!
    Will most of them be cheesy looks I would never touch?  Sure...but give me some templates to play with before I tweak the look down to my exact specifications.
    More speed!
    FCPX, for all its flaws, blazes on any modern Mac.  This probably comes back to hardware acceleration, but while Premiere Pro on a Mac isn’t slow, it doesn’t blow you away.

    You hit the nail on the head, Peter.
    I recently started giving Premiere Pro CS5 a try, and was shocked by the amount of bugs and usability issues. I'm not even going as deep as you in the features, but the most glaring evidence of the lousy interface is that timecode offset bubble that appears everytime you move a clip in the timeline... the bugger appears just under your mouse pointer and won't go away, so if you try to just move a clip down a track quickly, and let go of the button ONTO the bubble, it acts as an obstacle and your drag/drop fails ! seriously, Adobe... don't tell me nobody has stumbled upon this one during beta-testing ?
    Ditto on the autosave that basicly interrupts anything you're doing. No background saving in 2011 ? At first it bothered me to no end so I disabled the autosave. And then a few hours later, Premiere crashed, and didn't even try to recover my work. I lost 2 hours of intricate work. I put autosave back on, and learned to endure the constant, annoying save dialog. And it's not like the save process is instant... even the simplest of projects takes 5 to 10 seconds to save... on an SSD... come on... let me work already...
    Of course, a headache-inducing implementation wouldn't be complete if the autosave didn't trigger even 30 seconds after a manual save. If I choose an interval of 5 minutes, just autosave 5 minutes after a manual save !
    In thumbnail view, you can reorder the clips manually. It's all fine, but you can't reorder them by name or date or length, unless you switch to list view and of course, lose the thumbnails.
    Dragging and dropping a clip in thumbnail view is a chore, because the palette doesn't scroll when the mouse reaches the edge. You know, when you want to move something at the top all the way to the bottom... so you have to drag, let go, scroll one screen, drag, let go, scroll one screen... it's a joke. Even the timeline can do it. Heck, it's a software standard, nowadays.
    Renaming a clip and pressing ENTER takes you back to... the top of the folder !?! How many times I've renamed files that were at the end of the thumbnail view, and for each clip, I had to scroll back down. Time waster.
    Want to locate a clip from the timeline, in the project ? the locate function takes you to the folder. But not to the file, you have to navigate towards it manually.
    Ditto on the up/down arrows. I haven't found a way to jump from cut to cut like in FCP7. How often do I need to jump to the starting/ending points ? much less often than jumping to a nearby cut.
    How come I can't reorder filters in the effects pane ? sorry, I can actually reorder the filters... provided I take them from the bottom and move them up. Moving effects down doesn't work. It's driving me crazy.
    Conforming happens more or less anytime. Without reason. And even if the Media Cache is already full of conformed files.
    When moving the boundaries of the work area, no timecode/offset appears. You need to let go of the button and THEN hover, then you'll know the exact time/duration.
    Try scrolling up in the timeline, it scrolls to the left (which is stupid, it should scroll up). Now scroll up on the tabs of a palette : they scroll to the right !?!
    Can't select an active track. Direct consequence : copy-pasting a clip overlaps anything that's on track 1. Say I want to duplicate clips on the same track... I can't do it.
    Copy-pasting between projects doesn't keep the transitions, only the order of the clips.
    Have you tried doing a frame freeze on a reversed clip and setting proper in/out points for the freeze ? Good luck.
    "Duplicate" command, when you right click on a thumbnail, is way too far from the cut/copy/paste commands at the top, even though they're quite related.
    The other day I transcoded footage with different audio parameters. Just the audio had changed. Upon opening the project, Premiere wanted me to locate the files, which I did. And it failed miserably. Instead, I opened the project ignoring the missing files, and then re-linked them. I pointed Premiere at the first missing file, and had to confirm the replacement. Premiere saw all the other missing files in that folder, and began prompting me FOR EACH SINGLE FILE !!! two hundred and forty three of them, precisely. Can't I have a "yes to all" button in 2012 ? and why does the relinking work inside the project and not when you open a project ?
    That was just from 3 days with Premiere Pro CS5. I still can't believe it. Just to think people bashed Final Cut Pro X, praising Premiere in comparison... Sorry, but they both have serious issues. And Premiere doesn't even have the excuse of novelty.

  • How to finetune the force control of an AC Motor Linear Actuator?

    Hello,
    I
    am hoping to find some help here with the following problem, which I am trying
    to solve for several days now....
    I
    am using the UMI-7774 and an AC servo-motor-driven linear actuator to do
    force control. Basically, I need the actuator to apply a constant force and
    react quickly to force changes. My system setup is as follows: I am using
    a PCI-7344 Motion Control Card to provide the analogue command signal
    (0-10V). This signal is supplied to the actuator controller (through a
    UMI-7774), which transforms the command signal to an amperage command signal
    (0-2.17Arms). This is the signal controlling the actuator’s torque. The actuator controller is working in torque mode. I use
    a Kistler PZT force sensor (ring type) and a Kistler amplifier as my feedback
    source. The signal from the sensor amplifier is directly connected to the ADC of the
    UMI. I am using MAX to tune my system and define a PID controller that gives
    me a good step response.
    (1)
    The results so far show that it works in principle, but I believe my system is
    not yet tuned optimally. However, the best step response results I have
    obtained and the PID parameters I used are shown in the attached files. As I am
    relatively new to this area, could you please advise me on how I could further
    improve the step response of the system? The current rise time and
    overshoot values are very good (a 3% overshoot would also be acceptable),
    but the observed undershoot is causing delayed settling. Also, the oscillation
    observed during undershoot is something I would like to remove.
    (2)
    I have tried increasing Kp and Kd values. Increased Kd does not seem to correct
    the oscillation problem. On the contrary, it destabilises the system. Increasing
    Kp causes an unwanted overshoot.  I have also tried to reduce the
    Derivative Sampling Period but that gave even worse results (System Inertia: J
    = 1.8629*10^-5 Kgm^2).
    At
    Td=2 the actuator was retracting on its own to its home position when I set Ki>=8.
    I got the most stable behaviour using Td=4. Is there any other way I could
    improve the actuator’s response?
    (3)
    I have seen that in some cases people have used a “double PID loop” one
    for the encoder feedback and one for the force feedback. Do you believe that
    this would improve system behaviour? If so, how could
    I implement two PID loops? I mean, MAX only allows me to enter
    one set of PIDs....or is there a possibility to set up a second PID-loop
    somewhere?....I have seen that the "Force Control Using Monitoring
    Force" example essentially works with two Closed-loops, but one of them is
    implemented in the application software and this would result in a
    non-deterministic and comparatively slow response of the system, right??
    Sorry for the long post and thanks
    a lot in advance for help and advice.
    Attachments:
    Force Conrtol Loop Settings Actuator-BEST.JPG ‏41 KB
    Step Responce Actuator-Force Feedback-BEST.JPG ‏58 KB

    Hello Jochen and thank you for your very nice reply.
    The past few days I have been trying to implement your advice, but unfortunately I did not have much success. Let me start by saying that explanations to my problem, the 2nd one looked more probable, as I always make sure that there is contact between my actuator and the workpiece I am pushing against. So, I unmapped my DAC by setting up the axis as a stepper axis with no feedback and I used the Load DAC to apply voltage and see when my actuator starts moving. That gave me the upper and lower limits for the Static Friction Compensation filter (please refer to attached image). I then implemented this filter and tried to retune the PID parameters, but the results I got were poor.
    I can now adjust the parameters so that there is no initial spike and undershoot, but now the force ramps up fast to a specific value and then keeps rising slowly. Vibration is observed at the point of transition from fast to slow ramp-up (ref. Step Responce Actuator-Force Feedback-WITH FILTER_v2).
    I could not eliminate the steady state error. When I tried to eliminate the steady state error by increasing Ki, or tried to create an initial overshoot by increasing Kp, I always ended up with an unstable system or a system with a response similar to the one shown in attached figure “Step Responce Actuator-Force Feedback-WITH FILTER_v1”.
      Do you perhaps have an explanation or comments for this behaviour? As for your other questions:
    Sensor Bandwidth: N/A, Charge Amplifier Bandwidth: 200 kHz, Low pass filter: No (Amplifier has the capability though)
    PID Update Period: 250 microseconds (fastest available)
    NI Motion Version 2.3
    Labview Version 8.5.1
      Thank you,
    Thomas
    Attachments:
    Step Responce Actuator-Force Feedback-Filter Settings.JPG ‏28 KB
    Step Responce Actuator-Force Feedback-WITH FILTER_v2.JPG ‏69 KB
    Step Responce Actuator-Force Feedback-Filter Settings.JPG ‏28 KB

  • To improve the system performance of the code

    Please help me to improve the system performance of the following program. its very urgent
    report zsdr0125
              no standard page heading
    *         LINE-SIZE  170                                   " SIR 061880
              line-size  210                                   " SIR 061880
              line-count 58
              message-id zz.
    ** Report header ******************************************************
    ** Report name: Activity Costing Report
    ** Report id:   RO-01148
    ** Designed/Coded. Tori Chandler. Reporting Team.
    ** Date: March 01, 2000.
    ** Original SIR:  016113
    ** Application Area: V - Sales & Distribution  (OTC)
    ** Correction/Transport:  D10K951579
    ** Description:  It is normal business practice for logistics
    **               operations to charge business units for the activity
    **               incurred on their behalf.  This is consistent with
    **               activity based costing principles between BU and
    **               shared resources.  The activities involved are picking
    **               storage, shipping and receiving.  The purpose of this
    **               report is to provide data for the first 3.
    **      QRB2 - 03/13/2000 - Tracy, Antoine, Christian, Tori
    ** History:
    * 06/14/2001 SIR 032383 CTS                             Antoine Dailly
    * A plant (WERKS) can have several Distrib points (VSTEL)
    * SIGN = 032383
    * Modification History:
    * Date       Modified by  SIR       CTS          Description
    *11/14/2001  J.CAMPION   034606   D10K979189  Logistics Activity report
    * Logistics Activity reports
    * We added fields ship to customer and country and we also make another
    * total
    * QRB2 Tracy L. Obrien
    * Modification History:
    * Date       Modified by  SIR       CTS          Description
    *11/14/2001  J.CAMPION   37838   D10K982890      Select only
    *                                                material type HALB
    *06/12/2002  T OBrien    38784   D10K988181
    *        Allow option to get material weight from Master data or
    *        from the delivery.
    *  Modified by    SIR       CTS                         Date
    *  Jim Harwood    42730     D10K993119               10 Oct 2002
    * Description:  Code amended to default the Goods Issue Date range to
    * the previous month.  Also amended to print out the Select Options.
    *  Modified by    SIR       CTS                         Date
    *  Jim Harwood    44381     D10K994598               18 Nov 2002
    * Description:  Correct date range processing.  APPEND statement added
    * so that record is added ot internal table S_WADAT.  Also S_VKORG
    * removed as it was NO DISPLAY and nothing was assigned to it. It's use
    * in an SQL call may be causing the wrong optimization.
    *  Modified by    SIR       CTS                         Date
    *  Tori Chandler  45567     D10K995875               03 Jan 2003
    * Description:  Correct reporting of weights for non-pickable items
    *    when the Material Master Data radiobutton is selected. Also found
    *    from SIR 37838, that material type is hardcoded on the LIPS.  I
    *    created a new select option and the person needing the report
    *    can control if they want only HALB or all line items.  Also,
    *    because of this the delivery weight is obtain from header,
    *    changing to accumulate from LIPS to match which lines are selected
    *  QRB2:  1/15/2003:  Eileen, Jerome and Tori
    *{   INSERT         D11K901833                                        1
    *  Modified by    Sir             CTS                    Date
    *  Sue Kastan    48712/054042    D11K901833         28 Aug, 2003
    *  Fix overcounting of records from LIPS
    *}   INSERT
    *  Modified by    SIR       CTS                         Date          *
    *  Vijay Andea   061880    D11K918628               04/20/2006        *
    *                          D11K946194                                 *
    *  Description: Enhence ZSDR0125 Activity Cost Driver Report to allow *
    *  Analysis by Product Groupings.                                     *
    *}   INSERT
    *  Modified by            SIR       CTS                    Date       *
    *  Prakash Arunachalam  091510   D11K950288             09/26/2006    *
    *  Description: Correct Activity Cost report  - material weight       *
    *  calculation                                                        *
    *  Modified by            SIR       CTS                    Date       *
    *  Murali Krishna        301978    D50K903293            01/20/2008
    *  Description: Improve the system performance of this report and
    *               clean-up of code into various form routine
    * Table declaration.
    tables: likp,    " SD Document: Delivery Header Data
            lips,    " SD document: Delivery: Item data
            vepo,    " SD Document: Shipping Unit Item (Content)
            vekp,    " SD Document: Shipping Unit Header
            knvv,    " Customer Master Sales Data
            kna1,    " General Data in Customer Master            SIR 34606
            marm,    " Units of Measure
            mara,    " Material Master: General Data              SIR 38784
            t001l,   " Stge locs
            t001k,   " Valuation area
            tvswz,   " Shipping Points per Plant
            t134,    " Material types
            z0234.   " Alternative Unit of Measure
    *** Selection screen.
    selection-screen begin of block b1 with frame title text-001.
    parameters:     p_werks  like t001l-werks obligatory memory id wrk.
    select-options: s_lgort  for  t001l-lgort,
    *               S_VKORG  FOR  TVKO-VKORG NO-DISPLAY ," SIR 34606, 42730
    *               S_WADAT  FOR  LIKP-WADAT_IST OBLIGATORY NO-EXTENSION,
                    s_wadat  for  likp-wadat_ist no-extension,  " SIR 42730
                    s_mtart  for  t134-mtart,                   " SIR 45567
                    s_lfart  for  likp-lfart no-display no intervals.
    selection-screen skip 2.
    selection-screen comment 1(21) text-002.                    " SIR 38784
    parameters:     p_delwt  radiobutton group grp1,            " SIR 38784
                    p_mstwt  radiobutton group grp1.            " SIR 38784
    *--------------------------------------------------*Start of SIR 061880
    selection-screen skip 2.
    selection-screen comment 1(21) text-006.
    parameters:     p_voldl radiobutton group 2,     " Volume from Delivery
                    p_volmd radiobutton group 2.  " Volume from Master Data
    *-----------------------------------------------------End of SIR 061880
    selection-screen end of block b1.
    *--------------------------------------------------*Start of SIR 061880
    selection-screen begin of block b2 with frame title text-007.
    select-options: s_cbuun for knvv-kvgr1 no intervals,      " Customer BU
                    s_mbuun for mara-prdha+1(2) no intervals, " Material BU
                    s_lobus for mara-prdha+3(3) no intervals,         " LOB
                    s_pac1  for mara-prdha+6(3) no intervals.   " PAC1
    selection-screen end of block b2.
    *----------------------------------------------------*End of SIR 061880
    *---Type Declaration for Internal Tables------------------------------*
    types: begin of t_likp,
              vbeln      like likp-vbeln,  " delivery
              vstel      like likp-vstel,  " shipping point
              lfart      like likp-lfart,  " delivery type
              vkorg      like likp-vkorg,  " Sales organization
              kunag      like likp-kunag,  " sold-to party
              kunnr      like likp-kunnr,  " ship to party        SIR 34606
              btgew      like likp-btgew,  " Delivery weight
              gewei      like likp-gewei,  " Unit of weight
              anzpk      like likp-anzpk,  " Number of Packages   SIR 61880
              volum      like likp-volum,  " Delivery Volume      SIR 61880
              voleh      like likp-voleh,  " Volume Unit          SIR 61880
              vtwiv      like likp-vtwiv,  " Distribution channel
              spaiv      like likp-spaiv,  " Division
              wadat_ist  like likp-wadat_ist,  " actual goods issue date
              del_flg(1) type c,                            "(+) SIR 301978
           end of t_likp.
    types: begin of t_lips,
              vbeln      like lips-vbeln,  " delivery
              posnr      like lips-posnr,  " delivery line
              matnr      like lips-matnr,  " material
              lgort      like lips-lgort,  " storage location
              prodh      like lips-prodh,  " product hierarchy
              meins      like lips-meins,  " base UoM
              brgew      like lips-brgew,  " Material weight
              gewei      like lips-gewei,  " Unit of weight
              volum      like lips-volum,  " Material Volume      SIR 61880
              voleh      like lips-voleh,  " Volume Unit          SIR 61880
              lgmng      like lips-lgmng,  " actual delivery quantity
              komkz      like lips-komkz,  " Indicator for picking control
              mtart      like lips-mtart,  " Material type      " SIR 37838
              del_flg(1) type c,                            "(+) SIR 301978
           end of t_lips.
    types: begin of t_vepo,
              venum      like vepo-venum,  " shipping unit number
              vbeln      like vepo-vbeln,  " delivery
           end of t_vepo.
    types: begin of t_vekp,
              venum      like vekp-venum,  " shipping unit number
              brgew      like vekp-brgew,  " actual weight
              gewei_max  like vekp-gewei_max,  " unit of weight
              vpobjkey   like vekp-vpobjkey,   " key for assigned object
           end of t_vekp.
    types: begin of t_knvv,
              kunnr      like knvv-kunnr,  " customer number
              ktgrd      like knvv-ktgrd,  " acct assign group
              kvgr1      like knvv-kvgr1,  " customer group 1
           end of t_knvv.
    types: begin of t_kna1,                                     " SIR 34606
              kunnr      like kna1-kunnr,  " customer number    " SIR 34606
              land1      like kna1-land1,  " contry             " SIR 34606
           end of t_kna1.                                       " SIR 34606
    types: begin of t_marm,
              matnr      like marm-matnr,  " material
              meinh      like marm-meinh,  " Alt unit of measure     032383
              umrez      like marm-umrez,  " numerator
              umren      like marm-umren,  " denominator
           end of t_marm.
    types: begin of t_mara,                                     " SIR 38784
              matnr      like mara-matnr,  " material           " SIR 38784
              prdha      like mara-prdha,  " Product Hierarchy  " SIR 61880
              brgew      like lips-brgew,  " gross weight       " SIR 38784
              gewei      like mara-gewei,  " Unit of weight     " SIR 38784
              volum      like mara-volum,  " Volume             " SIR 61880
              voleh      like mara-voleh,  " Volume Unit        " SIR 61880
              del_flg(1) type c,                            "(+) SIR 301978
           end of t_mara.                                       " SIR 38784
    types: begin of t_tvswz,
              vstel      like tvswz-vstel, " shipping point
           end of t_tvswz.
    types: begin of t_z0234,                                        "032383
              vstel      like z0234-vstel, " shipping point          032383
              zpaluom    like z0234-zpaluom," pallet unit of measure 032383
              zcsuom     like z0234-zcsuom," Case unit of measure    032383
           end of t_z0234.                                          "032383
    types: begin of t_output_dt,
              wadat_ist    like likp-wadat_ist, " Goods issue date
              ktgrd        like knvv-ktgrd," acct assign group
              bu           like knvv-kvgr1," business unit
              kunnr        like kna1-kunnr," ship to location     SIR 34606
              land1        like kna1-land1," ship to location     SIR 34606
              d_btgew      like likp-btgew," delivery weight
              m_brgew      like lips-brgew," material weight
              a_brgew      like vekp-brgew," actual weight of ship unit
              num_del      type i,         " counter of deliveries
              num_pallets  type i,         " number of pallets
              num_cases    type i,         " number of cases
              num_loose    type i,         " loose quantity
              num_delln    type i,         " counter of delivery lines
    *         packages     like likp-anzpk," Number of Packages " SIR 61880
              packages(3)  type p,         " Number of Packages " SIR 61880
              volume       like lips-volum," Volume             " SIR 61880
              lobus(3)     type c,         " Line of Business   " SIR 61880
              pac1(3)      type c,                    " PAC1    " SIR 61880
           end of t_output_dt.
    types: begin of t_output_ag,
              ktgrd        like knvv-ktgrd," acct assign group
              bu           like knvv-kvgr1," business unit
              land1        like kna1-land1," country              SIR 34606
              d_btgew      like likp-btgew," delivery weight
              m_brgew      like lips-brgew," material weight
              a_brgew      like vekp-brgew," actual weight of ship unit
              num_del      type i,         " counter of deliveries
              num_pallets  type i,         " number of pallets
              num_cases    type i,         " number of cases
              num_loose    type i,         " loose quantity
              num_delln    type i,         " counter of delivery lines
    *         packages     like likp-anzpk," Number of Packages " SIR 61880
              packages(3)  type p,         " Number of Packages " SIR 61880
              volume       like lips-volum," Volume             " SIR 61880
              lobus(3)     type c,         " Line of Business   " SIR 61880
              pac1(3)      type c,                   " PAC1     " SIR 61880
           end of t_output_ag.
    types: begin of t_output_gs,                                " SIR 34606
              ktgrd        like knvv-ktgrd," acct assign group  " SIR 34606
              bu           like knvv-kvgr1," business unit      " SIR 34606
              d_btgew      like likp-btgew," delivery weight    " SIR 34606
              m_brgew      like lips-brgew," material weight    " SIR 34606
              a_brgew      like vekp-brgew," actual weight      " SIR 34606
              num_del      type i,         " counter of deliv   " SIR 34606
              num_pallets  type i,         " number of pallets  " SIR 34606
              num_cases    type i,         " number of cases    " SIR 34606
              num_loose    type i,         " loose quantity     " SIR 34606
              num_delln    type i,         " counter of deliv   " SIR 34606
    *         packages     like likp-anzpk, " Number of Package " SIR 61880
              packages(3)  type p,          " Number of Packages" SIR 61880
              volume       like lips-volum, " Volume            " SIR 61880
              lobus(3)     type c,          " Line of Business  " SIR 61880
              pac1(3)      type c,           " PAC1             " SIR 61880
           end of t_output_gs.                                  " SIR 34606
    *-------------------------------------------------* Begin of SIR 061880
    * Material Type
    types: begin of t_mtart,
           mtart like t134-mtart,                           " Material Type
           end of t_mtart.
    * Customer Business Unit.
    types: begin of t_kvgr1,
           kvgr1 like knvv-kvgr1,                        " Customer Group 1
           end of t_kvgr1.
    * sales Organization.
    types: begin of t_lgort,
           lgort like t001l-lgort,                     " Sales Organization
           end of t_lgort.
    *                                                   Begin of SIR 301978
    *      Header: Material Document
    types: begin of t_mkpf,
             vgart    type mkpf-vgart,
             xblnr    type likp-vbeln,
           end   of t_mkpf.
    *                                                     End of SIR 301978
    *---------------------------------------------------* End of SIR 061880
    *---Internal Tables---------------------------------------------------*
    data:  i_likp        type  t_likp occurs 0 with header line,
           i_temp_likp   type  t_likp occurs 0 with header line,
           v_likp        type  t_likp,
           i_lips        type  t_lips occurs 0 with header line,
           i_temp_lips   type  t_lips occurs 0 with header line,
           v_lips        type  t_lips,
           i_vepo        type  t_vepo occurs 0,
    *      V_VEPO        TYPE  T_VEPO,
           i_vekp        type  t_vekp occurs 0,
           v_vekp        type  t_vekp,
           i_knvv        type  t_knvv occurs 0 with header line,
           v_knvv        type  t_knvv,
           i_kna1        type  t_kna1 occurs 0,                 " SIR 34606
           v_kna1        type  t_kna1,                          " SIR 34606
           i_z0234       type  t_z0234 occurs 0,                "    032383
           v_z0234       type  t_z0234,                         "    032383
           i_z0234_uom   type  t_z0234 occurs 0,                "    032383
           v_z0234_uom   type  t_z0234,                         "    032383
           i_marm        type  t_marm occurs 0 with header line," SIR 61880
           i_marm_pallet type  t_marm occurs 0 with header line,
           v_marm_pallet type  t_marm,
           i_marm_case   type  t_marm occurs 0 with header line,
           v_marm_case   type  t_marm,
    *-------------------------------------------------* Begin of SIR 061880
    *      I_MARA        TYPE  T_MARA OCCURS 0,                 " SIR 38784
           i_mara1       type  t_mara  occurs 0 with header line,
           i_mtart       type  t_mtart occurs 0 with header line,
           i_kvgr1       type  t_kvgr1 occurs 0 with header line,
           i_lgort       type  t_lgort occurs 0 with header line,
           v_kvgr1       type  t_kvgr1,
    *---------------------------------------------------* End of SIR 061880
           v_mara        type  t_mara,                          " SIR 38784
           i_tvswz       type  t_tvswz occurs 0,
           v_tvswz       type  t_tvswz,                     "(+) SIR 301978
           i_output_dt   type  t_output_dt occurs 0,
           v_output_dt   type  t_output_dt,
           i_output_ag   type  t_output_ag occurs 0,
           v_output_ag   type  t_output_ag,
           i_output_gs   type  t_output_gs occurs 0,            " SIR 34606
           v_output_gs   type  t_output_gs,                     " SIR 34606
           i_mkpf        type  table of t_mkpf with header line."SIR 301978
    *** Data Declarations *
    data:  v_page(3)        type c,                          " Page Counter
           v_comp           like t001k-bukrs,       " zbsn0001 company code
           v_title(24)      type c,                 " zbsn0001 report title
           v_rpttyp         type c,                           " report type
           v_ok             type c,             " control While... endwhile
           v_diff_date      type p,                " days between selection
           v_werks          like t001l-werks,                       " plant
    *      v_z0234_zpaluom  like z0234-zpaluom,  " Pallet Unit of Measure
    *      v_z0234_zcsuom   like z0234-zcsuom,   " Case Unit of Measure
           v_palwto         type p decimals 6,                 " SIR 091510
    *       "like likp-btgew,       " Weight after conversion
           v_vekp_tabix     like sy-tabix,                  " index on read
           v_vekp_sum_brgew like vekp-brgew,                " actual weight
           v_pallet_qty     like lips-lgmng,        " calculated pallet qty
           v_pallet_integer type i,                       " true pallet qty
           v_case_qty       like lips-lgmng,          " calculated case qty
           v_case_integer   type i,                         " true case qty
           v_qty_not_pallets like lips-lgmng,                  " calculated
           v_num_pallets    like lips-lgmng,    " calculated nbr of pallets
           v_num_pallets_int type i,                  " true nbr of pallets
           v_num_cases      like lips-lgmng,      " calculated nbr of cases
           v_num_cases_int  type i,                     " true nbr of cases
           v_total_case_qty like lips-lgmng,                " case quantity
           v_loose_qty      type i,             " calculated loose quantity
    *-------------------------------------------------* Begin of SIR 061880
           v_volume         like lips-volum,      " Volume After Convertion
           v_cbuun          like knvv-kvgr1,                  " Customer BU
           v_mbuun          like knvv-kvgr1,                  " Material BU
           v_lobus(3)       type c,                      " Line of Business
           v_pac1(3)        type c,                                  " PAC1
           v_flag           type c.            " Flag Indicator for No Data
    *---------------------------------------------------* End of SIR 061880
    *                                                   Begin of SIR 301978
    * Ranges
    ranges : r_vstel for tvswz-vstel.
    *                                                     End of SIR 301978
    * Constants
    data:  c_uom(3)        type c value 'KG'.    " Kilogram Unit of Meas.
    data : c_vom like mara-voleh value 'M3'.   " Metter Cube.  " SIR 061880
    constants : c_wl(2) type c value 'WL'.                  "(+) SIR 301978
    * Initialization.
    initialization.
      s_lfart-sign   = 'I'.
      s_lfart-option = 'EQ'.
      s_lfart-low    = 'LF  '.
      append s_lfart.
      s_lfart-low    = 'NL  '.
      append s_lfart.
      s_lfart-low    = 'NLCC'.
      append s_lfart.
      s_lfart-low    = 'ZLFI'.
      append s_lfart.
    * AT SELECTION-SCREEN.
    at selection-screen.
    * SIR 42730 - If no Goods Issue Date has been specified in the
    *             Select Options set the range to the previous month.
      if s_wadat-low is initial.
        s_wadat-sign      = 'I'.
        s_wadat-option    = 'BT'.
        s_wadat-high      = sy-datum.              " Today's date
        s_wadat-high+6(2) = '01'.                  " First of this month
        s_wadat-high      = s_wadat-high - 1.      " End of last month
        s_wadat-low       = s_wadat-high.          " End of last month
        s_wadat-low+6(2)  = '01'.                  " First of last month
        append s_wadat.
      endif.     " SIR 42730 IF S_WADAT-LOW IS INITIAL.
      clear v_werks.                                        "(+) SIR 301978
    * Validate Plant/Storage Location from selection screen
      select werks up to 1 rows into v_werks from t001l
            where werks =  p_werks  and
                  lgort in s_lgort.
      endselect.
      if sy-subrc ne 0.
        message e045 with text-e01.
      endif.
    * Validate Storage Location
      if not s_lgort[] is initial.
        select lgort from t001l into table i_lgort where lgort in s_lgort.
        if sy-subrc ne 0.
          message e045 with text-e09.
        endif.
      endif.
    * Validate date range.  do not allow more that 31 days
      if not s_wadat-high is initial.
        v_diff_date = s_wadat-high - s_wadat-low.
        if v_diff_date >= '31'.
          message e045 with text-e02.
        endif.
      endif.
    *-------------------------------------------------* Begin of SIR 061880
    * Validation for Material Type in Selection Screen
      if not s_mtart[] is initial.
        select mtart from t134 into table i_mtart where mtart in s_mtart.
        if sy-subrc ne 0.
          message e045 with text-e07.
        endif.
      endif.
    at selection-screen on block b2.
    * Validation for Material Business Unit and Customer Business Unit.
      if s_cbuun-low is not initial and s_mbuun-low is not initial.
        message e045 with text-e05.
      endif.
    * Validation for Possible combinations of Material BU, Line of Business
    * and PAC1
      if ( s_mbuun-low is not initial and s_lobus-low is not initial
                                    and s_pac1-low is not initial )
      or ( s_mbuun-low is not initial and s_lobus-low is not initial )
      or ( s_lobus-low is not initial and s_pac1-low is not initial )
      or ( s_mbuun-low is not initial and s_pac1-low is not initial ).
        message e045 with text-e06.
      endif.
    * Validation for Customer Business Unit.
      if not s_cbuun[] is initial.
        select kvgr1 from tvv1 into table i_kvgr1 where kvgr1 in s_cbuun.
        if sy-subrc ne 0.
          message e045 with text-e08.
        endif.
    *    free: i_kvgr1.
      endif.
    *---------------------------------------------------- End of SIR 061880
    * TOP-OF-PAGE
    * Top of the page routine to print the headers and columns
    top-of-page.
      format color col_heading on.
      if v_rpttyp = 'D'.
        v_title = text-h01.
      else.
        v_title = text-h02.
      endif.
      perform zbsn0001_standard_header     " Standard Report Heading Form
               using v_comp v_title 'U' v_page.
      skip.
      if v_rpttyp = 'D'.
        perform write_dtlvl_headings.
      else.
        perform write_aglvl_headings.
      endif.
    *       FORM WRITE_DTLVL_HEADINGS                                     *
    *   for date detail level, print the column headers                   *
    form write_dtlvl_headings.
      write: /001 text-h03,                " Acct
              038 text-h04,                " ------ P I C K I N G ------
              105 text-h05,                " ----- S H I P P I N G -----
             /001 text-h06,                " Group
              007 text-h07,                " Date
              017 text-h08,                " BU
              021 text-h17,                " ship to party            34606
              030 text-h18,                " country
              039 text-h09,                " Pallets
              057 text-h10,                " Cases
              075 text-h11,                " Loose
              093 text-h12,                " Lines
              105 text-h13,                " Material Kg
              124 text-h16,                " Delivery Kg
              143 text-h14,                " Actual Kg
              161 text-h15,                " Deliveries
    *----------------------------------------------------Start of SIR 61880
              173 text-h20,                " Packages
              189 text-h21,                " Volume
              201 text-h22,                " LOB
              207 text-h23.                " PAC1
    *-----------------------------------------------------*End of SIR 61880
      skip.
    endform.                               " end of write_dtlvl_headings.
    *       FORM WRITE_AGLVL_HEADINGS                                     *
    *      for account group detail level, print the column headers       *
    form write_aglvl_headings.
      write: /001 text-h03,                " Acct
              038 text-h04,                " ------ P I C K I N G ------
              105 text-h05,                " ----- S H I P P I N G -----
             /001 text-h06,                " Group
              017 text-h08,                " BU
              030 text-h18,                " country              SIR 34606
              039 text-h09,                " Pallets
              057 text-h10,                " Cases
              075 text-h11,                " Loose
              093 text-h12,                " Lines
              105 text-h13,                " Material Kg
              124 text-h16,                " Delivery Kg
              143 text-h14,                " Actual Kg
              161 text-h15,                " Deliveries
    *---------------------------------------------------*Start of SIR 61880
              173 text-h20,                " Packages
              189 text-h21,                " Volume
              201 text-h22,                " LOB
              207 text-h23.                " PAC1
    *-----------------------------------------------------*End of SIR 61880
      skip.
    endform.                               " end of write_aglvl_headings.
    *-------------------------- SUBBROUTINES -----------------------------*
    include zbsn0001.      " Include to print all Standard Report Titles
    include zsdn0004.      " Print the Select Options
    *** MAIN SELECTION.                                                   *
    start-of-selection.
      refresh:  i_likp, i_temp_likp, i_lips, i_temp_lips, i_vepo,
                i_vekp, i_knvv, i_marm_pallet, i_marm_case, i_tvswz,
                i_output_dt, i_output_ag, i_mara1.
      clear:    v_likp, v_lips, v_vekp, v_knvv, v_mara,
                v_marm_pallet, v_marm_case, v_output_dt, v_output_ag.
      v_rpttyp = 'D'.
    * SIR 42730 - Echo the Select Options to the output listing and print
    *             the Goods Issue Date range being used.
      write: /,/.     " SIR 43730 - Skip a couple of lines to centre it.
      perform zsdn0004_print_select_options using sy-cprog ' '.
      if s_wadat-high is initial.
        write: /,/, text-003, 34 s_wadat-low.
      else.
        write: /,/, text-003, 34 s_wadat-low, 44 text-004, 47 s_wadat-high.
      endif.
      new-page.
    * Main Processing.                                                    *
      perform get_data.
      if not i_lips[] is initial.
        perform create_output.
      endif.
    * END-OF-SELECTION
    end-of-selection.
    *-------------------------------------------------* Start of SIR 061880
    *   PERFORM WRITE_REPORT.
      if not i_output_dt[] is initial and not i_output_ag[] is initial and
                                          not i_output_gs[] is initial.
        perform write_report.
      else.
        skip 2.
        write:/ text-e03.
        skip 2.
        uline.
        clear: v_flag.
      endif.
    *---------------------------------------------------* End of SIR 061880
    *       FORM GET_DATA                                                 *
    * build all of the internal tables needed for the report              *
    * selects on t001k, z0234, likp, lips, vepo, vekp, knvv & marm, mara  *
    form get_data.
      perform get_data_t001k.                                  " SIR 301978
      perform get_data_tvswz.                                  " SIR 301978
      if sy-subrc = 0.                     " Build shipping point range
        perform get_data_Z0234.                                " SIR 301978
        if sy-subrc ne 0.
          v_flag = 'X'.
    *      stop.
        else.
          sort i_z0234 by vstel.                                   " 032383
        endif.
    *                                                  Begin of  SIR 301978
    *   The data retrievalfrom LIKP has been modified for performance
    *   reasons
        perform get_data_mkpf.                                 " SIR 301978
        if sy-subrc eq 0.
    *     Deleting data other than Goods issued for delivery
          delete i_mkpf where vgart ne c_wl.
          sort i_mkpf by xblnr.
        endif.
    *   Deleting the data from the internal table i_likp by comparing
    *   shipping point
        r_vstel-sign = 'I'.
        r_vstel-option = 'EQ'.
        clear : v_tvswz.
        loop at i_tvswz into v_tvswz.
          r_vstel-low = v_tvswz-vstel.
          append r_vstel.
        endloop.
        if not i_mkpf[] is initial.
          perform get_data_likp.                             " SIR 301978
        endif.
        if sy-subrc = 0.
          delete i_likp where not lfart in s_lfart.
    *                                                  End    of SIR 301978
    *     Get data for the delivery lines
          if not i_likp[] is initial.
            perform get_data_lips.                         " SIR 301978
    *                                                  Begin of SIR 301978
            if i_lips[] is initial.
              v_flag = 'X'.
              message i089 with text-i02.
              leave list-processing.
            endif.                    " Return code for LIPS select
    *                                                     End of SIR 301978
          endif.
    *-------------------------------------------------* Begin of SIR 061880
    *     Get Data From MARA (Material Master) to Read Material Weight and
    *     Material Voluem from Master Data.
          if not i_lips[] is initial.
    *                                                   Begin of SIR 301978
    *       Delete the duplicate material from delivery item table
            i_temp_lips[] = i_lips[].
            sort i_temp_lips by matnr.
            delete adjacent duplicates from i_temp_lips comparing matnr.
            perform get_data_mara.                         " SIR 301978
            if sy-subrc = 0.
              sort i_mara1 by matnr.
              clear i_temp_lips.
              refresh i_temp_lips.
    *                                                     End of SIR 301978
            else.
              v_flag = 'X'.
              message i089 with text-i01.
              leave list-processing.
            endif.
          endif.
    *     Filter I_LIPS and I_MARA1 When Either material BU or Line of
    *     Business (LOB) or PAC1 are not left Balnk
          perform filter_data_for_prdha.
    *     Get data for the sold-to customer
          perform i_knvv_fill_data.
    *    Filter I_LIKP & I_LIPS & I_MARA for Cust-BU, When Cust-Bu is not
    *    left Blank.
          perform filter_likp_lips_mara_custbu.
    *---------------------------------------------------- End of SIR 061880
    *-------------------------------------------------* Begin of SIR 034606
    *     Get data for the ship to party
          i_temp_likp[]  = i_likp[].
          sort i_temp_likp by kunnr.
          delete adjacent duplicates from i_temp_likp comparing kunnr.
          perform get_data_kna1.                             " SIR 301978
          if sy-subrc = 0.
            sort i_kna1 by kunnr.
          endif.
    *---------------------------------------------------* End of SIR 034606
        else.
          v_flag = 'X'.
          message i089 with text-i04.
          leave list-processing.
        endif.                               " return code to LIKP select
    *    endif.                                                " SIR 061880
        free: i_temp_likp.
      endif.                               " return code for TVSWZ select
    * Process table LIPS
      if not i_lips[] is initial.
        i_temp_lips[] = i_lips[].
        sort i_temp_lips by vbeln.
        delete adjacent duplicates from i_temp_lips comparing vbeln.
    *   Get actual weight
        perform get_data_vepo.                                 " SIR 301978
        if sy-subrc = 0.
          sort i_vepo by venum.
          delete adjacent duplicates from i_vepo comparing venum.
          perform get_data_vekp.                               " SIR 301978
          sort i_vekp by vpobjkey.
        endif.
        free:  i_vepo, i_temp_lips.
        i_temp_lips[] = i_lips[].
        sort i_temp_lips by matnr.
        delete adjacent duplicates from i_temp_lips comparing matnr.
    *   Get Units of Measure for Material
        perform read_data_from_marm.                           " SIR 061880
    *                                                   Begin of SIR 032383
        i_z0234_uom = i_z0234.
        sort i_z0234_uom by zpaluom.
        delete adjacent duplicates from i_z0234_uom comparing zpaluom.
    *                                                   End   of SIR 032383
        clear i_marm_pallet.                                   " SIR 061880
        refresh  i_marm_pallet.                                " SIR 061880
        loop at i_z0234_uom into v_z0234_uom.             "LOOP Z0234 032383
    *-------------------------------------------------* Begin of SIR 061880
    *     Get Alternative Unit of Measure for Pallets
          perform i_marm_pallet_fill.
        endloop.                                      "ENDLOOP Z0234 032383
    ** get alternative UoM for pallets
    *      SELECT MATNR                     " material
    *             MEINH                     " Alt unit of measure  " 032383
    *             UMREZ                     " numerator
    *             UMREN                     " denominator
    **     into table i_marm_pallet                                " 032383
    *      APPENDING TABLE I_MARM_PALLET                            "032383
    *      FROM MARM
    *      FOR ALL ENTRIES IN I_TEMP_LIPS
    *      WHERE MATNR = I_TEMP_LIPS-MATNR  AND
    **           meinh = v_z0234_zpaluom.                          " 032383
    *            MEINH = V_Z0234_UOM-ZPALUOM.                      " 032383
    *---------------------------------------------------* End of SIR 061880
        sort i_marm_pallet by matnr meinh.
        free i_z0234_uom.                                           "032383
        i_z0234_uom = i_z0234.                                      "032383
        sort i_z0234_uom by zcsuom.                                 "032383
        delete adjacent duplicates from i_z0234_uom comparing zcsuom."32383
        clear i_marm_case.                                     " SIR 061880
        refresh i_marm_case.                                   " SIR 061880
        loop at i_z0234_uom into v_z0234_uom.            "LOOP Z0234 032383
    *-------------------------------------------------* Begin of SIR 061880
    *     Get Alternative Unit of Measure for Cases
          perform i_marm_case_fill.
        endloop.                                      "ENDLOOP Z0234 032383
    *---------------------------------------------------* End of SIR 061880
        sort i_marm_case by matnr meinh.
      else.
        v_flag = 'X'.
        message i089 with text-i02.
    *      leave list-processing.
      endif.                               " table LIPS is empty
    endform.                               " get_data
    *       FORM CREATE_OUTPUT                                            *
    * process internal table LIPS, for each delivery/delivery lines create*
    * an output record and collect into i_output internal table.  Fields  *
    * used for header are goods issue date, acct assign, BU for customer, *
    * total weight, total weight for shipping unit and count of           *
    * deliveries, the remaining fields will have a value of zero for the  *
    * collect.  For each delivery line, fields used are goods issue date, *
    * acct assign, BU for material, number of pallets, number of cases,   *
    * loose quantity and number of delivery lines.  The remaining header  *
    * fiels will be zero for the collect.                                 *
    form create_output.
    *-------------------------------------------------* Begin of SIR 061880
      sort i_mara1 by matnr.
      sort i_lips by vbeln posnr matnr.
      sort i_likp by vbeln.
      sort i_z0234 by vstel.
      sort i_knvv by kunnr.
      sort i_kna1 by kunnr.
      sort i_vekp by vpobjkey.
      sort i_marm_pallet by matnr meinh.
      sort i_marm_case by matnr meinh.
    * LOOP AT I_LIPS INTO V_LIPS.
      loop at i_lips.
        clear v_lips.
        v_lips = i_lips.
    *---------------------------------------------------* End of SIR 061880
        at new vbeln.
          perform collect_header_data.
        endat.
        if not v_lips-komkz is initial.                         " SIR 45567
          perform collect_item_data.
        endif.                                                  " SIR 45567
      endloop.
    endform.                               " create_output
    *       FORM COLLECT_HEADER_DATA                                      *
    * Fields used for header are goods issue date, acct assign,           *
    * BU for customer, total weight, total weight for shipping unit       *
    * and count ofdeliveries, the remaining fields will have a value of   *
    * zero for the collect.                                               *
    form collect_header_data.
      clear:  v_likp, v_knvv, v_vekp, v_vekp_sum_brgew.
      v_ok = 'Y'.
      read table i_likp into v_likp with key vbeln = v_lips-vbeln
                                                   binary search.
      if sy-subrc = 0.                                         " SIR 061880
        clear v_z0234.                                      "(+) SIR 301978
        read table i_z0234 into v_z0234                              "32383
             with key vstel = v_likp-vstel                           "32383
             binary search.                                          "32383
        read table i_knvv into v_knvv with key kunnr = v_likp-kunag
                                                     binary search.
        if sy-subrc ne 0.
          select single ktgrd kvgr1 into (v_knvv-ktgrd, v_knvv-kvgr1)
            from knvv where kunnr = v_likp-kunag  and
                            vkorg = v_likp-vkorg  and
                           vtweg = '01' and          " intercompany values
                           spart = '01'.             " intercompany values
        endif.
        clear v_kna1.                                           " SIR 34606
        read table i_kna1 into v_kna1                           " SIR 34606
           with key kunnr = v_likp-kunnr                        " SIR 34606
           binary search.                                       " SIR 34606
        read table i_vekp into v_vekp
           with key vpobjkey(10) = v_likp-vbeln
           binary search.
        if sy-subrc = 0.
          v_vekp_tabix = sy-tabix.
          while v_ok = 'Y'.
            if v_vekp-gewei_max ne c_uom.
              perform z_unit_conversion
                using v_vekp-brgew v_vekp-gewei_max c_uom v_palwto.
              v_vekp_sum_brgew = v_vekp_sum_brgew + v_palwto.
            else.
              v_vekp_sum_brgew = v_vekp_sum_brgew + v_vekp-brgew.
            endif.
            v_vekp_tabix = v_vekp_tabix + 1.
            read table i_vekp into v_vekp
               index v_vekp_tabix.
            if sy-subrc = 0.
              if v_vekp-vpobjkey(10) ne v_likp-vbeln.
                v_ok = 'N'.
              endif.
            else.
              v_ok = 'N'.
            endif.
          endwhile.
        endif.
      endif.                                                   " SIR 061880
    * populate output tables
      clear: v_output_dt, v_output_ag,v_output_gs.              " SIR 34606
      v_output_dt-wadat_ist = v_likp-wadat_ist.
      v_output_dt-ktgrd     = v_knvv-ktgrd.
      v_output_ag-ktgrd     = v_knvv-ktgrd.
      v_output_gs-ktgrd     = v_knvv-ktgrd.                     " SIR 34606
    *-------------------------------------------------* Begin of SIR 061880
    *  V_OUTPUT_DT-BU        = V_KNVV-KVGR1.
    *  V_OUTPUT_AG-BU        = V_KNVV-KVGR1.
    *  V_OUTPUT_GS-BU        = V_KNVV-KVGR1.                    " SIR 34606
    * Populate Business Unit,Line of Busness and PAC1 Values in Header Data
      perform get_busunit_lobus_pac1_data1.
    *---------------------------------------------------* End of SIR 061880
      v_output_dt-kunnr = v_kna1-kunnr.                         " SIR 34606
    * V_OUTPUT_AG-KUNNR = V_KNA1-KUNNR.                         " SIR 34606
      v_output_dt-land1 = v_kna1-land1.                         " SIR 34606
      v_output_ag-land1 = v_kna1-land1.                         " SIR 34606
      v_output_dt-a_brgew     = v_vekp_sum_brgew.
      v_output_ag-a_brgew     = v_vekp_sum_brgew.
      v_output_gs-a_brgew     = v_vekp_sum_brgew.               " SIR 34606
      if s_mbuun[] is initial and                               " SIR 61880
         s_lobus[] is initial and                               " SIR 61880
         s_pac1[] is  initial.                                  " SIR 61880
        v_output_dt-num_del   = 1.
        v_output_ag-num_del   = 1.
        v_output_gs-num_del   = 1.                              " SIR 34606
    *-------------------------------------------------* Begin of SIR 061880
    * Number of Packages
        v_output_dt-packages   = v_likp-anzpk.
        v_output_ag-packages   = v_likp-anzpk.
        v_output_gs-packages   = v_likp-anzpk.
      else.
        clear: v_output_dt-num_del,
               v_output_ag-num_del,
               v_output_gs-num_del,
               v_output_dt-packages,
               v_output_ag-packages,
               v_output_gs-packages.
      endif.
    *---------------------------------------------------* End of SIR 061880
      collect v_output_dt into i_output_dt.
      collect v_output_ag into i_output_ag.
      collect v_output_gs into i_output_gs.                     " SIR 34606
    endform.                               " collect_header_data
    *       FORM COLLECT_ITEM_DATA                                        *
    * For each delivery line, fields used are goods issue date,           *
    * acct assign, BU for material, number of pallets, number of cases,   *
    * loose quantity and number of delivery lines.  The remaining header  *
    * fiels will be zero for the collect.                                 *
    form collect_item_data.
      clear:  v_pallet_qty,      v_pallet_integer,
              v_case_qty,        v_case_integer,
              v_num_pallets,     v_num_pallets_int,
              v_num_cases,       v_num_cases_int,
              v_qty_not_pallets, v_total_case_qty, v_loose_qty.
      read table i_marm_pallet into v_marm_pallet
                 with key matnr = v_lips-matnr
                          meinh = v_z0234-zpaluom binary search."32382
      if sy-subrc = 0.
        v_pallet_qty = v_marm_pallet-umrez / v_marm_pallet-umren.
    * round down partial pallets
        v_pallet_integer = v_pallet_qty - '.499'.
      endif.
      read table i_marm_case into v_marm_case
                  with key matnr = v_lips-matnr
                           meinh = v_z0234-zcsuom binary search."32382
      if sy-subrc = 0.
        v_case_qty = v_marm_case-umrez / v_marm_case-umren.
    * round down partial cases
        v_case_integer = v_case_qty - '.499'.
      endif.
      if v_pallet_integer > 0.
        v_num_pallets     = v_lips-lgmng / v_pallet_integer.
        v_num_pallets_int = v_num_pallets - '.499'.
      endif.
      v_qty_not_pallets = v_lips-lgmng -
                          ( v_num_pallets_int * v_pallet_integer ).
      if v_case_integer > 0.
        v_num_cases     = v_qty_not_pallets / v_case_integer.
        v_num_cases_int = v_num_cases - '.499'.
      endif.
      v_total_case_qty     = v_num_cases_int * v_case_integer.
      if v_qty_not_pallets = v_total_case_qty.
        v_loose_qty = 0.
      else.
        v_loose_qty = 1.
      endif.
    * populate output tables
      clear: v_output_dt, v_output_ag, v_output_gs.             " SIR 34606
      v_output_dt-wadat_ist   = v_likp-wadat_ist.
      v_output_dt-ktgrd       = v_knvv-ktgrd.
      v_output_ag-ktgrd       = v_knvv-ktgrd.
      v_output_gs-ktgrd       = v_knvv-ktgrd.                   " SIR 34606
      v_output_dt-kunnr = v_kna1-kunnr.                         " SIR 34606
    * V_OUTPUT_AG-KUNNR = V_KNA1-KUNNR.                         " SIR 34606
      v_output_dt-land1 = v_kna1-land1.                         " SIR 34606
      v_output_ag-land1 = v_kna1-land1.                         " SIR 34606
    *-------------------------------------------------* Begin of SIR 061880
    *  V_OUTPUT_DT-BU          = V_LIPS-PRODH+1(2).
    *  V_OUTPUT_AG-BU          = V_LIPS-PRODH+1(2).
    *  V_OUTPUT_GS-BU          = V_LIPS-PRODH+1(2).             " SIR 34606
    * Populate Business Unit,Line of Business and PAC1 Values for Item Data.
      perform get_busunit_lobus_pac1_data2.
      if V_OUTPUT_DT-BU is initial.
       clear V_OUTPUT_DT.
       exit.
      endif.
    *---------------------------------------------------* End of SIR 061880
    * get delivery weight from delivery lines instead of header " SIR 45567
      if v_lips-gewei = c_uom.
        v_output_dt-d_btgew  = v_lips-brgew.
        v_output_ag-d_btgew  = v_lips-brgew.
        v_output_gs-d_btgew  = v_lips-brgew.                    " SIR 34606
      else.
        perform z_unit_conversion
             using v_lips-brgew v_lips-gewei c_uom v_palwto.
        v_output_dt-d_btgew  = v_palwto.
        v_output_ag-d_btgew  = v_palwto.
        v_output_gs-d_btgew  = v_palwto.                        " SIR 34606
      endif.
    * Get material weight from delivery (LIPS)(IF P_DELWT = 'X')" SIR 38784
      if p_delwt = 'X'.                                         " SIR 38784
        if v_lips-gewei = c_uom.
          v_output_dt-m_brgew  = v_lips-brgew.
          v_output_ag-m_brgew  = v_lips-brgew.
          v_output_gs-m_brgew  = v_lips-brgew.                  " SIR 34606
        else.
          perform z_unit_conversion
               using v_lips-brgew v_lips-gewei c_uom v_palwto.
          v_output_dt-m_brgew  = v_palwto.
          v_output_ag-m_brgew  = v_palwto.
          v_output_gs-m_brgew  = v_palwto.                      " SIR 34606
        endif.
      else.                                                     " SIR 38784
    * Get material weight from Master data (MARA)               " SIR 38784
        read table i_mara1 into v_mara                          " SIR 38784
                               with key matnr = v_lips-matnr    " SIR 38784
                               binary search.                   " SIR 38784
        if v_mara-gewei = c_uom.                                " SIR 38784
          v_output_dt-m_brgew  = v_mara-brgew * v_lips-lgmng.   " SIR 38784
          v_output_ag-m_brgew  = v_mara-brgew * v_lips-lgmng.   " SIR 38784
          v_output_gs-m_brgew  = v_mara-brgew * v_lips-lgmng.   " SIR 38784
        else.                                                   " SIR 38784
          perform z_unit_conversion                             " SIR 38784
               using v_mara-brgew v_mara-gewei c_uom v_palwto.  " SIR 38784
          v_output_dt-m_brgew  = v_palwto * v_lips-lgmng.       " SIR 38784
          v_output_ag-m_brgew  = v_palwto * v_lips-lgmng.       " SIR 38784
          v_output_gs-m_brgew  = v_palwto * v_lips-lgmng.       " SIR 38784
        endif.                                                  " SIR 38784
      endif.                                                    " SIR 38784
    *-------------------------------------------------* Begin of SIR 061880
    * To Get the Volume Data.
      perform get_volume_data.
    *---------------------------------------------------* End of SIR 061880
      v_output_dt-num_pallets = v_num_pallets_int.
      v_output_ag-num_pallets = v_num_pallets_int.
      v_output_gs-num_pallets = v_num_pallets_int.              " SIR 34606
      v_output_dt-num_cases   = v_num_cases_int.
      v_output_ag-num_cases   = v_num_cases_int.
      v_output_gs-num_cases   = v_num_cases_int.                " SIR 34606
      v_output_dt-num_loose   = v_loose_qty.
      v_output_ag-num_loose   = v_loose_qty.
      v_output_gs-num_loose   = v_loose_qty.                    " SIR 34606
    *{   INSERT         D11K901833                                        1
    * Sir 054042/48712 insert code to put in 0 instead of 1 for collect
    * value for delivery lines
      if v_lips-lgmng = 0.
        v_output_dt-num_delln   = 0.
        v_output_ag-num_delln   = 0.
        v_output_gs-num_delln   = 0.
      else.
    * end of insert for 054042/48712
    *}   INSERT
        v_output_dt-num_delln   = 1.
        v_output_ag-num_delln   = 1.
        v_output_gs-num_delln   = 1.          

    Since this is your first post, let me clue you in. This forum is meant for asking very short and specific questions. For example, if you've asked, how could you improve a particular one SELECT statement, I'm sure many people would have helped you.
    But you cannot seriously expect someone on this forum to spend his/her time and review such a long program. For this people are normally getting paid, you know.

  • How can I improve the SEO (Search Engine Optimization) of my website?

    Hello,
    I have pushed my website live and am currently looking at my basic website reviews from "Woorank".  There are a lot of areas that I can inprove for SEO and they seem simple enough to take care of. However many suggestions they give require direct input into HTML...and, well, I chose Muse so I didn't have to deal with that jazz.  So, the following is a list of items that I am looking to improve on my website and I am looking for the "how to" in Adobe Muse. I have located and read through Adobe's "strategies for SEO" at http://www.adobekb.com/strategies_for_seo.html#addingtitles but i still have unanswered questions.
    robots.txt
    I know Muse creates a "XML sitemap", which I do not quite understand...because I am only familiar with the sitemap links that are typically at the footer of a website and serve as a directory - but it would be nice to prevent crawlers from accessing specific directories and pages and specify where the sitemap file is located. What exactly Muse doing with my website's "sitemap"? Is this sitemap accessible to people viewing my website or just crawlers?
    Headings
    My website currently does not use html headings (<H1> to <H6>) I would like to use keywords in the headings.  In the "page properties"dialog box, under metadata, it has a "HTML for <head>" box. How do I input words in this? use the HTML such as: <H1>Green Roofs</H1><H2>Landscape Architecture</H2>? separate by comma? Just type in words with a space inbetween?
    Alternative Text for images
    I have found that only some of the images in my website have the option for adding alternative text. I right click on a photo and I get a "Edit Image Properties..." Option to add alt. text.  But some images do not have this option. Why?  I hover over an image and keep the arrow pointer (mouse) still and it will display a "tool tip" such as "Hero Frame", "image Frame", "thumbnail", "target", or "trigger". It seems that only on "image frame", "hero image", and "trigger" will right click and display the option for  "Edit Image Properties...".  Whats going on here?
    Blog
    I have an active blog that I have as a menu item and when you go to that page on my site, I just have a link that goes to the externally hosted blog.  Is there a way to eliminate a click by actually having the user directed to the external blog site when clicking the "Blog" menu tab?  I understand that a particular level in Business Catalyst has a Blog engine option.
    A lot of these are pretty nit-picky, but I would appreciate any insight given. Thanks,

    More info on sitemap.xml:
    http://www.adobekb.com/strategies_for_seo.html#understandingsitemap
    Note that you can also exclude a page from your sitemap.xml to prevent crawlers from crawling it. Usually you don't want to do this, but if you have a good reason to the setting for that is in the page properties dialog.
    You can assign heading tags using paragraph styles. More info here:
    http://www.adobekb.com/strategies_for_seo.html#usingparagraph
    I'm able to set alt text on thumbnail images. Are you sure you have the thumbnail image selected?
    You can create a placeholder page in your plan view, then mark the page menu options as 'include page without hyperlink'. Then your menu will contain an entry for this page, but no hyperlink. If you select the menu item, you can assign a hyperlink with the hyperlink control in the control strip.

  • Job output is no longer available in the database control file

    Im running my rman backup with Oracle Enterprise manager grid control 10.2.0.1.
    In nocatalog mode.
    When I look for the job output in the "View Backup Report" section, it says
    Job output is no longer available in the database control file.
    Here is my rman setup:
    RMAN> show all;
    using target database control file instead of recovery catalog
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 7;
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 2;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 5 G;
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/app/oracle/product/10.2.0/db_1/dbs/snapcf_mus_prod.f'; # default
    anyone knows why i cannot see my rman job output?

    show parameter control_file_record_keep_time;
    NAME TYPE VALUE
    control_file_record_keep_time integer 7
    The backup is usually the last one. And it's the day before.
    If i go to the JOB tab in oem, then click on the job detail, i can see the detail of my rman backup. But i cannot see the backup detail in the View Backup Report section off the database. It says the error message : Job output is no longer available in the database control file

  • How to change the background of the StackPanel control when any child element has focus?

    Hello folks!
    I need to change the background of the StackPanel control when any element within the StackPanel has focus. I am executing the code snippet below. The code works fine with elements within the Grid control named "main". It doesn't work when I focus
    an element within the Grid control named "header".
    <StackPanel x:Name="techReportStackPanel" Width="250" Background="{Binding ColorBrush}" >
    <StackPanel.Style>
    <Style TargetType="{x:Type StackPanel}">
    <Style.Triggers>
    <DataTrigger Binding="{Binding ElementName=techReportStackPanel, Path=IsKeyboardFocusWithin}" Value="True">
    <Setter Property="Background" Value="Gray" />
    <Setter Property="Opacity" Value=".5" />
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </StackPanel.Style>
    <Grid x:Name="header">
    <TextBlock x:Name="headerColumn" Text="{Binding Name}" Style="{StaticResource ColumHeader}"/>
    <Button Visibility="{Binding ElementName=headerColumn, Path=Text, Converter={StaticResource delButtonVisibilityConverter}}" Command="{Binding DelCommand}" Content="x" ToolTip="{l:Translate TechReportDeleteToolTip}"/>
    </Grid>
    <Grid x:Name="main">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <wpftoolkit:WatermarkTextBox Grid.Column="0" Style="{StaticResource OrdinaryTextbox}" Watermark="{l:Translate LengthLabel}" ToolTip="{l:Translate BoreholeSpacingInRow}" Text="{Binding BoreholeSpacingInRow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, StringFormat=F2, Converter={StaticResource zeroToEmptyDoubleConverter}}" />
    <wpftoolkit:WatermarkTextBox Grid.Column="1" Style="{StaticResource OrdinaryTextbox}" Watermark="{l:Translate WidthLabel}" ToolTip="{l:Translate BoreholeSpacingBetweenRow}" Text="{Binding BoreholeSpacingBetweenRow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, StringFormat=F2, Converter={StaticResource zeroToEmptyDoubleConverter}}" />
    </Grid>
    </StackPanel>
    Any advice and suggestions will be greatly appreciated!

    >>It doesn't work when I focus an element within the Grid control named "header".
    You mean when the Button in the "header" Grid is focused? A TextBlock is not focusable so when the Button is not visible no element in the "header" Grid will be focused since you only have two elements in the "header" Grid.
    But when the Button is visible it should work. Please refer to the following code:
    <StackPanel x:Name="techReportStackPanel" Width="250" Background="{Binding ColorBrush}" >
    <StackPanel.Style>
    <Style TargetType="{x:Type StackPanel}">
    <Style.Triggers>
    <DataTrigger Binding="{Binding ElementName=techReportStackPanel, Path=IsKeyboardFocusWithin}" Value="True">
    <Setter Property="Background" Value="Gray" />
    <Setter Property="Opacity" Value=".5" />
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </StackPanel.Style>
    <Grid x:Name="header">
    <TextBlock Text="text..."/>
    <Button Visibility="Visible" Content="Button" />
    </Grid>
    <Grid x:Name="main">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBox Grid.Column="0">main grid...</TextBox>
    <TextBox Grid.Column="1">main grid...</TextBox>
    </Grid>
    </StackPanel>
    When the Button is focused the Background colour of the StackPanel is set to Gray as expected.
    If you want to be able to focus the TextBlock you should set its Focusable property to true:
    <Grid x:Name="header">
    <TextBlock Focusable="True" x:Name="headerColumn" Text="{Binding Name}" Style="{StaticResource ColumHeader}"/>
    <Button Visibility="{Binding ElementName=headerColumn, Path=Text, Converter={StaticResource delButtonVisibilityConverter}}" Command="{Binding DelCommand}" Content="x" ToolTip="{l:Translate TechReportDeleteToolTip}"/>
    </Grid>
    Hpoe that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • How to improve the Performance of Swing Components

    Hi
    I have developed a GUI Framework with Swing components. I observed that when number of components are more, the GUI is slow. Could anybody suggest me the ways to improve the performance of Swing Components
    Thanks

    Hi There - I haven't found issues so far with the speed of the GUI building, it seems fast when compared with .NET applications
    Are you doing any database querying on form load? This can slow down the loading of the GUI, I use persistence in an application and before the GUI is shown the persistence unit logs in to the database and registers itself - it does take 2/3 seconds to register and complete whatever it does before the form builds and shows
    Also check if you are loading/using any network based files on form load, this can also slow down the building considerably as well. Apart from that it's hard to say where your issue may lie apart from removing controls and checking build speed until you find the one that's slowing it down (not a good approach though) I sometimes had to load csv files from a network drive and if the file server is slow or LAN speed isn't great this can also cause a delay, hope you find it.....

  • How to clear the reader control when displayed on a Win Form?

    Hello
    I am using the reader control to display a pdf using VB.NET 2008 on Windows XP / Win 7.  The pdf is realted to a record displayed in a grid.  The problem I am having is I can not find a way to clear the document.
    The grid is filtered and can be changed by the user.  When the filter changes the reader control has no file to reference, but I can not find a "clear" function.  When the form loads the reader control is nicely blank but I can not revert to that state.  I created a blank pdf but that is confusing because the toolbar remains.  So what now?  Hide that?  Then hide the scrollbars and hope more quirky things don't happen.
    Is there a way to have an empty reader control (like it exists when the form loads) without destroying and re-creating the control every time?
    Thanks
    JM

    Hi Derek,
    I would suggest you check out a piece of freeware called 'CCLEANER' from the following link :_
    http://www.ccleaner.com/
    I use this myself on a regular basis to clear out unwanted bits and pieces from my system including internet cookies which I do not want.
    Be careful though, it can sometimes clean more than expected. :)
    regards,

  • How to increase/improve the resolution ?

    Hi there,
    I have this old video & I check the resolution is only something like 400 x 288. If i use it on my sequence (which is set at 1920 x 1080), it will be very blur.
    Any recommendation to increase/up/improve the old video to 1920 x 1080 ?
    Thanks

    There is nothing you can do.
    The video will always be of 400x288 quality so it doesn't rally matter how you enlarge it.
    You could try using the Brightness, Contrast and Sharpness controls to imprrove the appearance though they might make matters even worse.
    It's something you will have to try for yourself but you will probably find that it has been a waste of time.

Maybe you are looking for