Need help in ALV Header to merge the columns.

HI All,
I have to create an ALV report with below Header in which i have to merge the data.
Col1
col2
Col3
col.3.1
col 3.2
col3.3
Please let me know how to create fieldcatalog for the above layout.
Thanks
Piyush

REPORT zhier_alv.
TYPE-POOLS : slis.
TABLES : mseg.
DATA : BEGIN OF itab_head OCCURS 0,
        matnr LIKE mseg-matnr,
        werks LIKE mseg-werks,
         mblnr LIKE mseg-mblnr,
        menge LIKE mseg-menge,
       END OF itab_head.
DATA : BEGIN OF itab_item OCCURS 0,
        matnr LIKE mseg-matnr,
        werks LIKE mseg-werks,
        mblnr LIKE mseg-mblnr,
        menge LIKE mseg-menge,
       END OF itab_item.
DATA : t_fcat TYPE slis_t_fieldcat_alv,
       key_info TYPE slis_keyinfo_alv,
       t_eve TYPE slis_t_event,
       gt_subtot TYPE slis_t_sortinfo_alv,
       subtot LIKE LINE OF gt_subtot,
       t_listhead TYPE slis_t_listheader,
       st_line TYPE slis_listheader.
DATA : t_mtdoc LIKE mseg-mblnr.
SELECT-OPTIONS : mat FOR mseg-matnr.
INITIALIZATION.
  PERFORM build_cat USING t_fcat.
  PERFORM build_eve.
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM dis_data.
*&      Form  build_cat
      text
     -->TEMP_FCAT  text
FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
  DATA : wa_fcat TYPE slis_fieldcat_alv.
  wa_fcat-tabname = 'ITAB_HEAD'.
  wa_fcat-fieldname = 'MATNR'.
  wa_fcat-seltext_m = 'Material'.
  APPEND wa_fcat TO temp_fcat.
  CLEAR wa_fcat.
  wa_fcat-tabname = 'ITAB_HEAD'.
  wa_fcat-fieldname = 'WERKS'.
  wa_fcat-seltext_m = 'Plant'.
  APPEND wa_fcat TO temp_fcat.
  CLEAR wa_fcat.
  wa_fcat-tabname = 'ITAB_ITEM'.
  wa_fcat-fieldname = 'MBLNR'.
  wa_fcat-seltext_m = 'Material Doc.'.
  APPEND wa_fcat TO temp_fcat.
  CLEAR wa_fcat.
  wa_fcat-tabname = 'ITAB_ITEM'.
  wa_fcat-fieldname = 'MENGE'.
  wa_fcat-seltext_m = 'Quantity'.
  wa_fcat-do_sum = 'Y'.
  APPEND wa_fcat TO temp_fcat.
  CLEAR wa_fcat.
  subtot-spos = 1.
  subtot-fieldname = 'MATNR'.
  subtot-tabname = 'ITAB_HEAD'.
  subtot-up = 'X'.
  subtot-group = 'X'.
  subtot-subtot = 'X'.
  subtot-expa = 'X'.
  APPEND subtot TO gt_subtot.
ENDFORM.                    "build_cat
*&      Form  build_eve
      text
FORM build_eve.
  DATA : wa_eve TYPE slis_alv_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     i_list_type           = 0
   IMPORTING
     et_events             = t_eve
  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 t_eve INTO wa_eve WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc = 0.
   wa_eve-form = 'TOP_OF_PAGE'.
   MODIFY t_eve FROM wa_eve INDEX sy-tabix.
ENDIF.
ENDFORM.                    "build_eve
*&      Form  get_data
      text
FORM get_data.
  SELECT matnr werks mblnr menge FROM mseg INTO CORRESPONDING FIELDS OF
TABLE itab_item
  WHERE matnr IN mat.
ENDFORM.                    "get_data
*&      Form  dis_data
      text
FORM dis_data.
  key_info-header01 = 'MATNR'.
  key_info-item01 = 'MATNR'.
  key_info-header02 = 'WERKS'.
  key_info-item02 = 'WERKS'.
  key_info-header03 = 'MBLNR'.
  key_info-item03 = 'MBLNR'.
  key_info-header04 = 'MENGE'.
  key_info-item04 = 'MENGE'.
  REFRESH itab_head.
  LOOP AT itab_item.
    ON CHANGE OF itab_item-matnr OR itab_item-werks.
      MOVE-CORRESPONDING itab_item TO itab_head.
      APPEND itab_head.
    ENDON.
  ENDLOOP.
  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      i_callback_program             = 'ZHIER_ALV'
      i_callback_user_command        = 'USER_COMMAND'
      it_fieldcat                    = t_fcat
      it_sort                        = gt_subtot
      it_events                      = t_eve[]
      i_tabname_header               = 'ITAB_HEAD'
      i_tabname_item                 = 'ITAB_ITEM'
      is_keyinfo                     = key_info
    TABLES
      t_outtab_header                = itab_head
      t_outtab_item                  = itab_item
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.                    "dis_data
*&      Form  user_Command
      text
     -->U_COMM     text
     -->SELFIELD   text
