on ‎2012 Jan 20 1:56 PM
Hello,
When importing a BAPI at Java side, I have a problem to deal with a field of type char1 (referenced to a domain with two fixed values : 'X' et ' ') which is becoming a boolean at Java Side.
I found posts talking about the same problems but I didn't find answers.
Have anyone encountred this problem before?
Thanks in advance for your help,
ImaneA
Request clarification before answering.
Hi Imane,
Char1 field which you are seeing at SAP end is of type FLAG it accepts only 'X' and ' ' . So boolean cannot accept this so declare the field as char instead of boolean in java or else declare Char1 in both SAP and Java so compatabilty doesnt miss .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you John & Srikanth for your replies.
My issue is that the Java side doesn't recognize the 'X' or ' '. It means that for Java side, the field is always empty.
We tried a domain with no values instead of 'X' and ' ' but it still doesn't recognize the content of field even if it is a String now and no longer a boolean in java side.
Do you have any idea how to solve this problem?
Thanks in advance for your help.
Regards,
Imane
Well, calculated attribute should solve this. Something like
public boolean getCalculatedAttribute()
{
return "X".equals(<CODE_TO_GET_ATTRIBUTE_VALUE_FROM_RFC_MODEL_CLASS>);
}
public boolean setCalculatedAttribute(boolean value)
{
if(value)
{
<CODE_TO_SET_VALUE_FROM_RFC_MODEL_CLASS_TO_'X'>
}
else
{
<CODE_TO_SET_VALUE_FROM_RFC_MODEL_CLASS_TO_''>
}
}
Actually, We had an issue with test values which made me think that the problem was in my coding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what's your issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.