Skip to Content
FIN Globalization Services

FIORI FLM ERP Integration Guide

Tags:

                         Contents


1. ERP Integration Overview

2. ERP Integration for Purchase Order

     2.1 Steps for Attaching Purchase Order as link

          2.1.1 Customizing

            2.1.2 Attaching the object link in the File Management app

            2.1.3 Saving the Attachment link to the file

    2.2 Steps for Attaching Purchase Order as PDF

            2.2.1 Customizing

          2.2.2 Attaching the object PDF in the File Management app

          2.2.3 Saving the Object PDF to the file

1 ERP Integration Overview

This chapter explains the procedure of integrating ERP Objects and Reports into a File. Using this solution, you can attach the following into the documents section of the file:

  1. ERP Objects along with the related Objects

During the file processing, you can integrate ERP object such as Purchase Order, Purchase Requisition to the file. You can also include the linked objects of an object.

The FLM solution uses the record management system (RMS) to store the ERP Object instance in the Document structure. When the user opens the attached PO, the system opens the PO as a transaction through ITS or as a PDF.

  1. Reports along with its variants

During the file processing, ERP reports like Comparison Statements, Source List can be attached to the file. The solution uses RMS to store the report name along with the variant in the document structure. When the user opens the attached report, the system displays the report result through ITS.

2 ERP Integration for Purchase Order

  1. 2.1  Steps for Attaching Purchase Order as link

  1. 2.1.1 Customizing

Perquisite:

You have created a BOR. If you have installed ERP and FLM in the same server/system, then you create BOR in FLM system. Else if ERP and FLM are in different server/system, then you create BOR in ERP system.

Note that the BOR should have a method GetDisplayUrl. This system uses this method to fetch the ITS URL of the ERP object. When an user clicks a dynamic ERP object attached to a file, then this method gets the ITS URL of the ERP object and the system uses this url to display the ERP object.

This is a sample code to generate the ITS URL for opening a Purchase order, using transaction ME23. You can create similar methods to generate ITS URL for opening any ERP object or report.

begin_method getdisplayurl changing container.

DATA:

ev_url(255).

DATA: lv_host TYPE string,

url TYPE string,

lv_temp TYPE string,

lv_url TYPE char255,

lv_port TYPE string.

*Call below method to get host and port

cl_http_server=>if_http_server~get_location(

IMPORTING

host = lv_host

port = lv_port ).

 

CONCATENATE 'https'

'://' lv_host ':' lv_port '/sap/bc/gui/sap/its/webgui/?&~transaction=*me23' INTO url.

CONCATENATE 'RM06E-BSTNR=' object-key-purchasingdocument ';DYNP_OKCODE=KOPF' INTO lv_temp.

CONCATENATE url lv_temp INTO url SEPARATED BY space. ev_url = url.

swc_set_element container 'EV_URL' ev_url.

end_method.

  1. Define Object Element types

You need to create object element type for every RMS_ID that you create for the organization.

You define the object element type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Basic Settings -> Configurations when creating RMS ID -> Create Element Types -> Create Element Types

    1. On the customizing activity Registry, choose Application Registry -> S_AREA_RMPS -> RM_PS_SP_BOR

         

2. Using the right mouse button, choose Create Element Type. The Create Element Type screen appears. Enter an ID and a short description for the new element type.

3. The Element Type screen appears. Enter the relevant attributes under the following tabs: Connection parameter value

  1. To maintain the BOR details, select BOR_OBJECT_TYPE and click on the Edit button. The Change Parameter screen appears. Enter the BOR name that you have created previously using the standard process.

     b. To maintain the Logical details, select the LOGICAL_SYSTEM and click on the Edit button

     Note that if you have installed FLM and ERP on the same server/system, then you are not required to maintain the logical system value. However if FLM and ERP on the different server/system then you have to maintain logical system value.

    

     Classification

  1. RMS ID - Specify the RMS ID that you have created for your organization.

b.       Type - Specify the type as SRM_BusinessObject


          Save your data. The element type is created successfully. Similarly you can create other element types.


2.     Define Object type for Object element type

An object ID is an ID through which an element type is referenced.

Instead of displaying the element type to the user, you can define an object type and a description of the object type. During file processing, the system displays the object type and its description on the screen, instead of the element type.

Example:

Consider that you have an element type ABC, and you have maintained object type as PUO and description as Purchase order link. During file processing, the system will display the description of PUO to the user instead of ABC.

You define the object element type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Define Object Type for Object Element Type.

3.     Create Profile and assign element object types to profile

A profile defines the objects that can be assigned to a file. Once you create a profile, you assign your element object type to it.

You define the profiles and assign element object type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Define Profile

4.       Assign a profile to a file

You assign a profile (created in the previous step) to a file type.

