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

Select-option length

Former Member
0 Likes
1,232

Hi,

I am working on a BDC program. In that, I have declared a Select-options for the Upload file name as below.

<i><b>SELECT-OPTIONS: S_PATH FOR PARMS-PATH

NO INTERVALS

LOWER CASE.</b></i>

<i><b>PARMS-PATH</b></i> is defined for 128 CHARs.

Later in the program I am using S_PATH-LOW value in the upload logic and etc.

Even though S_Path is defined for 128 CHARs, <b>it is taking only 45 characters(max)</b> when I give the file path in the selection screen.

<b>Eg:</b> If the Path is <b>'C:\ZTEST012uom.txt'</b>, it works and we are getting the output as below(as the file path length is less than 45 char).

And if the path is <b>'C:\folder1\folder2\folder3\folder4\folder5\ZTEST012uom.txt'</b>, it doesn't work(as the file path length is more than 45 char).

My question is, is there any fixed length defined for the select-options. Why am I facing this problem.

Can anyone help me how I can rectify this issue...?? Thanks in advance.

Regards,

Pradeep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

From SAP Help on SELECT-OPTIONS

...

Two input fields with the name selscrit-low and selscrit-high are created on the current selection screen using a matching external data type in a new line at positions 35 and 60. The length of the input fields bases upon the length of the data type which is defined after FOR. <b>The maximum length of the input fields is 45.</b> The maximum visible length of the input fields is, depending on the nesting depth, in blocks with frames between 10 and 18. If the length is larger than the maximum visible length, then the content is scrollable.

...

For longer values - use a PARAMETERS statement.

Hi,

I am working on a BDC program. In that, I have declared a Select-options for the Upload file name as below.

<i><b>SELECT-OPTIONS: S_PATH FOR PARMS-PATH

NO INTERVALS

LOWER CASE.</b></i>

<i><b>PARMS-PATH</b></i> is defined for 128 CHARs.

Later in the program I am using S_PATH-LOW value in the upload logic and etc.

Even though S_Path is defined for 128 CHARs, <b>it is taking only 45 characters(max)</b> when I give the file path in the selection screen.

<b>Eg:</b> If the Path is <b>'C:\ZTEST012uom.txt'</b>, it works and we are getting the output as below(as the file path length is less than 45 char).

And if the path is <b>'C:\folder1\folder2\folder3\folder4\folder5\ZTEST012uom.txt'</b>, it doesn't work(as the file path length is more than 45 char).

My question is, is there any fixed length defined for the select-options. Why am I facing this problem.

Can anyone help me how I can rectify this issue...?? Thanks in advance.

Regards,

Pradeep.

4 REPLIES 4
Read only

Former Member
0 Likes
825

i dont know why it is happening to you for me this code is working properly. Just try that...


parameters : p_path like rlgrap-filename.

data : val type string.

data : begin of itab occurs 0,
       f1(10),
       f2(10),
       f3(10),
       f4(10),
       end of itab.

data : len type i.
at selection-screen on value-request for p_path.

CALL FUNCTION 'F4_FILENAME'
 EXPORTING
   PROGRAM_NAME        = SYST-CPROG
   DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = ' '
 IMPORTING
   FILE_NAME           = p_path

          .


val = p_path.
compute len = strlen( p_path ).
start-of-selection.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = val
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = '#'
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   NO_AUTH_CHECK                 = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  TABLES
    DATA_TAB                      = itab
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

loop at itab.

endloop.

here my file path is C:\libra\testfolder1\testfolder2\testfolder3\testfolder4\testfolder5\testfolder6\testfolder7\TEST1.txt total length 102.

regards

shiba dutta

Read only

Former Member
0 Likes
825

Hi,

This is interesting since I actually tried this and it did not accept more than 50 characters.

The workaround could be try using the Parameters option with data type rlgrap-filename. This works.

Regards,

Shruthi R

Read only

Former Member
0 Likes
825

Dear Paddu,

Please use Parameters statement instead of Select-Options.

As you are giving only one file path name.

i.e Parameters: p_path like PARMS-PATH.

This will definitely work.

The other coding remains same.

Hope this would be useful.

Reward if useful.

Thanks

Venugopal

Read only

Former Member
0 Likes
826

From SAP Help on SELECT-OPTIONS

...

Two input fields with the name selscrit-low and selscrit-high are created on the current selection screen using a matching external data type in a new line at positions 35 and 60. The length of the input fields bases upon the length of the data type which is defined after FOR. <b>The maximum length of the input fields is 45.</b> The maximum visible length of the input fields is, depending on the nesting depth, in blocks with frames between 10 and 18. If the length is larger than the maximum visible length, then the content is scrollable.

...

For longer values - use a PARAMETERS statement.