**Fusion Financial Cloud**
**的报表开发**
Oracle Fusion Cloud中有以下四种常用的报表工具。本文主要对Fusion中的Financial
Reporting以及BIP工具进行报表开发步骤进行了详细描述。
• Financial Reporting
FR基于 Oracle 财务报告构建 Web Studio 使用 Oracle General Ledger
余额多维数据集中的数据。使用FR能设计传统的财务报告格式,如资产负债表, 损益表和现金流量表。也可以设计财务或分析数据的非传统报告,包括文本和图形。
• Smart View
Smart View是一个基于Excel的实用程序,使总账用户能够结合Excel工作表的功能,分析实时GL余额。这些工作表直接连接到 Essbase。
• Oracle Transactional Business Intelligence(OTBI)
OTBI是一种灵活且易于使用的分析工具,有助于实时了解交易数据,它是可以直接从Fusion应用程序数据查询的实时在线报告工具。可以简单地从主题区域拖放所选数据并使用不同的图形视图,而不是构建SQL查询,业务用户可以通过个性化轻松创建报表和仪表盘。它侧重于交易和运营数据,如发票、付款和资产。
• BIP
BIP通过SQL直接访问Oracle数据库,可以生成大量事务性和操作性打印报告。
**一、 使用Financial Reporting生成报告:**
下面用以下格式的报表为例,简述使用Financial Reporting做成报表的流程
**1\. 启动Financial Reporting Web Studio**
在【财务报告中心】的工作区中,选择【任务】面板选项卡,点击【打开财务报表的工作空间】。在“工具”菜单上,选择【启动Financial Reporting
Web Studio】
**2.做成报表主体**
a) 在【文件】菜单上,依次选择【新建】>【报表】。
b) 在工具栏上,单击【Grid】图标,并选择“数据源”列表,FR中的数据源基于Fusion系统中设定的会计科目表。
c) 数据源选择完成之后,单击【确定】,将打开“尺寸布局”对话框,将“部门”拖动到行轴,将“科目”拖动到列轴。
d) 报表主体布局调整完成之后,为所选行列的项目选择具体的值。
\- 双击“部门”单元格,“选择成员”对话框打开,选择相应的值并将其移动到选定区域。
\- 双击“科目”单元格,“选择成员”对话框打开,选择相应的值并将其移动到选定区域。
**3\. 显示报告名称**
在报表layout中,有Header,Body,Footer三部分显示区域。报表主体一般在Body中创建。在Header中创建一个Text文本框显示,输入报表名称
**4\. 显示报表日期以及会计期间**
a) 在Header中创建一个Text文本框,在该文本框内使用FR内置函数(<>)获取当前报表日期
b) 在Body中创建一个Text文本框(该文本框布局在报表主体之前),使用FR内置函数(<>)获取当前显示余额表的会计期间
**5\. 插入合计行,列**
a) 右键单击最后一行标题,选择插入行,然后选择公式。
b) 击新行,在标题行属性窗格中, 选择自定义标题选项, 输入“合计”,然后单击更新图标。新标题“合计”就会显示在报告中。
c) 在编辑栏中,单击 Sum(0) 按钮并在公式中输入公式Sum(行号),其中行号为1,2,3…
**6\. 插入合计列**
合计列的添加方式与合计行类似,合计列的公式为Sum(列标),其中列标为A,B,C…
**7\. 针对报表中所有的视点(POV)都需要为其选择相应的数值后,报表数据才可以正常显示**
**8\. 若有需要,可报表格式进行调整,比如背景色,线条格式,各种属性设定等等。**
**二、 使用BIP生成报告**
**1\. 数据源Data Model做成**
a) 在Fusion主页【工具】中进入【报告和分析】画面,按下右上的按钮【浏览目录】。点击【创建】>【数据模型】
b) 用SQL查询的类型定义数据集。选择【数据集】>【SQL查询】链接,显示数据集定义画面,在必须项目中输入适当的内容,按下【OK】。
c) 追加参数,用于查询
在【数据集】>【参数】中,选择【新建】,输入参数名称,类型等
d) 定义值列表
在值列表中定义一组值,该值允许报告使用者选择要传递给数据源的参数值。 定义Menu类型的参数后,这里定义的值列表会呈现选择菜单。
e) 关联参数和值列表
在参数中,将参数类型选择为Menu,并在Menu窗口中指定相应的值列表
f) 在数据页签下,指定参数具体值,按下【显示】按钮,显示数据。 确认数据无误后,按下【导出】按钮,导出XML文件后保存在本地
**2\. 在Word中,使用BIPublisher插件,上传上述导出的XML文件,并根据需求编辑Layout,生成RTF文件。** (与EBS
BIP报表开发相同,在此不做赘述)
**3\. 将第2步做成的RTF模板导入Fusion Cloud,生成报表**
a) 在【报告和分析】画面中,点击【创建】>【报表】,进入“报表生成”画面
b)
选择【使用数据模型】图标后,在数据集选择框中选择步骤1中已经做成的数据模型,在“您希望如何创建报表?”列表下选择【使用报表编辑器】,然后点击完成并保存报表
c) 在报表Layout画面,上传步骤2中做成的RTF文件
**三、 使用Smart View生成报表**
1\. 如果要使用SmartView,需要安装Excel SmartView插件。
在【财务报告中心】的工作区域中,选择【任务】面板标签,点击【打开财务报表的工作空间】,在【工具】⇒【安装】中点击下载【Smart View】插件,并安装。
插件安装完成之后,打开Excel后,会出现【SmartView】选项卡
**2\. 设置共享连接URL**
在【SmartView】选项卡下,选择【选项】,选项面板打开,然后在【高级】>【共享连接URL】中输入指定的URL
**3\. 用Smart View连接到Oracle Fusion General Ledger Balances**
a) 单击【Smart View】选项卡,然后选择【面板】图标。Smart View窗格随即打开,单击任务窗格上的【共享连接】按钮,使用用户名和密码登录。
b) 单击选择服务器列表图标,下拉列表中将显示两个值:Oracle Essbase,Oracle Hyperion Financial
Reporting。从列表中选择 Oracle Essbase 的共享连接后,Oracle Essbase服务器展开,显示多个多维数据集的会计科目表。
c) 然后选择相应会计科目表下的【db】,然后选择【连接】即可
**4\. Ad-Hock分析表做成**
a) 连接到db后,选择【Ad-Hock分析】,然后Excel中出现Essbase选项卡,在该选项卡中选择【POV】
b) 针对POV的各个维度,选择相应的值,并且上图中行列的维度可以替换为POV中的任意维度
c)
如果需要针对不同账户,生成不同的分析表,在Essbase选项卡中选择【级联】,选择【同一工作簿】,在打开的“级联成员选择”窗口中,【Account】选择需要分析的值后,选择【OK】。那么则会针对每个账户值,在多个Sheet中生成不同的分析表
**5\. 使用查询设计器定义报告**
a) 连接到db后,选择单元格,单击右键,点击“查询设计器”,在POV窗口中,可以将POV任意视点拖拽到行列维度中
b) 然后针对行列维度项目以及所有POV项目,选择相应的值
c) 在POV窗口中,选择【适用查询】,则EXCEL中就会生成相应的报表
d) 选择标题单元格,Essbase选项卡中选择【Zoom In】时,则该标题对应的子成员会在Excel中追加显示
e) 选择标题单元格,Essbase选项卡中选择【Zoom Out】时,其子项目会变成相应的父项目显示
**6\. 在SmartView中用Financial Reporting作为数据源生成报表**
a) 在3-b)中,如果下拉列表选择【Oracle Hyperion Financial
Reporting】,则可选择Fusion中现存的Financial Reporting,然后点击【打开】,出现“导入Workspace文档”窗口
b) 对于各个POV项目选择相应的值之后,点击【完成】,Excel中就会显示出该报表
**7\. 做成Smart View报表之后,如果需要获取最新数据,则在Essbase选项卡中选择【刷新】,则可获取Fusion中的最新数据**
**
**
**8\. 在Smart View中,显示的报表数据格式可以通过Excel进行设定,**
比如:将金额格式设置为“¥999,999,999”后,在Essbase中选择【保持格式】,那么之后刷新数据后,数据格式保持不变
**四、 使用OTBI生成报表**
OTBI是从主题区域拖放所选数据并使可以用不同的图形视图(下文只做简单说明)
**1\. 进入OTBI创建画面**
在Fusion主页【工具】中进入【报告和分析】画面,按下右上的按钮【浏览目录】。点击【创建】>【分析】
**2\. 选择主题区域**
a) 主题区域可以选择单个,也可以根据需求,选择多个
b) 每个主题区域都有一个事实文件夹和维度文件夹。文件夹可以有子文件夹。例如,“总帐 - 实时日记帐”主题区域中的“日记帐行”文件夹具有多个子文件夹
如帐户、行详细信息和行。
c) Fact:度量值或指标。报告通常至少包含一个Fact字段
d) 维度:为事实列提供上下文。维度是描述性的。
e) 事实文件夹:包含事实数据列,通常在列表中排在最后 文件夹,通常以主题区域命名
f) 维度文件夹:包含属性和Level列
**3\. 从选择的主题区域中,选择相应的字段显示**
**
**
**4\. 选择Layout,可以选择表格或者图表展示数据**
**
**
**5\. 分析中可以创建prompt字段,用于生成报表参数**
※由于项目环境的限制,本篇文章涉及到系统截图的部分均用文字描述。
作者:张 祎
审核:梁 超
编辑:朱思聪
以下内容整理自 SAP 官方 ABAP 速查表(主题:ABAP for Cloud Development),作为本文的扩展补充资料。
This ABAP cheat sheet briefly outlines the terms ABAP Cloud and classic ABAP to get an idea about ABAP for Cloud Development. It provides references to more detailed information on the topic.
SE80, SE24 etc. you may know from classic ABAP)[!NOTE] - See more information in the topic ABAP Language Versions, Release Contracts and Released APIs. - See the topic Language Elements in ABAP Versions that provides a table showing which ABAP language elements are allowed in which ABAP language version
1) If available to you, you have accessed an SAP BTP ABAP environment using ADT.
Access to SAP-provided repository objects is restricted to objects that have been released for ABAP for Cloud Development (released APIs). You can find the released repository objects in the Project Explorer view in ADT under Released Objects:

