Create An XML Blank Title 122867

With the BAQ Export process, you an create an XML file and tie an interval to it.

Sent from my iPhone

On Jul 23, 2013, at 12:42 PM, "pleasep" <bill.reckard@...<mailto:bill.reckard@...>> wrote:



Incoming xml we handle with Service Connect. Can't send an example.
Outgoing XML we handle with BPMs. here is some code I wrote to send out put a PO xml file. Key is to create the dataset temp tables with your structure.

/* start of code 8/
find first ttPOHeader where ttPoHeader.rowmod = 'u' or ttPOHeader.RowMod = 'a' no-error.

/*xml stuff */
DEFINE VARIABLE cTargetType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE lFormatted AS LOGICAL NO-UNDO.
DEFINE VARIABLE cEncoding AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSchemaLocation AS CHARACTER NO-UNDO.
DEFINE VARIABLE lWriteSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE lMinSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE retOK AS LOGICAL NO-UNDO.
DEF VAR v-file AS CHAR NO-UNDO.
DEF VAR v-duedate AS DATE NO-UNDO.
DEF VAR v-ref AS CHAR NO-UNDO.
DEF VAR v-extcost AS DECI NO-UNDO.

def variable tth1 as handle no-undo.
def variable tth2 as handle no-undo.
DEF VARIABLE bh1 AS HANDLE NO-UNDO.
DEF VARIABLE bh2 AS HANDLE NO-UNDO.

create temp-table tth1.
tth1:add-like-field("Type","poHeader.Character01").
tth1:add-like-field("AccountCode","poHeader.Character02").
tth1:add-like-field("OrderNo","poHeader.Character03").
tth1:add-like-field("BackOrderFlag","poHeader.Character04").
tth1:add-like-field("VendorCode","poHeader.Character05").
tth1:add-like-field("RevisionNo","poHeader.Character06").

tth1:Temp-table-prepare("POHeader").

bh1 = tth1:DEFAULT-BUFFER-HANDLE.

create temp-table tth2.
tth2:add-like-field("OrderNo","poHeader.Character01").
tth2:add-like-field("PartNum","poHeader.Character02").
tth2:add-like-field("Quantity","poHeader.Number01").

tth2:add-like-field("UnitMeasure","poHeader.Character03").

tth2:add-like-field("ExpectedDate","poHeader.Date03").

tth2:add-like-field("ItemDescription","poHeader.Character04").
tth2:add-like-field("Club","poHeader.Character05").
tth2:add-like-field("Dept","poHeader.Character06").
tth2:add-like-field("Reference","poHeader.Character07").
tth2:add-like-field("CostPer","poHeader.Character08").
tth2:add-like-field("ExtCost","poHeader.Character09").

tth2:Temp-table-prepare("POLine").
bh2 = tth2:DEFAULT-BUFFER-HANDLE.

DEF VARIABLE hdset AS HANDLE NO-UNDO.
DEF VARIABLE hrel AS HANDLE NO-UNDO.

CREATE DATASET hdset.
hDset:SET-BUFFERS(tth1,tth2).
hdSet:NAME = 'PO'.
hRel = hDset:ADD-RELATION(bh1,bh2,"orderno,orderno",false,true).

FIND FIRST vendor WHERE vendor.company = ttpoheader.company
AND vendor.vendornum = ttpoheader.vendornum
NO-LOCK NO-ERROR.

IF NOT AVAIL vendor THEN LEAVE . /*should never happen but exit gracefully */

if ttpoHeader.approvalStatus = "A" then. else next.
v-file = "c:\temp\"
+ "Purchaseorders"
+ string(ttpoheader.ponum)
+ string(year(today),'9999')
+ string(month(today),"99")
+ string(day(today),"99")
+ replace(STRING(TIME,"HH:MM:SS"),":","")
+ ".xml".

/* create file */

