Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FM 'DOCUMENT_SHOW_DIRECT'

Former Member
0 Likes
1,866

Hi,

as in transaction 'CV04N', I have in my report programmed functionality to open an arhcived document directly from the selected alv row.

This is done by calling FM DOCUMENT_SHOW_DIRECT' and works almost as i want it.

Apart from when a file is opened, it already has concatenated SY-UNAME + a number from 1-20 assigned to the opened file. So this name is displayed in the topframe of the opened document.

Anyone know if its possible to just retrieve the actual filename, instead of the FM generating this temporary name?

I also tried the FM CVAPI_DOC_VIEW.

Regards

Jakob

1 ACCEPTED SOLUTION
Read only

kostas_tsioubris
Contributor
0 Likes
1,175

Hi,

you can use the FM CVAPI_DOC_VIEW with the following parameters

CALL FUNCTION 'CVAPI_DOC_VIEW'               
              EXPORTING                                    
                pf_dokar      = ls_draw-dokar         
                pf_doknr      = ls_draw-doknr         
                pf_dokvr      = ls_draw-dokvr         
                pf_doktl      = ls_draw-doktl         
                pf_filename   = lv_url      "this is the path and filename you want 
                                            "to save the document
                pf_appl_start = space                       
              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.

Kostas

Thank you, I'll try this

3 REPLIES 3
Read only

kostas_tsioubris
Contributor
0 Likes
1,176

Hi,

you can use the FM CVAPI_DOC_VIEW with the following parameters

CALL FUNCTION 'CVAPI_DOC_VIEW'               
              EXPORTING                                    
                pf_dokar      = ls_draw-dokar         
                pf_doknr      = ls_draw-doknr         
                pf_dokvr      = ls_draw-dokvr         
                pf_doktl      = ls_draw-doktl         
                pf_filename   = lv_url      "this is the path and filename you want 
                                            "to save the document
                pf_appl_start = space                       
              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.

Kostas

Read only

Former Member
0 Likes
1,175

Thank you, I'll try this

Read only

Former Member
0 Likes
1,175

I was having the same issue and learned that this is controlled in 'Workstation Application' configuration using the 'You cannot rename temporary files' checkbox.  Tick the checkbox and the file will launch with the actual name on the original.  Just wanted to provide this info in case others come across the same problem.