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

SPLIT statement

Former Member
0 Likes
689

Hi All,

Suppose i have a code which look like.

DATA : file_name1 type fileintern.

Data : file_name TYPE fileintern VALUE '/sst_data/ACE/cdc/send/vtdwh/bmw_atl_cdc_I062_it_prices.dat',

split file_name at 24 into file_name1 in character mode.

when i executed this code it giving some error

"The VALUE specification is longer than the corresponding field. The VALUE specification will only be passed to the field length!

i want file_name1 = /sst_data/ACE/cdc/send/

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
655

HI Abdul,

It is either:

file_name1 = file_name+0(24). or

split file_name at 'vtdwh/bmw_atl_cdc_I062_it_prices.dat'

into file_name1 in character mode.

regards,

john.

5 REPLIES 5
Read only

Former Member
0 Likes
655

Hi,

Please try this FM SO_SPLIT_FILE_AND_PATH.


REPORT ZTEST.
                                                                        
DATA: FILENAME TYPE STRING VALUE
'/sst_data/ACE/cdc/send/vtdwh/bmw_atl_cdc_I062_it_prices.dat'.
                                                                        
DATA: FILENAME2 TYPE STRING.
                                                                        
CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
  EXPORTING
    FULL_NAME = FILENAME
  IMPORTING
    FILE_PATH = FILENAME2
  EXCEPTIONS
    X_ERROR   = 1
    OTHERS    = 2.
                                                                        
WRITE: / FILENAME2(23).

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
656

HI Abdul,

It is either:

file_name1 = file_name+0(24). or

split file_name at 'vtdwh/bmw_atl_cdc_I062_it_prices.dat'

into file_name1 in character mode.

regards,

john.

Read only

Former Member
0 Likes
655
REPORT ychatest.

DATA : file_name TYPE fileintern VALUE '/sst_data/ACE/cdc/send/vtdwh/bmw_atl_cdc_I062_it_prices.dat'.

SEARCH file_name FOR 'send'.
IF sy-subrc EQ 0.
  sy-fdpos = sy-fdpos + 5.
  file_name = file_name+0(sy-fdpos).
  WRITE : file_name.
ENDIF.
Read only

former_member187255
Active Contributor
0 Likes
655

Abdul,

Check this FM <b>PC_SPLIT_COMPLETE_FILENAME</b>

Regards.

Read only

0 Likes
655

Hi abdul,

When you are sure of splitting at 24th character, why don't you offset it ?

file_name1 = file_name+0(24).

This would give you the correct result with out any hassel.

Award points if it helps.