By assigning profile you define the objects and the reports that can be assigned to a file type and in turn a file.

You assign the profiles in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Assign Profile to File Type

 

2.1.2       Attaching the object link in the File Management app

  1. Log in to the File app.

   2.  Create/Open the relevant file

Note that your file should be of the file type that has the profile linked

   3.  Go the Noting and Document tab and click on the Add new Document button in the Document section.

   4.  The system displays the option for attachment

  • Attachment – you can add a document stored in the local machine
  • File – you can add a file
  • Object – You can add the ERP object

You have to select Object.

   5.    The system displays the Object screen. On this screen, enter the relevant details such as Document number and type.

Note that the system will display all the element object type that you have maintained and assigned to the profile, such as in this example Purchase order link, Purchase order PDF.

6.  The system checks whether the hook ‘attachCustomObject’ is implemented in the system. If the hook is implemented the control is passed to the hook with single input parameter

“DocumentObject”. The parameter has three object:

  • document
  • fileDetails
  • objectDetail

Object

Sub Object

Description

document

BorID

Key of the object entered by user such as PO number

BorType

BOR name

DocumentName

Name of the document user has entered

DocumentType

Type of document selected by user

CreatedByName

Name of the user

CreatedOn

System Date and time

ParentKey

Folder ID in which the document needs to be attached

This flag will be marked 'true' if the document is an

IsAttachment

attachment eg: PDF

This flag will be marked 'true' if the document is a File Eg:

IsFile

Another file in FLM

This flag will be marked 'true' if the document is a dynamic

IsObject

object eg: Link

ElementType

FileName

DocumentClass

AttachmentLoioID

FileSizeDescr

NotingEnabledRef

DeleteEnabledRef

Variant

Case GU ID of the file in which the document is being

fileDetails

caseGuiId

attached

Work Item Id of the file in which the document is being

workItemId

attached

fileId

Caseguid of the file in which the document is being attached

objectDetails

objectType

elementType

attachmentType

2.1.2.1  Using this parameter to create customer screen

Using the details present in the parameter, you can implement customer specific business logic in the hook.

  • Creating the customer specific UI (Dialog)
  • Handling the UI operations and service call to the backend to link the document

Once the document is successfully linked in the database, the document object present in the input parameter of the hook need to be filled with the details that were not present before the linking such file size, BOR ID, BOR type. Once the document object is filled, you have to call the function” attachObjectUI” and pass document object as input parameter.


2.1.3  Saving the Attachment link to the file

Process:

  • The user enters the object key for example Purchase order number and click OK. The system calls the o-Data service.
    • The service has a method CREATE_ENTITY that in turn calls the SAVE method to save the attachment link to the file

Note that you can create a new customer specific service or extension of the standard service /PSINDS/FILES_SRV.

While creating a new service or extension of standard service you should create a new:

  • entity type
  • entity set

Screenshot of sample entity type properties:

Sample code to save the object link to the file using the CREATE_ENTITY method:

DATA: ls_update TYPE zcl_z_erp_integration_mpc=>ts_fiori_db_update_et,

lv_uname TYPE sy-uname, lv_fname TYPE string,

lv_case_guid TYPE scmg_case_guid, lv_wfid TYPE sww_wiid, lv_filetype TYPE scmgcase_type, ls_hrchy TYPE /psinds/hrchy, ls_srmpspv1 TYPE srmspspv1, ls_cftype TYPE /psinds/c_ftyp,

 

lv_bor TYPE swo_objtyp,

lv_borid TYPE char70,

lv_elmtyp TYPE srmspsid,

ls_attachment TYPE /psinds/s_doc_tree,

lv_date TYPE string, lv_time TYPE string,

lv_yr TYPE string, lv_mn TYPE string, lv_dd TYPE string, lv_hr TYPE string, lv_mi TYPE string, lv_se TYPE string,

lv_funame TYPE ad_namtext.

io_data_provider->read_entry_data( IMPORTING

es_data = ls_update

).

lv_uname = cl_abap_syst=>get_user_name( ).

CALL METHOD /psinds/cl_bl_ofcr_file_op=>get_fullname_from_userid EXPORTING

iv_username = lv_uname CHANGING

  • cs_msg = cv_fullname = lv_funame.

lv_fname = lv_funame.

lv_case_guid = ls_update-caseguid. lv_wfid = ls_update-wiid.

SELECT SINGLE case_type INTO lv_filetype FROM scmg_t_case_attr WHERE case_g uid = lv_case_guid.

CALL METHOD /psinds/cl_bl_ofcr_file_op=>get_doc_att_details EXPORTING

iv_casetype = lv_filetype

IMPORTING

es_hrchy

=

ls_hrchy

es_srmpspv1 =

ls_srmpspv1

