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

field length

Former Member
0 Likes
917

hi to all,

plz help me

namely county of discharge, country of loading etc

i must change the field legth from 3 to 2 such that it should restrict the user to enter third digit in selection screen. and these three fields must be in select-options not parameters so please

suggest me the solution.

like ex county of loading its lenght in database table is 3 so i want it to be 2 in selection screen

Message was edited by: kranthi reddy

Message was edited by: kranthi reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
758

Hi,

There are two ways for acheiving this...

1. Create a select-option based on a data element as shown below...

data LAND1(2) TYPE C.

SELECT-OPTIONS P_LAND1 FOR LAND1.

2. To Check the field length at the AT SELECTION-SCREEN Event and raise error message when the length excees 2.

I don't think there is any other way to achieve this...

Regards,

Vara

hi to all,

plz help me

namely county of discharge, country of loading etc

i must change the field legth from 3 to 2 such that it should restrict the user to enter third digit in selection screen. and these three fields must be in select-options not parameters so please

suggest me the solution.

like ex county of loading its lenght in database table is 3 so i want it to be 2 in selection screen

Message was edited by: kranthi reddy

Message was edited by: kranthi reddy

5 REPLIES 5
Read only

guillaume-hrc
Active Contributor
0 Likes
758

Hi,

Can't you perform a AT SELECTION-SCREEN and check the content of the SELECT-OPTIONS ?

Could you please clarify your problem a bit more.

Thanks.

Best regards,

Guillaume

Read only

Former Member
0 Likes
759

Hi,

There are two ways for acheiving this...

1. Create a select-option based on a data element as shown below...

data LAND1(2) TYPE C.

SELECT-OPTIONS P_LAND1 FOR LAND1.

2. To Check the field length at the AT SELECTION-SCREEN Event and raise error message when the length excees 2.

I don't think there is any other way to achieve this...

Regards,

Vara

Read only

Laxmana_Appana_
Active Contributor
0 Likes
758

Hi,

check this :

Define the selection screen with visible length option like :

SELECT-OPTIONS s_matnr for mara-matnr VISIBLE LENGTH 5.

visible length of the field should be 5 (characters) if the database field length is more than this also.

validate the field contents at AT SELECTION SCREEN event like

loop at s_matnr

if strlen(s_matnr-low) > 5 .

-


error

exit.

endif.

endloop.

Regards

Appana

Read only

naimesh_patel
Active Contributor
0 Likes
758

Hello,

Options:

1. replce the parameter by 2 digit variable

2. parameters: p_ch(3) type c visible length 2.

at selection-screen on p_ch.

if p_ch+2(1) ne sapce.

  • error message

endif.

regards.

Naimesh

Read only

Former Member
0 Likes
758

check this

REPORT ABC.

TABLES : T005.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_LAND FOR T005-LAND1 VISIBLE LENGTH 2.
SELECTION-SCREEN END OF BLOCK B1.