CN115906783A - SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology - Google Patents

SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology Download PDF

Info

Publication number
CN115906783A
CN115906783A CN202211416142.7A CN202211416142A CN115906783A CN 115906783 A CN115906783 A CN 115906783A CN 202211416142 A CN202211416142 A CN 202211416142A CN 115906783 A CN115906783 A CN 115906783A
Authority
CN
China
Prior art keywords
excel
doi
function
report
creating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211416142.7A
Other languages
Chinese (zh)
Inventor
郭颖
冷宝剑
王庆祥
盛琪
刘晓进
吴卫亮
张倩
张宇惠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tangshan Huitang Iot Technology Co ltd
Original Assignee
Tangshan Huitang Iot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tangshan Huitang Iot Technology Co ltd filed Critical Tangshan Huitang Iot Technology Co ltd
Priority to CN202211416142.7A priority Critical patent/CN115906783A/en
Publication of CN115906783A publication Critical patent/CN115906783A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for directly generating an EXCEL report form by utilizing a DOI technology based on an SAP platform, which comprises the following steps: step S1, creating an include program for functional encapsulation, so as to facilitate program calling; s2, a DOI call function is created, an EXCEL report form template in an SAP system library is taken according to the entrance parameters, and the template display is carried out; s3, creating an EXCEL cell data filling function; s4, creating an EXCEL storage function; step S5, creating functions of a function menu function, namely 'return' and 'save'; the method for directly generating the EXCEL report by utilizing the DOI technology based on the SAP platform realizes the generation of the user configuration and the rapid issuing of the EXCEL report and the data export by means of the SAP platform packaging technology and the DOI technology, realizes that a user can design a template by himself, and realizes the purposes of improving the development speed, shortening the development time and shortening the report query and display time.

Description

SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology
Technical Field
The invention belongs to the technical field of enterprise information management, and particularly relates to a method for directly generating an EXCEL report form by utilizing a DOI technology based on an SAP platform.
Background
At present, reports needing to be printed and handed over are generally EXCEL files, and compared with line format files, the reports are more attractive in format and clearer in structure. At present, many enterprises implement SAP systems, a large number of reports are developed in the system, most reports are ABAP language, alv format display, EXCEL files are exported by an OLE technology, the OLE export speed is slow, the reports appear on the EXCEL files line by line at a speed visible to the naked eye during export, and if a large amount of data needs to be exported, the waiting time is long, so that the use requirements of users cannot be met.
In the SAP system, three implementation modes of self-development report form exist, 1, ABAP language development. 2. QUERY + ABAP development. 3. And developing a report assembler. The fastest and simplest development is the No. 3 development, and the method is a development tool for the end user by SAP company, but for the majority of users, the threshold of computer technology is still higher, and the majority of users still have no ability to self-issue EXCEL reports meeting the domestic format requirements, so the development and modification work of the reports at present are still on the body of developers. Once the report format changes, developers are required to modify the program, communication is firstly carried out, then modification and testing are carried out, and if the test fails, the communication modification test is carried out repeatedly, so that the time and the labor are consumed.
The existing EXCEL report form development mode of the SAP system can not meet the requirement that a terminal user modifies a self-developed report form by himself, so a new method is needed, the DOI technology is utilized to realize a method for rapidly providing the EXCEL report form according to user configuration, and the problems that the SAP system user configures the report form by himself according to business changes and rapidly develops the EXCEL report form of the SAP system are solved.
Disclosure of Invention
The invention aims to provide a method for directly generating an EXCEL report by utilizing a DOI technology based on an SAP platform, which realizes the generation of the EXCEL report and the data export by means of the SAP platform packaging technology and the DOI technology, realizes that a user can design a template by himself, improves the development speed, shortens the development time, shortens the report query display time and effectively solves the problems in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: a method for directly generating an EXCEL report form by utilizing a DOI technology based on an SAP platform comprises the following steps:
s1, creating an include program for functional encapsulation, so that the program can be conveniently called;
s2, creating a DOI call function, realizing the taking of an EXCEL report form template in an SAP system library according to the entrance parameters, and displaying the template;
s3, creating an EXCEL cell data filling function;
s4, creating an EXCEL storage function;
s5, creating functions of a function menu function, namely 'return' and 'save';
s6, uploading an EXCEL template to the SAP system, uploading an EXCEL template file by means of a standard function oaor of the SAP system, inputting three variables including a transfer class name, a classification type and an object code variable, and uploading the EXCEL template file with a format designed by a user;
and S7, creating a report inquiry program, and calling the packaging program and the report template to display the report.
Preferably, the step S2 includes the steps of:
step S201, a DOI calling function is established, and parameters are set;
step S202, obtaining DOI interface data and assigning the DOI interface data to a variable;
step S203, checking whether the container is valid, if the container is valid, initializing the container, operating the EXCEL program in the container, and returning error information if the container is invalid;
and step S204, checking whether the EXCEL template stored in the service of the business document is valid according to the access participant, if so, opening the EXCEL template, and if not, returning to report an error.
Preferably, the step S7 includes the steps of:
step S701, introducing an include packet to realize encapsulation calling;
step S702, creating a GUI state;
step S703, executing data query, and putting query results into an internal table;
step S704, calling a report generation function in the encapsulation package;
step S705, calling a data filling function in the encapsulation packet;
step S706, the menu function in the package is called, the GUI state is created in the main program, and the program is initialized, so that the functions of 'return' and 'save' of the menu function in the package can be directly used.
Compared with the prior art, the invention has the beneficial effects that: the method for directly generating the EXCEL report by utilizing the DOI technology based on the SAP platform realizes the generation of user configuration by means of the SAP platform packaging technology and the DOI technology, quickly provides the EXCEL report and leads out data, realizes that a user can design a template by himself, and realizes the purposes of improving the development speed, shortening the development time and shortening the report query and display time.
Drawings
FIG. 1 is a DOI call and data population diagram of the present invention;
FIG. 2 is a diagram of function invocation and implementation of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 to fig. 2, the present invention provides a technical solution: a method for directly generating an EXCEL report form by utilizing a DOI technology based on an SAP platform is developed by adopting an ABAP language on the SAP platform and comprises the following steps:
s1, creating an include program for functional encapsulation, so that the program can be conveniently called;
the step S2 includes the steps of:
step S201, a DOI calling function is established, and a parameter is set.
FORM create_basic_objects USING p_classname p_classtype p_doc_object_key.
p _ classname p _ classtype p _ doc _ object _ key is an entry parameter variable used to pass class name, classification type and object code variable respectively.
And step S202, DOI interface data are obtained and assigned to variables.
CALLMETHOD c_oi_container_control_creator=>get_container_control
IMPORTING
control=cl_control
error=cl_error.
The DOI interface data is assigned to the variable get _ container _ control.
And step S203, checking whether the container is valid, initializing the container if the container is valid, operating the EXCEL program in the container, and returning error information if the container is invalid.
CALL METHOD cl_error->raise_message
EXPORTING
type='E'.
Checking whether the container is valid, if not, putting the returned error report information into a variable raise _ message
CREATE OBJECT cl_splitter
EXPORTING
parent=cl_gui_container=>screen0
rows=1
columns=1.
CALL METHOD cl_splitter->set_border
EXPORTING
border=cl_gui_cfw=>false.
cl_container=cl_splitter->get_container(row=1column=1).
CALL METHOD cl_control->init_control
EXPORTING
r3_application_name='RBasis'
inplace_enabled='X'
inplace_scroll_documents='X'
parent=cl_container
register_on_close_event='X'
register_on_custom_event='X'
no_flush='X'
IMPORTING
error=cl_errors.
APPEND cl_errors.
CALL METHOD cl_gui_cfw=>dispatch.
wa_doc_signature-prop_name='DESCRIPTION'.
wa_doc_signature-prop_value='PP_REPORT'.
APPEND wa_doc_signature TO gt_doc_signature.
CREATE OBJECT cl_bds_instance.
CALL METHOD cl_bds_instance->get_info
EXPORTING
classname=p_classname
classtype=p_classtype
object_key=p_doc_object_key
CHANGING
components=gt_doc_components
signature=gt_doc_signature
EXCEPTIONS
nothing_found=1
error_kpro=2
internal_error=3
parameter_error=4
not_authorized=5
not_allowed=6.
CALL METHOD cl_bds_instance->get_with_url
EXPORTING
classname=p_classname
classtype=p_classtype
object_key=p_doc_object_key
CHANGING
uris=gt_doc_uris
signature=gt_doc_signature.
The container is initialized.
CALL METHOD cl_control->get_document_proxy
EXPORTING
document_type='EXCEL.Sheet'
no_flush='X'
IMPORTING
document_proxy=cl_docu_proxy
error=cl_errors.
APPEND cl_errors.
The EXCEL program is run in the container.
And step S204, checking whether the EXCEL template stored in the service of the business document is valid according to the access participant, if so, opening the EXCEL template, and if not, returning to report an error.
LOOP AT gt_doc_uris INTO wa_doc_uris.
g_url=wa_doc_uris-uri.
ENDLOOP.
CALL METHOD cl_docu_proxy->open_document
EXPORTING
open_inplace='X'
document_url=g_url
IMPORTING
error=cl_errors.
DATA:has TYPE i.
CALL METHOD cl_docu_proxy->has_spreadsheet_interface
EXPORTING
no_flush='X'
IMPORTING
is_available=has
error=cl_errors.
APPEND cl_errors.
CALL METHOD cl_docu_proxy->get_spreadsheet_interface
EXPORTING
no_flush='X'
IMPORTING
sheet_interface=cl_spreadsheet
error=cl_errors.
APPEND cl_errors.
And step S3, creating an EXCEL cell data filling function.
FORM fill_data USING valj i.
……
CALL METHOD cl_spreadsheet->insert_range_dim
EXPORTING
name='cell'
no_flush='X'
top=i
left=j
rows=rows_number
columns=columns_number
IMPORTING
error=cl_errors.
APPEND cl_errors.
REFRESH:gr_ranges,gt_EXCEL_input.
wa_rangeitem-name='cell'.
wa_rangeitem-columns=1.
wa_rangeitem-rows=1.
APPEND wa_rangeitem TO gr_ranges.
wa_EXCEL_input-column=1.
wa_EXCEL_input-row=1.
IF l_c_val CO'1234567890-.'.
CALL FUNCTION'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value=l_c_val.
ENDIF.
wa_EXCEL_input-value=l_c_val.
APPEND wa_EXCEL_input TO gt_EXCEL_input.
CALL METHOD cl_spreadsheet->set_ranges_data
EXPORTING
ranges=gr_ranges
contents=gt_EXCEL_input
no_flush='X'
IMPORTING
error=cl_errors.
APPEND cl_errors.
CALL METHOD cl_spreadsheet->fit_widest
EXPORTING
name=space
no_flush='X'.
REFRESH:gr_ranges,gt_EXCEL_input.
……
ENDFORM.
And S4, creating an EXCEL saving function.
FORM save_EXCEL USING p_f.
CALL METHOD cl_docu_proxy->save_copy_as
EXPORTING
file_name=p_f.
ENDFORM.
Step S5, function menu functions of 'return' and 'save' are created.
MODULE USER_COMMAND_0100INPUT.
DATA OKCODE LIKE SY-UCOMM.
CASE OKCODE.
WHEN'BACK'.
IF NOT cl_docu_proxy IS INITIAL.
CALL METHOD cl_docu_proxy->CLOSE_DOCUMENT.
FREE cl_docu_proxy.
ENDIF.
IF NOT cl_CONTROL IS INITIAL.
CALL METHOD cl_CONTROL->DESTROY_CONTROL.
FREE cl_CONTROL.
ENDIF.
SET SCREEN 0.
……
ENDCASE.
ENDMODULE.
S6, uploading the EXCEL template to the SAP system; the method comprises the steps of uploading an EXCEL template file by means of a standard function oaor of an SAP system, inputting three variables of a transmission class name, a classification type and an object code variable, and then uploading the EXCEL template file with a format designed by a user.
The step S7 includes the steps of:
and step S701, creating a report query program, introducing an include packet, and realizing encapsulation calling.
Step S702, a GUI state is created.
Step S703, perform data query, and put the query result in the internal table.
Step S704, a report generating function in the encapsulation package is called.
PERFORM CREATE_BASIC_OBJECTS USING'ZTEMPLATE”OT”ZYSF Y'.
And calling a generating function in the encapsulation package to realize the display of the report template, wherein the 'ZTEMLATE' OT 'ZYSFY' is the name of the transfer class, the classification type and the object code variable, and the object code variable is the template code uploaded to the SAP system by the EXCEL template.
Step S705, call the encapsulating trie data filling function.
LOOP AT gt_fagl.
……
PERFORM FILL_DATA USING ij.
ENDLOOP.
And filling a function for filling the quantity in the packaging packet by USING FILL _ DATA USING, filling the query result executed by the main program into the EXCEL template, and finishing the report DATA and the display format required by the user.
Step S706, the menu function in the package is called, the GUI state is established in the main program, and the functions of 'return' and 'save' of the menu function in the package can be directly used after initialization in the program.
MODULE status_0100OUTPUT.
SET PF-STATUS'100'.
ENDMODULE.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (3)

