cancel
Showing results for 
Search instead for 
Did you mean: 

DMS Download issue

K2_SAP
Explorer
0 Kudos

Hello Experts,

My coding is

CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'

           EXPORTING

             documenttype    = dokar

             documentnumber  = doknr

             documentpart    = doktl

             documentversion = dokvr

           TABLES

             documentfiles   = lt_docfiles.

           READ TABLE lt_docfiles INTO lw_docfiles .

               CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'

                 EXPORTING

                   documenttype    = dokar

                   documentnumber  = doknr

                   documentpart    = doktl

                   documentversion = dokvr

                   documentfile    = lw_docfiles

                   getstructure    = '1'

                   getcomponents   = 'X'

                   originalpath    = lv_org_path

                   getheader       = 'X'

                 IMPORTING

                   return          = lw_return.

               IF lw_return-type = 'E'.

                 MESSAGE s000(zmm) WITH lw_return-message.

               ELSE.

*                CLEAR: gt_filedet,gf_filedown.

                 MESSAGE s000(zmm) WITH 'Document Downloaded'(003).

               ENDIF.

             ENDIF.


My lw_return workarea didnt show any error, but the file didnt download in my selected path,

did i miss anything please experts help to figure it out..

Accepted Solutions (0)

Answers (4)

Answers (4)

prakashjasti
Contributor

Hi ,

Please check for conversion routines available  before sending the input to the BAPI.

Regards,

Prakash.

K2_SAP
Explorer
0 Kudos

Hi Prakash,

Yes i am using the Converstion routines already, but still it's happening the same thing

Thanks and Regards,

Karthik

K2_SAP
Explorer
0 Kudos

Hi Glen,

IF doknr IS NOT INITIAL.

     CALL METHOD cl_gui_frontend_services=>directory_browse

       EXPORTING

         window_title         = 'Choose a location'

       CHANGING

         selected_folder      = lv_path

       EXCEPTIONS

         cntl_error           = 1

         error_no_gui         = 2

         not_supported_by_gui = 3

         OTHERS               = 4.

     IF sy-subrc = 0.

       IF lv_path IS NOT INITIAL.

         CONCATENATE lv_path '\' INTO lv_org_path.

         TRANSLATE lv_org_path TO UPPER CASE.

         doktl = '000'.

         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

           EXPORTING

             input  = doknr

           IMPORTING

             output = doknr.

         CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'

           EXPORTING

             documenttype    = dokar

             documentnumber  = doknr

             documentpart    = doktl

             documentversion = dokvr

           TABLES

             documentfiles   = lt_docfiles.

         READ TABLE lt_docfiles INTO lw_docfiles .

*          lw_docfiles-documenttype = dokar.

*          lw_docfiles-documentnumber = doknr.

*          lw_docfiles-documentpart = doktl.

*          lw_docfiles-documentversion = dokvr.

         CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'

           EXPORTING

             documenttype    = dokar

             documentnumber  = doknr

             documentpart    = doktl

             documentversion = dokvr

             documentfile    = lw_docfiles

             getstructure    = '1'

             getcomponents   = 'X'

             originalpath    = lv_org_path

             getheader       = 'X'

           IMPORTING

             return          = lw_return.

         IF lw_return-type = 'E'.

           ROLLBACK WORK.

           MESSAGE s000(zmm) WITH lw_return-message.

           CLEAR lw_return.

         ELSE.

           COMMIT WORK.

*                CLEAR: gt_filedet,gf_filedown.

           MESSAGE s000(zmm) WITH 'Document Downloaded'(003).

           CLEAR lw_return.

         ENDIF.

       ENDIF.

     ENDIF.

   ENDIF.

This is my whole code..

Screen shot of debugger is here

thanga_prakash
Active Contributor
0 Kudos

Hello Karthik,

Use the return check on first BAPI. use importing parameter RETURN and check is there any exceptions raised.

There might be some exceptions are raised in First BAPI which is causing the problem.

Refer to the documentation of the BAPI BAPI_DOCUMENT_GETDETAIL2

Regards,

Thanga

K2_SAP
Explorer
0 Kudos

Hello Prakash,

I checked thoroughly the 1st BAPI , there is no Exception raised in that Return workarea , values are passing correctly to that Internal table of BAPI_DOCUMENT_GETDETAIL2 but in that Final BAPI something wrong..

Thanks and Regards

Karthik

former_member201275
Active Contributor
0 Kudos

Is your path correct in terms of upper and lower case and '/' etc.? Please debug, and click on this field at the point where it is called and then post the screenshot here. Thank you.