cancel
Showing results for 
Search instead for 
Did you mean: 

How do I include a blank in an enumeration

Former Member
0 Kudos

Hi -

I have an element in my datatype that is length 1 and I would like to specify 2 enumeration values, X and blank.

Essentially I want the following in my datatype XSD:

<xsd:restriction base="xsd:string">

<xsd:maxLength value="1" />

<xsd:enumeration value="X" />

<xsd:enumeration value=" " />

</xsd:restriction>

According to the SAP help the enumeration field should be set to the list of values separated by blanks.

So I've tried:

- X followed by 2 blanks - doesn't work

- X &#160; - complains that it exceeds the max length of 1

I've also tried exporting the XSD, changing it, and then importing it, but XI removes the <xsd:enumeration value=" " /> line on import.

Any ideas?

Accepted Solutions (0)

Answers (3)

Answers (3)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi, if the maxlength is 1 you never will send 2 characters

you can modify your DT field to maxlength=2. if you send a numeric value one character will be send,if you need an"X " youwont have a problem

now if you cannot modify you DT (i dont think so) the blank should be added in the target system

Former Member
0 Kudos

Hi Rodrigo, I think you did not get the problem correctly. In my example I have an attribute which is string and have enumeration constraint allowing only values ON and OFF. I now want to also add ""(Blank) as a value for this attribute. How to define this in XI? I tried to add the value "" manually to the Data type like below.

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="3"/>

<xsd:enumeration value="ON"/>

<xsd:enumeration value="OFF"/>

<xsd:enumeration value=" "/>

</xsd:restriction>

</xsd:simpleType>

But when I import the datatype into XI it will again become like below.

<xsd:simpleType>

<xsd:restriction base="xsd:string">

<xsd:maxLength value="3"/>

<xsd:enumeration value="ON"/>

<xsd:enumeration value="OFF"/>

</xsd:restriction>

</xsd:simpleType>

Hope it is clear to you now.

Regards,

Prasad

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

that happend because pi trunc those fields that are null or have a blank insede to avoid pass the whole structure (unused fields). its the same when an idoc reach, only the fields whichs has values pass, the other not. what you can do is define a wild character in your field (e.x "").later in your mapping validate if the source field equals "" then map a black to the target field.

Former Member
0 Kudos

Hi Rodrigo, I dont know if it is a bug in SAP XI or a feature. But due this we can not have a "" (blank) as a possible value in enumeration.

Regardss, Prasad

Former Member
0 Kudos

Hi, I have same requirement. Were you able to get a solution for this?

Experts: do you have any other inputs for this requirement?

Regards,

Prasad

Former Member
0 Kudos

Hi,

I fear there is indeed no possibility.

Which purpose do you want this datatype to use for? (ABAP proxy, java proxy).

Greetings

Stephan