Skip to Content
Author's profile photo K Jogeswara Rao

Explore ALV Graphs

/wp-content/uploads/2014/05/37810_clip_art_graphic_of_a_yellow_guy_character_holding_a_printed_bar_graph_by_jester_arts_491164.jpg

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%.

/wp-content/uploads/2014/05/1_459530.jpg

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….

/wp-content/uploads/2014/05/2_459531.jpg

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

/wp-content/uploads/2014/05/3_459534.jpg

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.

/wp-content/uploads/2014/05/menu1_459570.jpg


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


format axis1.JPG

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.

2g.JPG

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 …….

y-axis.JPG

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

/wp-content/uploads/2014/05/3g_459577.jpg

3. Display values on the Bars:

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

4g.JPG

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.

pie.JPG

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

pie1.JPG

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

/wp-content/uploads/2014/05/pie2_459583.jpg

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’..

Title.JPG

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.

/wp-content/uploads/2014/05/title1_459585.jpg

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
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 demoI’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…

multiple value1.JPG

After Configuration

multiple value2.JPG

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 value of 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 ….

multiple value4.jpg

Select Secondary Axis.

SecAxis.JPG

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

multiple value3.JPG

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

multiple value5.JPG




9. Changing the Colors of Bars, Pies etc.

For this Choose this option:

/wp-content/uploads/2014/05/untitled1_460496.jpg




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

/wp-content/uploads/2014/05/menu3_459593.jpg

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

Capture.JPG

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

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.

iw28_1.JPG

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.

iw28_2.JPG

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


