const bps = require('@sap/cloud-sdk-vdm-business-partner-service'); const { businessPartnerApi, businessPartnerAddressApi } = bps.businessPartnerService(); // Create destination dest = { url: "https://sandbox.api.sap.com/s4hanacloud" }; // Create request req = businessPartnerApi.requestBuilder() .getAll() .select( businessPartnerApi.schema.BUSINESS_PARTNER, businessPartnerApi.schema.FIRST_NAME, businessPartnerApi.schema.LAST_NAME, businessPartnerApi.schema.TO_BUSINESS_PARTNER_ADDRESS .select( businessPartnerAddressApi.schema.ADDRESS_ID, businessPartnerAddressApi.schema.COUNTRY, businessPartnerAddressApi.schema.CITY_NAME ) ) .filter( businessPartnerApi.schema.LAST_NAME.equals("Smith") ) .addCustomHeaders( { apikey: '>>>YOUR API KEY<<<' }); // execute request req.execute(dest) .then( // success function (result) { console.log(JSON.stringify(result, null, '\t')); }, // error function (error) { console.log("Error: " + error.message); } );