Skip to Content

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

/wp-content/uploads/2015/02/image1_651191.jpg

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.

/wp-content/uploads/2015/02/image2_651192.jpg

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.

/wp-content/uploads/2015/02/image3_651200.jpg

/wp-content/uploads/2015/02/image4_651201.jpg


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.

/wp-content/uploads/2015/02/image5_651202.jpg


5.       Parameters on which archiving of smartforms depends.

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

/wp-content/uploads/2015/02/image6_651218.jpg

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    = ''.


/wp-content/uploads/2015/02/image7_651220.jpg


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'.

/wp-content/uploads/2015/02/image8_651225.jpg


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.


/wp-content/uploads/2015/02/image9_651227.jpg

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.
To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. Kasper Peters

    Maybe late reply, but this helped me a lot. We call the form for mail and when the call is done – we convert it to mail with additional parameters like subject, sender and body text. So we needed to archive this email so with your suggestion we are able to do it.

    The only issue we experienced with calling the form twice is that it generated a spool. As an addition, we have a LOCL device driver and if user saved the document, the local windows driver ALSO wanted to create a PDF. This is because you call the function twice. The reason for this, is the tdarmod = ‘3’ (Print AND archive) you pass to the function module (output_options-tdarmod). We fixed this to set the tdarmod in the archiving ‘function call’ to ‘2’ (Archive). No spool and unwanted LOCL popup anymore. Maybe this helps someone else. Thanks.

    (0) 

Leave a Reply