bh1:BUFFER-CREATE.
bh1:BUFFER-FIELD("TYPE"):BUFFER-VALUE() = (if (vendor.vendorid = 'PCI001' or vendor.vendorid = 'C03325') then "L" else "M").
bh1:BUFFER-FIELD("AccountCode"):BUFFER-VALUE() = vendor.VendorId.
bh1:BUFFER-FIELD("OrderNo"):BUFFER-VALUE() = string(ttpoheader.ponum).
bh1:BUFFER-FIELD("backOrderFlag"):BUFFER-VALUE() = " ".
bh1:BUFFER-FIELD("VendorCode"):BUFFER-VALUE() = "xyx".
bh1:BUFFER-FIELD("RevisionNo"):BUFFER-VALUE() = "0".

FOR EACH poDetail
WHERE podetail.company = ttpoHeader.company
AND podetail.ponum = ttpoHeader.poNum
NO-LOCK:
FIND FIRST Part WHERE part.company = ttpoheader.company
AND part.partnum = poDetail.partnum
NO-LOCK NO-ERROR.
IF NOT AVAIL part THEN NEXT.


For each porel WHERE porel.company = podetail.company
AND porel.ponum = podetail.ponum
and porel.poline = podetail.poline
NO-LOCK.

v-duedate = porel.DueDate.
if v-duedate = ? then v-duedate = today + 3.

v-ref = ''.

v-extcost = podetail.docUnitcost * porel.xrelQty.

bh2:BUFFER-CREATE.
bh2:BUFFER-FIELD("OrderNo"):BUFFER-VALUE() = string(ttpoheader.ponum).
bh2:BUFFER-FIELD("PartNum"):BUFFER-VALUE() = podetail.partnum.
bh2:BUFFER-FIELD("Quantity"):BUFFER-VALUE() = poRel.XRelQty.
bh2:BUFFER-FIELD("UnitMeasure"):BUFFER-VALUE() = "EA".
bh2:BUFFER-FIELD("ExpectedDate"):BUFFER-VALUE() = v-duedate.
bh2:BUFFER-FIELD("ItemDescription"):BUFFER-VALUE() = podetail.linedesc.
bh2:BUFFER-FIELD("Club"):BUFFER-VALUE() = "BB".
bh2:BUFFER-FIELD("Dept"):BUFFER-VALUE() = "22".
bh2:BUFFER-FIELD("Reference"):BUFFER-VALUE() = v-ref.
bh2:BUFFER-FIELD("CostPer"):BUFFER-VALUE() = (IF bh1:buffer-field("Type"):buffer-value = 'L' THEN string(podetail.docunitcost) ELSE '').
bh2:BUFFER-FIELD("ExtCost"):BUFFER-VALUE() = (IF bh1:buffer-field("Type"):buffer-value = 'L' THEN string(v-extcost) ELSE '').

end. /* end porel*/
end. /*end podetail*/

/* now output the complete dataset */
ASSIGN cTargetType = "file"
cFile = v-file
lFormatted = TRUE
cEncoding = ?
cSchemaLocation = ?
lWriteSchema = FALSE
lMinSchema = FALSE.

retOK = hDset:WRITE-XML(cTargetType, cFile,lFormatted, cEncoding, cSchemaLocation, lWriteSchema, lMinSchema).

bh1:BUFFER-RELEASE().
bh2:BUFFER-RELEASE().

/*end of code */

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "devin.draeger" <devind@...> wrote:
>
> I dont have much knowledge with programing but if you have some service connect examples that would help me if you could?
>
> --- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, Calvin Dekker <calvind@> wrote:
> >
> > Devin -
> >
> > You could use any of the following:
> >
> > 1. Service Connect
> >
> > 2. Business Activity Manager & 4GL code
> >
> > 3. Customer Shipment Entry screen customization layer
> >
> > I have not done service connect with a script to ftp the file however, if you can send via email all three options can do what you need. The best is to pick where your most comfortable programming as you'll be the one maintaining it too.
> >
> > HTH
> >
> > Thank you in advance,
> > Calvin Dekker
> > Office: 630-672-7688 Ext. 1484
> > Email: calvin@<mailto:calvin@>
> > http://www.codabears.com<http://www.codabears.com/>
> > [cid:image001.jpg@]<http://www.codabears.com/>
> >
> > Solutions for Epiday living.
> >
> > "No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."
> >
> > From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of devin.draeger
> > Sent: Monday, July 22, 2013 10:28 AM
> > To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] Create An XML
> >
> >
> >
> > Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>





