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: 

Is it possible to dynamically change the length of a SAP field?

Former Member
0 Kudos

Hi,

is it possible to change the length of a std SAP field on a std SAP Screen? without modification?

For example the below image shows the screen 300 of std SAP program SAPLIPW1. On this screen we have the serial number field which has underlying data element and domain GERNR.

Currently the serial number field is 18 chars long. Is it possible to dynamically change it to 30 chars long only for display purpose?

The reason for this change is:

1. We want the user to enter a external serial number on the input field and this external number can be  upto 30 char long.

2. We will then enhance the conversion exit tied to the domain GERNR to convert the entered 30 char long external serial number to an internal number of 18 char long.

So we simply want to change the length on the above screen and of course we are trying to achieve without modification.

Any suggestions?

I tried to use the LOOP at screen and change he field LENGTH but it wont make any difference. Any idea if it is possible at all?

Thanks

1 ACCEPTED SOLUTION

juan_suros
Contributor
0 Kudos

The straightforward way to do this would be to expand the GERNR data type in your system data directory to 30 characters. SAP should be able to handle the full length of your serial number scheme in all transactions. You would need to test this thoroughly.

The complicated way to do this would be to define a new data type of length 30, and change the serial number screen fields of the transactions you want to use from a GERNR field to the new field. Then you will need to change the PAI code in these screens to make the conversion you mentioned before the values are saved. This is the safer approach.

8 REPLIES 8

juan_suros
Contributor
0 Kudos

The straightforward way to do this would be to expand the GERNR data type in your system data directory to 30 characters. SAP should be able to handle the full length of your serial number scheme in all transactions. You would need to test this thoroughly.

The complicated way to do this would be to define a new data type of length 30, and change the serial number screen fields of the transactions you want to use from a GERNR field to the new field. Then you will need to change the PAI code in these screens to make the conversion you mentioned before the values are saved. This is the safer approach.

matt
Active Contributor
0 Kudos

Juan Suros wrote:

The straightforward way to do this would be to expand the GERNR data type in your system data directory to 30 characters. SAP should be able to handle the full length of your serial number scheme in all transactions. ...

I'm not sure that this will be at all straightforward. Certainly in OSS there is a way of changing MATNR to 30 characters - but it is quite complicated. Be very very careful changing data definitions.

0 Kudos

The change is straightforward. The consequences could be very bad.

The safer approach is to modify a limited number of screens of the transactions used by this specific implementation of SAP.

matt
Active Contributor
0 Kudos

Since the change includes dealing with consequences, I'd say that the change is most certainly not straightforward.

kiran_k8
Active Contributor
0 Kudos

Hi,

Explore if you have any other alternatives instead of changing the field length of a Standard field and also search in SAP Service Market Place for OSS Notes,if any.

K.Kiran.

Former Member
0 Kudos

A safer way to do this might be to modify this screen to call a popup where you add the new serial numbers (in 30 characters) and then format them to 18 characters when the user goes back.

Rob

0 Kudos

A simpler and safer way with no changes to any SAP objects:

Create a standalone function that converts the 30 character serial numbers to 18. Copy and paste the results into the existing fields of the existing screen.

Rob

Jelena
Active Contributor
0 Kudos

Or better yet - use EWM where serial numbers can be 30 characters.

Also this has already been asked and answered on SCN back in 2009, which can be easily found by using Google.