Application Development 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: 

can a filename have spaces

Former Member
0 Kudos
799

Hi to all experts,

can a filename at the application server have spaces .If no how to cater for it ,,

1 ACCEPTED SOLUTION

former_member305388
Active Contributor
0 Kudos
229

Hi,

If you are uploading to AL11 (Application Server), then if you try uploading a file with spaces then, it will take only till a space.

Ex: If you are trying to upload 'file name.txt', it will consider 'file' and will take it into the server folder. But when you try to open it, it won't.

You better go for FM DOCFILE_CLIENT_TO_SERVER with no spaces in the filename.

11 REPLIES 11

Former Member
0 Kudos
229

hi:

it can be like

A B.dat etc but it is not possible like <space>.dat

Regards

Shashi

0 Kudos
229

my file name is OUT-1090000025-200903171823 - LY 1.txt.

actually my requirement is move the file from upload folder to the archive folder

im using the fm sxpg_command_execute to move the file from upload folder to archive folder using a zmove command.

when the file has spaces like above one it is not moving . when the file does not have spaces like

OUT-1090000029-200903171823-LY6.txt it is moved automatically . what could be the problem

code

DATA: filename(128) TYPE c.
   DATA: param LIKE sxpgcolist-parameters.


CASE sy-sysid.
  WHEN 'BO1'.
    p_arc = 'k:\\Share\MM_SCUBCode_PDAtxt_Archive'.
  WHEN 'BQ1'.
    p_arc = 'K:\\Share\MM_SCUBCode_PDAtxt_Archive'.
  WHEN OTHERS.
ENDCASE.



  CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
    EXPORTING
      full_name           = p_file
   IMPORTING
     STRIPPED_NAME       = filename
*     FILE_PATH           =
   EXCEPTIONS
     X_ERROR             = 1
     OTHERS              = 2
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



CONCATENATE p_arc filename INTO p_arc SEPARATED BY '\'.



CONCATENATE p_file p_arc INTO param SEPARATED BY space.


CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                         = 'ZMOVE'
   ADDITIONAL_PARAMETERS               =  param
*   OPERATINGSYSTEM                     = SY-OPSYS
*   TARGETSYSTEM                        = SY-HOST
*   DESTINATION                         =
*   STDOUT                              = 'X'
*   STDERR                              = 'X'
*   TERMINATIONWAIT                     = 'X'
*   TRACE                               =
*   DIALOG                              =
* IMPORTING
*   STATUS                              =
*   EXITCODE                            =
* TABLES
*   EXEC_PROTOCOL                       =
 EXCEPTIONS
   NO_PERMISSION                       = 1
   COMMAND_NOT_FOUND                   = 2
   PARAMETERS_TOO_LONG                 = 3
   SECURITY_RISK                       = 4
   WRONG_CHECK_CALL_INTERFACE          = 5
   PROGRAM_START_ERROR                 = 6
   PROGRAM_TERMINATION_ERROR           = 7
   X_ERROR                             = 8
   PARAMETER_EXPECTED                  = 9
   TOO_MANY_PARAMETERS                 = 10
   ILLEGAL_COMMAND                     = 11
   WRONG_ASYNCHRONOUS_PARAMETERS       = 12
   CANT_ENQ_TBTCO_ENTRY                = 13
   JOBCOUNT_GENERATION_ERROR           = 14
   OTHERS                              = 15
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.




clear filename .


endform.                    " process_file_on_server

Edited by: mohammed abdul hai on Mar 18, 2009 10:38 AM

0 Kudos
229

please help very critical

0 Kudos
229

No. I dont think so.

Filename cannot have Spaces as far as I know.

Write a simple application of accepting a text file from ur desktop(Presentation Server)

Use the FM GUI_DOWNLOAD to read and transfer it to internal table.

Check whether the above FM is working or not.

Based on that you can decide yourself. It takes hardly 5 mins to achieve this.....

former_member305388
Active Contributor
0 Kudos
229

Yes, the filename can have spaces like..

file name.txt

former_member305388
Active Contributor
0 Kudos
230

Hi,

If you are uploading to AL11 (Application Server), then if you try uploading a file with spaces then, it will take only till a space.

Ex: If you are trying to upload 'file name.txt', it will consider 'file' and will take it into the server folder. But when you try to open it, it won't.

You better go for FM DOCFILE_CLIENT_TO_SERVER with no spaces in the filename.

0 Kudos
229

it is through application server only and pardon me if im wrong i couldnt find any function module like

DOCFILE_CLIENT_TO_SERVER

Edited by: mohammed abdul hai on Mar 18, 2009 10:58 AM

0 Kudos
229

Yes they can have spaces.

ia m using below files from apps server, they do have space between characters like Prod and Allocation has one space in between them.

Prod Allocation.txt

GL 1 Released_PP_MRP Views Mat Master_Load File_Go Live.txt

0 Kudos
229

then what could be the problem in my code

0 Kudos
229

any help please

0 Kudos
229

Just guessing, but because of the spaces the unix "mv" command (probably behind your ZMOVE external command) might get confused with the number of parameters.

I'm not a unix buff, maybe the file name must be included in apostrophes or something if it contains spaces.

Thomas