cancel
Showing results for 
Search instead for 
Did you mean: 

Archive Smartform printout into SAP database

Former Member
0 Kudos

Dear All,

I am printing a smartform through Z-Program.

I need to archive this printout.

Please suggest me the solution.

Accepted Solutions (0)

Answers (3)

Answers (3)

david_liu1
Advisor
Advisor
0 Kudos

Hello,

Please be noted that archiving documents other than ABAP lists has been

deactivated through SAP note 725723.

So, OTF objects should be archived directly from the application.

The suggestion was that when the application calls the Smartforms

function module, it asks to prepare the OTF data and give it back to

the application.

If you set parameter CONTROL_PARAMETERS-GETOTF = 'X', then OTF data will

be returned to application and no printing/ archiving will be performed.

The application can manipulate the returned data. for instance convert

it to PDF and send as email (usual practice).

The application can also accumulate the OTF data received from different

Smartforms and then call the archiving procedure. e.g.

perform otf_archive in program SAPLSTXBC tables otfdata

using arc_params

arc_index.

It was also suggested that some modifcations to the OTF data before

appending it to a common table otfdata.

For instance, if you want to put 3 Smartforms into one archive, the

nntermediate OTF data returned will be OTF1, OTF2, OTF3. For OTF1

last line ('//'), for OTF2 you need to delete the first and last line,

for OTF3 you need to delete the first line only.

Then you can append them into the one OTFDATA table and do the call

above to otf_archive.

Or you can also use the Storage Mode Print and Archive instead of Print Only when print.

Regards,

David

Former Member
0 Kudos

Hello David,

Thanks for your solution. I did the same as you mentioned. The logic was executed.

The coding is given below,

DATA: otfdata TYPE TABLE OF itcoo.

DATA t_toa_dara TYPE tsfdara.

DATA: l_r_ssfcrescl TYPE ssfcrescl.

*----archive_parameters

MOVE: 'LIKP' TO arc_params-sap_object, " for delivery order

'SDODELNOTE' TO arc_params-ar_object, " for delivery order

sy-mandt TO arc_params-mandant,

sy-uname TO arc_params-arcuser,

'OT1C' TO arc_params-printer.

*----archive_index

MOVE: sy-mandt TO toa_dara-mandant,

'LIKP' TO toa_dara-sap_object, " for delivery order

'SDODELNOTE' TO toa_dara-ar_object. " for delivery order

APPEND toa_dara TO t_toa_dara.

Now How & where should I see the archived printout?

Former Member
0 Kudos

This is a great thread for creating OTF output from a Smart Form and archiving it.

Does anyone know the correct way to retrieve the OTF output and print it?

Former Member
0 Kudos

Hi,

Please go through this below thread...

hope this will help you.

Regards,

Kiran

Former Member
0 Kudos

Hi,

Pass values to the following parameters while calling smart form in the Z program:

ARCHIVE_INDEX

ARCHIVE_INDEX_TAB

ARCHIVE_PARAMETERS

CONTROL_PARAMETERS

Check below code for reference:

l_control_param-device = ld_device.

l_control_param-no_dialog = 'X'.

l_control_param-preview = xscreen.

l_control_param-getotf = getotf.

l_control_param-langu = nast-spras.

CALL FUNCTION lf_fm_name

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = ls_control_param