explore alv

20
Generated by Jive on 2015-08-17+02:00 1 Explore ALV Graphs Introduction: Graphs play a very vital role and have got great impact on business decisions. Senior Management, Clients, Customers all such stake-holders want to see information through Graphs to understand things easily. In SAP we have easy tool facility in ALV screens, but ...... It has been observed that threads related to ALV Graphs are rarely seen here. Objective: At the end of this document, members will be familiar with the basics about the ALV Graphs, as well as about various features available. I am sure certain cross-section of members will be benefited by this post through which they will be learning how to interpret the ALV data into various types of Graphs. Note: The features discussed in this document are largely applicable to ALVs of custom programs developed through SAP Queries or ABAP codes using fm 'REUSE_ALV_GRID_DISPLAY'. Things mentioned in this document are not applicable to ALV Graphs through Standard programs. Here we start..... How we get a Graph in ALV? We know that Graphs need numeric fields for Y-Axis. So the ALVs not containing a single numeric field are not Graph-relevant. Also the field for which you want to plot a Graph, looks like a Numeric, but if its data type is Character, then too it is not possible to plot a Graph for this field. In other-words we can say that, the ALV Layout where there is no icon in the Application Toolbar, we will not be able to draw Graphs. Ok...Let’s come back to the Graph possibilities. We are in the following ALV screen. Here these are 2 fields for X-Axis namely FinYr and Equipment Description. We have 4 numeric fields for Y-Axis i.e., MTBR, MTTR, TotBDns and Avlb%.

Upload: sanjeev-malik

Post on 18-Feb-2016

46 views

Category:

Documents


5 download

DESCRIPTION

fi

TRANSCRIPT

Page 1: Explore ALV

Generated by Jive on 2015-08-17+02:001

Explore ALV Graphs

Introduction:

Graphs play a very vital role and have got great impact on business decisions. Senior Management, Clients,

Customers all such stake-holders want to see information through Graphs to understand things easily. In SAP

we have easy tool facility in ALV screens, but ...... It has been observed that threads related to ALV Graphs

are rarely seen here.

Objective:

At the end of this document, members will be familiar with the basics about the ALV Graphs, as well as about

various features available. I am sure certain cross-section of members will be benefited by this post through

which they will be learning how to interpret the ALV data into various types of Graphs.

Note:

The features discussed in this document are largely applicable to ALVs of custom programs developed through

SAP Queries or ABAP codes using fm 'REUSE_ALV_GRID_DISPLAY'. Things mentioned in this document

are not applicable to ALV Graphs through Standard programs.

Here we start.....

How we get a Graph in ALV?

We know that Graphs need numeric fields for Y-Axis. So the ALVs not containing a single numeric field are

not Graph-relevant. Also the field for which you want to plot a Graph, looks like a Numeric, but if its data type

is Character, then too it is not possible to plot a Graph for this field. In other-words we can say that, the ALV

Layout where there is no icon in the Application Toolbar, we will not be able to draw Graphs.

Ok...Let’s come back to the Graph possibilities. We are in the following ALV screen. Here these are2 fields for X-Axis namely FinYr and Equipment Description. We have 4 numeric fields for Y-Axisi.e., MTBR, MTTR, TotBDns and Avlb%.

Page 2: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:002

Now select the first 2 columns (for X-Axis) and 3rd column for Y axis (Means we are drawing graph for MTBR

values) as shown in the picture below....

....and click on the Graph icon to get this graph window.

Page 3: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:003

What we see in this picture is, system default scale presents only 5 bars in X-axis, for the rest we need to use

horizontal Scroll (seen in the picture).

Here we start our exploration of ALV Graphs

1. To have all the Graph bars in one view (in other-words to remove horizontal scroll)

Place the Mouse pointer anywhere on the X-axis line and Right click, to get this menu.

Page 4: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:004

Click on Format Axis... to get a pop-up screen. Go to the tab Scale.

Page 5: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:005

Change the value shown above to as many as you want. In our case the bars are 8. So we change this value

to 8. Now the graph has got rid of horizontal scroll showing a;; the Graph bars, like this.

2. The Y-Axis

We see the bar with maximum value is touching the top of the Graph area, by default setting, where we want

create some room above this. This is nothing but we need to set the Y-Axis value. Our present maximum value

of Y-Axis is 2400. We want to change this to say 3000.

In a similar way we did for X-axis, keep the mouse pointer anywhere on the Y-Axis line, and right click. Go to

Scale tab. and .......

Page 6: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:006

change the Maximum value to 3000. See the graph now.

Page 7: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:007

3. Display values on the Bars:

Right click anywhere in the Plot Area to get this menu.

Page 8: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:008

4. Change the Type of Graph (Say to a PIE chart)

Refer to menu picture in Point3 above. Click on chart Type and in the pop-up Select Pies.

Page 9: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:009

Select the pie pattern you like, We here selected the 1st one. Now see how our Graph looks like.

Page 10: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0010

We got the Pies chart but the values disappeared. Follow the procedure explained in point3 to have Values of

