Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

rename a parameter


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?

Former Member
Former Member replied

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


Hope helps.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question