Skip to Content
avatar image
Former Member

rename a parameter

Hi

I have 2 parameters on a selection screen, p_dir and p_dir2.

from p_dir, we are retrieving the directory of a file.

p_dir2 will take the value of p_dir but with an extension.

like if p_dir = Y:\05. SAP \con\09 implementation\10 DEVELOPMENTS\Files\file.txt

p_dir2 is then Y:\05. SAP \con\09 implementation\10 DEVELOPMENTS\Files\file_new.txt

The problem is that I dont know how the name of the directory will be so that I can rename p_dir2, sometimes the directory doesnt even have the extension '.txt'

I dont know how to handle these cases

Is there any FM which can do this?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 03, 2008 at 08:15 AM

    Hi Sia,

    You can use SEARH to know whether it contains the extension, txt.

    Like this:

    search pdir for 'txt'.

    if sy-subrc eq 0.

    write : sy-FDPOS.

    " fdpos : offset in character string

    endif.

    Hope helps.

    deniz.

    Add comment
    10|10000 characters needed characters exceeded