REPORT zpwtest1 .
DATA : i_html TYPE w3htmltabtype,
g_url TYPE w3url .
DATA: g_html_control TYPE REF TO cl_gui_html_viewer .
START-OF-SELECTION .
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'PF01' .
SET TITLEBAR 'TIL01' WITH 'Sample'.
IF g_html_control IS INITIAL .
CREATE OBJECT g_html_control
EXPORTING
parent = cl_gui_container=>default_screen.
PERFORM bar_chart .
CALL METHOD g_html_control->load_data
EXPORTING
type = 'text'
subtype = 'html'
IMPORTING
assigned_url = g_url
CHANGING
data_table = i_html
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHOD g_html_control->show_url
EXPORTING
url = g_url.
ENDIF .
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
IF sy-ucomm = 'BACK' .
CLEAR g_html_control .
FREE g_html_control .
LEAVE TO SCREEN 0 .
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Form BAR_CHART
*&---------------------------------------------------------------------*
FORM bar_chart .
DATA lv_html TYPE string .
CONCATENATE
'<html>'
'<body>'
'<img src="http://chart.apis.google.com/chart?'
* Data
'&chd=t:10,20,90,40,70,60,50,40,20,40'
* Chart Type
'&cht=bhs'
* Size
'&chs=700x350'
* Scale
'&chds=0,100'
'&chxt=x,y'
'&chxl=1:|Dollar|Yen|Pound|Franks|Euro|Ruble|Peso|Dirham|Rupee|Dinar|'
'0:|0|10|20|30|40|50|60|70|80|90|100'
* Chart Heading
'&chtt=Sample+Bar+Chart'
* Backgroud lines
'&chg=10,0'
'&alt="Sample chart" />'
'</body>'
'</html>'
INTO lv_html .
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = lv_html
i_tabline_length = 255
TABLES
et_table = i_html.
ENDFORM. " BAR_CHART
List of All Blogs
-
►
2008
(39)
-
►
July
(9)
- Display ListBox in Parameter of Selection Screen
- Important EDI Transactions and Programs
- Hide F8 Button on Selection Screen
- Find Obsolete Function Module
- Sample RS_COVERPAGE_SELECTIONS
- SAP ABAP Dynamic Internal table and Processing 02
- SAP ABAP Dynamic Internal table and Processing 01
- Smartform/Sapscript Page Counter - Mode
- SAP SD Pricing Overview
-
►
June
(12)
- Transporting Table Entry
- Sample/Demo code availble in SAP
- SELECT-OPTION in Module Pool Screen
- Add your own pattern in SE38
- Call Transaction in New Window
- Minimum Code Required to Send SAP Mail
- Calculate Tax of Purchase order Line Item
- Send report as attachment in background
- Button on Selection-Screen
- Displaying Two ALV Grid on Screen
- Function Module for getting information of Diction...
- HR ABAP 02 - Getting Started - LDB PNP
-
►
July
(9)
Useful Links
Categories
Abap Objects
ALV List
Config
Dynamic
EDI
Excel
Formatting
HR ABAP
MD04
Module Pool
OLE Automation
Open Dialog Box
Quick Reference
Report
Sample Code
SAP ABAP
SAP FI
SAP Mail
SAP MM
SAP Notes
SAP SD
Sapscript
Selection-Screen
Smartforms
Standard Text
Translation
Tutorial
Upload Download
Utility
Web service
xml to ABAP
XSLT
You are most welcome to use any information available in this blog. Any usage of the information or sample code is at your own risk. I do take care of accuracy and relevance of blog before publishing. However, I do not guarantee that information and code are accurate and bug free, their can be alternate and better way of doing same thing so please use information as reference only. Relevance of code and instructions can possibly change with time, check the blog post date before using this information. This is my personal blog, recommendation and opinions expressed in this blog are mine and not of any company of any of my employer.
I do moderate comments and publish as soon as I check them. You can post questions as well, which I will try best to solve. I will anyway publish your questions in case others readers might have answer.
Thanks for coming here and reading the blogs :)
I do moderate comments and publish as soon as I check them. You can post questions as well, which I will try best to solve. I will anyway publish your questions in case others readers might have answer.
Thanks for coming here and reading the blogs :)
Saturday, July 4, 2009
Render Charts in SAP using Google Chart API
Labels:
Sample Code,
SAP ABAP
Subscribe to:
Post Comments (Atom)
1 comments:
Great idea
Post a Comment