cancel
Showing results for 
Search instead for 
Did you mean: 

Project Definition Length Validation

Former Member
0 Kudos

Hi Experts,

I am using free project numbering within a range (not using coding mask)

I have a validation restricting my project code between a range 0070000000 - 0079999999

however its allowing me to create project with code eg, 007001 . Its not allowing 008 or any other series though, which is good.

I want to make sure the project code is always 10 character long. How do I have it with validation?

Thanks,

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

Try to create a set in GS01 for PROJ-PSPID and giving that range.

Next you validate PROJ-PSPID IN <set name>

Thanks,

Paulo

Former Member
0 Kudos

Hi Paulo,

I tried it as below and its still allowing me to create project 0070002

Can you  let me know if anything is missing in this?

Regards,

Krishna

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

Have you tried before another version of check like:

( PROJ-PSPID >= '0070000000' ) AND ( PROJ-PSPID <= '0079999999' )

You can also try quotes in the set definition. 

Give it last try before me giving a try to set it up myself.

Thanks,

Paulo

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

Please, try this version:

( PROJ-PSPID :1-3: = '007' ) AND ( PROJ-PSPID :3-10: >= '70000000' ) AND ( PROJ-PSPID :3-10: <= '79999999' )


Also you can add a check with AND that PROJ-PSPID :11-24: = '' (or similar) to make sure there is nothing after 10th character.


Regards,

Paulo


Former Member
0 Kudos

Hi Paulo,

Tried both, unfortunately it still allows me to create project 007002,0071 etc.

can we write some code to just say project length = 10? that along with the range validation should work I think..

Thanks for you time. Let me know if you think of any options of if am missing anything..

Regards,

Krishna

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

Please, try to add this AND ( PROJ-PSPID :10-10: <> '' ) and ( PROJ-PSPID :11-11: = '')

There are no functions like LEN ( PROJ-PSPID ) = 10, but simple user exit can do it easily.

Regards,

Paulo

Former Member
0 Kudos

Hi Paulo,

Tried that code. But same issue. Allows to create project 007 series with less than  10 digits.

Am trying to see if its possible without user exit.

Any idea what the operator <-> mean? Am thinking if we can include a line with project code not in Range 007 - 007999999

Thanks,

Krishna

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

I am sure it is possible without ABAP exit, just takes some time... )

You can have two sets and check it belongs to one and does not belong to another.

<-> is the equivalence statement, means both statements must be true or false for overall true result.

Regards,

Paulo

kenmelching
Active Contributor
0 Kudos

You always need to be careful when checking PS id's because most of them have conversion routines assigned to the fields so what is in the database and what the validation is checking is not exactly what you are seeing.

PSPID has conversion roingutine ABPSN assigned to it.  Run the validation in debug mode and see what is actually being checked.  Then you'll know what to change.

Paulo_Vitoriano
Active Contributor
0 Kudos

Hi Krishna,

For last 7 digits you can validate each of them one by one to be in the set of 0 to 9 AND LIKE '007+++++++'

Not the most beautiful code, but without user exit.

Regards,

Paulo

Former Member
0 Kudos

Hi Ken,

You are right, debugging the code made us understand that the project def is being checked one digit at a time being a character, but if it were integer it would have worked.

Regards,

Krishna

Former Member
0 Kudos

Hi Paulo,

That sound like a great idea even if lengthy.

I think that should work, but my developer has already used an exit to check the length to be 10 based on the profile. the range I am controlling via PS validation.

Thanks for your help.

Regards,

Krishna

Answers (0)