SAP CONVERT_OTF_AND_ARCHIVE Function Module for Interface Between SAPscript and Archive: OTF->OTF or OTF->PDF
CONVERT_OTF_AND_ARCHIVE is a standard convert otf and archive SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Interface Between SAPscript and Archive: OTF->OTF or OTF->PDF processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for convert otf and archive FM, simply by entering the name CONVERT_OTF_AND_ARCHIVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STXW
Program Name: SAPLSTXW
Main Program: SAPLSTXW
Appliation area: S
Release date: 17-Sep-2003
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CONVERT_OTF_AND_ARCHIVE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CONVERT_OTF_AND_ARCHIVE'"Interface Between SAPscript and Archive: OTF->OTF or OTF->PDF.
EXPORTING
ARC_P = "Global Archive Parameters of Request
* ARC_I = "Archive Information of Document
* FORMAT = 'PDF' "
* ARC_TAB = "Table with Archive Indices (only Smart Forms)
* ARCHIVE_COPIES = ' ' "Archive Copies
* MAX_COPIES = '001' "Number of Copies
TABLES
OTF = "Table with Document in OTF Format
EXCEPTIONS
ERROR_ARCHIV = 1 ERROR_COMMUNICATIONTABLE = 2 ERROR_CONNECTIONTABLE = 3 ERROR_KERNEL = 4 ERROR_PARAMETER = 5 ERROR_FORMAT = 6
IMPORTING Parameters details for CONVERT_OTF_AND_ARCHIVE
ARC_P - Global Archive Parameters of Request
Data type: ARC_PARAMSOptional: No
Call by Reference: No ( called with pass by value option)
ARC_I - Archive Information of Document
Data type: TOA_DARAOptional: Yes
Call by Reference: No ( called with pass by value option)
FORMAT -
Data type:Default: 'PDF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ARC_TAB - Table with Archive Indices (only Smart Forms)
Data type: TSFDARAOptional: Yes
Call by Reference: No ( called with pass by value option)
ARCHIVE_COPIES - Archive Copies
Data type: TDBOOLDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
MAX_COPIES - Number of Copies
Data type: SFCOPIESDefault: '001'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CONVERT_OTF_AND_ARCHIVE
OTF - Table with Document in OTF Format
Data type: ITCOOOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR_ARCHIV - Error in ARCHIV_CREATE_OUTGOINGDOCUMENT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_COMMUNICATIONTABLE - Error in ARCHIV_CREATE_OUTGOINGDOCUMENT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_CONNECTIONTABLE - Error in ARCHIV_CREATE_OUTGOINGDOCUMENT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_KERNEL - Error in ARCHIV_CREATE_OUTGOINGDOCUMENT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_PARAMETER - Error in ARCHIV_CREATE_OUTGOINGDOCUMENT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_FORMAT -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CONVERT_OTF_AND_ARCHIVE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_otf | TYPE STANDARD TABLE OF ITCOO, " | |||
| lv_arc_p | TYPE ARC_PARAMS, " | |||
| lv_error_archiv | TYPE ARC_PARAMS, " | |||
| lv_arc_i | TYPE TOA_DARA, " | |||
| lv_error_communicationtable | TYPE TOA_DARA, " | |||
| lv_format | TYPE TOA_DARA, " 'PDF' | |||
| lv_error_connectiontable | TYPE TOA_DARA, " | |||
| lv_arc_tab | TYPE TSFDARA, " | |||
| lv_error_kernel | TYPE TSFDARA, " | |||
| lv_archive_copies | TYPE TDBOOL, " ' ' | |||
| lv_error_parameter | TYPE TDBOOL, " | |||
| lv_max_copies | TYPE SFCOPIES, " '001' | |||
| lv_error_format | TYPE SFCOPIES. " |
|   CALL FUNCTION 'CONVERT_OTF_AND_ARCHIVE' "Interface Between SAPscript and Archive: OTF->OTF or OTF->PDF |
| EXPORTING | ||
| ARC_P | = lv_arc_p | |
| ARC_I | = lv_arc_i | |
| FORMAT | = lv_format | |
| ARC_TAB | = lv_arc_tab | |
| ARCHIVE_COPIES | = lv_archive_copies | |
| MAX_COPIES | = lv_max_copies | |
| TABLES | ||
| OTF | = lt_otf | |
| EXCEPTIONS | ||
| ERROR_ARCHIV = 1 | ||
| ERROR_COMMUNICATIONTABLE = 2 | ||
| ERROR_CONNECTIONTABLE = 3 | ||
| ERROR_KERNEL = 4 | ||
| ERROR_PARAMETER = 5 | ||
| ERROR_FORMAT = 6 | ||
| . " CONVERT_OTF_AND_ARCHIVE | ||
ABAP code using 7.40 inline data declarations to call FM CONVERT_OTF_AND_ARCHIVE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| DATA(ld_format) | = 'PDF'. | |||
| DATA(ld_archive_copies) | = ' '. | |||
| DATA(ld_max_copies) | = '001'. | |||
Search for further information about these or an SAP related objects