1. A method for directly generating an EXCEL report form by utilizing a DOI technology based on an SAP platform is characterized by comprising the following steps: the method comprises the following steps:
step S1, creating an include program for functional encapsulation, so as to facilitate program calling;
s2, creating a DOI call function, realizing the taking of an EXCEL report form template in an SAP system library according to the entrance parameters, and displaying the template;
s3, creating an EXCEL cell data filling function;
s4, creating an EXCEL storage function;
step S5, creating functions of a function menu function, namely 'return' and 'save';
s6, uploading an EXCEL template to the SAP system, uploading an EXCEL template file by means of a standard function oaor of the SAP system, inputting three variables of a transmission class name, a classification type and an object code variable, and then uploading the EXCEL template file with a format designed by a user;
and S7, creating a report inquiry program, and calling the packaging program and the report template to display the report.
2. The method for directly generating EXCEL report by DOI technology based on SAP platform in claim 1, characterized by that: the step S2 includes the steps of:
step S201, a DOI calling function is established, and parameters are set;
step S202, obtaining DOI interface data and assigning the DOI interface data to a variable;
step S203, checking whether the container is valid, if the container is valid, initializing the container, operating the EXCEL program in the container, and returning error information if the container is invalid;
and step S204, checking whether the EXCEL template stored in the service of the business document is valid according to the access participant, if so, opening the EXCEL template, and if not, returning to report an error.
3. The method for directly generating EXCEL report by DOI technology based on SAP platform in claim 1, characterized by that: the step S7 includes the steps of:
step S701, introducing an include packet to realize encapsulation calling;
step S702, creating a GUI state;
step S703, executing data query, and putting query results into an internal table;
step S704, calling a report generation function in the encapsulation package;
step S705, calling a data filling function in the encapsulation packet;
step S706, the menu function in the package is called, the GUI state is created in the main program, and the program is initialized, so that the functions of 'return' and 'save' of the menu function in the package can be directly used.
CN202211416142.7A 2022-11-12 2022-11-12 SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology Pending CN115906783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211416142.7A CN115906783A (en) 2022-11-12 2022-11-12 SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211416142.7A CN115906783A (en) 2022-11-12 2022-11-12 SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology

