on 07-08-2013 8:13 AM
Dear All,
I am using following Project coding mask T.00.XXX.000.000.00.00.0
Where
Project code- T.00.XXX.000
Level 1 WBS -T.00.XXX.000.000
Level 2 WBS-T.00.XXX.000.000.00
Level 3WBS- T.00.XXX.000.000.00.00
Level 4 WBS-T.00.XXX.000.000.00.00.0
I want to restrict Field legth of Identification of WBS at each level.
For instance the level 1 WBS should be of 12 characters only.
I have used following logic in validation , but it is not working
Prequeste
PRPS-STUFE = '1'
Check
PRPS POSID :13 -: = ' '
Message
Error message.
This logic is not working . Even i used check condition as PRPS POSID :13 -13= ' '. It is also not working.
Please help , where i am getting wrong.
Regards,
Vishal
Hello Vishal,
Follow these steps ... This will surely help you.
Pre-requisite
PRPS-STUFE='1'
Check
( PRPS-POSID :1-12: = PROJ-PSPID :1-12: ) AND
PRPS-POSID :13-: = ''
followed by the desired error..
Let us know if it worked for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear All,
The following logic has worked in my case for level 1 WBS.
Pre-requisite
PRPS-STUFE='1'
Check
PRPS-POSID :13-14: = '00'
Message
Error message
Similar logic is working for other levels also.
I thank everyone for their support in helping me resort this issue.
I would like to appreciate Sarath for bringing out ABAP solution for this issue which i suppose would work in this case , but I would like to go ahead with standard configuration available for validation in PS module.
Closing this thread.
Thanks again .
Regards,
Vishal
Hi Vishal,
Why don't you try out ABAP regular expression to validate a string conforming to a particular code mask?
Syntax for creating the regular expressions can be found in the following link:
http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX.htm
Once you create the regular expression for your WBS element, you can make use of the methods in the ABAP class cl_abap_matcher to verify the entered string against your regular expression.
Sample code is as given below:
DATA: matcher TYPE REF TO cl_abap_matcher,
lv_match TYPE c,
lv_regex TYPE text255, "regular expression
lv_str TYPE text255. "string to be validated
* Verify match for the string
matcher = cl_abap_matcher=>create( pattern = lv_regex
ignore_case = abap_true
text = lv_str ).
lv_match = matcher->match( ).
IF lv_match EQ 'X'.
Message 'Success'.
Else.
Message 'Fail'.
Endif.
Hope this is helpful for you in resolving your issue.
Thanks & Regards,
Sarath.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vishal,
If you have configured the character " . " as a special character and then use in the mask even if you enter the code :
T.00.XXX.000 the system stores T00XXX000 ( special characters are not stored, only displayed) then you have to validate the position 10 instead of 13.
Check it!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello,
Why the validation is not working? the error message doesn't appear? or the error message always appear?
If it is the first case check the validation is correct assigned to your project profile and it is activated and generates correctly. ( you can check validate something like prerequisite : STUFE = 1 Check STUFE = 2) If the error message appears is it is correct configured.
If you think that the problem is with the code entered in the check, you can try :
prps-posid :1-12:
Not sure if this help you..
Hi Clara,
Thanks for reply.
I am not able to understand how to use logic PRPS- POSID :1-12:
Regarding your second suggestion , I have checked in the system & found that I am not getting error.
One thing I found that we are using multiple project coding mask for different kind of projects.
I have taken care of the same during validation by using project profile/project type in the prequeste.
Regards,
Vishal
Hello Vishal,
You say :
Regarding your second suggestion , I have checked in the system & found that I am not getting error.
If the system validates position "20" and position "13" and you don't have the same result in the validation.. it is due to your project internally is not : T00XXX000000
You can check how the project is intenally in PRPS table field POSID how internally the number has been generated ( you have to go PRPS excute it for your WBS and deactivate in the header : Settings --> user paramentes --> Format ( un flag check conversion exists)
Regards
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.