Graph In ALV
hi,
How can we add Graph in ALV?
With Regards,
lijo Joseph
Additionaly, you can have a look at this
SAP Graphics Help
http://help.sap.com/saphelp_46c/helpdata/en/a1/d9883672d57c73e10000009b38f889/frameset.htm
data: begin of i_tab occurs 0,
name(5) type c,
value type p,
end of i_tab.
i_tab-name = 'SAP'.
i_tab-value = '40'.
append i_tab.
clear i_tab.
i_tab-name = 'MSN'.
i_tab-value = '30'.
append i_tab.
clear i_tab.
i_tab-name = 'CNN'.
i_tab-value = '27'.
append i_tab.
clear i_tab.
i_tab-name = 'ABC'.
i_tab-value = '56'.
append i_tab.
clear i_tab.
call function 'GRAPH_2D'
EXPORTING
TYPE = 'PI'
TITL = 'My Graph'
tables
data = i_tab
EXCEPTIONS
GUI_REFUSE_GRAPHIC = 1
OTHERS = 2
if sy-subrc <> 0.
endif.
Subramanian V.
Similar Messages
-
I need to plot a graph in which i have material number on the X-Axis and no. of days on the Y-axis.And i need to plot more than one graph using the same X and Y axis.How do i do that? please help...
Hi,
Check the link for process and sample code
Graphs in ALV
Regards,
anirban -
How to include Barcharts/graphs in alv report
Hi,
I need to create a graph with the help of ALV Grid control. I could able to activate the graphical option through clicking the 'GRAPH' icon in the ALV display.
But i am in need of changing the properties of graph(chart type / gridlines / chart options etc.,) display and also it have to be displayed automatically on executing the report. More than I need the graphical output in a single page with maximized window size.
Like Sub-Total / Sorting options are possible thru REUSE_ALV_GRID_DISPLAY i am in need of activating the Graph(chart) options automatically.
Thanks in AdvanceHi Subhakar,
Step by step procedure.
1) Create a PF status and call it, create a button for the Displaying Graph/Bar Chart.
2) In the main program include this code to handle cliking of your graph button.
3) Include the code like the below pseudo code.
data: begin of itab_graph occurs 0,
status_text(10) type c,
count1 type i,
count2 type i,
count3 type i,
end of itab_graph.
data: begin of i_graph_opt occurs 1,
c(80) type c,
end of i_graph_opt
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&DIS'.
write 'P2TYPE = PI' to i_graph_opt .append i_graph_opt.
write 'P2SCAL = X' to i_graph_opt .append i_graph_opt.
write 'P2PCNT = X' to i_graph_opt .append i_graph_opt.
write 'CLPALT = C' to i_graph_opt .append i_graph_opt.
write 'P3CTYP = CO' to i_graph_opt .append i_graph_opt.
write 'P3SCAL = X' to i_graph_opt .append i_graph_opt.
write 'P3LINS = X' to i_graph_opt .append i_graph_opt.
write 'TIFULL = X' to i_graph_opt .append i_graph_opt.
write 'TISIZE = 3' to i_graph_opt .append i_graph_opt.
write 'CLBACK = X' to i_graph_opt .append i_graph_opt.
" above few lines are options for setting the graph - customizing the view....
" Say P2TYPE = PI calls a Pie chart.
itab_graph-status_text = 'No of Jobs'.
itab_graph-count1 = count_1. "( may be ur totals and subtotals )
itab_graph-count2 = count_2.
itab_graph-count3 = count_3.
append itab_graph.
call function 'GRAPH_MATRIX_3D'
exporting
col1 = 'Text1'
col2 = 'Text2'
col3 = 'Text3
titl = 'Title of graph'
tables
data = itab_graph
opts = i_graph_opt.
clear itab_graph[].
endform.
Also refer function module documentatoon for complete understanding and usage.
Thanks,
Srinivas. -
Displaying custom graph in ALV report
Hi
Can you tell me how to display a custom graph for a column in a alv report.
That is adding a seperate button in the report and display a graph for a column when the button is clicked.
If 'Graph_2d' function module is used can anybody tell how to pass values to the function module and display the graph using the function module.
Thanks & regards
SaravanakumarHi,
check out the standard program GRDEMO_D for more understanding of teh usage of FM GRAPH_2D
regards,
theja -
Hi All,
I made alv report in which graph is there.when alv grid open and I select graph button then it is showing graph by column wise(default). Now I do right click on graph and select chart type and select LINES then it comes line wise. Now I want these LINES wise default.
can any body help me?
Thanks,
RakeshHi,
Have you been able to find a way to make this chart type default ?
Regards,
Mathieu -
Hi Experts
i have an ALV Report which is running successfully.
Now i want to diaplay the report through Graphs.
i want to Display the Graphs for this ALV Report through Seperate T-Codesee the following example
*& Report ZGRAPHS_3D
REPORT ZGRAPHS_3D.
TYPES: BEGIN OF ttab_data,
dataname(15),
quantity1 TYPE i,
quantity2 TYPE i,
quantity3 TYPE i,
END OF ttab_data.
TYPES: BEGIN OF ttab_options,
option(20),
END OF ttab_options.
DATA: itab_data TYPE TABLE OF ttab_data,
xtab_data LIKE LINE OF itab_data.
DATA: itab_options TYPE TABLE OF ttab_options,
xtab_options LIKE LINE OF itab_options.
xtab_data-dataname = 'Screws'.
xtab_data-quantity1 = 5500.
xtab_data-quantity2 = 6200.
xtab_data-quantity3 = 5900.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Nails'.
xtab_data-quantity1 = 3500.
xtab_data-quantity2 = 5200.
xtab_data-quantity3 = 4400.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Nuts'.
xtab_data-quantity1 = 1800.
xtab_data-quantity2 = 2200.
xtab_data-quantity3 = 1900.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Fastners'.
xtab_data-quantity1 = 5500.
xtab_data-quantity2 = 6200.
xtab_data-quantity3 = 5900.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Bolts'.
xtab_data-quantity1 = 3500.
xtab_data-quantity2 = 5200.
xtab_data-quantity3 = 4400.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Clamps'.
xtab_data-quantity1 = 1800.
xtab_data-quantity2 = 2200.
xtab_data-quantity3 = 1900.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Hand Tools'.
xtab_data-quantity1 = 5500.
xtab_data-quantity2 = 6200.
xtab_data-quantity3 = 5900.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Saws'.
xtab_data-quantity1 = 3500.
xtab_data-quantity2 = 5200.
xtab_data-quantity3 = 4400.
APPEND xtab_data TO itab_data.
xtab_data-dataname = 'Jigs'.
xtab_data-quantity1 = 1800.
xtab_data-quantity2 = 2200.
xtab_data-quantity3 = 1900.
APPEND xtab_data TO itab_data.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
titl = 'Usage in $'
col1 = 'Materials'
TABLES
data = itab_data
opts = itab_options. -
How to plot graph in ALV?
Hi,
Any expert there know how to code in ALV in order for it to plot graph?the following classes may help u
CL_GFS_GRAPH
CL_GFS_GRAPH_EDGE
CL_GFS_GRAPH_VERTEX
CL_GFS_JOIN_GRAPH
CL_GFS_JOIN_GRAPH_EDGE
CL_GFS_JOIN_GRAPH_VERTEX
example
data:
lr_def_rt TYPE REF TO cl_gfs_viewdef_rt,
lr_root TYPE REF TO cl_gfs_usage_tree_node,
lr_pre_it TYPE REF TO if_gfs_iterator,
lr_node TYPE REF TO cl_gfs_usage_tree_node,
lr_def TYPE REF TO cl_gfs_viewdef,
l_defname TYPE sfsg_definition_name,
lr_vertex TYPE REF TO cl_gfs_graph_vertex,
lr_gvert TYPE REF TO cl_gfs_join_graph_vertex,
lr_edge TYPE REF TO cl_gfs_join_graph_edge.
CREATE OBJECT lr_def_rt.
lr_root ?= lr_def_rt->mr_tree->get_root( ).
lr_pre_it = lr_root->preorder_iterator( ).
WHILE lr_pre_it->has_next( ) EQ abap_true.
lr_node ?= lr_pre_it->next( ).
lr_def ?= lr_node->get_viewdef( ).
l_defname = lr_def->get_name( ).
l_dist = lr_node->m_level * 5.
WRITE: AT l_dist icon_planning_table AS ICON.
WRITE: l_defname.
WRITE: AT 50 'AS', lr_node->m_alias.
NEW-LINE.
l_dist = l_dist + 5.
LOOP AT lr_node->mr_join_graph->mt_vertex_list INTO lr_vertex.
lr_gvert ?= lr_vertex.
IF lr_gvert->m_source_view = l_defname.
lr_tabdesc ?= lr_vertex->mr_data.
WRITE: AT l_dist icon_database_table AS ICON.
WRITE: lr_tabdesc->m_table_descr-table_name.
WRITE: AT 50 'AS', lr_tabdesc->m_table_descr-t_alias.
IF lr_gvert EQ lr_def_rt->mr_anchor_vertex.
WRITE: AT 70 '[X]'.
ENDIF.
NEW-LINE.
ENDIF.
ENDLOOP.
ENDWHILE.
lr_def_rt->get_paths(
IMPORTING
rt_paths = lt_path
LOOP AT lt_path INTO ls_path.
SKIP.
ULINE (113).
NEW-LINE.
WRITE: '|' NO-GAP, ls_path-path_name NO-GAP.
WRITE: '|' NO-GAP, AT 7 '|' NO-GAP, (10) 'Join Name' COLOR COL_HEADING NO-GAP, '|' NO-GAP,"#EC NOTEXT
(20) 'Left Table' COLOR COL_HEADING NO-GAP,'|' NO-GAP,"#EC NOTEXT
(20) 'Left Attr.' COLOR COL_HEADING NO-GAP,'|' NO-GAP,"#EC NOTEXT
(20) 'Right Table' COLOR COL_HEADING NO-GAP,'|' NO-GAP,"#EC NOTEXT
(20) 'Right Attr.' COLOR COL_HEADING NO-GAP,'|' NO-GAP,"#EC NOTEXT
(10) 'TYPE' COLOR COL_HEADING NO-GAP, '|' NO-GAP.
ULINE (113).
NEW-LINE.
LOOP AT ls_path-edges INTO lr_edge.
lr_join_d ?= lr_edge->mr_data.
SORT lr_join_d->mt_join_descrs BY j_no.
LOOP AT lr_join_d->mt_join_descrs INTO ls_join.
WRITE: '|' NO-GAP, AT 7 '|' NO-GAP, ls_join-join_name NO-GAP,sy-vline NO-GAP,
(20) ls_join-left_table_name NO-GAP,sy-vline NO-GAP,
(20) ls_join-left_table_attr NO-GAP,sy-vline NO-GAP,
(20) ls_join-right_table_name NO-GAP,sy-vline NO-GAP,
(20) ls_join-right_table_attr NO-GAP,sy-vline NO-GAP,
(2) ls_join-join_type NO-GAP.
IF ls_join-join_type EQ 'L'.
WRITE: icon_ps_relationship AS ICON NO-GAP.
ELSE.
WRITE: icon_cut_relation AS ICON NO-GAP.
ENDIF.
WRITE: AT 113 '|' NO-GAP.
NEW-LINE.
ENDLOOP.
ULINE (113).
NEW-LINE.
ENDLOOP.
ENDLOOP.
Message was edited by: Hymavathi Oruganti -
Need to help in alv grid graph
Hi All,
I made alv grid report.I put graph button in screen using pf status(&graph).
Now when I execute the report output come and my graph button is also working fine.But when I click
the graph button, the graph shows defalut column wise.Now I right click on graph and select chart type and then select LINES wise then graph shows LINES wise. Can we do default LINES wise so that
when I click on graph button then it should come LINES wise default.
Thanks,
RakeshHI,
You can do this using the FM GFW_PRES_SHOW
Check the sample program : DEMO_GFW_PRES_SHOW.
For more infomation:
refer to links:
Re: How to plot graph in ALV?
http://help.sap.com/saphelp_erp2005/helpdata/en/7e/daf830b46411d2961200a0c9308b1f/frameset.htm
hope this infromation helps you.
Thanks! -
ALV Graphs: How to set line type graph as default graph
Hi All,
I need to develop a line graph. The fields on the X-axis will change dynamically. Some times they may be 10 field and some times they may be more than 100 fields. I tried with Function Module GFW_PRES_SHOW_MULT. But I can only display maximum 32 fields. Can anyone tell me exact program which helps me to full fill my requirement. It will be a great help if you could told how do display line type graph as default graph in ALV. In REUSE_ALV_GRID_DISPLAY there is a Exporting parameter MT_CHART_TYPES but this help you only to enter description for X-axis and Y-axis.
Many thanks in advance.I would call GRAPH_MATRIX_2D with options depending on representation you wish
look at the program GRBUSG_1 to see how to use it
there you have some options to display bar chart, but you could use other values (complete list of options is available in documentation of function module GRAPH_MATRIX_2D - click on parameter OPTS in help display to see full explanation)
exemple:
P2TYPE = LN to display lines -
Is there any example report where I can look for programming the result of an alv in a graph?
Hi,
Please refer to these links,
Graph in ALV Grid
graph in alv grid report
with regards,
Mamta -
About filter in alv grid display
Hi,
I am practicing on REUSE_ALV_GRID_DISPLAY in that i want to know about how to use some fields like
*ITFILTER*_
IT_ALV_GRAPHICS
IT_HYPERLINK
IT_ADD_FIELDCAT
IT_EXCEPT_QINFOHi Rock.
I would like to suggest you a couple of references which quite relate to your case,
REUSE_ALV_GRID_DISPLAY - Output of a simple list (single-line)
[SDN - Reference for Using REUSE_ALV_GRID_DISPLAY - Basic Program|alv prog;
[SDN - Reference for Use of IT_FILTER in REUSE_ALV_GRID_DISPLAY |Doubts in ALV?;
[SDN - Reference for use of IT_FILTER with CODE in REUSE_ALV_GRID_DISPLAY|ALV Report;
[SDN - Refernce for Using IT_ALV_GRAPHICS in REUSE_ALV_GRID_DISPLAY|OOPs : SAVE and ALV Display Variant;
[SDN - Reference for Editing a graph in ALV (IT_ALV_GRAPHICS) using REUSE_ALV_GRID_DISPLAY|Edit Graph display ALV list display;
[SDN - Reference for use of IT_HYPERLINK in REUSE_ALV_GRID_DISPLAY|editable fields on ALV grid;
[SDN - Reference including example of IT_ADD_FIELDCAT in REUSE_ALV_GRID_DISPLAY|building top of page in ALV list;
[SDN - Reference for scenario for use of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|Background ID in ALV Grid;
[SDN - Reference for application example of IT_EXCEPT_QINFO in REUSE_ALV_GRID_DISPLAY|PF Status in ALV list.;
Hope That's Usefull.
Good Luck & Regards.
Harsh Dave -
Hi all,
I want to display a graph in output by comparing data in two alv's which are displayed in the same screen .
__Ranjitsee this thread.
Graph In ALV
http://help.sap.com/saphelp_bw33/helpdata/en/5d/ad993888a5b268e10000009b38f8cf/content.htm -
Graph with 2 y axes and x axis (x , y1 , y2)
Hello,
I have a requirement to show a graph in a alv grid(using oops) report. The graph will have two y-axis that will represent two different scales.(For examle axis Y1 will have Volume & axis Y2 will show price). Can we make such a graph in ALV? Please point out how we can go about to do the same.<b> Any sample code will be appreciated.</b> We are using a customised toolbar and the standard tool bar is disabled.
| ...........................|Y2(Value in $)
Y1(Volume)...........
X-axis(Date)
Points will be rewarded.
Note - We will be using Line graphs in this case.What happens in your sequence structure is that the second fame overwrites the data from the first case.
You should create your two data-sets, and build an array of those, feed this into a for loop and then per data set, select the proper:
-plot (ActPlot)
-Y-scale (Plot.ScaleIdx)
-Y-scale to edit (ActYscl)
Then set the max and min, be aware that the second Y-scale should be created before running this code.
Another option would be to just auto-scale the Y-scales.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
Two Doubt abt Area Menu and Conv from C to I
Hello Guys,
I have two doubt can some one help me on the same.
1. I have created one area menu , added all T code in that and it is successfully move to prod. server. problem I am facing is that when user click on the t code
it give message <b>Transaction does not exist.</b>. Although T code available and user have right to access the same.
2. I have created one ALV in which I have shown AUSP-ATWRT value, which of type character but in our case we have numeric value over there. I am taking that value . But when End user want to take the Graph from ALV it's show nothing. Because value is character. Now I have change the type of Internal table variable as I. But it creating problem and giving Dump.
Please provide me valuable suggestion.
Regards
Swati..Hi,
Field mentioned by you is char type in DD so it will not be displaye as number in graph.
So you can convert that field using function like CK_AND_CONVERT_NUMERICS to numeric.
Hope this will help you.
Reward all help ful answers.
Jogdand M B -
hi all,
can anyone let me know how to print alv line graph .
wat i want is print option in zcopy of pgm GFW_PROG_PRES_SHOW_MULT.
regards
Avik NayakOn Thu, 11 May 2000 17:39:54 GMT, Steve Drake
wrote:
>Hello everyone. I have LabView printing an XY graph but it always
>wants to print in Portrait mode. I set the defaults of the printer to
>LandScape mode and still go a Portrait printout. Is there anyway
>to force LabView to print in LandScape mode? This will help the graph
>be more readable.
>
Hi, well after some playing around and touching things that I though
shouldn't make a difference I got it to print in Landscape mode. On
the VI's front panel menu File-Print I switched that to LandScape mode
and what do you know it printed the graph out in LandScape mode.
Now I want to manipulate the fonts on the graph. I have messed with
the cursors and I can put x axis lines
on the chart with a time value
but the text I'm putting up is small so I need a bigger font and I
need to get the text out of the graph itself.
Is there anyway to print the cursor titles vertical instead of
horizontal to the x axis. Thought I would ask anyway.
Thanks to anyone who already knew how to do this.
Regards,
Steve Drake
Maybe you are looking for
-
the built-in keyboard on my macbook is not functioning right, the number keys when pushed display the special characters instead of the numbers, the caps button doesn't work at all, the letter buttons display capitals when pushed whether the caps but
-
I cant download itunes to my pc
i download itune and when i try to open its says the program is not working what can i do about it.
-
I've asked this before, but the spinning wheel is still there and sometimes it freezes up to where I have to shut it down manually. Can someone tell me how to fix this!! I dont really know how to find certain places to check on things.
-
Multiple NW instances of different versions on same server
Hello, Our current landscape has two NW 7.2 Java AS instances installed on a single server. This solution works well for us, as one instance functions as our Dev server and the other functions as the QA. I am looking to upgrade to NW 7.3 EP1. Is it p
-
After Effects CC won't open on Mac OS X.9
I'm trying to use my first CC installed app – After Effects 12.2 CC – and can't get it to start. I installed the program then updated to the latest version (12.2) Messages below related to loading preferences on startup. Mac OS X.9.3. MacBookPro dual