cancel
Showing results for 
Search instead for 
Did you mean: 

Basic query on files attched to document

Former Member
0 Kudos

Hi,

I am new to docuemnt management.

one of existing directory files moved to new directory. so i have to change all orignal file path to new directory path.

Please help me how can do this mase change on file path.

Regards, Sri

Accepted Solutions (0)

Answers (1)

Answers (1)

christoph_hopf
Advisor
Advisor
0 Kudos

Hi Sri,

regarding some very similar issue I got an individual modification report with the following coding which could maybe be useful for your situation too:

tables: dms_phio2file.

parameters: old_path LIKE dms_phio2file-filename,
            new_path LIKE dms_phio2file-filename.

data: lt_dms_phio2file TYPE TABLE OF dms_phio2file,
      wa_dms_phio2file TYPE dms_phio2file,
      lt_dms_phio2file_1 TYPE TABLE OF dms_phio2file,
      wa_dms_phio2file_1 TYPE dms_phio2file,
      updated_path LIKE dms_phio2file-filename.

select * from dms_phio2file into corresponding fields of table lt_dms_phio2file.

LOOP AT lt_dms_phio2file INTO wa_dms_phio2file.
  IF wa_dms_phio2file-filename CS old_path.
    CLEAR updated_path.
    updated_path = wa_dms_phio2file-filename.
    REPLACE ALL OCCURRENCES OF old_path IN updated_path WITH new_path.
    wa_dms_phio2file-filename = updated_path.
    MODIFY lt_dms_phio2file INDEX sy-tabix FROM wa_dms_phio2file TRANSPORTING file_id filename.
  ENDIF.
ENDLOOP.

UPDATE dms_phio2file FROM TABLE lt_dms_phio2file.

IF sy-subrc = 0.
  WRITE 'Update in database successful'.
ELSE.
  WRITE 'Update in database not fully successful'.
ENDIF.

Please note that this report is just a sample and not an official SAP report. So please check if this could help to modify the file paths in your system too.

Best regards,

Christoph