cancel
Showing results for 
Search instead for 
Did you mean: 

How to check file dimension during DMS document check in

giancarlo_adamo
Explorer
0 Kudos

Hello,

I have this problem: I want to limit the dimension of originals during check in (CV02N or CV01N). I'm using KPRO then I cannot specify it in the document type definition (DC10).

I tried solution suggested previously in this community to use BADI DOCUMENT_STORAGE01 --> before_physical_checkin but I have not found a way to get the file size before to upload it.

I tried to use SDOK_PHIOS_FILE_PROPERTIES_GET but this works only for files already uploaded in SAP.

Please note that I need a solution that works also with SAP Engineering Control Center.

Can someone help me.

Massimiliano

Accepted Solutions (0)

Answers (2)

Answers (2)

giancarlo_adamo
Explorer
0 Kudos

Hello Ricardo,

thank you for your answer: it was very helpfull.

Using

    CALL METHOD cl_gui_frontend_services=>file_get_size
      EXPORTING
        file_name = lv_filename
      IMPORTING
        file_size = lv_ntemp.
    IF sy-subrc <> 0.
* Imple suitable error handling here
      lv_ntemp = 0.
    ENDIF.
    CALL METHOD  cl_gui_cfw=>flush( ).

I'm able to read the dimension of the file before check-in then this should solve my problem.

Unfortunately the event

DOCUMENT_STORAGE01 --> before_physical_checkin

seems to be not triggered when you check-in using ECTR.

So, I'm not sure how to on.

ricardo_mano4
Participant
0 Kudos

Hello Giancarlo,

Please see if this "question and solution" can help you. If not please return.

https://answers.sap.com/questions/4132654/function-module-which-reads-the-file-size.html

Good Luck