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: 

SXPG_COMMAND_EXECUTE: ADDITIONAL_PARAMETERS contains Blanks

Former Member
0 Kudos

Hi to all,

I want to start a shell-script with SXPG_COMMAND_EXECUTE on Linux. Therefor I have maintained a command with SM69.

I have to fill ADDITIONAL_PARAMETERS with a list of parameters which are passed to the shell-script. Unfortunately some parameters contains blanks, such as a material description.

How do I have to call SXPG_COMMAND_EXECUTE so that a parameter "AA BB" or "CC DD" conserves as one parameter when it is passed to the shell-script and the shell-script can recognize these as one parameter and not as two or more.

Maybe someone has a suggestion for another solution to handle this problem.

Thanks in advance

Karl-Wilhelm

1 ACCEPTED SOLUTION

BalaMalvatu
Participant
0 Kudos

Hi

We used The following Code To Save a File on Unix Server.

Please check whether its useful or not.

ls_path = '/dma/livis/IRENT/'.
  CONCATENATE ls_path ls_file INTO ls_path.

  OPEN DATASET ls_path IN BINARY MODE  FOR OUTPUT.
  TRANSFER w_iox  TO ls_path.
  CLOSE DATASET ls_path.

  ls_dir = '/dma/livis/IRENT/'.

  CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
      dirname      = ls_dir
      filenm       = '*.*'
    TABLES
      file_list    = lt_files
    EXCEPTIONS
      access_error = 1
      OTHERS       = 2.

Regards

Bala.Malvatu

2 REPLIES 2

BalaMalvatu
Participant
0 Kudos

Hi

We used The following Code To Save a File on Unix Server.

Please check whether its useful or not.

ls_path = '/dma/livis/IRENT/'.
  CONCATENATE ls_path ls_file INTO ls_path.

  OPEN DATASET ls_path IN BINARY MODE  FOR OUTPUT.
  TRANSFER w_iox  TO ls_path.
  CLOSE DATASET ls_path.

  ls_dir = '/dma/livis/IRENT/'.

  CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
      dirname      = ls_dir
      filenm       = '*.*'
    TABLES
      file_list    = lt_files
    EXCEPTIONS
      access_error = 1
      OTHERS       = 2.

Regards

Bala.Malvatu

0 Kudos

Hi,

thanks for the answer. But thats doesn't match my problem. What I want is to start a shell-script with parameter whereas some parameters might include one or more blanks. Like for examples a script with only one parameter:

shell-script 'this is a parameter'

What I found out while testing with SM49 is, when I put the parameter into apostrophe than the parameter is passed as a single parameter to the script. But SM49 elsewell SXPG_COMMAND_EXECUTE condense more than blank to only one blank. And the apostrophe remain in the parameter.

SM49:

shell-script 'This   is a parameter'

The shell-script gets the parameter 'This is a parameter' , whereas the apostrophe ' and the start and at the end is part of the parameter.

Using the function modules SXPG_RFCDEST_OPEN_INT, SAPXPG_START_XPG and SAPXPG_END_XPG instead of SXPG_COMMAND_EXECUTE solves the problem of condensing the blanks to one blank. But the apostrophe is still part of the parameter. And I have to consider that the apostrophe might be originally part of the parameter.

And I have to solve this problem.

Regards

Karl-Wilhelm