cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PS Validation

Former Member
0 Kudos

Hi all,

I have looked at the forum and various others but I cannot seem to find a solution to my problem.

I am building a validation on the WBS element level to ensure that WBS follows the project definition. 

I have created Coding Mask as follows C-XXXXX-00.00.00.00.00.  Project Definition thus has C-00001 as the number.  When I create WBS under the project definition I want to perform check to ensure that is has prefix equal to Project Definition.  Thus Level 1 WBS = C-00001, Level 2 WBS = C-00001-01 etc. should be allowed.

I created the following validation PRPS-POSID :1-7: = PROJ - PSPID.  This did not work as I got my custom validation error message on all WBS created even if correct as specified above.  Subsequently change this to PRPS-POSID :1-7: = PROJ - PSPID :1-7:  Did not receive error on Level 1 WBS anymore (C-00001) but still got in on Level 2 WBS C-00001-01.

Also thought the special character "-" might be the reason for the problem so I split the validation and created PRPS-POSID :1-1: = PROJ - PSPID :1-1: AND PRPS-POSID :3-7: = PROJ - PSPID :3-7:  Still received the same results.

Thank you;

Werner

Accepted Solutions (1)

Accepted Solutions (1)

soubhagya_rout
Participant
0 Kudos

Hi,

I think you were almost there. Just try this logic, it may help.

Create 2 validation steps 1 for 1st level WBSE and another one for all other levels of WBSE.

For 1st level WBS

Prerequisite - PRPS-STUFE = '1'

Check - PRPS-POSID :1-6: = PROJ-PSPID :1-6:

For all other level WBS

Prerequisite - PRPS-STUFE <> '1'

Check - PRPS-POSID :1-8: = RCJ_PRPSUP-POSID :1-8:

Try this once , if it works for 2nd level then it will definitely work for all other levels.

Thanks,

Soubhagya

Former Member
0 Kudos

Thanks Soubhagya,

Really helpfull!  One minor change required to ensure it works though:

Change

Check - PRPS-POSID :1-8: = RCJ_PRPSUP-POSID :1-8:

To

Check - PRPS-POSID :1-6: = RCJ_PRPSUP-POSID :1-6:

With the 1-8 option I still got the error but when I changed it to 6 it worked.

Kind Regards;

Werner

Answers (1)

Answers (1)

former_member203098
Active Contributor
0 Kudos

Write logic in U911 exist.

Sample code: IF prps-posid+0(3) = 'C-5'

        AND prps-posid+3(5) CO ‘0123456789’.

        ELSE.

          b_result = b_false.

          MESSAGE ##### WITH prps-posid.

        ENDIF.

      ELSE.

        ENDIF.

    ELSEIF prps-stufe EQ '2'.

      DATA: i2 TYPE i.

      i2 = strlen( prps-posid ).

      IF i2 EQ 11.

        IF  prps-posid+0(3) = 'C-5'

        AND prps-posid+3(5) CO '0123456789'

        ELSE.

          b_result = b_false.

          MESSAGE #### WITH prps-posid.

        ENDIF

In validation check the exist u911 and maintain project profiles as prerequisites

Regards,