on 09-07-2009 3:30 AM
Hi, I am creating a Web Dynpro Java application but having trouble when calling BAPI RFC Model.
I want to get 1 attribute from an output data structure, but I am getting exception before I can reach the data. It says:
-
com.sap.dictionary.runtime.DdCheckException: Character string "" does not exist in the set of allowed values
at com.sap.dictionary.runtime.DdTypeString.checkValid(DdTypeString.java:311)
com.sap.tc.cm.base.exception.BaseModelRuntimeException: Attribute value is not valid for attribute 'Currency' of model class 'cn.com.cmbc.relatedmodels.get_org_detailmodel.Zbp_Org_Detail'
The Currency is a tructure from the data model and "" is not in the value dictionay. But This could happen when there is not result or the return data which currency is "" because we are not using it which is an optional input.
How can I get around this exception and get 1 attrubute within the structure when Currency is "" ?
Many Thanks.
Duplicated post due to lag
Edited by: Gsheng on Sep 12, 2009 8:47 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, Gourav.
That is an option but adding extra work to our RFC team. I am looking for a way dealing it within Web Dynpro. It will be the best if there is an option configure JCO to make it not checking dictionary. This what ABAP doing. SAP should make them matched.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you getting result back for attribute currency? It seems it is mandatory in this case (usually it does). So if output is not populating any values in output structure then you will face this issue.
Regards,
Gourav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It happened because records have Currency as "". The big problem is the BAPI itself is running with NO PROBLEM in ABAP. In ABAP, the return structure gives all data even Currency is "" without even warning. ABAP programmers refused to change anything because they don't think it is their problem.
So any other way except changing ABAP dictionary or changing BAPI to set defualt value within dictionary?
Hi,
"currency" is mandatory if amount is used.
What you can do is just capture this issue as "catch" block and assign default value to currency field, like "USD", "EUR", "GBP" etc.
It is possible some other BAPI field has currency value use that filed to assign value for currency and treat this as "known bug" in your service.
Regards,
Gourav
Hi,
another possible way is to create wrapper RFC for this BAPI which can be exposed as service and you can consume that service. Assign default value to "currency" field if it return nothing.
or
create composite service in CAF and assign default value there and then consume in Dynpro.
I belive it is difficult for you capture it as it is throwing exception even before reaching to data value. but try with CAF composite services and this may help.
Regards,
Gourav
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.