Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

I was working on a smartform associated with an output type where it was required to trigger an output with the following requirements.

  1. Archive the output triggered into an external repository, like doculink
  2. Convert the smartform to PDF
  3. Store the PDF on the SAP UNIX directory
  4. Send the PDF as an attachment in an email and archive the same(Transmission Medium = ‘5’)

I was able to fulfill all the above requirements, except archiving of the outputs which led me to do extensive research on this concept and subsequently found a solution for the same.

In this blog, I would like to share my knowledge on this as I have seen many threads asking for solution on this.

1.       What is archiving?

Archiving is the process of storing data in an external repository which can be reused and viewed as and when needed and which is governed in SAP by the storage mode.

SAP allows outputs to be triggered in three storage modes:

  1. Print only – Printout is issued and no archiving of the output issued
  2. Archive only – The output is only archived
  3. Print and archive – Print out is issued and also output is archived

2.       Why archiving is needed?

Archiving allows us to store the related documents together under one folder with information such as date on which the outputs was triggered.


3.       How to view the archived documents?

Method 1: Transaction code J6NY allows us to see all the archived documents under the required folder for the required output with trigger date.

For example, all vendor POs will be under one folder named Vendor Purchasing Folder. Search the document with PO number.

Method 2: Display Originals in communication method

Under messages, select the output successfully processed (Green indicator) , click on "Communication method" then click on "Displ. originals". You will be redirected to where the document is archived.


4.       Required settings to archive

To archive the document with the output type, required document type has to be maintained under Storage system in NACE settings.


5.       Parameters on which archiving of smartforms depends.

    1. CONTROL_PARAMETERS     
    2. OUTPUT_OPTIONS                
    3. ARCHIVE_INDEX
    4. ARCHIVE_PARAMETERS

ABAP approach to archive the outputs:

STEP 1:


"Structure for Smartform Control Parameters
DATA : gst_control_param    TYPE ssfctrlop.
"Set the GETOTF field to blank           
gst_control_param-getotf    = ''.



STEP 2:


"Structure for  Smartform Output Options
DATA :  gst_output_options           TYPE ssfcompop.  
"Set the TDARMOD TO 2 ( Archive only) / 3 (Print and Archive)
gst_output_options-tdarmod = '2'.

                                        OR

 gst_output_options-tdarmod = '3'.


STEP3:

Call the smartform with the below parameters



CALL FUNCTION gw_fm_name
EXPORTING
archive_index           = toa_dara
archive_parameters      = arc_params
control_parameters      = gst_control_param
output_options          = gst_output


That’s all , call the smartform with these parameters set as required,the output triggered will get archived in the repository. But to convert the smartform output to PDF and attach in the email we need to get the OTF of the smartform called which will be achieved by setting the GETOTF field ‘X’ as below.


gst_control_param-getotf    = 'X'. "Get OTF of the smartform

But by doing so it fails to archive the document so to overcome you can call the smartform twice with GETOTF = ‘Blank’ and GETOTF = ‘X’, first one to archive and second one to get otf which can be converted into PDF.

Note : Archiving with Transmission medium as External Send (NAST-NACHA = ‘5’)

When output is triggered with transmission medium as external send, the output fails to archive as the GETOTF field is set to ‘X’. So in such case call the smartform twice as explained above.


Summary:

  1. To archive, GETOTF = space and TDARMOD = 2 or 3
  2. To get OTF, GETOTF = ‘X’ which can be converted into PDF and can be uploaded onto the SAP UNIX server.
9 Comments