2009 Sep 15 10:03 AM
Hello,
I have a problem programming against my generated ABAP Code. I am using SAP PI and created a DataType / MessageType at PI. I did then create a ABAP ServerProxy which should fill the structure.
Within the PI structure I have a XSD boolen. This element is mapped automatically to a datatyp with domain XSDBOOLEAN. This Datatyp is C(1) and values should be X = true and nothing is false. This is all done by abap proxy generation automatically.
And here comes the problem, within XML I have three posibilities for this element.
1.) true
2.) false
3.) element not present
In ABAP I can not distingush these three conditions. If I set my element to space it wont be pobulated at XML at all. But the meaning of not present and false is different!
How do I have to set my ABAP variable in order to get an false within my XML message?
Any help is appreciated,
thanks, Erik
2009 Sep 16 11:22 PM
I have a question: Do you make some transformation (mapping) to the information in the structure you return to the program wich is calling the ABAP Server Proxy?
SAP XI/PI usually return the information in the structure you define and in the way you put it the structure.
Regards.
-Rafael Rojas-
Hello,
I have a problem programming against my generated ABAP Code. I am using SAP PI and created a DataType / MessageType at PI. I did then create a ABAP ServerProxy which should fill the structure.
Within the PI structure I have a XSD boolen. This element is mapped automatically to a datatyp with domain XSDBOOLEAN. This Datatyp is C(1) and values should be X = true and nothing is false. This is all done by abap proxy generation automatically.
And here comes the problem, within XML I have three posibilities for this element.
1.) true
2.) false
3.) element not present
In ABAP I can not distingush these three conditions. If I set my element to space it wont be pobulated at XML at all. But the meaning of not present and false is different!
How do I have to set my ABAP variable in order to get an false within my XML message?
Any help is appreciated,
thanks, Erik
2009 Sep 16 11:22 PM
I have a question: Do you make some transformation (mapping) to the information in the structure you return to the program wich is calling the ABAP Server Proxy?
SAP XI/PI usually return the information in the structure you define and in the way you put it the structure.
Regards.
-Rafael Rojas-
2009 Sep 17 8:23 AM
Helo Rafael,
no there is no mapping at all.The schema has been modelded within PI and a server proxy has been generated. I am programming directly against the structure.
The problem is that within the ABAP--> XML transformation it seems that empty elements are not transfered. This is good for all regular elements like string. If it does have no value the XML element should not be created. However for xsd boolen this runs into a problem. Since in SAP false is an empty string and a empty string gets translatet to nothing in XML.
I did try to set the varibale like "isReady = SPACE" but it does not work. My xml message is still missing this element.
So the structure is not the problem it is the content.
Looking forward to help,
Erik
2009 Sep 17 11:56 PM
Hi Erik.
I was asking a friend of mine about your question, and he suggests you can return to the calling program the words 'true' instead 'X' and 'false' instead ' ' in the respective field of structure, without the apostrophes. Note that this words must be lowercase. The transformation should work well, according with my friend's experience. He does not tell me nothing about the 3rd state you mention.
Let me know if this suggestion works for you.
Regards.
Rafael Rojas.
2009 Sep 21 12:38 PM
Hello Rafael,
thank you for your help. It did not reslove directly my problem but it helped.
Togehther with a colleague I found the problem. If you generare the proxy you have the possibility to chose the translation to CHAR(5) or XSDBOOLEAN. For whatever reason XSDBOOLEAN was the default. With this ABAP type a CHAR 1 translation to X and SPACE will be done.
Apperantly you can only change this while generating the proxy a change o the allready acivated object just did not work. So I deleted all dependencies and generated the type again, this time I changed the ABAP Type to CHAR 5 and now it works.
Within my ABAP coding I now can use 'true' and 'false'.
The third state I menationed was the state: XML element missing.
Thanks for your help.