cancel
Showing results for 
Search instead for 
Did you mean: 

SDK: How to Read Address Component For Sales Order Form

former_member272979
Participant
0 Kudos

Hi,

Currently I’m trying to figure out how to read values in the Address Component from the SO form with the SDK. Below is a screenshot giving you a better idea the values I want to read. The reason for this, when a user click on a button to create SO to PO, I want to copy the values from Address Component from SO and send these values to an PO with the SDK. Can you advise how to read the Address Component for the SO in VB?

Regards,

William

View Entire Topic
former_member233854
Active Contributor
0 Kudos

See below, I got from SDK Help

// Get Invoice document 

SAPbobsCOM.Documents _mDoc;
AddressExtension m_AddrExtension; 

m_Doc = (SAPbobsCOM.Documents)m_Company.GetBusinessObject(BoObjectTypes.oInvoices); 
m_Doc.GetByKey(4); 
 
// Get the address sub object from the document object 
m_AddrExtension = (AddressExtension)m_Doc.AddressExtension; 
 
// Set bill to address properties 
m_AddrExtension.BillToBlock = "BillToBlockU"; 
m_AddrExtension.BillToBuilding = "BillToBuildingU"; 
m_AddrExtension.BillToCity = "BillToCityU"; 
m_AddrExtension.BillToCountry = "BCU"; 
m_AddrExtension.BillToCounty = "BUt"; 
m_AddrExtension.BillToState = "BSU"; 
m_AddrExtension.BillToStreet = "BillToStreetU"; 
m_AddrExtension.BillToStreetNo = "BillToStreetNoU"; 
m_AddrExtension.BillToZipCode = "BillToZipCodeU"; 
m_AddrExtension.BillToAddressType = "BillToAddressTypeU"; 
 
// Set ship to address properties 
m_AddrExtension.ShipToBlock = "ShipToBlockU"; 
m_AddrExtension.ShipToBuilding = "ShipToBuildingU"; 
m_AddrExtension.ShipToCity = "ShipToCityU"; 
m_AddrExtension.ShipToCountry = "SCU"; 
m_AddrExtension.ShipToCounty = "SUt"; 
m_AddrExtension.ShipToState = "SUt"; 
m_AddrExtension.ShipToStreet = "ShipToStreetU"; 
m_AddrExtension.ShipToStreetNo = "ShipToStreetNoU"; 
m_AddrExtension.ShipToZipCode = "ShipToZipCodeU"; 
 
// Update the document 
m_Doc.Update(); 
former_member272979
Participant

Hi Danilo,

Thanks for the solution. I was able to use your code as a guide and workout the conversion in VB.

Regards,

William

m_felicella
Participant
0 Kudos

This example is for an exists document, for a new document, how do it ?

Many Thank's