[Non-text portions of this message have been removed]
Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702
Devin -

You could use any of the following:

1. Service Connect

2. Business Activity Manager & 4GL code

3. Customer Shipment Entry screen customization layer

I have not done service connect with a script to ftp the file however, if you can send via email all three options can do what you need. The best is to pick where your most comfortable programming as you'll be the one maintaining it too.

HTH

Thank you in advance,
Calvin Dekker
Office: 630-672-7688 Ext. 1484
Email: calvin@...<mailto:calvin@...>
http://www.codabears.com<http://www.codabears.com/>
[cid:image001.jpg@...3B1E0]<http://www.codabears.com/>

Solutions for Epiday living.

"No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of devin.draeger
Sent: Monday, July 22, 2013 10:28 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Create An XML



Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702



[Non-text portions of this message have been removed]
I dont have much knowledge with programing but if you have some service connect examples that would help me if you could?

--- In vantage@yahoogroups.com, Calvin Dekker <calvind@...> wrote:
>
> Devin -
>
> You could use any of the following:
>
> 1. Service Connect
>
> 2. Business Activity Manager & 4GL code
>
> 3. Customer Shipment Entry screen customization layer
>
> I have not done service connect with a script to ftp the file however, if you can send via email all three options can do what you need. The best is to pick where your most comfortable programming as you'll be the one maintaining it too.
>
> HTH
>
> Thank you in advance,
> Calvin Dekker
> Office: 630-672-7688 Ext. 1484
> Email: calvin@...<mailto:calvin@...>
> http://www.codabears.com<http://www.codabears.com/>
> [cid:image001.jpg@...]<http://www.codabears.com/>
>
> Solutions for Epiday living.
>
> "No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of devin.draeger
> Sent: Monday, July 22, 2013 10:28 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Create An XML
>
>
>
> Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702
>
>
>
> [Non-text portions of this message have been removed]
>
One of my first "Rubes" was to simply create a .csv file pull it into Access, create a "report" that simulated an xml file and off it went. Did all this automatically via a few DOS batch commands. A bit rookieish, but worked like a charm.

Brenda

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of devin.draeger
Sent: Monday, July 22, 2013 2:08 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Create An XML



I dont have much knowledge with programing but if you have some service connect examples that would help me if you could?

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, Calvin Dekker <calvind@...<mailto:calvind@...>> wrote:
>
> Devin -
>
> You could use any of the following:
>
> 1. Service Connect
>
> 2. Business Activity Manager & 4GL code
>
> 3. Customer Shipment Entry screen customization layer
>
> I have not done service connect with a script to ftp the file however, if you can send via email all three options can do what you need. The best is to pick where your most comfortable programming as you'll be the one maintaining it too.
>
> HTH
>
> Thank you in advance,
> Calvin Dekker
> Office: 630-672-7688 Ext. 1484
> Email: calvin@...<mailto:calvin@<mailto:calvin@...%3cmailto:calvin@>...>
> http://www.codabears.com<http://www.codabears.com/>
> [cid:image001.jpg@...]<http://www.codabears.com/>
>
> Solutions for Epiday living.
>
> "No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of devin.draeger
> Sent: Monday, July 22, 2013 10:28 AM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Create An XML
>
>
>
> Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702
>
>
>
> [Non-text portions of this message have been removed]
>



[Non-text portions of this message have been removed]
Incoming xml we handle with Service Connect. Can't send an example.
Outgoing XML we handle with BPMs. here is some code I wrote to send out put a PO xml file. Key is to create the dataset temp tables with your structure.


