Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamically file name

Former Member
0 Likes
1,111

Hi all,

I am getting the file name from /SAPDMC/LSM_PATH_FILE_SPLIT table . But i need to pass this file in the Application Server path.

I want to pass the file name Dynamically. Please help me in this.

regards,

Ajay

10 REPLIES 10
Read only

Former Member
0 Likes
1,066

I wonder if a table name be such big.

can u post more details and clearly..so that u can get help ..

thanks

kiran

Read only

0 Likes
1,066

HI ,

I have two parameters in the selection screen.

One presentation Srver file path:

C:\Documents and Settings\RRR\Desktop\test1.xls

One Application Server fiel Path:

sapfeeds/interface/test1.xls.

from above filename test1.xls, i need to fill in the Application Srver file path dynamically in selection scree.

How can i carry the file name to the second parameters (Application Server fiel Path) input.

regards,

Ajay

Read only

0 Likes
1,066

you need to follow some standard filename always and find the string length of the whole file name and pick the last few cahracters of the file name and concatenate for the app server path.

Read only

0 Likes
1,066

Hi Ajay I wrote some logic which ill work for you...

DATA lv_line TYPE i.
DATA: lv_p TYPE string VALUE 'sapfeeds/interface/test1.xls'.
DATA: lv_junk TYPE string.
lv_line = STRLEN( lv_p ).

IF lv_p CS '/'.
  DO 2 TIMES.
    SPLIT lv_p AT '/' INTO lv_junk lv_p.
  ENDDO.
  WRITE / lv_p.
ENDIF.

Read only

0 Likes
1,066

Hi,

You can populate the values dynammically at selection screen event. Here you need to call the function module 'DYNP_VALUES_READ' which reads the contents on the selection screen and then u need to call another function module 'DYNP_VALUES_UPDATE' which updates the contents the screen.

So in your case read the file name using fisrt function module and then use the second functionmodule to update the path in the application server.

Thanks,

Preetham S

Read only

0 Likes
1,066

HI all,

I have 2 input 's on the selection screen . I am giving the C:\ravi\test1.txt in first input. After that I am reding the filename text1.txt bysuing the FM. I am kepping in one variable.

This valiable should come in second input automatically. My problme is this Valiable not carrying to the second input.

regards,

Ajay

Read only

0 Likes
1,066

Hi,

How are u entering the values manaully or by f4 help. If you populate manually then u will have to trigger the even manually. I suggest u to populate the values using F4. So in that value request event you can populate the second field as well using the function module i mentioned in my previous post.

thanks,

preetham s

Read only

0 Likes
1,066

Solved By Me thQ yoo all.

regards,

Ajay reddy

Read only

former_member156446
Active Contributor
0 Likes
1,066

Hi check this..


Concatenate 'US' 'Filename' 'EXT' into lv_path.

open dataset lv_path in text mode....

Read only

Former Member
0 Likes
1,066

As you already asked how to get the file name from that string, I'll continue from there.

Instead of writing it like I did in my answer, use the same type of string reading for puting it into a variable, as in file_name = file+0(cont).

Now you have the file name in the variable file_name, so you just concatenate the string for your new path with this variable into another variable, and can pass it dinamically to the presentetion server in the form of this new variable.