SAP CVAPI_DOC_VIEW Function Module for NOTRANSL: DVS: Original anzeigen mit Auswahl falls mehere existieren
CVAPI_DOC_VIEW is a standard cvapi doc view SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: DVS: Original anzeigen mit Auswahl falls mehere existieren 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 cvapi doc view FM, simply by entering the name CVAPI_DOC_VIEW into the relevant SAP transaction such as SE37 or SE38.
Function Group: CVAPI01
Program Name: SAPLCVAPI01
Main Program: SAPLCVAPI01
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CVAPI_DOC_VIEW 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 'CVAPI_DOC_VIEW'"NOTRANSL: DVS: Original anzeigen mit Auswahl falls mehere existieren.
EXPORTING
PF_DOKAR = "Dokumentart
* PF_FILENAME = ' ' "Alternativer Dateiname für View
* PS_FILE = "Welches Original soll geviewt werden
* PF_PARENT = "Container für Inline-Viewing
* PF_USE_DYNP = ' ' "Control in modalem Screen darstellen
* PS_DRAP_AUDIT = "Zeige alle Inhaltsversionen zu Auditstatus
PF_DOKNR = "Dokumentnummer
PF_DOKVR = "Dokumentversion
PF_DOKTL = "Teildokument
* PF_HOSTNAME = ' ' "Rechnername des Frontends
* PF_APPL_START = 'X' "Applikation starten ?
* PF_GET_URL = ' ' "URL zurückliefern
* PF_APPTP = '1' "Applikationstyp
* PF_ASK_FILENAME = ' ' "Benutzer nach Dateinamen fragen
IMPORTING
PFX_FILE = "temp. Dateiname für View
PFX_URL = "URL
PFX_VIEW_INPLACE = "Viewer inplace gestartet
EXCEPTIONS
ERROR = 1 NOT_FOUND = 2 NO_AUTH = 3 NO_ORIGINAL = 4
IMPORTING Parameters details for CVAPI_DOC_VIEW
PF_DOKAR - Dokumentart
Data type: DRAW-DOKAROptional: No
Call by Reference: No ( called with pass by value option)
PF_FILENAME - Alternativer Dateiname für View
Data type: DRAW-FILEPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PS_FILE - Welches Original soll geviewt werden
Data type: CVAPI_DOC_FILEOptional: Yes
Call by Reference: No ( called with pass by value option)
PF_PARENT - Container für Inline-Viewing
Data type: CL_GUI_CONTAINEROptional: Yes
Call by Reference: No ( called with pass by value option)
PF_USE_DYNP - Control in modalem Screen darstellen
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PS_DRAP_AUDIT - Zeige alle Inhaltsversionen zu Auditstatus
Data type: DRAPOptional: Yes
Call by Reference: No ( called with pass by value option)
PF_DOKNR - Dokumentnummer
Data type: DRAW-DOKNROptional: No
Call by Reference: No ( called with pass by value option)
PF_DOKVR - Dokumentversion
Data type: DRAW-DOKVROptional: No
Call by Reference: No ( called with pass by value option)
PF_DOKTL - Teildokument
Data type: DRAW-DOKTLOptional: No
Call by Reference: No ( called with pass by value option)
PF_HOSTNAME - Rechnername des Frontends
Data type: TDWD-NTADRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_APPL_START - Applikation starten ?
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_GET_URL - URL zurückliefern
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_APPTP - Applikationstyp
Data type: TDWX-APPTPDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PF_ASK_FILENAME - Benutzer nach Dateinamen fragen
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CVAPI_DOC_VIEW
PFX_FILE - temp. Dateiname für View
Data type: DRAW-FILEPOptional: No
Call by Reference: Yes
PFX_URL - URL
Data type: MCDOK-URLOptional: No
Call by Reference: Yes
PFX_VIEW_INPLACE - Viewer inplace gestartet
Data type: COptional: No
Call by Reference: Yes
EXCEPTIONS details
ERROR - allg. Fehler
Data type:Optional: No
Call by Reference: Yes
NOT_FOUND - Dokument nicht gefunden
Data type:Optional: No
Call by Reference: Yes
NO_AUTH - Keine Berechtigung
Data type:Optional: No
Call by Reference: Yes
NO_ORIGINAL - Kein Original
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CVAPI_DOC_VIEW 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: | ||||
| lv_error | TYPE STRING, " | |||
| lv_pfx_file | TYPE DRAW-FILEP, " | |||
| lv_pf_dokar | TYPE DRAW-DOKAR, " | |||
| lv_pf_filename | TYPE DRAW-FILEP, " SPACE | |||
| lv_ps_file | TYPE CVAPI_DOC_FILE, " | |||
| lv_pf_parent | TYPE CL_GUI_CONTAINER, " | |||
| lv_pf_use_dynp | TYPE C, " SPACE | |||
| lv_ps_drap_audit | TYPE DRAP, " | |||
| lv_pfx_url | TYPE MCDOK-URL, " | |||
| lv_pf_doknr | TYPE DRAW-DOKNR, " | |||
| lv_not_found | TYPE DRAW, " | |||
| lv_no_auth | TYPE DRAW, " | |||
| lv_pf_dokvr | TYPE DRAW-DOKVR, " | |||
| lv_pfx_view_inplace | TYPE C, " | |||
| lv_pf_doktl | TYPE DRAW-DOKTL, " | |||
| lv_no_original | TYPE DRAW, " | |||
| lv_pf_hostname | TYPE TDWD-NTADR, " SPACE | |||
| lv_pf_appl_start | TYPE C, " 'X' | |||
| lv_pf_get_url | TYPE C, " SPACE | |||
| lv_pf_apptp | TYPE TDWX-APPTP, " '1' | |||
| lv_pf_ask_filename | TYPE C. " SPACE |
|   CALL FUNCTION 'CVAPI_DOC_VIEW' "NOTRANSL: DVS: Original anzeigen mit Auswahl falls mehere existieren |
| EXPORTING | ||
| PF_DOKAR | = lv_pf_dokar | |
| PF_FILENAME | = lv_pf_filename | |
| PS_FILE | = lv_ps_file | |
| PF_PARENT | = lv_pf_parent | |
| PF_USE_DYNP | = lv_pf_use_dynp | |
| PS_DRAP_AUDIT | = lv_ps_drap_audit | |
| PF_DOKNR | = lv_pf_doknr | |
| PF_DOKVR | = lv_pf_dokvr | |
| PF_DOKTL | = lv_pf_doktl | |
| PF_HOSTNAME | = lv_pf_hostname | |
| PF_APPL_START | = lv_pf_appl_start | |
| PF_GET_URL | = lv_pf_get_url | |
| PF_APPTP | = lv_pf_apptp | |
| PF_ASK_FILENAME | = lv_pf_ask_filename | |
| IMPORTING | ||
| PFX_FILE | = lv_pfx_file | |
| PFX_URL | = lv_pfx_url | |
| PFX_VIEW_INPLACE | = lv_pfx_view_inplace | |
| EXCEPTIONS | ||
| ERROR = 1 | ||
| NOT_FOUND = 2 | ||
| NO_AUTH = 3 | ||
| NO_ORIGINAL = 4 | ||
| . " CVAPI_DOC_VIEW | ||
ABAP code using 7.40 inline data declarations to call FM CVAPI_DOC_VIEW
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.| "SELECT single FILEP FROM DRAW INTO @DATA(ld_pfx_file). | ||||
| "SELECT single DOKAR FROM DRAW INTO @DATA(ld_pf_dokar). | ||||
| "SELECT single FILEP FROM DRAW INTO @DATA(ld_pf_filename). | ||||
| DATA(ld_pf_filename) | = ' '. | |||
| DATA(ld_pf_use_dynp) | = ' '. | |||
| "SELECT single URL FROM MCDOK INTO @DATA(ld_pfx_url). | ||||
| "SELECT single DOKNR FROM DRAW INTO @DATA(ld_pf_doknr). | ||||
| "SELECT single DOKVR FROM DRAW INTO @DATA(ld_pf_dokvr). | ||||
| "SELECT single DOKTL FROM DRAW INTO @DATA(ld_pf_doktl). | ||||
| "SELECT single NTADR FROM TDWD INTO @DATA(ld_pf_hostname). | ||||
| DATA(ld_pf_hostname) | = ' '. | |||
| DATA(ld_pf_appl_start) | = 'X'. | |||
| DATA(ld_pf_get_url) | = ' '. | |||
| "SELECT single APPTP FROM TDWX INTO @DATA(ld_pf_apptp). | ||||
| DATA(ld_pf_apptp) | = '1'. | |||
| DATA(ld_pf_ask_filename) | = ' '. | |||
Search for further information about these or an SAP related objects