/* start of code 8/
find first ttPOHeader where ttPoHeader.rowmod = 'u' or ttPOHeader.RowMod = 'a' no-error.

/*xml stuff */
DEFINE VARIABLE cTargetType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE lFormatted AS LOGICAL NO-UNDO.
DEFINE VARIABLE cEncoding AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSchemaLocation AS CHARACTER NO-UNDO.
DEFINE VARIABLE lWriteSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE lMinSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE retOK AS LOGICAL NO-UNDO.
DEF VAR v-file AS CHAR NO-UNDO.
DEF VAR v-duedate AS DATE NO-UNDO.
DEF VAR v-ref AS CHAR NO-UNDO.
DEF VAR v-extcost AS DECI NO-UNDO.


def variable tth1 as handle no-undo.
def variable tth2 as handle no-undo.
DEF VARIABLE bh1 AS HANDLE NO-UNDO.
DEF VARIABLE bh2 AS HANDLE NO-UNDO.

create temp-table tth1.
tth1:add-like-field("Type","poHeader.Character01").
tth1:add-like-field("AccountCode","poHeader.Character02").
tth1:add-like-field("OrderNo","poHeader.Character03").
tth1:add-like-field("BackOrderFlag","poHeader.Character04").
tth1:add-like-field("VendorCode","poHeader.Character05").
tth1:add-like-field("RevisionNo","poHeader.Character06").

tth1:Temp-table-prepare("POHeader").

bh1 = tth1:DEFAULT-BUFFER-HANDLE.

create temp-table tth2.
tth2:add-like-field("OrderNo","poHeader.Character01").
tth2:add-like-field("PartNum","poHeader.Character02").
tth2:add-like-field("Quantity","poHeader.Number01").

tth2:add-like-field("UnitMeasure","poHeader.Character03").

tth2:add-like-field("ExpectedDate","poHeader.Date03").

tth2:add-like-field("ItemDescription","poHeader.Character04").
tth2:add-like-field("Club","poHeader.Character05").
tth2:add-like-field("Dept","poHeader.Character06").
tth2:add-like-field("Reference","poHeader.Character07").
tth2:add-like-field("CostPer","poHeader.Character08").
tth2:add-like-field("ExtCost","poHeader.Character09").

tth2:Temp-table-prepare("POLine").
bh2 = tth2:DEFAULT-BUFFER-HANDLE.



DEF VARIABLE hdset AS HANDLE NO-UNDO.
DEF VARIABLE hrel AS HANDLE NO-UNDO.

CREATE DATASET hdset.
hDset:SET-BUFFERS(tth1,tth2).
hdSet:NAME = 'PO'.
hRel = hDset:ADD-RELATION(bh1,bh2,"orderno,orderno",false,true).



FIND FIRST vendor WHERE vendor.company = ttpoheader.company
AND vendor.vendornum = ttpoheader.vendornum
NO-LOCK NO-ERROR.

IF NOT AVAIL vendor THEN LEAVE . /*should never happen but exit gracefully */

if ttpoHeader.approvalStatus = "A" then. else next.
v-file = "c:\temp\"
+ "Purchaseorders"
+ string(ttpoheader.ponum)
+ string(year(today),'9999')
+ string(month(today),"99")
+ string(day(today),"99")
+ replace(STRING(TIME,"HH:MM:SS"),":","")
+ ".xml".




/* create file */

bh1:BUFFER-CREATE.
bh1:BUFFER-FIELD("TYPE"):BUFFER-VALUE() = (if (vendor.vendorid = 'PCI001' or vendor.vendorid = 'C03325') then "L" else "M").
bh1:BUFFER-FIELD("AccountCode"):BUFFER-VALUE() = vendor.VendorId.
bh1:BUFFER-FIELD("OrderNo"):BUFFER-VALUE() = string(ttpoheader.ponum).
bh1:BUFFER-FIELD("backOrderFlag"):BUFFER-VALUE() = " ".
bh1:BUFFER-FIELD("VendorCode"):BUFFER-VALUE() = "xyx".
bh1:BUFFER-FIELD("RevisionNo"):BUFFER-VALUE() = "0".



FOR EACH poDetail
WHERE podetail.company = ttpoHeader.company
AND podetail.ponum = ttpoHeader.poNum
NO-LOCK:
FIND FIRST Part WHERE part.company = ttpoheader.company
AND part.partnum = poDetail.partnum
NO-LOCK NO-ERROR.
IF NOT AVAIL part THEN NEXT.



