<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Automatic number conversion to string in object in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940687#M4487299</link>
    <description>&lt;P&gt;Hello Johannes,&lt;/P&gt;&lt;P&gt;console.log writes a message to the console by default&lt;/P&gt;&lt;P&gt;please use &lt;STRONG&gt;typeof&lt;/STRONG&gt; operator to get the primitive type of the variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var status = oModel.getProperty("status"); 
console.log(typeof status);// expected output: "number" in your case
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Mar 2019 15:08:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-03-19T15:08:23Z</dc:date>
    <item>
      <title>Automatic number conversion to string in object</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaq-p/11940686</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;
  &lt;P&gt;my issue is this.&lt;/P&gt;
  &lt;P&gt;In below coding (simplified), what is the reason that the property "status" is becoming a string?&lt;/P&gt;
  &lt;P&gt;The oData Field is a Integer.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;var iStatus = parseInt(oView.byId("status").getSelectedKey(), 10); //get Status of select

oModel.create(sPath, {
//...
status: iStatus, 
//...
}, fnCallback...);

console.log(oModel.getProperty("status"); --&amp;gt; &lt;U&gt;STRING&lt;/U&gt; 

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Mar 2019 12:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaq-p/11940686</guid>
      <dc:creator>former_member460045</dc:creator>
      <dc:date>2019-03-19T12:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic number conversion to string in object</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940687#M4487299</link>
      <description>&lt;P&gt;Hello Johannes,&lt;/P&gt;&lt;P&gt;console.log writes a message to the console by default&lt;/P&gt;&lt;P&gt;please use &lt;STRONG&gt;typeof&lt;/STRONG&gt; operator to get the primitive type of the variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var status = oModel.getProperty("status"); 
console.log(typeof status);// expected output: "number" in your case
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Mar 2019 15:08:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940687#M4487299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-03-19T15:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic number conversion to string in object</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940688#M4487300</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;thats exactly what I did. The data types in my description are identified by typeof operation. &lt;/P&gt;&lt;P&gt;I did'nt mention it and I cannot edit the question anymore.&lt;/P&gt;&lt;P&gt;Best regards Johannes&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 06:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940688#M4487300</guid>
      <dc:creator>former_member460045</dc:creator>
      <dc:date>2019-03-20T06:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic number conversion to string in object</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940689#M4487301</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Johannes,&lt;/P&gt;&lt;P&gt;if you are unable to edit your question, you can add a new comment with a screenshot of the oData structure and the code where you are reading the value of Status.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Bopanna&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 08:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940689#M4487301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-03-20T08:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic number conversion to string in object</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940690#M4487302</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;onProjectSave: function () {
var oModel = this.getView().getModel();
var oView = this.getView();

var iStatus = parseInt(oView.byId("status").getSelectedKey(), 10);
console.log(typeof iStatus, iStatus); --&amp;gt; number

var oAddon = {
// some other properties
pmtStatus: iStatus,
// some other properties
};

oModel.update("/pmtAddon('" + oObject.pmtId + "')", oAddon, {
		success: function (oData, Response) {
			that._setFragment("Display");
			that._toggleButtons(false);
			console.log(typeof that._getCurrentRecord().statusId);
}
});
getCurrentRecord: function () {
 if (this.getView().getBindingContext()) {
return this.getView().getBindingContext().getObject();
			}
		},









&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 10:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-number-conversion-to-string-in-object/qaa-p/11940690#M4487302</guid>
      <dc:creator>former_member460045</dc:creator>
      <dc:date>2019-03-20T10:13:36Z</dc:date>
    </item>
  </channel>
</rss>

