You are on page 1of 12

TECHSPEC FOR INVOICE DISPLAY IN UCES VIA ARCHIVELINK

Archive Link is a service integrated in the SAP Web Application Server for linking archived documents and the application documents entered in the SAP system. Linking documents according to content guarantees long term easy access to the documents. From the screen of the application document, you can directly display the stored document that is associated with it. You can also use attributes to search for documents. This replaces time consuming processes such as making copies of originals, searching for procedure-related information, etc. doc

Integration To use Archive Link, you must have installed a storage system. The document to be stored must already be in, or be converted to electronic format. It does not matter how the document is physically stored in the storage system. Features The following documents can be stored in a storage system using Archive Link: Incoming documents Outgoing documents Print lists Archive files

Incoming and outgoing documents are linked to the corresponding Business Objects. A business object is created in the SAP System whenever an application document is entered. The link is written in an Archive Link link table while the system is running and is associated with the On Base object. The business object and stored document must be uniquely identified for the link. The business object identification consists of: Client Business Object Type (abbr.: Object type)

Business object ID (abbr.: Object ID)

The stored document identification consists of: Content Repository ID Document ID

The diagram below illustrates all the link entry data in the link entry table :an also use attributes to search for documents. This replaces time consuming processes such as making copies of originals, searching for procedure-

related information, etc.

Different sorts of multiple references are possible, for example one stored document can be linked to several business objects, or several stored documents can be linked to one business object. We need to follow these steps to enable Archive Link with Hyland Onbase so that we can access the PDFs of the THEY utilities invoices: define content repository define document type

associate document type to content repository assign an Object Type, Archive ID, and a link table to the Document Type to import the PDF documents You can add bills to archive link using if you want to archive a PDF file in the storage system with the Identification A7 and the Bill Document type ISU_BILL. The OBJECT type should be PRINTDOC.

MTMEC is currently displaying the UCES invoice listing on the web page with a hyperlink and a PDF icon. However, this currently links to a program that simulates the bill as it would be at that point in time because FICA charges are not frozen in the database and always reflect the latest status, and produces a PDF invoice reflecting the previous billed charges and the up-to-date FICA charges in PDF format. The purpose of this implementation is to have UCES display an image of the same invoice that was sent to the customer. We has made the recommendation that we use Archive Link functionality in SAP which does not need much coding or testing as this a flexible but very common practice. Archive Link when properly configured will communicate with the current On Base repository of PDFs as well any future invoices added to On Base and display them in a web page in UCES based on the user clicking the PDF icon on the bills display page. According to Gary Noe, In terms of populating data (both day forward and back file) we need the SAP Object ID that the invoice document will be attached to. In this case its PRINTDOC. This value will allow OnBase to call a system web service in OnBase and create the attachment to the specified Object ID PRINTDOC. For day forward documents this will need to be a change to the import file THEY is using to import PDF documents to OnBase. Once these documents are imported they will be added to a system workflow to facilitate the link to SAP. Here are the current keywords we are importing into OnBase through the DIP process. SAP generates a file with member invoice data that we FTP to a vendor named Cash Cycle Solutions (formerly Total Billings). The vendor prints and mails the invoices to our members. The next step is to import PDFs and an index text file containing the keywords into OnBase.

Heres a screen capture of the Total Billings PDF invoice keywords after we have committed via the DIP process :

