Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8644

Re: Create a New Address in a Business Partner

$
0
0

Hi Sunil,

thank you for your support.

 

I checked better the Public Solution Model for release 1505, and it seems that I cannot add new addresses to the Customer by ABSL Code.

 

After debugging and displaying the information contained in the Business Object Customer, the right node to create should be under Root.AddressInformation. Nevertheless, if I check the Repository documentation, it seem to be a read only node:

 

2015-05-26 16_08_09-Y7V7LJ8VY_ - SAP Cloud Applications Studio (Administrator).png

 

And actually, if I try to use the auto-completion for checking the available actions and methods, my list does not display the Create() method:

 

2015-05-26 16_16_08-Greenshot.png

 

It seems that my address manipulating options are limited just on changing and maintaining the current Address, via the following code (which does work instead):

 

/*

       Add your SAP Business ByDesign scripting language implementation for:

              Business Object: AddressSelector_BO

              Node: Root

              Action: WriteNewAddress

             

       Note:

         - To access the elements of the business object node,

           use path expressions, for example, this.<element name>.

         - To use code completion, press CTRL+J.

         

*/

 

importABSL;

importAP.Common.GDT;

importAP.FO.BusinessPartner.Global;

importAP.FO.Address.Global;

 

varbp;

varaddressInfo;

varaddressNode:

    elementsofBusinessPartner.AddressInformation.Address.PostalAddress;

varaddressObject:

     BusinessObject::BusinessPartner.AddressInformation.Address.PostalAddress;

 

bp = BusinessPartner.Retrieve(this.BusinessPartnerID);

 

if (bp.IsSet()) {

       if (bp.CurrentDefaultAddressInformation.IsSet()) {

              if (bp.CurrentDefaultAddressInformation.Address.IsSet()) {

                     if (bp.CurrentDefaultAddressInformation

                           .Address

                           .DefaultPostalAddressRepresentation

                           .IsSet()) {

                          

                           var postalAddress = bp

                                .CurrentDefaultAddressInformation

                                .Address

                                .DefaultPostalAddressRepresentation;


                           postalAddress.CountryCode = this.Country;

                           postalAddress.StreetName = this.StreetName;

                           postalAddress.CityName = this.City;

                           postalAddress.HouseID = this.HouseNumber;

                           postalAddress.StreetPostalCode = this.Postcode;

                     }

              }

       }

}

 

 

Can anyone provide any feedback on my statements and observations?

 

Thanks a lot,

Davide


Viewing all articles
Browse latest Browse all 8644

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>