For each porel WHERE porel.company = podetail.company
AND porel.ponum = podetail.ponum
and porel.poline = podetail.poline
NO-LOCK.

v-duedate = porel.DueDate.
if v-duedate = ? then v-duedate = today + 3.

v-ref = ''.

v-extcost = podetail.docUnitcost * porel.xrelQty.


bh2:BUFFER-CREATE.
bh2:BUFFER-FIELD("OrderNo"):BUFFER-VALUE() = string(ttpoheader.ponum).
bh2:BUFFER-FIELD("PartNum"):BUFFER-VALUE() = podetail.partnum.
bh2:BUFFER-FIELD("Quantity"):BUFFER-VALUE() = poRel.XRelQty.
bh2:BUFFER-FIELD("UnitMeasure"):BUFFER-VALUE() = "EA".
bh2:BUFFER-FIELD("ExpectedDate"):BUFFER-VALUE() = v-duedate.
bh2:BUFFER-FIELD("ItemDescription"):BUFFER-VALUE() = podetail.linedesc.
bh2:BUFFER-FIELD("Club"):BUFFER-VALUE() = "BB".
bh2:BUFFER-FIELD("Dept"):BUFFER-VALUE() = "22".
bh2:BUFFER-FIELD("Reference"):BUFFER-VALUE() = v-ref.
bh2:BUFFER-FIELD("CostPer"):BUFFER-VALUE() = (IF bh1:buffer-field("Type"):buffer-value = 'L' THEN string(podetail.docunitcost) ELSE '').
bh2:BUFFER-FIELD("ExtCost"):BUFFER-VALUE() = (IF bh1:buffer-field("Type"):buffer-value = 'L' THEN string(v-extcost) ELSE '').

end. /* end porel*/
end. /*end podetail*/

/* now output the complete dataset */
ASSIGN cTargetType = "file"
cFile = v-file
lFormatted = TRUE
cEncoding = ?
cSchemaLocation = ?
lWriteSchema = FALSE
lMinSchema = FALSE.


retOK = hDset:WRITE-XML(cTargetType, cFile,lFormatted, cEncoding, cSchemaLocation, lWriteSchema, lMinSchema).

bh1:BUFFER-RELEASE().
bh2:BUFFER-RELEASE().


/*end of code */








--- In vantage@yahoogroups.com, "devin.draeger" <devind@...> wrote:
>
> I dont have much knowledge with programing but if you have some service connect examples that would help me if you could?
>
> --- In vantage@yahoogroups.com, Calvin Dekker <calvind@> wrote:
> >
> > Devin -
> >
> > You could use any of the following:
> >
> > 1. Service Connect
> >
> > 2. Business Activity Manager & 4GL code
> >
> > 3. Customer Shipment Entry screen customization layer
> >
> > I have not done service connect with a script to ftp the file however, if you can send via email all three options can do what you need. The best is to pick where your most comfortable programming as you'll be the one maintaining it too.
> >
> > HTH
> >
> > Thank you in advance,
> > Calvin Dekker
> > Office: 630-672-7688 Ext. 1484
> > Email: calvin@<mailto:calvin@>
> > http://www.codabears.com<http://www.codabears.com/>
> > [cid:image001.jpg@]<http://www.codabears.com/>
> >
> > Solutions for Epiday living.
> >
> > "No trees were harmed during the sending of this message, however a large number of electrons were terribly inconvenienced."
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of devin.draeger
> > Sent: Monday, July 22, 2013 10:28 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Create An XML
> >
> >
> >
> > Can i create a XML file for use with a BPM. I am trying get an xml file to create when our shipping personel use a specfic ship to creates an xml and sends to specific location and it is sent to shiping company. Then that shipping company sends a .net file back which i think i can get Service Connect to do this for me. Or would i use a Service Connect workflow to create the output file. Any Idea would be helpfull thanks. Im currentlly running epicor 9.05.702
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>