To process the back file we will need a way to map keyword data in OnBase today to back file SAP Object IDs. (i.e. Customer Account # and Date = SAP Object ID). We can use this information to populate existing documents with the necessary SAP Object ID PRINTDOC. These items can then be added to the same system workflow to attach to SAP. The biggest hurdle will be adding the Object ID to the back file documents. We can use functionality in OnBase to do the update or we can utilize database scripting. This will really be based on the format of the data that we need and volume. Database scripting is the preferred method. MTMEC wont need to make any change to the Cash Cycle Solutions interface to export any other IDs and will not need any new (keywords) that need to be exported to CCS in order to import them into OnBase with the member invoice PDF. Currently THEY has an active implementation for event 1231. This event already sets the indicator, XPDF in table T_INVOICES so that a customer is able to request a PDF in the front end of SAP Biller Direct. Technically, this means you ensure that the appropriate icons are shown with the indicator. Then to retrieve the PDF out of archive link a function in the event called ISU_ADD_ITEM_TO_INVOICE is used to populate the list of invoices and other charges that THEY has said to allow to appear as line items. If the

invoice already exists then only the open amount must be modified. In addition for new invoices it is determines if the invoice is available in the archive in On base via FUNCTION 'ISU_GET_ARCHIV_FOR_EBPP'. This function calls is made using the following parameters the ISU billing doc number and SAP Business Object PRINTDOC. Using the object id which is what Archive Link would call the billing doc also known as (erdb-opbel) in the SAP database along with the Business object PRINTDOC it calls the function ARCHIV_CONNECTINFO_GET_META which will display a URL to the PDF masked under the PDF icon on the screen in UCES invoice display.

So inside function module ARCHIV_CONNECTINFO_GET_META we call: call function module 'ARCHIV_GET_CONNECTIONS' exporting objecttype = sap_object object_id = l_objectid archiv_id = archiv_id documenttype = ar_object documentclass = doc_type limited = limited importing count = l_count reducedbylimit = reducedbylimit reducedbyauthority = reducedbyauthority tables connections = connect_info exceptions nothing_found = 1 others = 2. So inside 'ARCHIV_GET_CONNECTIONS' we call: call function: ARCHIV_GET_CONNECTIONS_INT EXPORTING OBJECTTYPE = OBJECTTYPE OBJECT_ID = OBJECT_ID CLIENT = CLIENT ARCHIV_ID = ARCHIV_ID ARC_DOC_ID = ARC_DOC_ID DOCUMENTTYPE = DOCUMENTTYPE FROM_AR_DATE = FROM_AR_DATE UNTIL_AR_DATE = UNTIL_AR_DATE DOCUMENTCLASS = DOCUMENTCLASS DEL_DATE = DEL_DATE LIMITED = LIMITED NO_AUTH_CHECK = SPACE LIMIT = LIMIT IMPORTING COUNT = COUNT

REDUCEDBYLIMIT = REDUCEDBYLIMIT REDUCEDBYAUTHORITY = REDUCEDBYAUTHORITY TABLES CONNECTIONS = CONNECTIONS PARAMETER = PARAMETER EXCEPTIONS NOTHING_FOUND =1 OTHERS =2 Inside ARCHIV_GET_CONNECTIONS_INT we call the method. call method cl_alink_connection=>find exporting sap_object = objecttype object_id = object_id mandt = client archiv_id = archiv_id arc_doc_id = arc_doc_id ar_object = documenttype from_ar_date = from_ar_date until_ar_date = until_ar_date doc_type = documentclass del_date = del_date limited = limited no_auth_check = no_auth_check limit = limit parameter = l_parameter[] importing count = count reducedbylimit = reducedbylimit reducedbyauthority = reducedbyauthority connections = l_connections[] exceptions not_found =1 error_authorithy = 2 error_parameter = 3 others = 4. These are the tables that are perquisites before the below statement will return a values to make a connection from SAP archive link to On Base. TOAC1 TOAC2 TOACA TOACB TOACB_HEAD TOACL TOACM TOACM_C SAP ArchiveLink: Frontend Customizing SAP ArchiveLink administration settings Cache for frontend files ArchiveLink Asynchronous CFBC Responses ArchiveLink Asynchronous CFBC Responses He SAP ArchiveLink: Frontend Customizing log Bar code entry of incoming documents Settings for Bar Code Entry

TOACO TOACR TOACR_HEAD TOACU TOACU_C

Check table for link tables Asynchronous ArchiveLink Requests Asynchronous ArchiveLink Requests Header T SAP ArchiveLink Customizing table Customizing: Administration Settings

With the previous method called the following SQL is executed which accesses the tables mentioned above to retrieve the connection info. * start database selection open cursor with hold l_cursor for select * from (l_toaco-connection) client specified where (l_condition) and mandt in l_ra_mandt and sap_object in l_ra_sap_object and object_id in l_ra_object_id and archiv_id in l_ra_archiv_id and arc_doc_id in l_ra_arc_doc_id and ar_object in l_ra_ar_object and ar_date in l_ra_ar_date and del_date in l_ra_del_date and reserve in l_ra_reserve. * get next package of connections if l_toaco is initial. loop at l_archived_connections assigning <conn>. if ( l_mandt_p is initial or <conn>-mandt cp l_mandt_p ) and ( l_sap_object_p is initial or <conn>-sap_object cp l_sap_object_p ) and ( l_object_id_p is initial or <conn>-object_id cp l_object_id_p ) and ( l_archiv_id_p is initial or <conn>-archiv_id cp l_archiv_id_p ) and ( l_arc_doc_id_p is initial or <conn>-arc_doc_id cp l_arc_doc_id_p ) and ( l_ar_object_p is initial or <conn>-ar_object cp l_ar_object_p ) and ( l_reserve_p is initial or <conn>-reserve cp l_reserve_p ) and ( l_del_date_p is initial or <conn>-del_date cp l_del_date_p ) and <conn>-mandt in l_ra_mandt and <conn>-sap_object in l_ra_sap_object and <conn>-object_id in l_ra_object_id and <conn>-archiv_id in l_ra_archiv_id and <conn>-arc_doc_id in l_ra_arc_doc_id and <conn>-ar_object in l_ra_ar_object and <conn>-ar_date in l_ra_ar_date and <conn>-del_date in l_ra_del_date and <conn>-reserve in l_ra_reserve. append <conn> to connections. endif.

After this select we end up with a value for the function ARCHIV_CONNECTINFO_GET_META.

Next we look to see if archive link is connected by calling function 'SCMS_URL_GENERATE' which returns an archiv_url after we pass in the archive-id we received in the communication structure along with the arc_doc_id which we also got from the communication structure from the SQL query we ran against the archive link customizing tables that Gary Noe from On Base will do. * connected to SAP-Archive READ TABLE lt_connect_info INTO lw_connect_info INDEX 1. IF sy-subrc = 0. * read url for bill in archive CALL FUNCTION 'SCMS_URL_GENERATE' EXPORTING command = 'get' contrep = lw_connect_info-archiv_id docid = lw_connect_info-arc_doc_id compid = 'data' duration = '010000' signature = 'X' accessmode = 'r' IMPORTING absolute_uri = archiv_url EXCEPTIONS error_parameter = 1 error_signature = 2 OTHERS = 3. This function has an algorithm that reads the archive Link confiig and creates a URl to display in the invoice display. The next part is how do we get the PDF to display in a windo in UCES when a user clicks on the PDF icon. So the click calls this function GEN_EBPP_GET_INVOICE_DETAIL, because its mapped in JAVA in UCES to XML function mapping in ECC. It does so when the icon is clicked which in turn calls the BADI GET_INVOICE_DETAIL there is an implementation for ISU. THEY has implemented the BAdI CL_IM_ISU_INVOICEDETAIL This BAdI is called by the front end if the customer selects the corresponding link. For the call the invoice format is set to XPDF in the parameter I_INVOICE_FORMATS. Along with I_REQUESTING_PARTNER, I_BILLING_DOC , I_LANGUAGE This is supposed to return the Created corresponding binary data, and fill table T_PDF. Along with the indicator XPDF in structure C_INVOICE_FORMATS so that UCES knows its a PDF. This BAdI CL_IM_ISU_INVOICEDETAIL in turn calls CALL FUNCTION 'ISU_GET_INVOICES_PDF_RAW' which in turn if the PDF is specified it then performs the following subroutine after which it either returns the archived PDF or the OTF to PDF conversion of the current PDF for bill display.

We first do this routine:

PERFORM set_document_number TABLES t_messages USING i_billing_doc CHANGING c_return c_returncode l_opbel "FI-CA DOC l_printdoc "INVOICE DOC

"fill l_opbel or l_printdoc

Then it fills tab_opbel, tab_printdoc. *>>>>>>>>>>>*** begin fill tab_opbel, tab_printdoc PERFORM fill_tab_opbel_printdoc TABLES tab_opbel USING l_opbel . PERFORM fill_tab_opbel_printdoc TABLES tab_printdoc USING l_printdoc . *<<<<<<<<<<*** end fill tab_opbel, tab_printdoc

. PERFORM fill_tab_partner TABLES tab_partner t_messages USING i_requesting_partner CHANGING c_return c_returncode IF NOT i_invoice_formats-xpdf IS INITIAL then x_pdf = i_invoice_formats-xpdf. x_raw = i_invoice_formats-xraw.

When we reach this subroutine it uses our archive keys and determines the link to retrieve the archived image. If it finds ones it exist the program here and returns the PDF to UCES.

PERFORM get_pdf TABLES t_messages tab_printdoc tab_partner t_eiterdk USING x_raw x_pdf l_printdoc i_language CHANGING t_pdf[] c_return c_returncode . * kein Ausstieg mit mac_exit nur Speichern der Nachricht IF c_returncode = 0. c_invoice_formats-xpdf = 'X'. ENDIF.

If we get a return code of zero from her and c_invoice_formats-xpdf = 'X'. Then we found a PDF in the archive and can send it back in binary form to UCES. If not then we continue our search for a print doc we can generate via OTF conversion from a SmartForm.

We then execute the following function to get the applications form used to print the invoice with. &Printparameter setzen PERFORM set_print_parameters TABLES sel USING wa_eiterdk printpar print_obj run_no.

LOOP AT p_t_eiterdk INTO wa_eiterdk.

PERFORM check_opt_archiv USING wa_eiterdk CHANGING p_t_pdf p_c_return p_c_returncode . IF p_c_returncode NE 0. * im Fehlerfall Drucksimulation ENDIF. DESCRIBE TABLE p_t_pdf. IF sy-tfill GT 0. got_pdf_from_archive = 'X'. ELSE. CLEAR got_pdf_from_archive. ENDIF. IF sy-tfill GT 0 AND p_xraw IS INITIAL. * Was gefunden --> Ausstieg EXIT. ENDIF.

In the following subroutine it prints the invoice in OTF format so that it can be onverted to PDF format. * Printobjekt fllen PERFORM fill_print_obj USING wa_eiterdk-opbel print_obj g_error_flag.

Which calls this function to print the invoice. call function 'ISU_DB_PRINT_DOC_SINGLE' exporting x_opbel = p_opbel * X_ACTUAL =

importing y_print_doc = wa_print_doc exceptions not_found = 1 not_qualified = 2 system_error = 3 others = 4.

IF ( g_error_flag = co_true ). * Fehler beim Lesen Printobjekt -> nchsten Beleg verarbeiten g_error_counter = g_error_counter + 1. CHECK 1 = 2. ENDIF. * Printparameter setzen PERFORM set_print_parameters TABLES sel USING wa_eiterdk printpar print_obj run_no.

This performs our OTF to PDF conversion. CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' IMPORTING bin_filesize = ld_pdflength TABLES otf = gt_otf_data lines = lt_lines EXCEPTIONS err_max_linewidth = 1 err_format =2 err_conv_not_possible = 3 OTHERS = 4.

Now we have a PDF that was generated in the same manner as a production invoice is done today.

You might also like