es_casetype = ls_cftype. ls_attachment-text = ls_update-docnum. ls_attachment-parent_key = ls_update-parid. lv_elmtyp = ls_update-elmtyp.

SELECT SINGLE spspv INTO lv_paravalue FROM srmspspv1 WHERE spsid EQ lv_elmtyp AND

spid    EQ 'RM_PS_SP_BOR' AND

 

sppaid EQ 'BOR_OBJECT_TYPE'.

lv_bor = lv_paravalue. lv_borid = ls_update-adocnum.

CALL METHOD /psinds/cl_bl_ofcr_file_op=>attach_file

EXPORTING

im_rms_id

=

ls_cftype-rms_id

im_doc_sps_id

=

lv_elmtyp

" Element Type ID

im_attachment_details

=

ls_attachment

im_wfid

=

lv_wfid

" Work item ID

iv_cfile_guid

=

lv_case_guid

)

iv_object

=

'X'

iv_bor_type

=

lv_bor

iv_object_id

=

lv_borid

CHANGING

ct_msg

=

lt_msg.

" Re

IF lt_msg IS INITIAL.

er_entity-fullname = lv_fname.

er_entity-bortype = lv_bor.

er_entity-borid = lv_borid.

er_entity-elmtyp = lv_elmtyp.

er_entity-isdelete = 'X'.

er_entity-isnoting = 'X'.

lv_date = sy-datum.

lv_time = sy-uzeit.

lv_yr = lv_date+0(4).

lv_mn = lv_date+4(2).

lv_dd = lv_date+6(2).

lv_hr = lv_time+0(2).

lv_mi = lv_time+2(2).

lv_se = lv_time+4(2).

CLEAR :lv_date, lv_time.

CONCATENATE lv_dd lv_mn

lv_yr INTO lv_date SEPARATED BY '.'.

CONCATENATE lv_hr lv_mi

lv_se INTO lv_time SEPARATED BY ':'.

CONCATENATE lv_date lv_time INTO er_entity-size SEPARATED BY ' '.

ENDIF.


Note

You can use the above steps to add link of other objects such as Source list. However objects such as source list have multiple input fields (material, plant) for fetching and displaying them.

You have to create a screen that supports entering the multiple input fields. Once the user enters the multiple input fields, the system call the CREAT_ENTITY method to concatenate the input values and saves them in the database. Later to display the object, the system calls the BOR method to split the concatenated values and generate the ITS url.

2.2  Steps for Attaching Purchase Order as PDF

2.2.1 Customizing

  1. Define Object Element types

You need to create object element type for every RMS_ID that you create for the organization.

You define the object element type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Basic Settings -> Configurations when creating RMS ID -> Create Element Types -> Create Element Types

    1. On the customizing activity Registry, choose Application Registry -> S_AREA_RMPS -> RM_PS_SP_BOR

  1. Using the right mouse button, choose Create Element Type. The Create Element Type screen appears. Enter an ID and a short description for the new element type.
  2. The Element Type screen appears. Enter the relevant attributes under the following tabs:

 

Classification

     c. RMS ID - Specify the RMS ID that you have created for your organization.

     d.       Type - Specify the type as SRM_BusinessObject

Save your data. The element type is created successfully. Similarly you can create other element types.

 

2. Define Object type for Object element type

An object ID is an ID through which an element type is referenced.

Instead of displaying the element type to the user, you can define an object type and a description of the object type. During file processing, the system displays the object type and its description on the screen, instead of the element type.

Example:

Consider that you have an element type ABC, and you have maintained object type as PUO and description as Purchase order PDF. During file processing, the system will display the description of PUO to the user instead of ABC.

You define the object element type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Define Object Type for Object Element Type.

3. Create Profile and assign element object types to profile

A profile defines the objects that can be assigned to a file. Once you create a profile, you assign your element object type to it.

You define the profiles and assign element object type in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Define Profile

4.       Assign a profile to a file

You assign a profile (created in the previous step) to a file type.

By assigning profile you define the objects and the reports that can be assigned to a file type and in turn a file.

You assign the profiles in the Customizing for SAP File Lifecycle Management under SAP NetWeaver -> Application Server -> SAP File Lifecycle Management -> Integration with other System -> Assign Profile to File Type

 

2.2.2       Attaching the object PDF in the File Management app

  1. Log in to the File app.

   2. Create/Open the relevant file

Note that your file should be of the file type that has the profile linked.

   3. Go the Noting and Document tab and click on the Add new Document button in the Document section.

   4. The system displays the option for attachment

  • Attachment – you can add a document stored in the local machine
  • File – you can add a file
  • Object – You can add the ERP object

You have to select Object.

   5. The system displays the Object screen. On this screen, enter the relevant details such as Document number and type.

