on 02-05-2008 3:52 PM
I have created a model using Import Adaptive Web Service model option (a web service was a wrapper around SAP BAPI function module).
There were no dictionary types created in the Local dictionary as a result of import.
I have mapped the context of the controller to the model node.
One of the fields in the model is name CUSTOMER_NUMBER type string;
Corresponding element in the wsdl of the web service is
<xsd:element name="CUSTOMER_NUMBER" type="tns:char10" />
I have created a view with the input filed mapped to the CUSTOMER_NUMBER field of the model node.
When I type more than 10 chars into the field and hit the search button, I get a com.sap.dictionary.runtime.Ddcheck exception that the length of the field should be less than 10 chars.
How can I set the max length of the field in design time to prevent runtime exception?
Thanks,
Julia
Julia,
As this is a simple thing(10 Chars to Web Service), i would not recommend to create Value Node and copy the structure.
Why dont you try with substring(int beginIndex, int endIndex)
it returns first 10 chars of your search string.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply.
Java trim function will trim the white spaces only, not the characters.
I can code check length functionality before calling execute function (the function that call the web service).
I can also create a dictionary structure based on the model structure; create a context value node based on the dictionary structure and use WDCopyService API to move the data between value node and model node.
I was looking for the best practice...
When importing model based on Adaptive RFC, the dictionary structures are imported together with the model. This does not happen for Adaptive web service - hence there is a need to add coding for simple checks.
Julia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For date you are not going to write any code because the frame work is going to take care of the date validations.And for the strings you make use of the same simple type for all the attributes if their max length is same.And for the numeric make use of another simple type then you dont need to do any coding for error messages as the webdypro framework is going to take care of the error message generation.(if its a simple type)
Yes you can do it making use of the String related methods.The method trim() of String class is going to limit the values to the number of characters you want to do it.As per you after you enter more than 10 characters then those values will be trimmed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.