Subtotals on tech field in reuse_alv_grid_display

I have a report that is using reuse_alv_grid_display
Ihave a requirement to have a subtotal for a field that includes both numeric and alpha content (the subtotals should ignore the alphas). See below for details
key field      data field
a                   1
a                   0
a                   3
a                  text
total for a        4
What I had done was defined an additiona field (data_tech) as numeric - and populated it with all the data from my data field - but where there was a text - populated it with 0.
I set this numeric field as tech, and dosum.
I also had an aditional key field (key_tech) which contains the same data as my key field.
In my report I set the sort to up on key and key_tech. I set key_tech as subtot.
I set dosum on both data and data_tech.
I define a subtotal_text form which is triggered when the subtotal for the tech field key_tech is reached. At this point I move the values calculated from es_data for field data_tech into data.
This all works fine - until I set the field data_tech to tech. The second I do that - there are no values in ANY of my fields in es_data. It still gets to subtotal_text - but there are no values in the fields. If I take the tech out - then all fields have the correct values - but I really do need to hide the duplicate coloums.
The frustrating thing is this DID work yeterday - and then I went and cleaned up my code and added comments. Not sure what I changed and now no matter whayt I try it does not work.
Help.

What error is it giving now??? paste ur code if possible

Similar Messages

  • Input field in REUSE_ALV_GRID_DISPLAY

    Hi all!
    I'm using REUSE_ALV_GRID_DISPLAY   FM and I have to alow the user to enter data in the screen.
    I'll displaying a list and the user need to fill quantities and save them then.
    I don't know hoy to declarate the field type. For the moment I'm only allow to display the data not to capture.
    Any help?
    Thanks.

    HI,
    the field which you want to make as input enabled then you need pass the 'X' to the EDIT field while Populating the Field Catalog.
    Refer to this link..[Updating the Internal Table -After Edit in ALV using Function Modules|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/updatingtheInternalTable-AfterEditinALVusingFunctionModules]

  • Subtotalling a numeric field for each row

    CR Xi
    In reviewing a legacy report for creation of a new report I'm getting an error: "There must be a gropu that matches this field"
    I've created three (3) Formula fields: DailyQty, NonDailyQty and TotalQty
    Here's the logic for TotalQty which generates the above error.
    (Sum ({@DailyQty}, {Table1.KeyID})* {Table2.HOURS_PER_DAY})
    + Sum ({@NonDailyQty}, {Table1.KeyID})
    The error focuses on the Table1.KeyID.
    1) I don't understand the error and the things I need to do.  Google/Bing searches don't provide much.  I'm a little new to the SUM function also.
    2) Essentially, I'm attempting to total EACH row for the various entries in ANOTHER table that's linked via Left Outer Join.  Note: If this is pretty involved we may opt to setup a TotalQty field in the appropriate table and bring that over directly into the Detail section of the CR Xi report.
    TIA!

    Sastry,
    It appears that the 'blank' line is really a <CRLF> as the data is the same but the spacing is different.  Hence, I get something linke this:
    07/01/2011  John Doe.....
    07/01/2011  Mary Smith.....
    So, there's double spacing occurring in some fashion.
    I've gone into the Section Expert for Details and I already have "Suppress Blank Section" checked.  There are no other boxes check. 
    Now, under the Suppress (No Drill-Down) in the Section Expert dialog box I have the {Table2.Field1}=Previous({Table2.Field1}) that I mentioned before.  There are no other formulas or calculations within the Section Expert.
    Thanks!

  • Checkbox field in REUSE_ALV_GRID_DISPLAY without creating additional field

    Hi Experts,
    I want to show checkboxes in ALV without adding an additional checkbox field in my structure. OO-ALV will also do.......
    Plz Help........

    hi check this...
    REPORT Z_TEST7 .
    *Table declaration
    tables: vbak,vbap.
    *internal table
    data: begin of i_sales occurs 0,
    vbeln like vbak-vbeln,
    erdat like vbak-erdat,
    audat like vbak-audat,
    kunnr like vbak-kunnr,
    vkorg like vbak-vkorg,
    matnr like vbap-matnr,
    netpr like vbap-netpr,
    check type c, "checkbox
    end of i_sales.
    type-pools: slis.
    data: v_fieldcat type slis_fieldcat_alv,
    gt_fieldcat type slis_t_fieldcat_alv,
    gt_layout type slis_layout_alv,
    gt_sort type slis_sortinfo_alv,
    fieldcat like line of gt_fieldcat.
    *Selection screen
    parameters: p_vkorg like vbak-vkorg.
    select-options: s_vbeln for vbak-vbeln.
    *start of selection.
    start-of-selection.
    perform get_data.
    perform fill_fieldcatalog.
    perform write_data.
    FORM get_data .
    select avbeln aerdat aaudat akunnr avkorg bmatnr b~netpr into
    corresponding fields of table i_sales from vbak
    as a inner join vbap as b on avbeln = bvbeln
    where a~vkorg = p_vkorg and
    a~vbeln in s_vbeln.
    ENDFORM. " get_data
    FORM write_data .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = sy-repid
    IS_LAYOUT = gt_layout
    IT_FIELDCAT = gt_fieldcat
    TABLES
    T_OUTTAB = i_sales .
    ENDFORM. " write_data
    FORM fill_fieldcatalog .
    sort i_sales by vbeln.
    clear v_fieldcat.
    "for check box
    v_fieldcat-col_pos = 1.
    v_fieldcat-fieldname = 'CHECK'.
    v_fieldcat-seltext_m = 'chek'.
    v_fieldcat-checkbox = 'X'.
    v_fieldcat-input = 'X'.
    v_fieldcat-edit = 'X'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 2.
    v_fieldcat-fieldname = 'VBELN'.
    v_fieldcat-seltext_m = 'Sales Document'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 3.
    v_fieldcat-fieldname = 'ERDAT'.
    v_fieldcat-seltext_m = 'Creation Date'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 4.
    v_fieldcat-fieldname = 'AUDAT'.
    v_fieldcat-seltext_m = 'Document Date'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 5.
    v_fieldcat-fieldname = 'KUNNR'.
    v_fieldcat-seltext_m = 'Customer'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 6.
    v_fieldcat-fieldname = 'VKORG'.
    v_fieldcat-seltext_m = 'Sales Organization'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 7.
    v_fieldcat-fieldname = 'MATNR'.
    v_fieldcat-seltext_m = 'Material'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 8.
    v_fieldcat-fieldname = 'NETPR'.
    v_fieldcat-seltext_m = 'Net Value'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    endform.

  • How to display subtotals in separate column in alv report?

    hi,
    I am displayed the subtotals  for QUantity field BDMNG in Reuse_alv_grid_display  in the same column.
    but I want to display subtotal in separate column.
    How to display subtotals in separate column in alv report?
    thanks&regards.
    samba.k

    Hi
    As far as i know you can't do this,the option you have is to create one more column (subtotal) and populate it by manual calculation at every subtotal (not alv subtotal but yours) .
    Best Regards
    Yossi

  • Do not display field in report output using ALV

    Hello friends,
    I have a dilemma here. I sorted my report using a dummy field named asset_dum. now, this is my basis of sub totals but I do not need to show it in the display. Is there a way or an option to do this?

    Hi,
    The problem with NO_OUT is that if the user changes the layout he can see the field and there is nothing in the system that would stop him from displaying the same.
    However TECH field should be useful in your case.
    TECH
    If this field is set, the relevant field is not displayed on the list and cannot be shown interactively. The field is only known in the field catalog. (For example, it must not be specified as a sorting criterion).
    Regards,
    Ravi
    Note : Please close the thread if the issue is resolved and mark all the helpful answers

  • Add $ and % to fields in ALV report

    Hi,
    How to add $ and % sybmbols to field values in ALV report. I cannot use a Char as I need to do totals and subtotals for those fields.
    Best Regards
    Suresh

    Hi,
    You cannot use % or $ or any special characters if you want to use the standard SAP totaling ans subtotaling.. you need to create another field adjacent to that field and show the currency or %.
    Otherwise you need to do the totaling logic yourself and then you can use $ or %
    Cheers:)
    Kothand

  • Display Subtotals on ALV Report W/O changing Layout

    Hi ,
    I need to display subtotals of quantity fields in my output of report ,with corresponding production order by using ALV container,Layout default seetings won't work here because user has to do many operations such as sorting filtering etc ,after displaying the report

    Check these threads out
    http://www.sap-basis-abap.com/sapalv.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/b99d37e188a049e10000009b38f8cf/content.htm
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS = 1.
    GS_SORT-UP = 'X'.
    GS_SORT-SUBTOT = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS = 2.
    GS_SORT-UP = 'X'.
    *GS_SORT-SUBTOT = 'X'.
    APPEND GS_SORT TO GT_SORT.
    Regards

  • Mapping of R/3 fields with SAP BI Infoobjects

    Hi All,
    In R/3 there are tables related to different business like sales, mm, fico etc.
    In the tables there are fields.
    Now I want to map fields of R/3 to BI Info objects. Is there any way I can map. I want enitre list of r/3 mapped to sap bi
    Example :
    Tech Field in R/3    Desc. of Tech Field                                                         Tech Name of  Infobject in SAP BI    Desc of Infoobj.
    VKBUR              Sales Office                  -> Maps to ->                             0SALES_OFF                                Sales Office
    Please let me know
    Thanks,
    Madhav

    Hi Madhav,
    The issue seems to be related to BI. Post your question in BI forumns.
    Thanks,

  • Displaying Subtotals in XL-Report

    hi guys,
    1. how to display the subtotals for userdefined fields for each column.
    2.And i wanted to merge each User defined columns for  displaying Sub-total for each every  column,
    this is an urgent requirement can give more suggestions about this issue.
    Thanking u
    Regards
    Naga

    Sub-totaling a UDF in XLR is just like sub-totalaling any other B1 field.  In Report Designer you use the =SUM(ixRef(I9,2)) where I9 is the ceel you want to sub-total.  The short cut for this function can be found on the XL Reporter toolbar under Formula Builder>Functions>Total>Column Total.   I am assuming that you have already added your UDFs to XLR under the Tools>User-Defined Field Menu.
    Dan

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • ALV - Subtotals with different waers

    Hello!
    I have a hierarquical ALV sorted by LIFNR and payments with the WRBTR and WAERS columns.
    WAERS can be 'ARS' 'USD' etc. for the same LIFNR.
    I want to display subtotals of WRBTR field for each LIFNR by WAERS.
    Can anyone help me please?
    Thanks,
    Liliana.

    Hi Liliana,
    Plz check this code .
    report  zxx_alvexer4    message-id zz        .
    *& TABLES DECLARATION                                                  *
    tables: vbak, vbap.
    *& TYPE POOLS DECLARATION                                              *
    type-pools: slis.
                          DATA DECLARATIONS                             *
    data: v_flag type c.                        "Flag to display the header
    data: v_repid type sy-repid.
    *& INTERNAL TABLE DECLARATION                                          *
    data: begin of it_vbak occurs 0,
           vbeln like vbak-vbeln,
           audat like vbak-audat,
           auart like vbak-auart,
           netwr like vbak-netwr,
           expand(1),
          end of it_vbak.
    data: begin of it_vbap occurs 0,
           vbeln like vbap-vbeln,
           posnr like vbap-posnr,
           matnr like vbap-matnr,
           pstyv like vbap-pstyv,
           charg like vbap-charg,
         end of it_vbap.
    data: it_fldcat type slis_t_fieldcat_alv,
          it_fldcat1 type slis_t_fieldcat_alv,
    *events
          it_events type slis_t_event with header line,
          v_call type c,
          x_user type  slis_exit_by_user,
          it_variant like  disvariant occurs 0 with header line,
          x_keyinfo type slis_keyinfo_alv,
    *layout
          x_layout type slis_layout_alv,
    *sort
          it_sort type slis_t_sortinfo_alv,
          wa_sort like line of it_sort,
          x_cat type slis_fieldcat_alv,
          v_tabix like sy-tabix.
          Selection screen Declaration
    *--BLOCK1
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_vbeln for vbak-vbeln,
                    s_auart for vbak-auart.
    selection-screen end of block b1.
    AT SELECTION-SCREEN                                                 *
    *- Validations
    at selection-screen.
      perform validate_screen.
                  START OF SELECTION                                    *
    start-of-selection.
    *- To get data from VBAK
      perform get_data.
    *to get data from VBAP
      perform get_data_vbap.
      perform prepare_alv.
                  END OF SELECTION                                    *
    end-of-selection.
      perform display_report.
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    form validate_screen .
      data: lv_vbeln like vbak-vbeln,
            lv_auart like vbak-auart.
      if not s_vbeln[] is initial.
        select vbeln
               into lv_vbeln
               from vbak
               where vbeln in s_vbeln.
        endselect.
        if sy-subrc <> 0.
          message e000 with 'INVALID SALES DOC'(002).
        endif.
      endif.
      if not s_auart[] is initial.
        select auart
               into lv_auart
               from vbak
               where auart in s_auart.
        endselect.
        if sy-subrc <> 0.
          message e000 with 'INVALID SALES DOC TYPE'(003).
        endif.
      endif.
    endform.                    " VALIDATE_SCREEN
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form get_data .
      select vbeln
             audat
             auart
             netwr
             from vbak
             into table it_vbak
             where vbeln in s_vbeln
             and auart in s_auart.
      if sy-subrc = 0.
        sort it_vbak by vbeln.
      endif.
    endform.                    " GET_DATA
    *&      Form  GET_DATA_VBAP
          text
    -->  p1        text
    <--  p2        text
    form get_data_vbap .
      select vbeln
             posnr
             matnr
             pstyv
             charg
             into table it_vbap
             from vbap
             for all entries in it_vbak
             where vbeln = it_vbak-vbeln.
      if sy-subrc = 0.
        sort it_vbap by vbeln posnr.
      endif.
    endform.                    " GET_DATA_VBAP
    *&      Form  prepare_alv
          text
    -->  p1        text
    <--  p2        text
    form prepare_alv .
    Prepare field catalog .
      perform prepare_catalog.
    Modify catalog
      perform change_attr_of_catalog.
    Modify Layout
      perform modify_layout.
    Sort Catalog
      perform sort_catalog.
    endform.                    " prepare_alv
    *&      Form  prepare_catalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_catalog .
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = sy-repid
          i_internal_tabname     = 'IT_VBAK'
          i_inclname             = sy-repid
        changing
          ct_fieldcat            = it_fldcat1[]
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      append lines of it_fldcat1 to it_fldcat.
      clear: it_fldcat1[].
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = sy-repid
          i_internal_tabname     = 'IT_VBAP'
          i_inclname             = sy-repid
        changing
          ct_fieldcat            = it_fldcat1[]
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      append lines of it_fldcat1 to it_fldcat.
    endform.                    " prepare_catalog
    *&      Form  change_attr_of_catalog
          text
    -->  p1        text
    <--  p2        text
    form change_attr_of_catalog .
      loop at it_fldcat into x_cat.
        v_tabix = sy-tabix.
        case x_cat-fieldname.
          when  'EXPAND'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-no_out = 'X'.
            endif.
         when  'VBELN'.
           if x_cat-tabname = 'IT_VBAK'.
             x_cat-no_out = 'X'.
           endif.
          when  'VBELN'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '1'.
              x_cat-seltext_m = 'SALES DOC'.
              x_cat-seltext_l = 'SALES DOC'.
              x_cat-seltext_s = 'SALES DOC'.
              x_cat-outputlen = '10'.
            endif.
          when  'AUDAT'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '2'.
              x_cat-seltext_m = 'DOC DATE'.
              x_cat-seltext_l = 'DOC DATE'.
              x_cat-seltext_s = 'DOC DATE'.
              x_cat-outputlen = '8'.
            endif.
          when  'AUART'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '3'.
              x_cat-seltext_m = 'ORDER REASON'.
              x_cat-seltext_l = 'ORDER REASON'.
              x_cat-seltext_s = 'ORDER REASON'.
              x_cat-outputlen = '5'.
            endif.
          when  'NETWR'.
            if x_cat-tabname = 'IT_VBAK'.
              x_cat-col_pos   = '4'.
              x_cat-seltext_m = 'NET PRICE'.
              x_cat-seltext_l = 'NET PRICE'.
              x_cat-seltext_s = 'NET PRICE'.
              x_cat-outputlen = '15'.
            endif.
        endcase.
        modify it_fldcat from x_cat.
        clear x_cat.
      endloop.
    endform.                    " change_attr_of_catalog
    *&      Form  modify_layout
          text
    -->  p1        text
    <--  p2        text
    form modify_layout .
      x_layout-default_item = 'X'.
      x_layout-zebra = 'X'.
      x_layout-expand_fieldname = 'EXPAND'.
    endform.                    " modify_layout
    *&      Form  sort_catalog
          text
    -->  p1        text
    <--  p2        text
    form sort_catalog .
      clear wa_sort.
      wa_sort-spos = '01'.
      wa_sort-fieldname = 'VBELN' .
      wa_sort-tabname   = 'IT_VBAP'.
      wa_sort-up        = 'X'.
      append wa_sort to it_sort.
      clear  wa_sort.
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'POSNR' .
      wa_sort-tabname   = 'IT_VBAP'.
      wa_sort-up        = 'X'.
      append wa_sort to it_sort.
    endform.                    " sort_catalog
    *&      Form  DISPLAY_REPORT
          text
    -->  p1        text
    <--  p2        text
    form display_report .
      it_variant-report = sy-repid.
      sort it_vbak by vbeln.
      sort it_vbap by vbeln posnr.
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        exporting
          i_callback_program      = sy-repid
          is_layout               = x_layout
          it_fieldcat             = it_fldcat[]
          it_sort                 = it_sort
          is_variant              = it_variant
          it_events               = it_events[]
          i_tabname_header        = 'IT_VBAK'
          i_tabname_item          = 'IT_VBAP'
          is_keyinfo              = x_keyinfo
        importing
          e_exit_caused_by_caller = v_call
          es_exit_caused_by_user  = x_user
        tables
          t_outtab_header         = it_vbak
          t_outtab_item           = it_vbap
        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.                    " DISPLAY_REPORT
    Regards,
    Laxmi
    Message was edited by: Laxmi

  • Condition Rates(KBETR) from Subtotals KZWI2/KZWI6

    Hello All
    Base : I am implementing Condition Value Formula Routines in VOFM in order to Price Material.
        In a Pricing Procedure, they are two step numbers defined that displays the Subtotals( one with field 2 and other with 6).
         In a dummy condition type, I want to copy the subTotals and Condition Rates.
         For this dummy condition Type, I have implemented the CalType rountine and able to get the Subtotal as follows :
         xkwert      = komp-kzwi6.  (for first dummy condition type)
         xkwert      = komp-kzwi2.  (for 2nd dummy condition type)
         But I do not know how to find the Condition Rates associated separately for these subtotals and save it into the dummy conditions types.(both Condition Rates and Subtotal).
       Please guide to achive this !
    Cheers
    RJ

    Found myself!

  • Alv not displaying top-of-page

    hi every buddy,
    i am workiong on report where there  is a requirment of dislpaying alv
    with top of page having some details . the event function mudule is calling the top-of-page fm properly
    but perform for top-of page is not called up
    i.e. controls are not goin to that point of perform
    please give me your valuable suggestions
    regards
    prashant

    Hi,
    please check this code it is working
    type-pools: slis.
    * Including icon for icon display
    include <icon>.
    * Including symbol
    include <symbol>.
    * Declaring structure for vbak
    types: begin of t_vbak,
            vbeln type vbeln_va,
            auart type auart,
            netwr type netwr,
            vkorg type vkorg,
            vtweg type vtweg,
            erdat type erdat,
            vbtyp type vbtyp,
            augru type augru,
            icon  type icon-id,
          end of t_vbak.
    * Declaring structure for vbap
    types: begin of t_vbap,
           vbeln type vbeln_va,
           posnr type posnr,
           matnr type matnr,
           arktx type arktx,
           lsmeng type dzmeng,
           auart type auart,
           netwr type netwr,
           vkorg type vkorg,
           vtweg type vtweg,
           erdat type erdat,
           vbtyp type vbtyp,
           augru type augru,
           icon  type icon-id,
         end of t_vbap.
    * Declaring variables
    data: v_vbeln type vbeln,
          my_tab type sy-tabix.
    * Declaring internal table and wa for vbak and vbap
    data: i_vbak type table of t_vbak,
          wa_vbak type t_vbak,
          i_vbap type table of t_vbap,
          i_pbo type table of t_vbap,
          wa_vbap type t_vbap.
    * Declaring internal table and wa for alv components(fieldcatalog,layout,events,header)
    data: i_fieldcat type slis_t_fieldcat_alv,
          wa_fieldcat type slis_fieldcat_alv,
          wa_layout   type slis_layout_alv,
          i_event    type slis_t_event,
          wa_event   type slis_alv_event,
          i_header   type slis_t_listheader,
          wa_header   type slis_listheader,
          wa_varient  type disvariant,
          wa_sort     type slis_sortinfo_alv,
          i_sort     type slis_t_sortinfo_alv.
    * Declaring selection-screen details
    selection-screen: begin of block b1 with frame title text-001.
    selection-screen skip.
    select-options: s_vbeln for v_vbeln.
    selection-screen: begin of block b2 with frame title text-008.
    parameter: ch1 type c as checkbox,       "check bos for Subtotal.
               ch2 type c as checkbox.       "check box for Grand total.
    selection-screen: end of block b2.
    selection-screen: end of block b1.
    * Start of start-of-selection
    start-of-selection.
    * Fetching data from vbak table
      select vbeln
             auart
             netwr
             vkorg
             vtweg
             erdat
             vbtyp
             augru
           from vbak into table i_vbak
                 where vbeln in s_vbeln.
      if sy-subrc = 0.
    * Fetching data for vbap table
        select vbeln
               posnr
               matnr
               arktx
               lsmeng
             from vbap into table i_vbap
             for all entries in i_vbak
             where vbeln = i_vbak-vbeln.
      endif.
    * Looping data for final output
      loop at i_vbak into wa_vbak.
    * checking conditiions for icon
        if wa_vbak-netwr < 10000.
          wa_vbak-icon = '@08@'.
        elseif wa_vbak-netwr < 15000.
          wa_vbak-icon = '@09@'.
        else.
          wa_vbak-icon = '@0A@'.
        endif.
        modify i_vbak from wa_vbak index sy-tabix  .
      endloop.
    *Looping data for final output
      loop at i_vbap into wa_vbap.
        my_tab = sy-tabix.
        read table i_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.
        if sy-subrc = 0.
          wa_vbap-auart = wa_vbak-auart.
          wa_vbap-netwr = wa_vbak-netwr.
          wa_vbap-vkorg = wa_vbak-vkorg.
          wa_vbap-vtweg = wa_vbak-vtweg.
          wa_vbap-erdat = wa_vbak-erdat.
          wa_vbap-vbtyp = wa_vbak-vbtyp.
          wa_vbap-augru = wa_vbak-augru.
          wa_vbap-icon  = wa_vbak-icon.
          modify i_vbap from wa_vbap index  my_tab transporting
                                 auart netwr vkorg vtweg erdat vbtyp augru icon.
        endif.
      endloop.
    * Preparing fieldcatalog for final output
      perform main_fieldcat.
    *Preparing final layout for final output
      perform layout.
    *Preparing list header for final output
      perform list_header.
    *Preaparing events for alv display
      perform event.
    *Getting subtotals for amount fields
      if ch1 eq 'X'.
        perform sub_total.
      endif.
    *Showing final output data
      perform alv_display.
    form main_fieldcat .
    *Fieldcatalog for icon
      wa_fieldcat-fieldname = 'ICON'.
    * WA_FIELDCAT-TECH     = 'X'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-icon      = 'X'.
      wa_fieldcat-seltext_l = 'ICON'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    * Fieldcatalog for salesorder
      wa_fieldcat-fieldname = 'VBELN'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C410'.
      wa_fieldcat-seltext_l = 'Sales order NO'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for salesordertype
      wa_fieldcat-fieldname = 'AUART'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C610'.
      wa_fieldcat-seltext_l = 'Sales order type'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for netamount
      wa_fieldcat-fieldname = 'NETWR'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-edit   = 'X'.
      wa_fieldcat-emphasize = 'C501'.
    *  wa_fieldcat-input = 'X'.
      wa_fieldcat-seltext_l = 'Net Amount'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for salesorg
      wa_fieldcat-fieldname = 'VKORG'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C310'.
      wa_fieldcat-seltext_l = 'Sales Organization'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for salesdistribution
      wa_fieldcat-fieldname = 'VTWEG'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C210'.
      wa_fieldcat-seltext_l = 'Sales Distribution'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for date
      wa_fieldcat-fieldname = 'ERDAT'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C110'.
      wa_fieldcat-seltext_l = 'Sales OrderDate'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for salestype
      wa_fieldcat-fieldname = 'VBTYP'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C410'.
      wa_fieldcat-seltext_l = 'Sales type'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for orderreason
      wa_fieldcat-fieldname = 'AUGRU'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C710'.
      wa_fieldcat-seltext_l = 'Order reason '.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for itemnum
      wa_fieldcat-fieldname = 'POSNR'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C110'.
      wa_fieldcat-seltext_l = 'Item No '.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for materialnum
      wa_fieldcat-fieldname = 'MATNR'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C710'.
      wa_fieldcat-seltext_l = 'Material No '.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
      wa_fieldcat-fieldname = 'ARKTX'.
      wa_fieldcat-tabname   = 'IT_VBAP'.
      wa_fieldcat-emphasize = 'C310'.
      wa_fieldcat-seltext_l = 'Description'.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    *Fieldcatalog for quantity
      if ( ch1 = 'X' and ch2 = 'X' ) or ( ch1 = 'X' and ch2 = ' ' ) or ( ch2 = 'X' and ch1 = ' ' ).
        wa_fieldcat-fieldname = 'LSMENG'.
        wa_fieldcat-tabname   = 'IT_VBAP'.
        wa_fieldcat-emphasize = 'C510'.
        wa_fieldcat-seltext_l = 'Quantity '.
    *    WA_FIELDCAT-edit   = 'X'.
        wa_fieldcat-do_sum     = 'X'.
      else.
        wa_fieldcat-fieldname = 'LSMENG'.
        wa_fieldcat-tabname   = 'IT_VBAP'.
        wa_fieldcat-emphasize = 'C510'.
        wa_fieldcat-seltext_l = 'Quantity '.
    *    WA_FIELDCAT-edit   = 'X'.
      endif.
      append wa_fieldcat to i_fieldcat.
      clear wa_fieldcat.
    endform.                    " MAIN_FIELDCAT
    form alv_display .
      wa_varient-report = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = sy-repid
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort                  = i_sort
          i_callback_pf_status_set = 'PF_STATUS'
          i_save                   = 'X'
          is_variant               = wa_varient
          it_events                = i_event
        tables
          t_outtab                 = i_vbap
        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.                    " ALV_DISPLAY
    form layout .
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-subtotals_text    = 'SUBTOTAL SUM'.
      wa_layout-totals_text       = 'TOTAL'.
      wa_layout-zebra             = 'X'.
    endform.                    " LAYOUT
    form event .
      call function 'REUSE_ALV_EVENTS_GET'
        importing
          et_events       = i_event
        exceptions
          list_type_wrong = 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.
      read table i_event into wa_event with key name = 'USER_COMMAND'.
      if sy-subrc = 0.
        wa_event-form = 'USER_COMMAND'.
        modify i_event from wa_event transporting form where name = 'USER_COMMAND'.
      endif.
      read table i_event into wa_event with key name = 'TOP_OF_PAGE'.
      if sy-subrc = 0.
        wa_event-form = 'TOP_OF_PAGE'.
        modify i_event from wa_event transporting form where name = 'TOP_OF_PAGE' .
      endif.
    endform.                    " EVENT
    form user_command using ucomm type sy-ucomm
                            selfield type slis_selfield.
      data: gstring type c.
      constants: l_c_repid type sy-repid value 'ZCOE_ALV_SIMPLE'.
      data: l_i_seltab type table of rsparams.
      case ucomm.
        when '&IC1'.
          if selfield-fieldname = 'VBELN'.
            set parameter id 'AUN' field selfield-value.
            call transaction 'VA02' and skip first screen.
          endif.
    *  *  CASE ok_code.
        when 'SAVE'.
    *  *A pop up is called to confirm the saving of changed data
          call function 'POPUP_TO_CONFIRM'
            exporting
              titlebar       = 'SAVING DATA'
              text_question  = 'Continue?'
              icon_button_1  = 'icon_booking_ok'
            importing
              answer         = gstring
            exceptions
              text_not_found = 1
              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.
    *      *When the User clicks 'YES'
          if ( gstring = '1' ).
            message 'Saved' type 'S'.
    *Now the changed data is stored in the it_pbo internal table
            i_pbo = i_vbap.
          else.
    *When user clicks NO or Cancel
            message 'Not Saved'  type 'S'.
          endif.
    **When the user clicks the 'EXIT; he is out
        when 'EXIT'.
          leave program.
    * Clicking on refresh button at toolbar
        when 'REF'.
    * Calling fm to get refresh data
          call function 'RS_REFRESH_FROM_SELECTOPTIONS'
            exporting
              curr_report     = l_c_repid
            tables
              selection_table = l_i_seltab
            exceptions
              not_found       = 1
              no_report       = 2
              others          = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          else.
    *  * Calling the screen after refreshing
            submit zcoe_alv_simple with selection-table l_i_seltab.
          endif.
      endcase.
    endform.                    " USER_COMMAND
    form top_of_page .
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_header.
    endform.                    " TOP_OF_PAGE
    form list_header .
    * Local data declaration
      data: l_date      type char10,    "Date
            l_time(8)   type c.         "Time
      wa_header-typ = 'H'.
      wa_header-info = 'Sales Order Information Report'.
      append wa_header to i_header.
    * Run date Display
      clear l_date.
      wa_header-typ  = 'S'.
      write: sy-datum  to l_date dd/mm/yyyy.
      wa_header-key = 'Run Date :'(002).
      wa_header-info = l_date.
      append wa_header to i_header.
      clear: wa_header.
      wa_header-typ  = 'S'.
    *  WRITE: sy-uzeit  TO l_time .
      l_time+0(2) = sy-uzeit+0(2).
      l_time+2(1) = ':'.
      l_time+3(2) = sy-uzeit+2(2).
      l_time+5(1) = ':'.
      l_time+6(2) = sy-uzeit+4(2).
      wa_header-key = 'Run Time :'(009).
      wa_header-info = l_time.
      append wa_header to i_header.
      clear: wa_header.
    endform.                    " LIST_HEADER
    form pf_status using rt_extab type slis_t_extab.
      set pf-status 'SSS'.
      set titlebar 'MAIN100'.
    endform.                    "pf_status
    form sub_total .
      wa_sort-fieldname = 'VBELN'.
      wa_sort-tabname   = 'I_VBAP'.
      wa_sort-spos      = 1.
      wa_sort-up        = 'X'.
      wa_sort-subtot    = 'X'.
    *  wa_sort-group = 'X'.
    *  WA_SORT-EXPA       = 'X'.
      append wa_sort to i_sort.
    endform.                    " SUB_TOTAL

  • SkillBuilders Modal 2.0 plugin with a page-item button - pass parameters

    Hi all.
    I have an employee table, which is connected with a 1:N relationship to two tables: Emp_Tech_Fields and Emp_Kids.
    I've created a form to update / insert employee data, and I want to add two modal pages: one for kids and one for tech_fields. I think this will be the most usable way for this form.
    I've created two page-item buttons on that form, which open the respective modal pages successfully, but I can't dynamically pass them the EMP_ID in order to filter the data in them.
    Iv'e uploaded an example to http://apex.oracle.com/pls/apex/f?p=64921:1:6401028834215::::: guest / gu12est3
    Document Types is a report with a link-column which opens a modal page with data filtering, as it should.
    Employees (click an edit link) has two buttons: Kids, which open the modal form, but does not filter, and Tech Fields, which is filtered hard-coded with EMP_ID = 1 (see in the dynamic action definition).
    As far as I understand, this should be something quite easy and day-to-day, so I don't know why I did not find a way to do this. What am I missing?
    Any help will be greatly appreciated,
    Dovi.

    Hi Dovi,
    I had a look at your application and can see the link your using for the kids and tech fields modal isn't passing the session ID which is why it is asking you to log in again.
    Below is an example URL for your issue, it isn't tested though.
    f?p=&APP_ID.:20:&APP_SESSION.:::19:P20_EMP_ID:&P19_EMP_ID.:: You will need to change the page numbers of the pages and items to match the page numbers of yours. This is using the statically defined url inside the plugin itself, I have also only done this in an earlier version of plugin but believe the functionality is very similar.
    Hope this helps.
    Paul

Maybe you are looking for

  • Slow internet connection via AirPort on MacBook running 10.5.7

    The internet connection via AirPort on my MacBook is frustratingly slow, and I have no idea why. I have an AirPort Extreme connected to a Virgin Media cable modem, a new iMac and a two year-old MacBook, both running 10.5.7. No problems at all with th

  • Will a library vault created in 3.5.1, open in 3.6.

    I'm considering backing up my Aperture Library to a vault on 3.5.1, before upgrading to 3.6, in the event of a worst case scenario.  Will a vault created in the earlier version, be able to open in 3.6.  I also have two libraries on on 3.5.1, so I'm g

  • Process to CLOSE-OUT Purchase orders.

    Hi,    Would anyone be able to share the process they follow to close-out Purchase orders which are open ? Thanks, RB

  • Limit vi hierarchy view

    I have a vi with 3 subpanels accessed via VI Server. I would like to see the VI Hierarchy for the top level VI only and not include the subpanels. Can this be done?

  • How can i recover my music

    how can i recover my music that was deleted off my i pod when i sycned it on i tunes