Assigned Tags

      77 Comments
      Comments are closed.
      Author's profile photo Thyagarajan Krishnamurthy
      Thyagarajan Krishnamurthy

      Excellent,

      Keep it up for sharing your knowledge,it benefits to others as well as yours.

      Regards

      Thyagarajan

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Sir,

      for your recognition and continued support.

      Regards

      Jogeswara Rao K

      Author's profile photo sriramula kishore
      sriramula kishore

      Jogeshwara Rao garu,

      It is nice to see your effort to help people.

      Regards

      SSK

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Kishore !

      Author's profile photo Ashu Aggarwal
      Ashu Aggarwal

      Hi Sir,

      The above Document is very very useful & Helpful for me

      Can We get above such Graphs in IW28 Report  also [Only Single column is selected in IW28]

      Thanks πŸ™‚

      Ashu.

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Hi Ashu,

      As you must have read in the document, there needs to be atleast one Numeric Field in the IW28 ALV output. Such only 2 fields are there in IW28 report.

      1. Breakdown Duration(Hr)

      2. Wrk. Center Load/Piece

      So you can draw Graphs for these parameters against your Equipment or Notification or Malfunction Date etc as X-Axis.

      Select Equipment field and Breakdown Duration field, click on Graph icon.


      Jogeswara Rao K

      Author's profile photo Ashu Aggarwal
      Ashu Aggarwal

      Thank you

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Ashu,

      I have added some information at the bottom of the post about Sub-total Graphs. Please go through this. In fact another thing I realised was the things explained here are more applicable to Z programs or Infoset Queries. The Graphs through Standard programs are not that flexible.

      Jogeswara Rao K

      Author's profile photo Hemant Rathod
      Hemant Rathod

      Hello Ashu and Joegeshwara,

      We also have row count as numeric value field in most of the ALV reports for plant maintenance ( refer note 2111087). You can use this count to create meaningful chart for example number of orders for different types of maintenance activities.

      Regards

      Hemant

      Author's profile photo Akhilesh Singh
      Akhilesh Singh

      Excellent Design of ALV Graphs with report presentation, Keep it up...!!!

      Thanks for sharing ....!!!

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Akhilesh for your good words!

      Author's profile photo Gary Bracegirdle
      Gary Bracegirdle

      Another excellent document - always thought that the use of graphs within the ALV functionality of list edit reports was pretty poor but your document dispells that theory!!

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Gary for the motivating words. I'm glad you are benefited by this work.

      Author's profile photo Former Member
      Former Member

      That's very helpful. Great document.

      Regards.

      Douglas

      Author's profile photo Former Member
      Former Member

      Hi Jogeswara .

      If I may, I still complement your document with the hint of how to print the chart.

      Place the Mouse pointer anywhere and Right click, to get this menu.

      /wp-content/uploads/2014/05/print1_460410.jpg

      For example, I generated a PDF πŸ˜‰

      /wp-content/uploads/2014/05/print2_460411.jpg

      Regards.

      Douglas

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Hi Douglas,

      That's a great Value addition. One needs to have a PDF printer installed in the PC, so that he/she can use this print option and get the graph created in PDF format. e.g., I did the same thing with my PDF printer pdf995 which is a part of Software995 package freely available on net. (Several other free pdf printers are available on net)

      graph.JPG

      As far as the type of Graph you've used, as I mentioned there are such several types user can explore.

      I should thank you to have added more value to this work, the final objective of which is benefit to the member.

      Regards

      Jogeswara Rao K

      Author's profile photo Former Member
      Former Member

      Hi,

      Beautiful one....

      Useful to many...

      Thanks for sharing

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Sethuraman,

      Thank you for your valuable review.

      Jogeswara Rao K

      Author's profile photo Former Member
      Former Member

      Hi Sir,

      I have seen SAIL in your profile earlier now I couldnt see.

      Have you resigned or retired sir.

      Just asked out of curiosity sorry if it seems too personal.

      Thank you

      Author's profile photo Gurunath Kumar Dadamu
      Gurunath Kumar Dadamu

      Hi,

      Very nice document .Thanks for your effort it will helpful for end users in lot of cases.

      Regards,

      Gurunath D

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Gurunath for the review!!!

      Jogeswara Rao K

      Author's profile photo Krisztian Mihaly
      Krisztian Mihaly

      Excellent, thanks for sharing this option.

      Do you have any information from supporting graphs in WebDynpro based tables in a familiar way?

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you for the praise Krisztian Mihaly,.

      I have yet to work in the queried area.

      Regards

      Jogeswara Rao K

      Author's profile photo Former Member
      Former Member

      excellent work, very useful document.

      Thank you Jogeswara for sharing this Doc. πŸ™‚

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Nihal ! πŸ™‚ Pleasure is all mine in sharing knowledge.

      Author's profile photo Former Member
      Former Member

      NICE ONE

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you very much Anwer !

      Author's profile photo Silambu RS
      Silambu RS

      Amazing!

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Silambu !

      Author's profile photo Former Member
      Former Member

      Hi,

      Though i am not the PM consultant,your contributions touches the heart of the consultants , how to involve in KEY RESULTS AREA / KEY PERFORMANCE AREAS of the company,

      I would liked to learn PM module from you.

      With best regards,

      Devendra

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Hi Devendra,

      Thank you for the kind words as always.

      The KPAs etc, if desired to be mapped through PM objects. then they can be mapped as Tasks of a Notification, whereas the Notification can be created in the name of an employee or in the name of a Section of the company as the requirement may be. And the Fulfillment can be described in the Tasks Long Texts. If marks to be give, you can have additional fields using User-Exit QQMA0011.


      As far as learning a module is concerned, it is my strong belief that effective learning takes place only when we have real tasks in hand. In the other case, things faded away within no time. Few minutes ago I was telling one of my colleagues that I appear to be a teacher here, but in fact, I am the largely benefiting student here. So if you start with real assignments, SCN can be a perfect teacher for you.


      Thanks again Devendra

      Jogeswara Rao K

      Author's profile photo Former Member
      Former Member

      Hi,

      Thanks for your updation and courtesy.

      Devendra

      Author's profile photo Anil Kumar Chilukuri
      Anil Kumar Chilukuri

      Very Helpful!! Thank You!

      Author's profile photo Santosh Sharma
      Santosh Sharma

      Very helpful!!! Thank you !

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Glad you liked it Santosh.

      Author's profile photo Former Member
      Former Member

      Hi Sir,

      Thanks for your contribution, your document is helpful for all consultants irrespective of there modules. once again thanks a lot.

      Best Regards

      Kamal

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you kamal,

      That's a great compliment !

      Regards

      Jogeswara Rao K

      Author's profile photo rajesh bethamcharla
      rajesh bethamcharla

      Nice Blog. Very helpful when we are working report with Graphs. Thanks for sharing.

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Glad Rajesh, You've found it Useful πŸ™‚

      Author's profile photo Former Member
      Former Member

      nice doc !!!!!!!

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Sandeep πŸ™‚

      Author's profile photo Former Member
      Former Member

      Dear Jogeshwarasir,

      This is very helpful and detailed document. It's very useful when we are working with Graphs.

      Thanks a lot for sharing.... πŸ™‚

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      πŸ™‚

      Thank you Parag

      Author's profile photo Former Member
      Former Member

      Hi Jogeshwara ,

      Thank you ..

      Its very usefull document

      regards,

      mahabooba shaik

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      πŸ™‚ Thank you mahabooba

      Author's profile photo Former Member
      Former Member

      Hi,

      Nice presentation & documentation Thanks for sharing

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Mr.Sukant πŸ™‚

      Author's profile photo Former Member
      Former Member

      Excellent article

      Thanks for sharing & caring;

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      πŸ™‚

      Thank you Mehmood Bhai

      Author's profile photo Former Member
      Former Member

      Excellent document. its very useful .

      Best regards,

      Nitin

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      πŸ™‚

      Am glad you are benefited by this work.

      Thank you for review Nitin !

      Author's profile photo Former Member
      Former Member

      Very Helpful Document. Thanks for this. I used this in Implementation project.

      Thanks,

      Chaitanya

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Chaitanya πŸ™‚

      Author's profile photo Former Member
      Former Member

      Hi Sir,

      Thanks for nice document:) its so helpful

      My doubt is there anywhere the graph which we save particular to layout will be saved?

      please share

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author
      Author's profile photo Former Member
      Former Member

      Thank you. A wonderful document from a great talented consultant πŸ˜€

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you  Karim, That is a great compliment. πŸ™‚

      Author's profile photo swapnil rajane
      swapnil rajane

      Dear Mr Jogeswara,

      Its really new thing to know in such detail.Thanks for sharing it.

      Regards.

      Swapnil

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you  swapnil πŸ™‚

      Regards

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you swapnil πŸ™‚ for the review.

      Regards

      Author's profile photo Former Member
      Former Member

      Hi Jogeswara,

      The document make it so easy and interesting, thank you..

      between, as in the last step I tried saving the layout after setting the properties keeping the graph itself, but it gets reset back to default form after saving the layout. would you be able to advise?

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      You need to either Tick the default checkbox while saving the layout OR Give the saved layout name, in the selection screen layout field, like this, before executing.

      Capture.JPG

      Author's profile photo Former Member
      Former Member

      I did check Default settings check box  and provided layout field too,still graph properties gets refreshed.. πŸ™

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      May be the thing I observed was happening under some circumstances. My experience was with Z reports. I am not sure whether this would happen in graphs from standard reports.

      Author's profile photo Former Member
      Former Member

      Probably yes, I followed the given steps and it didn't happen as expected, its a z report only- anyhow, thank you for your kind response, appreciate it..

      your document was a good experience though..

      Author's profile photo Former Member
      Former Member

      Hi

      My recommendation is that you install last version of SAP GUI. Same issue happened to us and the solution was to update it.

      Best regards.

      Author's profile photo Praveer Kumar Sen
      Praveer Kumar Sen

      Nice document and very usefull.

      Thanks for sharing..

      πŸ™‚ Learning.

      Author's profile photo James Prabaharan
      James Prabaharan

      Dear Mr.Rao,

      Thank you for the knowledge sharing.

      Have you given any detailed method to address the KPA issue, which you have hinted-like using notification?

      Have a great day,

      James Prabaharan

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you James,

      Probably you were referring to my reply to Devendra on KRA/KPA. That was an idea for mapping in SAP if someone desires. We did not have to go for this. Our employee KPA system is browser based on asp. There might be standard ways in SAP-HCM which we do not have.

      You too Have a great Day.

      Jogeswara Rao

      Author's profile photo Former Member
      Former Member

      good job

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Sam πŸ™‚

      Author's profile photo Vamsi N
      Vamsi N

      Hi Jogeswara rao,

      Good stuff..

      Keep Blogging πŸ™‚

      Cheers πŸ™‚

      Vamsi

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Thank you Vamsi,

      πŸ™‚

      Author's profile photo Former Member
      Former Member

      Thank you Mr. Roa for the excellent guide on ALV graph. I am truly amazed with the detail level and completeness of this guide. Keep up your good work!

      If I may ask for a favour. Could you elaborate further how's X-Axis and Y-Axis being determined in the graph? And, how easy is it to swap X-Axis with Y-Axis?

      Thank you in advance. Cheers.

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      Hello Girish,

      A graph is drawn for a numeric field as Y axis vs a field selected by you for X-axis. This is DEFAULT arrangement. In other words this is the Default Graph type or Chart type system provides (Type name is Columns). For your requirement of swapping axes, indirectly you are asking for a different Chart type called Bars. For this, Right click anywhere in the chart area and click on Chart Type...  Now, when you click on any pattern you liked, your job is done. You will get a graph with swapped axes.

      Hope you can see this. It's simple.

      KJogeswaraRao

      Author's profile photo Former Member
      Former Member

      Hello Mr. Rao.

      Thank you for your reply. Now I understand how's system determines X-Axis.


      However, my question remain open for Y-Axis with the given scenario below in the context of Lines Graph.


      Assuming I have column A, B and C which are all numeric fields. I choose column A as X-Axis. Between column B and C, I would need system to choose column C as Y-Axis instead of column B. In this case, how do I explicitly tell the system?


      Hope you could enlighten me on this while I am still in the midst of figuring it out myself.


      Many thanks.

      Author's profile photo K Jogeswara Rao
      K Jogeswara Rao
      Blog Post Author

      There are 2 options for you.

      1. Hide column B

      OR

      2..Remove Totaling of this column by selecting and clicking on icon.

      Comments are closed.