‎2008 May 02 8:16 PM
hi i am using the below code
this is regarding manipulations to the file name whenre to place an excel sheet.
i have split the location given by user seperated by ' \' into each record of of the V_NAMTAB table.
it says unable to interpret V_NAMTAB-NAME.
DESCRIBE TABLE V_NAMTAB LINES N.
N = N - 1.
LOOP AT V_NAMTAB.
CONCATENATE V_NAMTAB-NAME '\' INTO l_floc.
IF SY-INDEX GE N.
EXIT.
ENDIF.
ENDLOOP.
My whole purpose of this is to keep the location of the file as given by user but name of the file will be calculated by this program.
‎2008 May 02 8:32 PM
hi,,
Use the FM SO_SPLIT_FILE_AND_PATH to split the Path and the filename
‎2008 May 02 8:20 PM
Hi,
what is the structure of V_NAMTAB , do you have a field NAME in that??
Have you declared V_NAMTAB with a header line
‎2008 May 02 8:23 PM
yes chandra shekar,
i have declared like below
DATA: begin of V_NAMTAB occurs 0,
NAME(30),
END OF V_NAMTAB.
‎2008 May 02 8:23 PM
I am not able to recreate your issue. this passes syntax check.
data: begin of v_namtab OCCURS 0,
name type tabname,
end of v_namtab.
data: n(4) type n.
data: l_floc type string.
DESCRIBE TABLE V_NAMTAB LINES N.
N = N - 1.
LOOP AT V_NAMTAB.
CONCATENATE V_NAMTAB-NAME '\' INTO l_floc.
IF SY-INDEX GE N.
EXIT.
ENDIF.
ENDLOOP.Regards,
RIch Heilman
‎2008 May 02 8:30 PM
yes reich,
i too did the same thing and it is passing the syntax check, but in debugging, the variable is holding only the last value in the loop. ie.
it is not holding the complete C:\.........\MAT.XLS
it is holding only MAT.XLS
but i want to hold everything except MAT.XLS
i want to put date inplace of MAT
thanks.
‎2008 May 02 8:35 PM
hi use this command..
for getting some value we use the offset..
or for replacing some data we use this..
data:char(25) value '5#4#2#&1#&'.
replace all occurrences of '#' in char with 'and' .
replace all occurrences of '&' in char with 'num' .
write: char.
for splitting use this simple command..
data: char(10) type c value 'hello/hai',
char1(5) type c,
char2(5) type c.
split char at '/' into char1 char2 .
write:/ char1 ,char2.
regards,
venkat
‎2008 May 02 8:28 PM
hi this is working..
data: begin of V_NAMTAB occurs 0,
name(10) type c,
end of V_NAMTAB .
data:l_floc(10) type c .
data: v_lines type i.
V_NAMTAB-name = 'hai'.
append V_NAMTAB.
V_NAMTAB-name = 'hello'.
append V_NAMTAB.
V_NAMTAB-name = 'good'.
append V_NAMTAB.
DESCRIBE TABLE V_NAMTAB LINES v_lines.
v_lines = v_lines - 1.
LOOP AT V_NAMTAB.
CONCATENATE V_NAMTAB-NAME '\' INTO l_floc.
write:/ l_floc .
ENDLOOP.
reagrds,
venkat
‎2008 May 02 8:32 PM
hi,,
Use the FM SO_SPLIT_FILE_AND_PATH to split the Path and the filename
‎2008 May 02 9:20 PM