FORM user_command USING u_comm TYPE sy-ucomm selfield TYPE slis_selfield
  CASE u_comm.
    WHEN '&IC1'.
      READ TABLE itab_item INDEX selfield-tabindex.
      t_mtdoc = itab_item-mblnr.
      SET PARAMETER ID 'MBN' FIELD t_mtdoc.
      CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
  ENDCASE.
ENDFORM.                    "user_Command
*&      Form  top_of_page
      text
FORM top_of_page.
  CLEAR st_line.
  st_line-typ = 'H'.
  st_line-info = 'Krupa'.
  APPEND st_line TO t_listhead.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = t_listhead
  I_LOGO                   =
  I_END_OF_LIST_GRID       =
  I_ALV_FORM               =
ENDFORM.                    "top_of_page
if it is use then give point

Similar Messages

  • I need help, yesterday I installed and reinstalled the Yosemite system and take long to turn on my laptop, the bar takes to fill, and I'm worried. Can you help? thank

    I need help, yesterday I installed and reinstalled the Yosemite system and take long to turn on my laptop, the bar takes to fill, and I'm worried.
    Can you help? thank

    revert back to Maverick that is what I had to finally do. This was the worst upgrade I have ever seen. Hopefully you have Time Machine backup and can revert back. It was pretty painless except for a few issues. I will wait until Apple gets their stuff together on this upgrade or may never will.

  • Hi i need help one of my key on the keyboard dosen't work for some reason please help

    hi i need help one of my key on the keyboard dosen't work for some reason please help

    try smc reset
    http://support.apple.com/kb/ht3964
    and Pram reset
    http://support.apple.com/kb/ht1379
    (Try pram a few times to get correct sequence)
    Check what you have selected in
    system preferences/system/accessibility/keyboard
    and system preferences/hardware/keyboard  (keyboard and keyboard short cuts tabs)

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • New airport user need help setting up a pc on the network

    went and bought a airport extream today and my mac works fine on it but i also have a pc and need help getting it to work with the airport express. it seems to see the airport in the network slection screen but after i put in the pass i get nothing and it returns to the "chose a wireless network" can anyone help?

    Thanks for the reply.
    That's interesting, I guess I had assumed that would be a basic thing.
    Right now the 4000 number is in port 1, and then 4244 is in port 2. So if no one else is on the phone, and my  boss picks up his phone, dials 9 then XXX-XXXX, he will be routed outbound on the 4000 line on port 1. Then while he's talking, if I pick up the phone and dial 9 then XXX-XXXX, I will be routed out on the 4244 line on port 2.
    Am I understanding that correctly?
    If that is the case, then that is a bit frustrating. Our 4000 line has everything on it, call waiting, caller id, long distance, etc. But the 4244 line is just a basic service. So if I'm calling local or toll free, I don't want to tie the other line up in case someone else needs to make a long distance call to a client. Is there any work around to that at all? Is there any way to use steering digits to point the call to the right line? Would we have to put the PSTN lines on seperate SPA400's?
    Again, any comments and suggestions are much appreciated!
    Message Edited by VoIP_Me on 07-30-2008 06:27 AM
    Message Edited by VoIP_Me on 07-30-2008 06:28 AM

  • I NEED HELP!! Been calling since the end of Nov and being charged for a Warranty device. The device was returned the next day!! Been calling twice a week.. NEED RESOLUTION

    I NEED HELP!! Been calling since the end of Nov and being charged for a Warranty device. The device was returned the next day!! Been calling twice a week.. I NEED HELP 6 TCC TICKETS HAVE BEEN OPENED - PROMISED CALLS BACK AND NEVER GET CALLS.
    About to cancel my account and move to AT&T
    TCC TICKETS:  (removed)
    I am trying here for the last resort. After this evening my account along with my business account will be cancelled. Total lines that Verizon will have lost will be 93 lines.
    PLEASE SOMEONE JUST HELP ME!!!!
    I already tweeted and facebook messaged Verizon. Your CS group has gone down hill over the last 3-6 months. I use to enjoy being a customer.
    >> Edited to comply with the Verizon Wireless Terms of Service <<

    not all the lines have ETF's. I have 30 tablets and the rest phones. The phones have ETFs and the tablets are all month to month.
    The total to move my account over is going to come out to about $8500.
    Rep has been trying to get my business for years.  I was always loyal to Verizon until this happened.

  • How do I sort songs in the iTunes store?  You used to be able to click on the column header to sort the column (ie Popularity)?

    How do I sort songs in the iTunes store?  You used to be able to click on the column header to sort the column (ie Popularity)?

    It seems this is a "backwards" upgrade from Apple in their iTunes 11 release....like you, I used to use that function in the iTunes store to sort through and decide which song version to purchase.   (For a large returned list of songs...see all...then sort by any of the headers, including Popularity...this functionality is now gone.)  
    The iPad always suffered from this...was never able to sort on those same column headers with an iPad.   It seems, this new iTunes release killed that functionality on the Mac as well.
    Just one of the few things that went wrong with number 11!
    Better luck next time,

  • Merging of 2 Cells in WD ABAP ALV Header & Dynamically change the header

    Hello Experts,
    I have two main requirements with respect to WD ABAP - ALV report creation
    1) Two feilds in the  header of ALV GRID created in the WD ABAP screen must be merged as shown below(Month Column) ,
    |     January         |     February         |  
    |   Col 1 | Col2      |   Col 1 | Col2        |     
    2) The header value(Month) should dynamically change based on the current date.
    For Eg: If June 2011 is the current month , the ALV table should start from June 2011 and displayed till May 2012.
    Looking forward for your valuable inputs @ the earliest
    Regards,
    Sriram

    Hi Sriram,
    For merging..
    Pleaese go through this
    Merge of Cells in ALV table in ABAP webdynpro.
    ABAP WD: ALV merge cells
    For Header Change..
    How to set title/text for ALV table column header in WD ABAP
    Change column header in ALV to another DDIC Element type
    Change label of a column in ALV
    Cheers,
    Kris.

  • Need help in ALV web dynpro

    Hi all,
    I need help in the web dynpro ALV.
    I have an ALV generated dynamically. On the ALV, there is filter and settings link on the extreme right of the alv header.
    How is it possible to get them left align after the export button ?
    I want to maitain some gap between the export button, filter and settings.
    Please give me inputs.
    Thanks in Advance.

    Hi Jatra,
    I am working on an ALV table in a standard Web Dynpro ABAP application.
    The business requirement is to hide the header for the ALV table.
    The header has a dropdown to choose u201CStandard Viewu201D and 2 options: Filter and Settings.
    The footer for the ALV table containing the Row and Column numbering also needs to be hidden.
    I am looking at the IF_SALV_WD_TABLE_SETTINGS to find the relevant methods to hide the header and footer.
    Please let me know if I am on the right track and if there is an alternate way to do this through changing the layout of the ALV table. I tried to hide the header and footer manually via the layout but am unable to do so, as the ALV table is just displayed as ViewContainerUI Element.
    Please help me as to how to hide the header and footer as I am new to ALV in WDA.
    Thanks and Regards.

  • Need help with ALV Grid

    Hi,
    I am displaying Header and Item details in an ALV Grid. The first row will be having Header info and the next rows contains Item Details. I want to hide some of the columns of the first record only. The titles and the Item Details should remain same.
    Can any body help me.
    Regards,
    Srinivas

    Hello,
    That cannot be done as you are displaying the header and item level data together. Let the fields you do not want to display be blank while you display.
    Hope it helps.
    Thanks,
    Jayant

  • Need help with disappearing header row in tables

    Hey guys.
    I'm working on a large document with tables (annual report). I have set up table styles with header and body cell styles. When I apply the table style to a table, then convert the first row to header row, the entire header row disappears...!
    If I leave the row as body row and just apply the header cell style to it, it won't disappear. The row will only disappear if I convert it to header row in Indesign.
    I checked the Word doc I imported the text from, the first row of the tables is just normal body row.
    I dunno where to look so I have no idea how to fix this problem. It happens to all the tables. I was supplied this file. I don't particularly want to recreate the file. The original file was created in Creative Clouds and exported to idml for me as I have CS6.
    Has anyone experienced the same problem or know what's the solution? I really need help.
    Thanks in advance.

    It may be on the Table Options dailog box on the section of Headers and Footers> Header: Repeat Header the Skip First is check on.

  • Need help to draw a graph from the output I get with my program please

    Hi all,
    I please need help with this program, I need to display the amount of money over the years (which the user has to enter via the textfields supplied)
    on a graph, I'm not sure what to do further with my program, but I have created a test with a System.out.println() method just to see if I get the correct output and it looks fine.
    My question is, how do I get the input that was entered by the user (the initial deposit amount as well as the number of years) and using these to draw up the graph? (I used a button for the user to click after he/she has entered both the deposit and year values to draw the graph but I don't know how to get this to work?)
    Please help me.
    The output that I got looked liked this: (just for a test!) - basically this kind of output must be shown on the graph...
    The initial deposit made was: 200.0
    After year: 1        Amount is:  210.00
    After year: 2        Amount is:  220.50
    After year: 3        Amount is:  231.53
    After year: 4        Amount is:  243.10
    After year: 5        Amount is:  255.26
    After year: 6        Amount is:  268.02
    After year: 7        Amount is:  281.42
    After year: 8        Amount is:  295.49
    After year: 9        Amount is:  310.27
    After year: 10        Amount is:  325.78
    After year: 11        Amount is:  342.07
    After year: 12        Amount is:  359.17
    After year: 13        Amount is:  377.13
    After year: 14        Amount is:  395.99
    After year: 15        Amount is:  415.79
    After year: 16        Amount is:  436.57
    After year: 17        Amount is:  458.40And here is my code that Iv'e done so far:
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.lang.Math;
    import java.text.DecimalFormat;
    public class CompoundInterestProgram extends JFrame implements ActionListener {
        JLabel amountLabel = new JLabel("Please enter the initial deposit amount:");
        JTextField amountText = new JTextField(5);
        JLabel yearsLabel = new JLabel("Please enter the numbers of years:");
        JTextField yearstext = new JTextField(5);
        JButton drawButton = new JButton("Draw Graph");
        public CompoundInterestProgram() {
            super("Compound Interest Program");
            setSize(500, 500);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            amountText.addActionListener(this);
            yearstext.addActionListener(this);
            JPanel panel = new JPanel();
            panel.setBackground(Color.white);
            panel.add(amountLabel);
            amountLabel.setToolTipText("Range of deposit must be 20 - 200!");
            panel.add(amountText);
            panel.add(yearsLabel);
            yearsLabel.setToolTipText("Range of years must be 1 - 25!");
            panel.add(yearstext);
            panel.add(drawButton);
            add(panel);
            setVisible(true);
            public static void main(String[] args) {
                 DecimalFormat dec2 = new DecimalFormat( "0.00" );
                CompoundInterestProgram cip1 = new CompoundInterestProgram();
                JFrame f = new JFrame();
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.getContentPane().add(new GraphPanel());
                f.setSize(500, 500);
                f.setLocation(200,200);
                f.setVisible(true);
                Account a = new Account(200);
                System.out.println("The initial deposit made was: " + a.getBalance() + "\n");
                for (int year = 1; year <= 17; year++) {
                      System.out.println("After year: " + year + "   \t" + "Amount is:  " + dec2.format(a.getBalance() + a.calcInterest(year)));
              @Override
              public void actionPerformed(ActionEvent arg0) {
                   // TODO Auto-generated method stub
    class Account {
        double balance = 0;
        double interest = 0.05;
        public Account() {
             balance = 0;
             interest = 0.05;
        public Account(int deposit) {
             balance = deposit;
             interest = 0.05;
        public double calcInterest(int year) {
               return  balance * Math.pow((1 + interest), year) - balance;
        public double getBalance() {
              return balance;
    class GraphPanel extends JPanel {
        public GraphPanel() {
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.red);
    }Your help would be much appreciated.
    Thanks in advance.

    watertownjordan wrote:
    http://www.jgraph.com/jgraph.html
    The above is also good.Sorry but you need to look a bit more closely at URLs that you cite. What the OP wants is a chart (as in X against Y) not a graph (as in links and nodes) . 'jgraph' deals with links and nodes.
    The best free charting library that I know of is JFreeChart from www.jfree.org.

  • Need help in displaying error message on the same screen

    Hi Experts,
    I have written a report which gets called from IW52 by clicking one of the action items. Now in my report when I am trying display an error message it is getting displayed at the bottom of a blank screen. My requirement is to display it at the bottom of the IW52 screen, so that user can rectify the error.
    Please help.
    Regards,
    Sambaran Ray.

    Hi,
    Probably you need to find a way to enhance the standard code.
    But make one thing sure that the code (included bu you) gets fired only when that specific report is being executed. Else it may harm the standard functionality.
    Hope this helps you.
    Regards,
    Tarun

  • Need Help in displaying data labels at the top of the bars in CFCHART

    Hi,
    I have a cfchart with two line series and one bar. I want to display the data values at the top of the bar and the line series. Below is the XML I am using:
    <cfsavecontent variable="chartStyle">
    <?xml version="1.0" encoding="UTF-8"?>
    <frameChart is3D="false" isMultiline="true">
              <frame xDepth="12" yDepth="11" outline="black" stripColor="light_gray">
                   <background maxColor="black"/>
              </frame>
    <yAxis scaleMin="0" scaleMax="30">
                   <labelFormat pattern="###"/>
    <parseFormat pattern="###"/>
    <labelStyle orientation="Horizontal"/>
    <titleStyle font="Arial-11-bold" isMultiline="false"><![CDATA[
    #Vehicles       ]]>
    </titleStyle>
    </yAxis>
    <yAxis2 scaleMin="0" scaleMax="30">
                   <labelFormat pattern="###"/>
    <parseFormat pattern="###"/>
    <labelStyle orientation="Horizontal"/>
    <titleStyle font="Arial-11-bold" isMultiline="false"><![CDATA[
    Profitability       ]]>
    </titleStyle>
    </yAxis2>
    <dataLabels foreground="black" font="Arial-12-bold"/>
    <legend allowSpan="true" equalCols="false" halign="Center" isMultiline="true" placement="Bottom"><decoration style="None"/></legend>
    <elements place="Stacked" drawOutline="false">
    <series index="1" place="Stacked">
    <dataLabel style="value"/>               
    </series>     
              <series index="2" place="Stacked">
    <!--- <![CDATA[#summaryQuery.quotes[i]#+#summaryQuery.orders[i]#]]> --->
    </series>     
    <series index="3" place="Stacked">
    <!--- <![CDATA[#summaryQuery.quotes[i]#+#summaryQuery.orders[i]#]]> --->
    </series>
    <series index="0" place="Stacked" shape="Line" isSecondAxis="true">
    <dataLabel style="value"/>
              </series>
    <series index="1" place="Stacked" shape="Line" isSecondAxis="true">
    <dataLabel style="value"/>
              </series>
    </elements>
              <table>
                   <heatmap isEnabled="false" minLevel="0.0" maxLevel="0.0"/>
              </table>
              <popup background="white" foreground="black"/>
              <paint isVertical="true" min="26" max="76"/>
              <insets right="5"/>
    </frameChart>
    </cfsavecontent>
    Can anyone please tell me what is the mistake i am doing.
    Thanks in advance,
    Jeevan Pulugu.

    Hi,
    Probably you need to find a way to enhance the standard code.
    But make one thing sure that the code (included bu you) gets fired only when that specific report is being executed. Else it may harm the standard functionality.
    Hope this helps you.
    Regards,
    Tarun

  • I need help Guys I might of deleted the Archive utility How do i get it back.

    i Have a Mac Air Book OS  X and i think i might of deleted the Archive utility How do i get it back please need help.

    Why do you think you deleted it?

Maybe you are looking for

  • How do I delete a composed unsent e-mail?

    I was attempting to send a mass e-mail out to my customers to which I have a small business .  The addresses which I had copied and pasted in were not recognized.  When I attempted to send the message a box appeared with all the e-mail addresses and

  • OC4J 11 with ADF Runtime does not start.

    When starting OC4J 11 I get this error. Error initializing server: Shared library "oracle.fabric.runtime" could not be found. Fatal error: server exiting I downloaded OC4J 11 (11.1.1.0.0) Standalone. Then I was running "ADF Runtime Installer" in JDev

  • Dreamweaver CS5 11.0.3 Update Won't Install

    Hello, I have the Adobe CS5 Web Premium that I use at work. Adobe Application Manager popped up with a Dreamweaver update (11.0.3). I downloaded it and it tries to install but it won't. I run the Support Advisor but it detects no problems. I've never

  • Master Vs Transactional

    How do I distinguish between a master and a transactional table by just looking at the technical name in SAP R/3? Thanks

  • Feature Request: Web Clips Home Page

    I would love it if it were possible to create a Safari homepage out of several web clips. Rather than just putting web clips on the dashboard we should be able to create (possibly multiple) home pages built from clips. (cf. igoogle)