Purpose
The plain technical requirement is that a PDF document is stored in SAP needs to be displayed as a Pop-up to the portal user.
Details
Earlier, I used to use SAP GUI for HTML and call the 'DOCUMENT_SHOW_DIRECT' in a wrapper program with submit.
But here is a better way.
Create a New method DISPLAY_DOCUMENT in your assitance class, generally the TYPE of document is static but you can keep all as parameterised.
Inside the method call the following code
v_url type MCDOK-URL.
CALL FUNCTION 'CVAPI_DOC_VIEW'
EXPORTING
PF_DOKAR = I_DOKAR
PF_DOKNR = I_DOKNR
PF_DOKVR = I_DOKVR
PF_DOKTL = I_DOKTL
PF_HOSTNAME = 'DEFAULT'
PF_APPL_START = ' '
PF_GET_URL = 'X'
IMPORTING
PFX_URL = v_URL
EXCEPTIONS
ERROR = 1
NOT_FOUND = 2
NO_AUTH = 3
NO_ORIGINAL = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
lo_api_component = wd_comp_controller->wd_get_api( ). CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW MODAL = ABAP_FALSE lo_window->open( ).
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component type ref to if_wd_component.
data lo_window type ref to if_wd_window.
lo_window_manager = lo_api_component->get_window_manager( ).
EXPORTING
URL = W_URL
HAS_MENUBAR = ABAP_TRUE
IS_RESIZABLE = ABAP_TRUE
HAS_SCROLLBARS = ABAP_TRUE
HAS_STATUSBAR = ABAP_TRUE
HAS_TOOLBAR = ABAP_TRUE
HAS_LOCATION = ABAP_TRUE
RECEIVING
WINDOW = lo_window.
Output
Well, I have called this code on click of ALV on the DMS document number... and here is the result