As an example of a released API, consider the CL_ABAP_RANDOM_INT class (computes random integers). In ADT, once you have opened the class, check the Properties tab. Click API State on the left to display information about the release contracts. In this case, it is C1. As mentioned above, see here for more information on C1, and so on. This is also true for ABAP repository objects in classic ABAP.

For deprecated and invalid syntax in ABAP for Cloud Development, refer to the following (nonsensical) example code. You can create a demo class and insert the code below (adjust the class name if necessary). Several syntax errors and warnings will be displayed:
CLASS zcl_demo_abap DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS zcl_demo_abap IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
"Example that demonstrates (not) released APIs, deprecated and
"invalid syntax in ABAP for Cloud Development
"Released DDIC data elements
DATA dobj1 TYPE timestampl.
DATA dobj2 TYPE land1.
"Attributes of the accessible type pool ABAP
DATA flag TYPE abap_boolean.
flag = abap_true.
"Released table types
DATA it1 TYPE string_table.
DATA it2 TYPE string_hashed_table.
DATA it3 TYPE xstring_table.
"Released CDS object
DATA s1 TYPE i_timezone.
"Released interface
"The if_oo_adt_classrun interface is released, and you can implement it to run an ABAP class.
"In ADT, you can do this by choosing F9. To output the content of data objects, you can use
"out->write( ... ). in the main method.
DATA ref_classrun TYPE REF TO if_oo_adt_classrun.
"Not released DDIC database table
DATA s2 TYPE scarr.
"Classes
"(Not) Released classes
DATA(ixml1) = cl_ixml_core=>create( ).
"Not released (API for classic ABAP)
DATA(ixml2) = cl_ixml=>create( ).
"Getting a random integer
DATA(random_num) = cl_abap_random_int=>create( seed = cl_abap_random=>seed( )
min = 1
max = 100 )->get_next( ).
"Released APIs from the XCO library
"Retrieving the current user date
DATA(user_date) = xco_cp=>sy->date( xco_cp_time=>time_zone->user
)->as( xco_cp_time=>format->iso_8601_extended
)->value.
"Retrieving the current user time
DATA(user_time) = xco_cp=>sy->time( xco_cp_time=>time_zone->user
)->as( xco_cp_time=>format->iso_8601_extended
)->value.
"Not released API: Querying whether the current database supports AMDP methods
DATA(amdp_allowed) = xsdbool( cl_abap_dbfeatures=>use_features(
EXPORTING requested_features = VALUE #( ( cl_abap_dbfeatures=>call_amdp_method ) ) ) ).
"ABAP SQL statements
"Selecting from a
"... not released database table
SELECT carrid, connid FROM spfli WHERE carrid = 'LH' INTO TABLE @DATA(spfli_tab).
"... released CDS view
SELECT SINGLE * FROM i_timezone WHERE TimeZoneID = 'EST' INTO @DATA(tz_info).
"... not released database table using a dynamic ABAP SQL statement
"Although the source code provides an invalid data source, the dynamic ABAP SQL statement
"does not produce a syntax error during compilation. However, it would result in a runtime
"error because you cannot select from that data source. You can check the validity of dynamic
"specifications using the `cl_abap_dyn_prg` class, which supports dynamic programming.
SELECT SINGLE carrid, connid FROM ('SPFLI') WHERE carrid = 'LH' INTO NEW @DATA(ref_spfli_tab).
"ABAP SQL Statement involving client handling; using a cheat sheet database table
"The addition `USING CLIENT` for client handling is not allowed in the restricted ABAP language scope.
DATA(clnt) = sy-mandt.
SELECT carrid, connid FROM ('ZDEMO_ABAP_FLI') USING CLIENT @clnt WHERE carrid = 'LH' INTO TABLE NEW @DATA(ref_demo_tab).
"The example includes a selection of deprecated and invalid syntax in ABAP for Cloud Development. They are added
"for demonstration purposes. For example, classic UI technology-related (such as dynpro) syntax is not allowed.
"The pointless WRITE statement within the method implementation represents invalid classic list-related statements.
"Executable programs (reports) are not allowed in the restricted ABAP language scope. To set breakpoints in ADT,
"double-click the area to the left of the code line number.
"Assignments
DATA(num1) = 1.
DATA(num2) = 1.
DATA(num3) = 2.
"Invalid statement for an assignment
MOVE num3 TO num1.
"Using the assignment operator
num2 = num3.
"Determining the number of lines in an internal table
DATA(str_table) = VALUE string_table( ( `a` ) ( `b` ) ( `c` ) ).
DATA(num_lines1) = lines( str_table ).
"Invalid statement
DESCRIBE TABLE str_table LINES DATA(num_lines2).
"Getting references
DATA: ref1 TYPE REF TO i,
ref2 TYPE REF TO i.
ref1 = REF #( num1 ).
"Deprecated statement
GET REFERENCE OF num1 INTO ref2.
"Classic ABAP-related statements and syntax
"Various sy components should not be used in ABAP for Cloud Development
DATA(current_as_abap_time) = sy-uzeit.
DATA(current_as_abap_date) = sy-datum.
DATA(current_local_time) = sy-timlo.
"Various invalid statements
DATA scarr_tab TYPE TABLE OF scarr WITH EMPTY KEY.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(alv)
CHANGING t_table = scarr_tab ).
"The exception class is not released, too.
CATCH cx_salv_msg.
ENDTRY.
DATA code TYPE string_table.
READ REPORT 'ZCL_DEMO_ABAP_UNIT_TEST=======CCAU' INTO code.
WRITE 'hi'.
BREAK-POINT.
ENDMETHOD.
ENDCLASS.2) If available to you, you have accessed a system supporting classic ABAP using ADT. It is assumed that the latest ABAP release is available.
a) Checking API status information
CTRL + SHIFT + A to open the search in ADT. Search the class CL_ABAP_RANDOM_INT. Once you have opened the class, check the Properties tab and find the API status information. b) Creating an example class
For the example class created, check the information in the Properties tab. Choose General. The ABAP Language Version is maintained as Standard ABAP: 
Z.... You should not see any syntax errors. Activate the class. BREAK-POINT statement and the debugger should have started. Choose Terminate to exit the debugger.c) Verifying cloud-readiness of your code in classic ABAP
ABAP_CLOUD_READINESS for this purpose.ABAP_CLOUD_READINESS in the pop-up window and choose Ok. The ATC check run is started. d) Cloud-ready development in classic ABAP
3) In a class using the ABAP language version ABAP for Cloud Development, you can insert the following code snippet.
CL_ABAP_PROB_DISTRIBUTION class, which generates random numbers from various probability distributions and performs probability calculations. It extracts 10 distinct random integers from the range of 1 to 100 and stores them in an internal table. The range table is typed with TYPE RANGE OF i. CL_ABAP_PROB_DISTRIBUTION is set as C1 at the time of creating the example. The code snippet will generate a syntax warning because the compatibility of the specified type is not guaranteed. This issue arises from the range table typed with TYPE RANGE OF i, while the get_uniform_int_distribution method requires a range table of type if_abap_prob_types=>int_range. At the time of creating this example, if_abap_prob_types=>int_range corresponded to TYPE RANGE OF i. However, a warning is displayed, as the type might be extended in the future, potentially breaking the code. When you comment out the type defined with TYPE RANGE OF i and use the type defined with if_abap_prob_types=>int_range, the syntax warning disappears. TYPES ty_range TYPE RANGE OF i.
"TYPES ty_range TYPE if_abap_prob_types=>int_range.
DATA(range) = VALUE ty_range( ( sign = 'I' option = 'BT' low = 1 high = 10 ) ).
DATA(nums) = REDUCE if_abap_prob_distribution_int=>random_numbers(
LET rng = cl_abap_random=>create( cl_abap_random=>seed( ) ) IN
INIT numbers = VALUE if_abap_prob_distribution_int=>random_numbers( )
myrange = range
number = 0
dist = cl_abap_prob_distribution=>get_uniform_int_distribution( range = range )
FOR i = 1 UNTIL i > 5
NEXT number = dist->next_random_number( rng )
numbers = VALUE #( BASE numbers ( number ) )
myrange = VALUE #( BASE myrange ( sign = 'E' option = 'EQ' low = number ) )
dist = cl_abap_prob_distribution=>get_uniform_int_distribution( range = myrange ) ).[!NOTE] - The executable example ... - does not focus - unlike other ABAP cheat sheet examples - on ABAP syntax as such (the other non-Standard-ABAP cheat sheet examples focus on ABAP syntax available in ABAP for Cloud Development), but rather emphasizes released APIs and libraries that provide predefined functionality and can be used in ABAP for Cloud Development. In particular, the Extension Components Library (XCO) is used. - covers an arbitrary selection for you to explore. For more detailed information and code snippets, see the SAP Help Portal documentation here and here about XCO. In most cases, the example covers a selection of classes and methods for retrieving information about repository objects. It is more of a "playground" for exploring the APIs with a few snippets of code, and should be seen as an invitation to more in-depth exploration. - The steps to import and run the code are outlined here. - Disclaimer
19_ABAP_for_Cloud_Development.md。版权归原作者所有。