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

problem with concatenate

Former Member
0 Likes
917

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
893

hi,,

Use the FM SO_SPLIT_FILE_AND_PATH to split the Path and the filename

8 REPLIES 8
Read only

Former Member
0 Likes
893

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

Read only

0 Likes
893

yes chandra shekar,

i have declared like below

DATA: begin of V_NAMTAB occurs 0,

NAME(30),

END OF V_NAMTAB.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
893

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

Read only

0 Likes
893

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.

Read only

0 Likes
893

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

Read only

Former Member
0 Likes
893

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

Read only

Former Member
0 Likes
894

hi,,

Use the FM SO_SPLIT_FILE_AND_PATH to split the Path and the filename

Read only

Former Member
0 Likes
893

thanks for everyone.