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

Dump for strlen()

Former Member
0 Likes
1,418

Hi,

Following goes for dump:

data:path TYPE FILE_INFO.

DATA:l_path TYPE string,

l_len TYPE i.

l_len = STRLEN( path ).

l_path = path+9(l_len).

Can you suggest?

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
1,270

Hi, Ginger

Please Check the following Sample Code hope will solve out your problem,

DATA: path    LIKE file_info-filename.
DATA: l_path  TYPE string,
      l_len   TYPE i.

path = '123456789ABC'.
l_len = STRLEN( path ).
l_path = path+9(l_len).

WRITE: l_path.

Faisal

11 REPLIES 11
Read only

Former Member
0 Likes
1,270

Hi,

Path must be character-like data Object.

Read only

former_member209217
Active Contributor
0 Likes
1,270

Hi,

Path should be a character type data object. Here ur using file_info which is a structure.

This structure contains date time integer fields which are not suitable for string operations

Read only

Former Member
0 Likes
1,270

Hi Dear,

FILE_INFO is a structure and not a field.

"PATH" must be a character-type data object (data type C, N, D, T or String)

Regards,

Vijay

Read only

Former Member
0 Likes
1,270

strlen function can't be used on structure ' FILE_INFO'

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,270

Hello Ginger,

The code does nto even syntax check, how can you get a dump? (May be you did a "activate anyways").

BR,

Suhas

Read only

Former Member
0 Likes
1,270

Now suggest!!!please...

data:path TYPE FILE_INFO.

DATA:l_path TYPE string,

l_len TYPE i.

l_len = STRLEN( path-name ).

l_path = path-name+9(l_len).

Edited by: Ginger on Sep 24, 2009 8:20 AM

Read only

Former Member
0 Likes
1,270

this will work!!!!

data:path TYPE FILE_INFO.

DATA:l_path TYPE string,

l_len TYPE i.

l_len = STRLEN( path-FILENAME ).

l_path = path+9(l_len).

Read only

Former Member
0 Likes
1,270

Hi Ginger again,

TRy this.

DATA:path TYPE file_info.

DATA:l_path TYPE string,

l_len TYPE i.

l_len = STRLEN( path-filename ).

l_path = path-filename+9(l_len).

Regards,

VIjay

Read only

Former Member
0 Likes
1,270


data:path LIKE RLGRAP-FILENAME.

DATA:l_path LIKE RLGRAP-FILENAME.

path = 'C:\file.txt'.
data : len TYPE i.

translate path to upper case.
    len = strlen( path ).
    l_path = path+9(len).

Read only

Former Member
0 Likes
1,270

Hi,

Declare path as file_info-filename


data:path TYPE FILE_INFO-filename.
DATA:l_path TYPE string,
l_len TYPE i.

l_len = STRLEN( path ).
l_path = path+9(l_len).

Regards,

Vikranth

Read only

faisalatsap
Active Contributor
0 Likes
1,271

Hi, Ginger

Please Check the following Sample Code hope will solve out your problem,

DATA: path    LIKE file_info-filename.
DATA: l_path  TYPE string,
      l_len   TYPE i.

path = '123456789ABC'.
l_len = STRLEN( path ).
l_path = path+9(l_len).

WRITE: l_path.

Faisal