the Pies.

Page 11: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0011

A number of Chart Type are available in this section of the Menu.

5. Titles to the Graph

Now Let’s Give a Title to our Graph and Configure it. Go to the Title tab of the menu in Point3,Give the Title you want. Say ‘MTBR Values FinYr-wise in Hrs’..

Page 12: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0012

You can Drag & Drop this title to anywhere in the Chart Area. Also you can configure the Font, Font Size,

Color etc by Right clicking on the edges of this Title box and choosing Format Chart Title.

In a similar way you can have Titles for your Axes from the same tab (Title tab).

6. Similar Graphs can be drawn for the rest of the value fields viz., MTTR, TotBDn and Avlb% by selecting

these fields as the 3rd field for Graph (First two fields being FinYr and Equipment Description for X-Axis)..

7. Multiple Value Graphs:

Many times we have a requirement for multiple parameters for Y-Axis. This suits when we have an ALV report

something like:

MTBR (Hrs) Financial Year wise:

FinYr Equipment01 Equipment02 Equipment03

1112

1213

Page 13: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0013

1314

In this case: The X-Axis will have FinYr, like the present case. The Y-Axis can have all the Equipment fields. In

this case there will be 3 bars with different colors above each FinYr on X-Axis. This is a very suitable case for

Multi-bar Graph because of the uniformity in UOMs for all 3 bars i.e., Hrs.

No two ALV fields in our current ALV are having same UOMs for demonstrating this case, we choose two fields

MTBR and Avlb%. for this demo. I've selected first two columns(FinYr and Equipment Description), and

MTBR and Avlb% (total 4 columns) . Now upon Clicking on the Graph icon, system presented the following

Graph...

After Configuration

Page 14: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0014

Now let’s discuss about the UOM (Unit Of Measure) on the Y-Axis. When this was a graph for MTBR

alone the Y-Axis unit of Hrs is OK. But when we have plotted the Avlb% also, the Maximum valueof which is 100, all these bars fell within the first grid line, which is 500 high.

8. Secondary Axis:

The above is the right situation to discuss about the Secondary Axis. i.e., we will have the vertical line on the

right side converted as Axis for the 2nd bar (Avlb%). For this Right click on Plot Area ....

Page 15: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0015

Select Secondary Axis.

Now your Graph looks better like this. (The Secondary Axis selected automatically has 0 - 100 Range)

Page 16: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0016

To have values on the Secondary Axis, select as under in the Axes tab of Chart Options.

Page 17: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0017

9. Changing the Colors of Bars, Pies etc.

For this Choose this option:

10. There are other features in the Plot Area / Chart Options Menu as shown below.

Page 18: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0018

Some useful features are

- In the Grid-lines Tab you can remove or set Grid lines for both Axes.

- In the Legend tab you can have the Color Legend Settings.

You may explore what is there in other 2 tabs Data Table and Options. With this we have explored almost

everything in ALV Graphs.

11. Now How to Save Graphs which we configured with so much effort.:

Simple,

Without closing the Graph-window in the ALV layout, click on the Save Layout button on the Application

toolbar

and Save the Layout. Now your graph is saved. Any time you select this layout, the graph will be appearing,

Similarly, when you save any Selection screen variant with this Layout, upon Executing the report you will be

directly presented the Graph. Please read ALV Graphs : An Accidental Discovery for details.

Addition no.1

Graphs on Sub-Totals

While replying to a member's query, I'd recalled another feature that should be added to this document., i.e.,

Graphs on sub totals

Example

Suppose I try to draw a graph between Equipment and Breakdown duration for IW28 ALV by giving list of

Equipments and range of Malfunction Start Date. In this case the output is likely to have several line items for a

single equipment. The Graph (X-Axis) will be crowded with of Equipments repeating themselves several times.

From such graph we would not get any information for analysis. Here comes the Sub-Total Graphs. For follow

these steps. (Have Equipment and Breakdown Duration fields as 1st 2 columns for simplicity)

1. Sort the ALV by Equipment field

Page 19: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0019

2. Select the Breakdown column and click on icon to display the totals.

(Notice that as immediately after this step a sub-total icon would be added to the toolbar next to

icon.)

3. Now Select the Equipment column and click on this Sub-total icon. A report like this would appear.

This is giving Equipment wise Total Breakdown duration. Now let's draw graph for Equipment-wise

Breakdown duration. For this, click on the icon at Red-Arrow shown in above picture. This collapses the details

and only Sub-total are visible now. as under.

Page 20: Explore ALV

Explore ALV Graphs

Generated by Jive on 2015-08-17+02:0020

Now select the Equipment Column and click on the Graph icon to get the desired Graph. I have taken IW28

case for ease of demonstration of this section (Sub-total graphs). As I said in the beginning, Graphs through

standard reports are not that explorable as discussed in this document. For this very reason, I developed

ZIW28 through Infoset query, where all these graph features are available.

Hope this document too helps members across the spaces in SCN.

Thank you.

Jogeswara Rao K