‎2014 Dec 02 12:18 PM
Hi everybody,
One of the client i am working for has the following requirement.
1. Draw a pie chart
2. Display it in adobe forms.
I was able to draw a pie chart using the FM "GFW_PRES_SHOW" but i am unable to dip lay the percentage
against the color in the chart...please let me how to display the percentage...if it is not possible using the above
FM please let me know alternative way how to achieve this.
pleas also let me know how to add this pie chat to the adobe forms.I have searched a lot over net but could not
find a suitable solutions.
Thanks
Bhargava
‎2014 Dec 02 12:42 PM
Hi Bhargava,
Have a look at program GFW_PROG_PIE.
This will help you to partition the colour based on your percenatge . (Copy this program and customize it . change the values in the form FILL_DC in your customized program.
Regards,
Saddam.
‎2014 Dec 02 1:17 PM
Hi kazmi,
I have tried the program but i am unable to show the % vale in the colored portion of the PIE chart.
‎2014 Dec 02 12:51 PM
‎2014 Dec 02 12:58 PM
Hi jaydeep,
I have tried all the threads you have posted above.....i was able to draw the pie chart but unable to represent the % value in the diagram. please help me in how to achieve it.
‎2014 Dec 02 1:49 PM
Hi,
You can label your chart area as follow, will this do ?
Regards,
Jaydeep
‎2014 Dec 02 5:52 PM
‎2014 Dec 02 6:07 PM
Hi,
you can use fm ' GRAPH_MATRIX_2D' .
here is sample code.
DATA: BEGIN OF data OCCURS 1,
text(36),
feld1 TYPE p,
END OF data,
BEGIN OF opts OCCURS 1,
c(80) TYPE c,
END OF opts,
BEGIN OF tyear OCCURS 1,
c(20) TYPE c,
END OF tyear.
opts-c = 'P2TYPE = PI'.
APPEND opts.
data-text = 'X 10'.
data-feld1 = '10'.
APPEND data.
data-text = 'Y 20'.
data-feld1 = '20'.
APPEND data.
CALL FUNCTION 'GRAPH_MATRIX_2D'
TABLES
data = data
opts = opts
tcol = tyear
EXCEPTIONS
col_invalid = 1
opt_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Or you can take reference of GRBUSG_1 .
‎2014 Dec 03 4:57 AM
Hi jaideep,
Thanks for your code... it will solve one of my two qureis mentioned above...
please let me know if there is any way to place this image in the Adobe forms....
‎2014 Dec 03 8:28 AM
Dear bhargava dns,
I'm sorry, but I might not be able to help you with this because my system is not config with adobe service.
Regards,
Jaydeep
‎2014 Dec 02 6:37 PM
hi bhargava,
inpired by jaydeep patel.
I have got the output as per your requirement.
please check blow code.
REPORT ZR_PIE_CHART2.
DATA: BEGIN OF data OCCURS 1,
text(36),
feld1 TYPE p,
perc TYPE i,
END OF data,
BEGIN OF opts OCCURS 1,
c(80) TYPE c,
END OF opts,
BEGIN OF tyear OCCURS 1,
c(20) TYPE c,
END OF tyear.
opts-c = 'P2TYPE = PI'.
APPEND opts.
data-text = 'X 10'.
data-feld1 = '10'.
APPEND data.
data-text = 'Y 20'.
data-feld1 = '20'.
APPEND data.
data total type i.
data perc1(20) type c.
loop at data.
total = total + data-feld1.
ENDLOOP.
loop at data.
data-perc = ( data-feld1 / 30 ) * 100.
perc1 = data-perc.
CONCATENATE perc1 '%' into data-text.
modify data.
ENDLOOP.
CALL FUNCTION 'GRAPH_MATRIX_2D'
TABLES
data = data
opts = opts
tcol = tyear
EXCEPTIONS
col_invalid = 1
opt_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.