Question about subtotal in alv output

I am using REUSE_ALV_GRID_DISPLAY for my ALV output.
In that i am sub-totaling for quantity base on material group(MATKL). But also I want to display material group descriptions(WGBEZ) at the same subtotal-line. How can do that?

Sort on the field WGBEZ...
Check the sample program.
TYPE-POOLS: SLIS.
DATA: G_REPID LIKE SY-REPID,
GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: BEGIN OF ITAB,
  FIELD1(5) TYPE C,
  FIELD2(5) TYPE C,
  FIELD3(5) TYPE P DECIMALS 2,
    FIELD4(5),
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0.
  INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
  INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB_FIELDCAT.
INITIALIZATION.
G_REPID = SY-REPID.
START-OF-SELECTION.
MOVE 'TEST1' TO ITAB1-FIELD1.
MOVE 'TEST1' TO ITAB1-FIELD2.
MOVE '10.00' TO ITAB1-FIELD3.
MOVE '1esr0' TO ITAB1-FIELD4.
APPEND ITAB1.
MOVE 'TEST2' TO ITAB1-FIELD1.
MOVE 'TEST2' TO ITAB1-FIELD2.
MOVE '20.00' TO ITAB1-FIELD3.
MOVE 'sdtg0' TO ITAB1-FIELD4.
APPEND ITAB1.
DO 5 TIMES.
  APPEND ITAB1.
ENDDO.
END-OF-SELECTION.
PERFORM BUILD.
PERFORM CALL_ALV.
FORM BUILD.
* DATA FIELD CATALOG
* Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD1'.
FIELDCAT_LN-TABNAME   = 'ITAB1'.
FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD2'.
FIELDCAT_LN-TABNAME   = 'ITAB1'.
*FIELDCAT_LN-NO_OUT    = ' '.
FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
FIELDCAT_LN-TABNAME       = 'ITAB1'.
*FIELDCAT_LN-NO_OUT        = ' '.
FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME     = 'FIELD4'.
FIELDCAT_LN-TABNAME       = 'ITAB1'.
*FIELDCAT_LN-NO_OUT        = ' '.
FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
GS_LAYOUT-TOTALS_TEXT = ' My Total'.
GS_LAYOUT-subtotals_text = 'subtot'.
* DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
<b>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.</b>
ENDFORM.
FORM CALL_ALV.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT =  GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
  IT_SORT = GT_SORT[]
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.

