How do I uses the PartnerAddresses object in SalesOrder.CreateFromDat2

5 pts.
Tags:
STR_SUPPL3
I cannot finsd a reference anywhere for how to use the ParnterAddresses in SalesOrder.CreateFromDat2. I am processing automatic orders from customers thast isist on supplying 3 address lines and need to be able to save those lines. Here is a sample of my code (using VB6): Public Function SupmitOrder() as Boolean Dim boOrder As Object Dim oHeader As Object Dim oPartner As Object Dim oItemIn As Object Dim oAddress As Object Dim oReturn As Object Dim oBAPIService As Object Dim oCommitReturn As Object Dim IDX As Integer Dim iItem As Integer Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder") ' BUS2032 Set oHeader = oBAPICtrl.DimAs(boOrder, "CreateFromDat2", "OrderHeaderIn") With oHeader .Value("DOC_TYPE") = "TA" .Value("SALES_ORG") = "BP01" .Value("DISTR_CHAN") = "01" .Value("DIVISION") = "01" .Value("INCOTERMS1") = msHoldFOB ' A customer supplie value .Value("INCOTERMS2") = Trim(Left(msHoldCarrier & Space(28), 28)) ' Also customer-supplied .Value("PRICE_DATE") = Format(Now(), "MM/DD/YYYY") .Value("PURCH_NO_C") = Trim(msCustPoNo) ' Customer provided PO Number .Value("PURCH_NO_S") = Trim(msOCNCustPO) & IIf(Trim(msOCNCustRLS) = "", "", " REL " & Trim(msOCNCustRLS)) ' Customer PO and Realese data End With Set oPartner = oBAPICtrl.DimAs(boOrder, "CreateFromDat2", "OrderPartners") With oPartner 'Add the sold-to partner (this one is already in the database, so we don't need to add additional info) .Rows.Add .Value(1, "PARTN_ROLE") = "AG" .Value(1, "PARTN_NUMB") = Trim(msCustomerNumber) ' Our number for the requesting customer. 'Add the ship-to partner (this one probably does not exists, so we add all pertinent data) .Rows.Add .Value(2, "PARTN_ROLE") = "WE" .Value(2, "PARTN_NUMB") = Trim(msCustomerNumber) .Value(2, "ITM_NUMBER") = "000000" .Value(2, "NAME") = Trim(msShipToName) .Value(2, "NAME_2") = Trim(msShipAddr2) ' I am saving address line 2 here, temporarily, until I can figure out how to use the PartnerAddresses object .Value(2, "NAME_3") = Trim(msShipAddr3) ' ditto for address line 3 .Value(2, "STREET") = Trim(msShipAddr1) .Value(2, "COUNTRY") = Trim(msShipCountry) .Value(2, "POSTL_CODE") = Trim(msShipZip) .Value(2, "CITY") = Trim(msShipCity) .Value(2, "FAX_NUMBER") = Trim(msFaxNumber) .Value(2, "LANGU") = "EN" .Value(2, "TAXJURCODE") = Left(Trim(msShipState) & "000000000", 9) End With ' Set oAddress = oBAPICtrl.DimAs(boOrder, "CreateFromDat2", "PartnerAddresses") ' With oAddress ' .rows.Add ' .Value(1, "ADDR_NO") = "" ' Where do I get this? ' .Value(1, "FORMOFADDR") = "" ' ditto ' .Value(1, "NAME") = Trim(msShipToName) ' .Value(1, "CITY") = Trim(msShipCity) ' .Value(1, "POSTL_COD1") = Trim(msShipZip) ' .Value(1, "STREET") = Trim(msShipAddr1) ' .Value(1, "LOCATION") = Trim(msShipAddr3) ' .Value(1, "COUNTRY") = Trim(msShipCountry) ' .Value(1, "LANGU") = "EN" ' .Value(1, "REGION") = Trim(msShipState) ' .Value(1, "TAXJURCODE") = Left(Trim(msShipState) & "000000000", 9) ' .Value(1, "FAX_NUMBER") = Trim(msFaxNumber) ' .Value(1, "STR_SUPPL3") = Trim(msShipAddr2) ' End With ' Set oItemIn = oBAPICtrl.DimAs(boOrder, "CreateFromDat2", "OrderItemsIn") IDX = 0 With oItemIn For iItem = 1 To 20 If Trim(muReplyItem(iItem).SupplierPartNo) <> "" Then .Rows.Add IDX = IDX + 1 .Value(IDX, "MATERIAL") = muReplyItem(iItem).SupplierPartNo ' Our part number .Value(IDX, "CUST_MAT22") = Trim(msCSN(iItem)) ' Customer's part number .Value(IDX, "TARGET_QTY") = muLineItem(iItem).OrderQty * 1000 .Value(IDX, "CUST_MAT35") = Trim(msCSN(iItem)) ' Customer's part number End If Next End With Set oReturn = oBAPICtrl.DimAs(boOrder, "CreateFromDat2", "Return") Set oBAPIService = oBAPICtrl.GetSAPObject("BapiService") Set oCommitReturn = oBAPICtrl.DimAs(oBAPIService, "TransactionCommit", "Return") ' Here is what I want to use... ' boOrder.CreateFromDat2 OrderHeaderIn:=oHeader, _ ' OrderItemsIn:=oItemIn, _ ' OrderPartners:=oPartner, _ ' PartnerAddresses:=oAddress, _ ' Return:=oReturn ' Use this version until we can figure out PartnerAddresses... boOrder.CreateFromDat2 OrderHeaderIn:=oHeader, _ OrderItemsIn:=oItemIn, _ OrderPartners:=oPartner, _ Return:=oReturn bOrderPlaced = False For i = 1 To oReturn.rowCount If UCase(oReturn.Value(i, "TYPE")) = "S" And UCase(oReturn.Value(i, "ID")) = "V1" And oReturn.Value(i, "NUMBER") = 311 Then oBAPIService.TransactionCommit Wait:="X", Return:=oCommitReturn bOrderPlaced = True End If Next SubmitOrder = bOrderPlaced Exit Function

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following