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

PARAMETERs with ranges

Former Member
0 Likes
15,414

Hello All,

I have created a report on which there is a selection screen with select options.I am passing a string in Select-Options in runtime while executing the report. But length of the string which I am passing is about 50 chars.But Select options wont allow this so I am using Parameters for that.

But I have to pass more than 1 string with about 50 characters. How to add that multiple values using parameters?

Ragards,

Rahul

Hello All,

I have created a report on which there is a selection screen with select options.I am passing a string in Select-Options in runtime while executing the report. But length of the string which I am passing is about 50 chars.But Select options wont allow this so I am using Parameters for that.

But I have to pass more than 1 string with about 50 characters. How to add that multiple values using parameters?

Ragards,

Rahul

20 REPLIES 20
Read only

Former Member
0 Likes
8,084

I would re-visit your select options.  Any user having to type in multiple 50 character strings will be bound to make mistakes.

Explain a bit more.

Are these strings static ?  Ie is the user selecting from a list of values that rarely changes - or only changes programatically ?? If that is the case consider using a code for each string,  which is specified in a database table,  and that database table is the check table for a domain.  That will provide a popup list or you can then read those values and populate a VRM drop down.

If they are not static strings then what are they ?  Can you make a dynamic domain out of them ?

Give more information and you will get a better answer.

Regards

Rich

Read only

Former Member
0 Likes
8,084

Hi Rahul,

Since you did not include any code samples it hard to tell how your declaring your select option or the variables used by it but did you declare it using the following code?

TYPES: BEGIN of sample_structure,

        sample(50) TYPE c,

   END OF sample_structure.

DATA SAMPLE_TABLE TYPE TABLE OF sample_structure WITH HEADER LINE.

SELECT-OPTIONS s_range FOR sample_table-sample NO INTERVALS.


Please note the only reason i did the types and data declaration was that i had no tables with a field of 50 char available so i had to create one.


But i also agree with Richard that depending on what your trying to do there may be better ways to go about this then having users type in a 50 char string.


Geoffery

Read only

Richa_Gupta
Contributor
0 Likes
8,084

Just search for the data type CHAR<N> where N is the number you want the length of input parameter to be in SE11 and do a where-used on that. For example, search for data type CHAR50 and check its where used list. You will get table name along with field name where it is used.

Use this field's data type to create your select option on selection screen. It should not be an issue. But yes, before that do consider that why do you want to give a string type field on selection screen? Is it actually required?

Regards,

Richa

Read only

Former Member
0 Likes
8,084

Hello All,

In the code , I am using this:

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_reciv FOR somlrec90-receiver NO INTERVALS. "For multiple Email IDs

SELECTION-SCREEN : END OF BLOCK b1.

When I execute the program, I need to paas  Multiple Email Ids in this select options . The length of those email IDs are huge.So its not taking email IDs with large number of characters.

Because of this , I am using PARAMETERS. But there is not provision in PARAMETERS to enter multiple values .

Read only

0 Likes
8,084

Hi,

What is the length of the email ids?

The field somlrec90-receiver can take upto 1215 characters.

Regards,

Taiyeb

Read only

0 Likes
8,084

Hi Taiyeb,

Its length is about 50 chars.

For example.

Here, it is not allowing the full length. i am unable to add '.com' in the last

Regards,

Rahul

Read only

0 Likes
8,084

Hi,

Could you tell me what is the length of somlrec90-receiver field.

If it is 50 characters then only the limitation arises, otherwise it should allow you to enter for the length specified.

Regards,

Taiyeb

Read only

0 Likes
8,084

Why don't you use SAP email field?

tables adr6.

select-options:s_email for adr6-smtp_addr.

Read only

0 Likes
8,084

Hi Taiyab,

The length of somlrec90-receiver field is 1215 CHARS. Still the select options wont allow length more than 45 chars.



Regards,

Rahul

Read only

0 Likes
8,084

Hi Nabneet,

I have tried select-options:s_email for adr6-smtp_addr. It is also not working as SELECT OPTIONS wont allow more than 45 chars



Regards,

Rahul

Read only

0 Likes
8,084

Hi,

Unfortunately this was a limitation for earlier NW release.

Please check this thread.

http://scn.sap.com/thread/3252093

Hope it helps.

Regards,

Taiyeb

Read only

0 Likes
8,084

I input more than 45 and checked in debugger

Read only

RaymondGiuseppi
Active Contributor
0 Likes
8,084

I don't think select-option is suitable for some mail address, much too long, I would consider some true module program with some table control or ALV grid for input. Note that in second case you could display an ALV for input in a docking container during execution of a selection-screen.

Regards,

Raymond

Read only

0 Likes
8,084

Hmmm.

I like that idea - I've very often displayed results in an alv grid on with the selection screen above it but never used it as a parameter.

If you are talking about email addresses,  then you will need a regex to check to see if it has a valid structure or not.... 

And this is a good example of where with-holding information at the start has made answering your question difficult.

Rich

Read only

0 Likes
8,084

Question: with which version does the OP work?

Actually, those "truncation" problems on select-options (and parameters in some cases) should be solved for system versions with BASIS  7.02 (when maximal length was raised to 255) or more recent, that should be enough:


The maximum length is specified in RFC 5321: "The maximum total length of a reverse-path or forward-path is 256 characters"

Regards,

Raymond

Read only

0 Likes
8,084

Hi Raymond,

Thanks for the Information.

Regards,

Pallavi

Read only

Former Member
0 Likes
8,084

Hi,

Please try like this :

data test type text80.

SELECT-OPTIONS: s_reciv FOR test.

read table s_reciv.

if sy-subrc = 0.

write : s_reciv-low.

endif.

Go To SE51  with program name and screen number as 1000 and there you can change the field definite length to the desired length and it works.

Regards,

Pallavi

Read only

0 Likes
8,084

Hi Pallavi,

And why does SAP warn you not to do this ??

Rich

Read only

0 Likes
8,084

Hi Richard,

So,  Can we create a user defined selection screen and place the screen elements with desired length instead? and call it from the ZProgram?

Please suggest .

Regards,

Pallavi

Read only

0 Likes
8,084

I've no problem with that.

Rich