Similar Messages

  • Show policy-map interface | Question about QOS show command output

    I hope this is the correct place for this question. If not, please let me know.
    When I issue the show policy-map interface command (in this case on a  3845) there is some output I don't understand.  I have included some output below and formatted the lines I am confused about as "computer code" which show up as red on my screen.  A list of the individual lines i'm confused about is below, followed by those liens in the context of the show policy-map command's output.
    Any help with this will be greatly appreciated. Thanks in advance.
    5 minute offered rate 46000 bps, drop rate 0 bps
     5 minute rate 10000 bps
     bandwidth remaining 50% (768 kbps)
    show policy-map interface
    --- previous output omitted ---
    GigabitEthernet0/0
      Service-policy input: QoS_IN
    class-map: Silver (match-any)
          164691299 packets, 23570752398 bytes
          5 minute offered rate 46000 bps, drop rate 0 bps
          Match: access-group name MAINFRAME
            4371992 packets, 2311242335 bytes
            5 minute rate 0 bps
          Match: access-group name KRONOS
            13334297 packets, 3051409140 bytes
            5 minute rate 5000 bps
          Match: access-group name EMAIL
            97652823 packets, 10323856470 bytes
            5 minute rate 10000 bps
          Match: access-group name VOIP-CONTROL
            20782858 packets, 1481676784 bytes
            5 minute rate 0 bps
          Match: access-group name LOGIXWEB
            0 packets, 0 bytes
            5 minute rate 0 bps
          Match: access-group name GRINDLOG
            0 packets, 0 bytes
            5 minute rate 0 bps
          Match: access-group name CITRIX
            46895 packets, 14669179 bytes
            5 minute rate 0 bps
          Match: access-group name CORP_WEB
            28502414 packets, 6387897396 bytes
            5 minute rate 4000 bps
          QoS Set
            dscp af31
              Packets marked 164691269
    show policy-map interface s0/0/0:0
    Serial0/0/0:0
      Service-policy output: QoS_OUT
    --- previous output omitted ---
        Class-map: Silver (match-any)
          86590227 packets, 12051546524 bytes
          5 minute offered rate 3000 bps, drop rate 0 bps
          Match: access-group name MAINFRAME
            7641084 packets, 2701232492 bytes
            5 minute rate 0 bps
          Match: access-group name KRONOS
            6975052 packets, 1555404656 bytes
            5 minute rate 0 bps
          Match: access-group name EMAIL
            58438150 packets, 5433636586 bytes
            5 minute rate 3000 bps
          Match: access-group name VOIP-CONTROL
            355083 packets, 41252455 bytes
            5 minute rate 0 bps
          Match: access-group name LOGIXWEB
            0 packets, 0 bytes
            5 minute rate 0 bps
          Match: access-group name GRINDLOG
            0 packets, 0 bytes
            5 minute rate 0 bps
          Match: access-group name CITRIX
            19 packets, 4967 bytes
            5 minute rate 0 bps
          Match: access-group name CORP_WEB
            13180836 packets, 2320015236 bytes
            5 minute rate 0 bps
          Queueing
          queue limit 64 packets
          (queue depth/total drops/no-buffer drops) 0/18156/0
          (pkts output/bytes output) 86421413/12004278837
          bandwidth remaining 50% (768 kbps)

    this is my configuration
    DGMGRL> show configuration
    Configuration
    Name: matrix
    Enabled: YES
    Protection Mode: MaxPerformance
    Databases:
    stdby1 - Primary database
    stdby2 - Physical standby database
    stdby3 - Physical standby database
    Fast-Start Failover: DISABLED
    Current status for "matrix":
    SUCCESS
    --- this is my first successful switchover -----
    DGMGRL> switchover to stdby2
    Performing switchover NOW, please wait...
    New primary database "stdby2" is opening...
    Operation requires shutdown of instance "stdby1" on database "stdby1"
    Shutting down instance "stdby1"...
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    Operation requires startup of instance "stdby1" on database "stdby1"
    Starting instance "stdby1"...
    ORACLE instance started.
    Database mounted.
    Switchover succeeded, new primary is "stdby2"
    -------------------this is my second switchover -------------
    DGMGRL> switchover to stdby1
    Performing switchover NOW, please wait...
    New primary database "stdby1" is opening...
    Operation requires shutdown of instance "stdby2" on database "stdby2"
    Shutting down instance "stdby2"...
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    Operation requires startup of instance "stdby2" on database "stdby2"
    Starting instance "stdby2"...
    Unable to connect to database
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    Failed.
    You are no longer connected to ORACLE
    Please connect again.
    Unable to start instance "stdby2"
    You must start instance "stdby2" manually
    Switchover succeeded, new primary is "stdby1"
    DGMGRL>
    Edited by: user6981287 on Jan 7, 2010 12:57 AM
    Edited by: user6981287 on Jan 7, 2010 1:00 AM

  • Question about AE CS3 swf output

    I'm curious about something... I know that obviously using bitmap elements within a scene will not convert to vectors (so, for each bitmap you use in a scene, you lose out on the file size efficiency that vectors give you).
    However, I'm confused and curious about what/how AE creates swf files from your scene.
    Text, made in AE, will obviously convert fine (stay vectors)...
    Beyond that, I'm not sure what things convert fine to the swf vectors, and what becomes bitmapped (or, for whatever reason, become detrimental to the efficiency of the swf file.
    1) Could someone outline what does and doesn't maintain it's efficient vector format when converted to an swf in AE CS3?
    2) What about illustrator files brought into AE? Are they treated the same as vectors created in Flash (keeping their vector form even when animated and the scene is exported as an swf)?
    3) If I use a bitmapped background, but all foreground elements are vectors, does the swf just store the bg once (adds to the file size), but then has no other detrimental effect to the file size?
    Any other words of wisdom on the subject would also be appreciated!
    Thanks...

    >1) Could someone outline what does and doesn't maintain it's efficient >vector format when converted to an swf in AE CS3?
    Masks on solids; text layers; Radio Waves, Path Text, Audio Waveform, and Audio Spectrum effects; Illustrator files
    >2) What about illustrator files brought into AE? Are they treated the
    >same as vectors created in Flash (keeping their vector form even when
    >animated and the scene is exported as an swf)?
    Under the right conditions - yes.
    >3) If I use a bitmapped background, but all foreground elements are
    >vectors, does the swf just store the bg once (adds to the file
    >size), but then has no other detrimental effect to the file size?
    If the bg is a static image, it should.
    For more info check here:
    http://help.adobe.com/en_US/AfterEffects/9.0/WS3878526689cb91655866c1103a4f2dff7-79caa.htm l
    Mylenium

  • Question about .swf and HTML5 output and passing variables via querystring

    Hello,
    I am using Captivate 7. We're developing a program that we would like to output both for desktop users and mobile users.If I'm correct, multiscreen.html will determine whether or not to load index.html (which is for mobile users) or yourprogram.htm (for desktop users).
    Currently, we pull and push data from the database using .NET via a querystring and Javascript into yourprogram.htm. In the program, there's a Response.Redirect which sends that data (what screen you've finished reviewing as well as quiz data). So it basically reloads yourprogram.htm after each "save" point. We're wondering how to best approach it if multiscreen.html is first loaded, we imagine the variables may not get passed back and forth correctly into the index.html(HTML5 output)? Has anyone had experience with developing a program this way?
    Looking forward to your insights, recommendations and anything to look out for.
    Thanks,
    Ruth

    Basically, the code is meant to be an example of using a wrapper to modify output before it gets written to the file. So, println is called and the wrapper just alters any text that comes to it before it gets printed to the file. Think of writing to a message to an error log and appending the Date and time to the front.
    The code works fine if you only work on the string that is passed in by itself such as:
    s = s.replace('1', '2');When I try to add text onto the string s I run into problems. I need to send the length of the string to the write function but then length ends up being 8202 on the new string. I don't understand why. I am wondering if this has to do with converting chars to string or the way strings are passed to methods.
    This method is called first and then calls the write method with the string as a param.
    public void write(char[] cbuf, int off, int len) throws IOException {
                    String s= new String(cbuf);
                    this.write(s, off, len);
            }but for some reason when I try to create a new string from the string passed in or try to append text to it, the length of the string gets message up.
    Does that help?
    Sorry, I am just trying to understand what is going on here.
    Thanks.

  • Questions about reading/writing with output and input streams

    I'm getting a bit confused on this subject. I have written an array of doubles to a file, and now I need to know how to read them back in to another array. I have also wrapped each double into its own object, but I need to know how to write those to a file, and read the doubles contained in them back into an array.
    Here is what I have so far; the method that writes the array of doubles to a file.
    public void writePrimDoubles() {
              DataOutputStream outStream;
              System.out.println("Now writing the values to file...");
              try     {               
                   outStream = new DataOutputStream(new FileOutputStream("file.dat"));
              catch (IOException ex) {
                   System.out.println("Error opening file");
              return;
              try {
                   for(int i = 0; i<arraySize; i++)
                        outStream.writeBytes(numberArray[i] + "\n");
                   outStream.close();
              catch(IOException e) {
                   System.out.println("Error writing to file");
         }

    * writes all doubles in the given array to the file 'file.dat'
    public void writePrimDoubles(double[] array) throws IOException {
       DataOutputStream out = new DataOutputStream(new FileOutputStream("file.dat"));
       for(int i=0; i<array.length; i++) {
          out.writeDouble(array);
    out.close();
    * reads in all stored doubles from the given file ('file.dat').
    * cause of each double has been written to a 8byte part of the file
    * you could get the number of doubles stored in the file by dividing
    * its filesize by 8.
    * Alternatively you might first store all read doubles as Double in
    * a list (e.g. java.util.ArrayList). After reading all doubles you could then
    * create a new double[] with the lists size (double[] array = new double[list.size()];)
    * -> this alternative is commented out in the following code.
    public double[] readPrimDoubles() throws IOException {
    File file = new File("file.dat");
    DataInputStream in = new DataInputStream(new FileInputStream(file));
    double[] array = new double[file.length()/8];
    for(int i=0; i<array.length; i++) {
    array[i] = in.readDouble();
    in.close();
    return array;
    ArrayList list = new ArrayList();
    try {
    while(true) {
    list.add(new Double(in.readDouble()));
    catch(EOFException e) {} // catchs the exception thrown when end of file is reached
    in.close();
    double[] array = new double[list.size()];
    for(int i=0; i<list.size(); i++) {
    array[i] = ((Double)list.get(i)).doubleValue();
    return array;
    For further information on the classes you have to use you might have a look to the concerning API documentation (http://java.sun.com/j2se/1.4.2/docs/api/). In this docs you could find all methods, constructors and fields accessable for a class.
    have fun...

  • A question about ALV subtotal

    Hello Expert,
    I have a question about ALV subtotal
    In my ALV output, there are three columns: SalesOrder, Item, Sales Volumn. Suppose there are following data in the ALV output
    SalesOrder   Item   Volumn
    123              10      100.00
    123              20      300.00
    456              10      200.00
    456              20      500.00
    What I want in the ALV outpu is as below:
    SalesOrder   Item   Volumn
    123              10      100.00
    123              20      300.00
                     subtotal  400.00
    456              10      200.00
    456              20      500.00
                     Subtotal 700.00
    Total                       1100.00
    Is this possible, and how can I achieve that result?
    Thanks & Regards, Johnny

    You can use sortinfo structure of ALV.
      Data:GT_SORT TYPE slis_t_sortinfo_alv.
      GTT_SORT-FIELDNAME = 'VBELN'.
      GTT_SORT-UP = 'X'.
      GTT_SORT-SUBTOT = 'X'.
      APPEND GTT_SORT TO GT_SORT.

  • Subtotal in alv grid output.

    hi experts,
                   i want to display subtotal in the alv output using control break statement, without using alv functionality and layout.
    my code is given below, how can i add subtotal field and display them in alv ,
    *& Report  Y_VARUNSHARMA
    REPORT  Y_VARUNSHARMA.
    TABLES: VBAK.
    TYPE-POOLS: SLIS.
    TYPES: BEGIN OF T_ITAB,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           ERNAM LIKE VBAK-ERNAM,
           ANGDT LIKE VBAK-ANGDT,
           BNDDT LIKE VBAK-BNDDT,
           AUART LIKE VBAK-AUART,
           POSNR LIKE VBAP-POSNR,
           MATNR LIKE VBAP-MATNR,
           CHARG LIKE VBAP-CHARG,
           MAKTX LIKE MAKT-MAKTX,
           NETPR LIKE VBAP-NETPR,
           VGBEL LIKE VBAK-VGBEL,
           MEINS LIKE VBAP-MEINS,
           SMENG LIKE VBAP-SMENG,
            END OF T_ITAB.
    DATA: G_REPID LIKE SY-REPID.
    DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: I_ITAB TYPE T_ITAB OCCURS 0,
          WA_ITAB TYPE T_ITAB.
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV ,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: I_LISTHEADER TYPE SLIS_T_LISTHEADER,
          WA_LISTHEADER TYPE SLIS_LISTHEADER.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: DOCNO FOR VBAK-VBELN.
    PARAMETER DOCTYPE LIKE VBAK-AUART.
    SELECT-OPTIONS: DATE FOR SY-DATUM.
    SELECTION-SCREEN SKIP 2.
    PARAMETER P_CHECK AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM BUILD_CATALOGE.
    PERFORM LIST_HEADER.
    PERFORM SET_LAYOUT.
    AT SELECTION-SCREEN.
    IF DOCNO-LOW = '' .
    MESSAGE E000(ZVARUN) .
    elseif DOCNO-HIGH = '' .
    MESSAGE E001(ZVARUN) .
    ENDIF.
    START-OF-SELECTION.
    PERFORM GET_DATA.
    *PERFORM DISPLAY.
    END-OF-SELECTION.
    IF P_CHECK = 'X'.
    PERFORM DOWNLOAD_EXCEL.
    ELSE.
    PERFORM DISPLAY.
    ENDIF.
    FORM DOWNLOAD_EXCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'C:\FILE.XLS'
      FILETYPE                        = 'XLS'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = I_ITAB
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    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.
    FORM BUILD_CATALOGE.
    WA_FIELDCAT-FIELDNAME = 'VBELN'.
    WA_FIELDCAT-SELTEXT_M = 'SALES DOC'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ERDAT'.
    WA_FIELDCAT-SELTEXT_M = 'DATE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ERNAM'.
    WA_FIELDCAT-SELTEXT_M = 'NAME'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ANGDT'.
    WA_FIELDCAT-SELTEXT_M = 'VALID FR'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BNDDT'.
    WA_FIELDCAT-SELTEXT_M = 'VALID TO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'AUART'.
    WA_FIELDCAT-SELTEXT_M = 'DOC TYPE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'POSNR'.
    WA_FIELDCAT-SELTEXT_M = 'DOC ITEM'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MATNR'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'CHARG'.
    WA_FIELDCAT-SELTEXT_M = 'BATCH NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MAKTX'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL DESC'.
    WA_FIELDCAT-EDIT = 'X'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'NETPR'.
    WA_FIELDCAT-SELTEXT_M = 'UNIT PRICE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'VGBEL'.
    WA_FIELDCAT-SELTEXT_M = 'RFR DOC NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MEINS'.
    WA_FIELDCAT-SELTEXT_M = 'UNIT'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'SMENG'.
    WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM.
    FORM LIST_HEADER.
    WA_LISTHEADER-TYP = 'H'.
    WA_LISTHEADER-INFO = 'RJT COMPUSOLUTIONS'.
    APPEND WA_LISTHEADER TO I_LISTHEADER.
    CLEAR WA_LISTHEADER.
    ENDFORM.
    FORM SET_LAYOUT.
    WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    ENDFORM.
    FORM DISPLAY.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = G_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = WA_LAYOUT
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = I_ITAB
    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.
    FORM TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = I_LISTHEADER
       I_LOGO                   = 'RJT'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM GET_DATA.
    SELECT AVBELN AERDAT AERNAM AANGDT ABNDDT AAUART AVGBEL BPOSNR BMATNR BCHARG BMEINS BSMENG BNETPR CMAKTX  INTO CORRESPONDING FIELDS OF TABLE I_ITAB FROM  ( ( VBAK AS A INNER JOIN VBAP AS B
    ON AVBELN = BVBELN ) INNER JOIN MAKT AS C  ON BMATNR = CMATNR )  WHERE AVBELN IN DOCNO AND AAUART = DOCTYPE .
    ENDFORM.
    FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
    CASE L_UCOMM.
    WHEN '&IC1'.
    IF L_SELFIELD-FIELDNAME  = 'VBELN'.
    CALL TRANSACTION 'VA02'.
    ELSEIF
    L_SELFIELD-FIELDNAME = 'MATNR'.
    CALL TRANSACTION 'MM02'.
    ENDIF.
    ENDCASE.
    ENDFORM.

    Hi,
    That I guess is difficult. Only way is to append a new line with your subtotal to the output table with the subtotal filled in appro. field.
    Santhosh

  • Subtotal problem in Export Excel from ALV Output

    Subtotal displays correct in alv output, but if i do the export excel , that subtotal value is changed in excel sheet.
    is it possible to solve this problem.

      DATA: lo_grid TYPE REF TO cl_gui_alv_grid.
    ** get the global reference 
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING    
        e_grid = lo_grid.
    ** get the subtotal
    DATA: it_01 TYPE REF TO data.
    *  CALL METHOD lo_grid->get_subtotals 
      IMPORTING    
      ep_collect01 = it_01.
    ** change the data 
    FIELD-SYMBOLS: <ft_tab> TYPE ANY TABLE, 
                   <fs_tab> TYPE ANY,   
                 <ff_field> TYPE ANY.
    ASSIGN it_01->* TO <ft_tab>.
    LOOP AT <ft_tab> ASSIGNING <fs_tab>. 
      ASSIGN COMPONENT 'PER' OF STRUCTURE <fs_tab> TO <ff_field>. 
      <ff_field> = '100'.
    ENDLOOP.
    ** Refresh the table display 
    CALL METHOD lo_grid->refresh_table_display  
    EXPORTING         
    i_soft_refresh = 'X'.

  • CBWFQ: Question about the output of "show policy-map interface" command

    Hi everyone,
    I have a question about the output of "show policy-map interface" command.
    The following is the output of this command and lower side of the output shows
    (total queued/total drops/no-buffer drops) 0/342/0
    If the packets drop occur due to the situation of no enough buffer,
    "no-buffer drops" counted up. But "no-buffer drops" has not been counted up.
    The "no-buffer drops" is 0 (zero) but "total drops" are counted as 342.
    I guess there are other factors except "no-buffer drops" to add "total drops".
    But I can not find any information about "other factors".
    So I would like to know the "other factors" added to "total drops".
    reserch-3725#sh policy-map interface fastethernet0/1
    FastEthernet0/1
    Service-policy output: shaping
    Class-map: kdpc (match-all)
    146956873 packets, 115209221595 bytes
    5 minute offered rate 156000 bps, drop rate 0 bps
    Match: access-group name YOKOHAMA_to_CHINO
    Traffic Shaping
    Target/Average Byte Sustain Excess Interval Increment
    Rate Limit bits/int bits/int (ms) (bytes)
    9360000/9360000 58500 234000 234000 25 29250
    Adapt Queue Packets Bytes Packets Bytes Shaping
    Active Depth Delayed Delayed Active
    - 0 146956724 3539850811 2960247 3851843541 no
    Class-map: class-default (match-any)
    552458414 packets, 249687580329 bytes
    5 minute offered rate 242000 bps, drop rate 0 bps
    Match: any
    Traffic Shaping
    Target/Average Byte Sustain Excess Interval Increment
    Rate Limit bits/int bits/int (ms) (bytes)
    3072000/3072000 19200 76800 76800 25 9600
    Adapt Queue Packets Bytes Packets Bytes Shaping
    Active Depth Delayed Delayed Active
    - 0 552453209 573909865 30358216 2926188156 no
    Service-policy : policy1
    Class-map: dlsw (match-all)
    979578 packets, 264843255 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: access-group name acl-dlsw
    Queueing
    Output Queue: Conversation 137
    Bandwidth 128 (kbps) Max Threshold 64 (packets)
    (pkts matched/bytes matched) 20922/17371500
    (depth/total drops/no-buffer drops) 0/0/0
    Class-map: telnet (match-all)
    29938 packets, 1806058 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: access-group name acl-telnet
    Queueing
    Output Queue: Conversation 138
    Bandwidth 64 (kbps) Max Threshold 64 (packets)
    (pkts matched/bytes matched) 639/38900
    (depth/total drops/no-buffer drops) 0/0/0
    Class-map: class-default (match-any)
    551448911 packets, 249420939729 bytes
    5 minute offered rate 242000 bps, drop rate 0 bps
    Match: any
    Queueing
    Flow Based Fair Queueing
    Maximum Number of Hashed Queues 128
    (total queued/total drops/no-buffer drops) 0/342/0
    Your information would be appreciated.

    Details infomatiuon regarding show policy-map interface
    http://www.cisco.com/en/US/tech/tk543/tk545/technologies_tech_note09186a008010dd6a.shtml
    http://www.cisco.com/en/US/tech/tk543/tk760/technologies_tech_note09186a0080108e2d.shtml
    http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/qos_r/qos_s2g.htm#wp1146884

  • A question about editing ALV fields

    Hello Expert,
    In my project, we need to read data from DB and display in the ALV. In the ALV output, we should be able to edit the records, and after user clicks the "Save" button in the applicaiton toolbar, the program should be able to save the changed data into DB.
    Currently, I can display the data in ALV and all fields are editable. After I change some data and click "Save", the program will go into subroutine 'F_ALV_USER_COMMAND',  but the data in the internal table GT_OUTTAB is not changed.
    I generate the ALV output by the following calling:
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program = wf_pgm
            is_layout          = gs_layout
            it_fieldcat        = gt_fieldcat[]
            i_callback_pf_status_set     = 'F_PF_STATUS_SET'
            i_callback_user_command = 'F_ALV_USER_COMMAND'
            is_variant         = g_variant
          tables
            t_outtab           = gt_outtab
          exceptions
            program_error      = 1
            others             = 2.
    In the subroutine 'F_PF_STATUS_SET', I call a GUI Status defined by myself.
    But if I call as below
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program = wf_pgm
            is_layout          = gs_layout
            it_fieldcat        = gt_fieldcat[]
           i_callback_pf_status_set     = 'F_PF_STATUS_SET'
            i_callback_user_command = 'F_ALV_USER_COMMAND'
            is_variant         = g_variant
          tables
            t_outtab           = gt_outtab
          exceptions
            program_error      = 1
            others             = 2.
    GT_OUTTAB is changed accordingly after clicking the "Save".
    Can any expert tell me why Internal table is not changed in the case I use user-defined GUI Status?
    Thanks & Regards, Johnny
    Edited by: Yongbo Wu on Jun 10, 2011 10:51 AM

    Hi Yongbo;
    Unfortunately REUSE_ALV_GRID_DISPLAY has update problem.
    REUSE_ALV_LIST_DISPLAY FM is making automatic update/change itab.
    You can change REUSE_ALV_GRID_DISPLAY FM with REUSE_ALV_LIST_DISPLAY FM.
    Best Regards.
    call function 'REUSE_ALV_LIST_DISPLAY' "'REUSE_ALV_GRID_DISPLAY'

  • Subtotal in ALV grid for a particular type and Grand total in ALV

    Hi,
    I need to have sub total for a particular type(eg: goods, services).. and grand total at end in ALV grid..
    ALV output required as below:
    Type     VAT registration number     Country      Total Gross Amounts       Total Tax Amounts       Total Amount, ex-tax
    Goods     ATU12345678     AT                  222.42      0         222.42
    Goods     NL123456789B02     NL               3,417.00      0      3,417.00
         Goods Total                    3,639.42                -         3,639.42
    Services     ATU12345678     AT               2,342.34      0      2,342.34
    Services     NL123456789B02     NL                  223.33      0         223.33
         Services Total                    2,565.67                -         2,565.67
         Grand Total                    6,205.09                -         6,205.09
    Let me as to how to achieve the above type in ALV grid...
    Regards
    Shiva

    check this link..
    Grand Totals in ALV grid disply function module
    or do like this..
    REPORT  ZALVTESTFORSUBTOTAL.
    tables:pa0008.
    type-pools:slis.
    types:begin of ty_pa0008,
          pernr like pa0008-pernr,
          begda like pa0008-begda,
          endda like pa0008-endda,
          ansal like pa0008-ansal,
          lga01 like pa0008-lga01,
          bet01 like pa0008-bet01,
          end of ty_pa0008.
    data:it_pa0008 type standard table of ty_pa0008 with header line.
    data:it_fieldcat type SLIS_T_FIELDCAT_ALV,
         wa_fieldcat type slis_fieldcat_alv,
         it_layout type slis_layout_alv,
         WA_events TYPE slis_alv_event,
         it_events TYPE slis_t_event.
    select-options:s_pernr for pa0008-pernr.
    start-of-selection.
    perform getD_data.
    perform disp_alv.
    *&      Form  getD_data
          text
    -->  p1        text
    <--  p2        text
    form getD_data .
    select pernr
           begda
           endda
           ansal
           lga01
           bet01
           from pa0008
           into table it_pa0008
           where pernr in s_pernr.
    sort it_pa0008 by pernr begda descending.
    endform.                    " getD_data
    *&      Form  disp_alv
          text
    -->  p1        text
    <--  p2        text
    form disp_alv .
    wa_fieldcat-fieldname = 'PERNR'.
    wa_FIELDCAT-REPTEXT_DDIC = 'Personnel no'.
    *WA_FIELDCAT-no_subtotals = 'X'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    wa_fieldcat-fieldname = 'BEGDA'.
    wa_FIELDCAT-REPTEXT_DDIC = 'Start date'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    wa_fieldcat-fieldname = 'ENDDA'.
    wa_FIELDCAT-REPTEXT_DDIC = 'End date'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    wa_fieldcat-fieldname = 'ANSAL'.
    wa_FIELDCAT-REPTEXT_DDIC = 'Annula salary'.
    wa_fieldcat-do_sum = 'X'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    wa_fieldcat-fieldname = 'LGA01'.
    wa_FIELDCAT-REPTEXT_DDIC = 'Wage Type'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    wa_fieldcat-fieldname = 'BET01'.
    wa_FIELDCAT-REPTEXT_DDIC = 'Amount for wagetype'.
    append wa_fieldcat to it_fieldcat.
    clear wa_fieldcat.
    DATA: sort TYPE slis_sortinfo_alv,
    it_sort TYPE slis_t_sortinfo_alv.
    sort-fieldname = 'PERNR'.
    sort-subtot = 'X'.
    SORT-UP = 'X'.
    APPEND sort TO it_sort.
    *sort-fieldname = 'BEGDA'.
    *SORT-NO_SUBTOTS = 'X'.
    *APPEND sort TO it_sort.
    IT_layout-totals_text = 'total text'.
    IT_layout-subtotals_text = 'Subtotal text'.
    *WA_EVENTS-NAME = 'SUBTOTAL TEXT'.
    *WA_EVENTS-FORM = 'SUBTOTAL TEXT'.
    *APPEND WA_EVENTS TO IT_EVENTS.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM             = sy-repid
       IS_LAYOUT                      = it_LAYOUT
       IT_FIELDCAT                    = IT_FIELDCAT
       it_sort                        = it_sort
      it_events                      = it_events
       TABLES
        t_outtab                       = it_pa0008 .
    endform.                    " disp_alv

  • Questions about editing with io HD or Kona 3 cards

    My production company is switching from Avid to Final Cut Pro. I have a few editing system questions (not ingesting and outputting, just questions about systems for the actual editors - we will have mac pros with either kona 3 or io HD for ingest and outputs)
    1) Our editors work from home so they most likely will be using MacBook Pros - Intel Core 2 Duo 2.6GHz 4GB computers with eSata drives to work on uncompressed HD, will they be able to work more quickly in FCP if they are using the new Mac Pro 8-Core (2 Quad-Core 2.8GHz Intel Xeon) or will the mac book pro's be able to hold their own with editing hour long documentaries, uncompressed HD
    2) Will having an AJA Kona 3 (if we get the editors mac pros) or io HD (for the mac book pros) connected be a significant help to the editor's and their process, will it speed up their work, will it allow them to edit sequences without having to render clips of different formats? Or will they be just as well off without editing with the io HD?
    I'm just trying to get a better understanding of the necessity of the AJA hardware in terms of working with the editors to help them do what they have to do with projects that have been shot on many formats- DVCPro tapes, Aiptek cameras that create QTs and P2 footage.
    Thanks

    1. with the IoHD, laptops become OK working with ProRes and simply eSata setups. Without the Io, they can't view externally on a video monitor (a must in my book). It will not speed up rendering a ton, nor will it save renders of mixed formats. The idea is to get all source footage to ProRes with the Io, and then the Io also lifts the CPU from having to convert ProRes to something you can monitor externally on a video monitor, and record back to any tape format you want... all in real time.
    2. Kona 3's on Towers would run circles around render times on a Laptop... no matter what the codec, but the Kona does not really speed renders up. That's a function of the CPU and just how fast is it. (lots of CPU's at faster speeds will speed up render times).
    I'd recommend you capture to ProRes with Io's or the Kona 3 and don't work in uncompressed HD. You gain nothing doing it quality wise at all. And you only use up a ton of disk space (6 times the size in fact) capturing and working in uncompressed HD, which from your post, you're not shooting anyway. The lovely thing about ProRes is that it's visually lossless, efficient, and speeds up the editing process. Mixing formats can be done, but it's better to go to ProRes for all source footage, and edit that way.
    With either the Kona or the Io, you then can output to uncompressed HD tape... that's what they do for you no matter what codec you've edited in. ProRes is designed to be the codec of choice for all HD projects when you're shooting different formats especially... Get them all singing the same tune in your editing stations, and you'll be a much happier camper. Only reason to buy laptops is portability... otherwise you're much better off with towers and the Kona 3 speed wise.
    Jerry
    Message was edited by: Jerry Hofmann

  • A few questions about Patone colors

    I have a few questions about patone colors since this is the first time I use them. I want to use them to create a letterhead and business cards in two colors.
    1)
    I do understand that the uncoated is more washed out than the coated patone colors. I heard that this is because the way paper absorbs the inkt. This is why the same inkt results in different colors on different paper (right?). My question is why is the patone uncoated black so much different than normal black (c=0 m=0 y=0 k=100) or rich black:
    When I print a normal document with cmyk, I can get pretty dark black colors. Why is it that I cannot have that dark black color with patone colors? Even text documents printed on a cheap printer can get a darker color than the Patone color. It just looks way too grey for me.
    2) For a first mockup, I want to print the patone colors as cmyk (since I put like 10 different colors on a page for fast comparison). I know that these cmyk colors differ from the patone colors and that I cannot get a 100% representation. But is there a way to convert patone to cmyk values?
    I hope that some of you can help me out with my questions.
    Thanks.

    You can get Pantone's CMYK tints in Illustrator, (Swatches Panel > Open Swatch Library > Color Books > PANTONE+ Color Bridge Coated or Uncoated) but in my view, what's the point?  If you're printing to a digital printer, just use RGB (HSB) or CMYK. Personally, I never use Pantone's CMYK so-called "equivalents."
    Pantone colors are all mixed pigmented inks, many of which fluoresce beyond the gamut limits of RGB and especially CMYK. The original Pantone Matching System (PMS) was created for the printing industry. It outlined pigmented ink formulations for each of its colors.
    Most digital printers (laser or inkjet) use CMYK. The CMYK color gamut is MUCH SMALLER than what many mixed inks, printed on either coated or uncoated papers can deliver. When you specify non-coated Pantone ink in AI, according to Pantone's conversion tables, AI tries to "approximate" what that color will look like on an uncoated sheet, using CMYK. -- In my opinion, this has little relevance to real-world conditions, and is to be avoided in most situations.
    If your project is going to be printed on a printing press with spot Pantone inks, then by all means, use Pantone colors. But don't trust the screen colors; rather get a Pantone swatch book and look at the actual inks on both coated and uncoated papers, according to the stock you will use on the press.
    With the printing industry rapidly dwindling in favor of the web and inkjet printers, Pantone has attempted to extend its relevance beyond the pull-date by publishing (in books and in software alliances, with such as Adobe) its old PMS inks, and their supposed LAB and CMYK equivalents. I say "supposed" because again, RGB monitors and CMYK inks can never be literally equivalent to many Pantone inks. But if you're going to print your project on a printing press, Pantone inks are still very relevant as "spot colors."
    I also set my AI Preferences > Appearance of Black to both Display All Blacks Accurately, and Output All Blacks Accurately. The only exception to this might be when printing on a digital printer, where there should be no registration issues.
    Rich black in AI is a screen phenomenon, unless in Prefs > Appearance of Black, you also specify "Output All Inks As Rich Black," -- something I would NEVER do if outputting for an actual printing press. I always set my blacks in AI to "Output All Blacks Acurately" when outputting for a press. If you fail to do this, then on the press you will see any minor registration problems, with C, M, and Y peeking out, especially around black type.  UGH!
    Good luck!  :+)

  • Runtime Error while summing a column in ALV output

    Dear All,
    I have developed an ALV Report and the report is giving output without any flaws.
    I have defined proper field catalog and displaying the results using REUSE_ALV_GRID function module.
    Now the report is generating Runtime Error while the user selects a column and click the SUM icon.
    The fields like Qty, or amounts are also theowing runtime error while summing up their column in the ALV output.
    What might be the reason and how to resolve this issu?
    Regards
    Pavan

    Hi ,
    I don't know how you have write  down the code but follow the below coding example:
    FOR TOTAL:
    there is a property of fieldcatalog, that is do_sum.
    USE COED LIKE:
    PERFORM fieldcat USING:
    '1' 'MATNR' 'I_MARD' 'MATERIAL NO' 'MARD' 'MATNR ' ' ',
    '2' 'NETWR' 'I_MARD' 'PLANT' 'MARD' 'WERKS' ' ',
    FORM fieldcat USING value(p_0029)
    value(p_0030)
    value(p_0031)
    value(p_0032)
    wa_fieldcat-col_pos = p_0029.
    wa_fieldcat-fieldname = p_0030.
    wa_fieldcat-tabname = p_0031.
    wa_fieldcat-reptext = p_0032.
    wa_fieldcat-do_sum = 'X'.
    APPEND wa_fieldcat TO i_fieldcat.
    ENDFORM. " FIELDCAT
    in final output you will get the total of currency field.
    FOR SUB TOTAL:
    decleare: i_sort type standard table of slis_sortinfo_alv,
              wa_sort type slis_t_sortinfo_alv.
    wa_sort-spos = '1'.
    wa_sort-fieldname = 'field1'.
    wa_sort-subtot = 'X'.
    append wa_tab to i_sort.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    it_fieldcat = it_fieldcat
    it_sort = i_sort
    Hope this can solve your pbs.
    If you need more inputs let me know.
    Regards,
    Tutun

  • Subtotal in alv

    hi experts,
                   i want to display subtotal in the alv output using control break statement, without using alv functionality and layout.
    my code is given below, how can i add subtotal field and display them in alv ,
    *& Report  Y_VARUNSHARMA
    REPORT  Y_VARUNSHARMA.
    TABLES: VBAK.
    TYPE-POOLS: SLIS.
    TYPES: BEGIN OF T_ITAB,
           VBELN LIKE VBAK-VBELN,
           ERDAT LIKE VBAK-ERDAT,
           ERNAM LIKE VBAK-ERNAM,
           ANGDT LIKE VBAK-ANGDT,
           BNDDT LIKE VBAK-BNDDT,
           AUART LIKE VBAK-AUART,
           POSNR LIKE VBAP-POSNR,
           MATNR LIKE VBAP-MATNR,
           CHARG LIKE VBAP-CHARG,
           MAKTX LIKE MAKT-MAKTX,
           NETPR LIKE VBAP-NETPR,
           VGBEL LIKE VBAK-VGBEL,
           MEINS LIKE VBAP-MEINS,
           SMENG LIKE VBAP-SMENG,
            END OF T_ITAB.
    DATA: G_REPID LIKE SY-REPID.
    DATA: WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: I_ITAB TYPE T_ITAB OCCURS 0,
          WA_ITAB TYPE T_ITAB.
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV ,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: I_LISTHEADER TYPE SLIS_T_LISTHEADER,
          WA_LISTHEADER TYPE SLIS_LISTHEADER.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: DOCNO FOR VBAK-VBELN.
    PARAMETER DOCTYPE LIKE VBAK-AUART.
    SELECT-OPTIONS: DATE FOR SY-DATUM.
    SELECTION-SCREEN SKIP 2.
    PARAMETER P_CHECK AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM BUILD_CATALOGE.
    PERFORM LIST_HEADER.
    PERFORM SET_LAYOUT.
    AT SELECTION-SCREEN.
    IF DOCNO-LOW = '' .
    MESSAGE E000(ZVARUN) .
    elseif DOCNO-HIGH = '' .
    MESSAGE E001(ZVARUN) .
    ENDIF.
    START-OF-SELECTION.
    PERFORM GET_DATA.
    *PERFORM DISPLAY.
    END-OF-SELECTION.
    IF P_CHECK = 'X'.
    PERFORM DOWNLOAD_EXCEL.
    ELSE.
    PERFORM DISPLAY.
    ENDIF.
    FORM DOWNLOAD_EXCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'C:\FILE.XLS'
      FILETYPE                        = 'XLS'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = I_ITAB
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    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.
    FORM BUILD_CATALOGE.
    WA_FIELDCAT-FIELDNAME = 'VBELN'.
    WA_FIELDCAT-SELTEXT_M = 'SALES DOC'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ERDAT'.
    WA_FIELDCAT-SELTEXT_M = 'DATE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ERNAM'.
    WA_FIELDCAT-SELTEXT_M = 'NAME'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ANGDT'.
    WA_FIELDCAT-SELTEXT_M = 'VALID FR'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BNDDT'.
    WA_FIELDCAT-SELTEXT_M = 'VALID TO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'AUART'.
    WA_FIELDCAT-SELTEXT_M = 'DOC TYPE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'POSNR'.
    WA_FIELDCAT-SELTEXT_M = 'DOC ITEM'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MATNR'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'CHARG'.
    WA_FIELDCAT-SELTEXT_M = 'BATCH NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MAKTX'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL DESC'.
    WA_FIELDCAT-EDIT = 'X'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'NETPR'.
    WA_FIELDCAT-SELTEXT_M = 'UNIT PRICE'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'VGBEL'.
    WA_FIELDCAT-SELTEXT_M = 'RFR DOC NO'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MEINS'.
    WA_FIELDCAT-SELTEXT_M = 'UNIT'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'SMENG'.
    WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
    *WA_FIELDCAT-OUTPUTLEN = 10.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM.
    FORM LIST_HEADER.
    WA_LISTHEADER-TYP = 'H'.
    WA_LISTHEADER-INFO = 'RJT COMPUSOLUTIONS'.
    APPEND WA_LISTHEADER TO I_LISTHEADER.
    CLEAR WA_LISTHEADER.
    ENDFORM.
    FORM SET_LAYOUT.
    WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    ENDFORM.
    FORM DISPLAY.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = G_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = WA_LAYOUT
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = I_ITAB
    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.
    FORM TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = I_LISTHEADER
       I_LOGO                   = 'RJT'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM GET_DATA.
    SELECT AVBELN AERDAT AERNAM AANGDT ABNDDT AAUART AVGBEL BPOSNR BMATNR BCHARG BMEINS BSMENG BNETPR CMAKTX  INTO CORRESPONDING FIELDS OF TABLE I_ITAB FROM  ( ( VBAK AS A INNER JOIN VBAP AS B
    ON AVBELN = BVBELN ) INNER JOIN MAKT AS C  ON BMATNR = CMATNR )  WHERE AVBELN IN DOCNO AND AAUART = DOCTYPE .
    ENDFORM.
    FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM L_SELFIELD TYPE SLIS_SELFIELD.
    CASE L_UCOMM.
    WHEN '&IC1'.
    IF L_SELFIELD-FIELDNAME  = 'VBELN'.
    CALL TRANSACTION 'VA02'.
    ELSEIF
    L_SELFIELD-FIELDNAME = 'MATNR'.
    CALL TRANSACTION 'MM02'.
    ENDIF.
    ENDCASE.
    ENDFORM.

    if u dont want std alv functionality,u have to explicitly sum it and insert it to ur itab.
    for dat u have to change ur itab declaration like dis..
    assuming u want to display the subtotals of NETPR based on vbeln...
    TYPES: BEGIN OF T_ITAB,
    VBELN LIKE VBAK-VBELN,
    NETPR LIKE VBAP-NETPR,
    ERDAT LIKE VBAK-ERDAT,
    ERNAM LIKE VBAK-ERNAM,
    ANGDT LIKE VBAK-ANGDT,
    BNDDT LIKE VBAK-BNDDT,
    AUART LIKE VBAK-AUART,
    POSNR LIKE VBAP-POSNR,
    MATNR LIKE VBAP-MATNR,
    CHARG LIKE VBAP-CHARG,
    MAKTX LIKE MAKT-MAKTX,
    VGBEL LIKE VBAK-VGBEL,
    MEINS LIKE VBAP-MEINS,
    SMENG LIKE VBAP-SMENG,
    END OF T_ITAB.
    den in form get_data.
    aftr select statement. itab2 is the final table
    sort itab by vbeln.
    loop at it itab into wa.
    move wa TO wa1.
    v_netpr = v_netpr +  wa-netpr.
    append wa1 to itab2.
    at end of vbeln.
      clear wa1.
      wa1-netpr = v_netpr.
      append wa1 to itab2.
    endat.
    endloop.

Maybe you are looking for