Note that the system will display all the element object type that you have maintained and assigned to the profile, such as in this example Purchase order link, Purchase order PDF.

6. At this point you can create you customer specific screen to add the attachment.

 

2.2.3  Saving the Object PDF to the file

Process:

  • The user enters the object key for example Purchase order number and click OK. The system calls the o-Data service.
    • The service has a method CREATE_ENTITY that in turn calls the SAVE method to save the object PDF to the file

Note that you can create a new customer specific service or extension of the standard service /PSINDS/FILES_SRV.

While creating a new service or extension of standard service you should create a new:

  • entity type
  • entity set

Screenshot of sample entity type properties:

Sample code to save the object PDF to the file using the CREATE_ENTITY method:

DATA: ls_update TYPE zcl_z_erp_integration_mpc=>ts_fiori_db_update_et,

lv_uname TYPE sy-uname, lv_fname TYPE string,

lv_case_guid TYPE scmg_case_guid, lv_wfid TYPE sww_wiid, lv_filetype TYPE scmgcase_type, ls_hrchy TYPE /psinds/hrchy, ls_srmpspv1 TYPE srmspspv1, ls_cftype TYPE /psinds/c_ftyp,

 

lv_bor TYPE swo_objtyp,

lv_borid TYPE char70,

lv_elmtyp TYPE srmspsid,

ls_attachment TYPE /psinds/s_doc_tree,

lv_date TYPE string, lv_time TYPE string,

lv_yr TYPE string, lv_mn TYPE string, lv_dd TYPE string, lv_hr TYPE string, lv_mi TYPE string, lv_se TYPE string,

lv_cont TYPE xstring,

ls_attached TYPE /psinds/s_doc_tree,

lt_msg TYPE bapiret2_t, lv_funame TYPE ad_namtext.

io_data_provider->read_entry_data( IMPORTING

es_data = ls_update

).

lv_uname = cl_abap_syst=>get_user_name( ).

CALL METHOD /psinds/cl_bl_ofcr_file_op=>get_fullname_from_userid EXPORTING

iv_username = lv_uname CHANGING

  • cs_msg = cv_fullname = lv_funame.

lv_fname = lv_funame.

lv_case_guid = ls_update-caseguid. lv_wfid = ls_update-wiid.

SELECT SINGLE case_type INTO lv_filetype FROM scmg_t_case_attr WHERE case_g uid = lv_case_guid.

CALL METHOD /psinds/cl_bl_ofcr_file_op=>get_doc_att_details EXPORTING

iv_casetype = lv_filetype

IMPORTING

es_hrchy

= ls_hrchy

es_srmpspv1 =

ls_srmpspv1

es_casetype =

ls_cftype.

 

ls_attachment-text = ls_update-docnum. ls_attachment-parent_key = ls_update-parid. lv_elmtyp = ls_update-elmtyp.

Write a method that gets PO number passed in the variable “ls_update-docnum” and generates the content of the static PO in the variable “lv_cont”.

CONCATENATE ls_update-adocnum '.pdf' INTO ls_attachment-file_title. ls_attachment-document_type = ls_update-doctype. ls_attachment-file_type = 'application/pdf'. ls_attachment-file_content = lv_cont.

CREATE OBJECT lo_filedoc.

CALL METHOD lo_filedoc->/psinds/if_bl_ofcr_op~save

EXPORTING

im_rms_id                          = ls_cftype-rms_id

im_doc_sps_id                  = ls_hrchy-et_document

im_doc_class                    = ls_srmpspv1-spspv

im_case_guid                    = lv_case_guid

im_attachment_details = ls_attachment

im_wfid                              = lv_wfid

IMPORTING

es_attachment_details = ls_attached

CHANGING

ct_msg                                = lt_msg.

IF lt_msg IS INITIAL.

er_entity-fullname = lv_fname. er_entity-documentclass = ls_attached-document_class.

er_entity-documentguid = ls_attached-attachment_loio_id. er_entity-size = ls_attached-file_size_descr. er_entity-isdelete = 'X'.

er_entity-isnoting = 'X'. lv_date = sy-datum. lv_time = sy-uzeit.

lv_yr = lv_date+0(4). lv_mn = lv_date+4(2). lv_dd = lv_date+6(2). lv_hr = lv_time+0(2). lv_mi = lv_time+2(2). lv_se = lv_time+4(2).

CLEAR :lv_date, lv_time.

CONCATENATE lv_dd lv_mn lv_yr INTO lv_date SEPARATED BY '.'. CONCATENATE lv_hr lv_mi lv_se INTO lv_time SEPARATED BY ':'. CONCATENATE lv_date lv_time INTO er_entity-size SEPARATED BY ' '.

ENDIF.

Former Member

No comments