Publications (1)

Publication Number Publication Date
CN115906783A true CN115906783A (en) 2023-04-04

Family

ID=86473765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211416142.7A Pending CN115906783A (en) 2022-11-12 2022-11-12 SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology

Country Status (1)

Country Link
CN (1) CN115906783A (en)

Similar Documents

Publication Publication Date Title
Blaschek Object-oriented programming: with prototypes
CN108268253B (en) Interface code generation method and terminal equipment
Noran An analysis of the Zachman framework for enterprise architecture from the GERAM perspective
CN103226478B (en) A kind of method automatically generating and using code
CN112650533B (en) Interface document generation method and device and terminal equipment
US20110153505A1 (en) Deliver application services through business object views
Yang et al. Design knowledge modeling and software implementation for building code compliance checking
CN103383645A (en) Code generation method and system
CN108255479B (en) Creation method, device, storage medium and the terminal of cube file
CN110309099A (en) Interface managerial method, device, equipment and computer readable storage medium
CN109857389A (en) Model data generation method, device, computer equipment and storage medium
Ellis et al. Computer science and office information systems
Salay et al. Using macromodels to manage collections of related models
CN116974581B (en) Code generation method, device, electronic equipment and storage medium
CN108469977B (en) Interface data management method
CN107844710B (en) Contract generating system and generating method
CN117311683A (en) Code auxiliary system, code auxiliary processing method and device and electronic equipment
CN115906783A (en) SAP platform-based method for directly generating EXCEL report form by utilizing DOI technology
CN115269040B (en) Tenant business application expanding method, device and system
CN115510052A (en) Dynamic form and database-based dynamic verification method and system
Starr et al. Models to Code
Wills Formal Methods applied to Object-Oriented Programming
CN110018828A (en) Source code inspection method, device and terminal device
CN113296763B (en) Application capability management method and system
CN115098514A (en) Method and device for identifying scene based on annotation, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination