title: How to get customer id KUNNR of current Launchpad user?
body: <p>I am writing a custom Fiori to access sales data from an SAP ERP backend system using a Gateway.</p>
  
  <p>The use case is "customer logs in launchpad, opens Fiori app and sees all his/hers sales items based on the customer id". The customer id is stored in <code>kna1-kunnr</code> and has to be included in a select on the <code>vbak</code> table in SAP. Nothing fancy.</p>
  
  <p>Now I ask myself: how do I get the customer id / kunnr? What do I get at all from the currently logged in user? When debugging my Gateway project code, is it actually the name stored in <code>sy-uname</code> or can I get something better?</p>
  
  <p>How should I continue to get the customer id / kunnr? Are there some function modules like <code>GET_CUSTOMER_ID_OF_USER</code> to call in the SAP ERP?</p>
  
  <p>Or are the actually other / better ways to get the sales documets for one user?</p>
  
  <p><strong>Update</strong>
  Thank you for your answers so far. I am going to check the default Fiori implementations to get some inside. But, since we are already here, I want to specify my question a little bit more:</p>
  
  <p>Giving I create an OData model in my Component.js like that:</p>
  
  <pre><code>    var oModel = new sap.ui.model.odata.ODataModel("[...]/sap/opu/odata/sap/Z_MYODATA_SRV/",
          false, "user", "password" );
  </code></pre>
  
  <p><code>user</code> and <code>password</code> are supposed to be the ones currently entered as user credentials in the Fiori Launchpad. How can I access those? Are there some SAPUI5 api like <code>getCurrentUser</code> or <code>getCurrentSession</code> ? Do I actually have to do this user check?</p>