Business Function for Copying Tables

RichMSlaney

Member
My client has a requirement for a particular Business Function. Due to a business requirement, we need to create interface applications which need to create files on the fly and populate them.

In my scenario, we need to create a file on the fly for each Customer Record, populate it with the required data and then FTP it to another Server / System. But we don't want to create a file for each customer (as they don't all need exporting), and we don't want the overhead of creating / maintaining files to keep in line with JDE.

So, my plan is to create a JDE Table with all the required fields and Indices all ready created. I would then like a routine which could copy and rename my template file and then generate the table in OneWorld. I can't use the OS as the client is migrating from AS400 to NT in the near future

Has anyone tried to do this ?
If you have, could someone please let me know how, and maybe email me the C++ code.
Any other suggestions ?

Thanks in Advance
Rich Slaney
OneWorld Developer.
 

W_Herdes

Member
Rich,

can't you use the Z-files and the functionality of that part of interoperability?
And what kind of version of OneWorld are you using?

Walter.
 

Larry_Jones

Legendary Poster
Rich,

your plan won't work in the NT Environment since all tables are in a SQL Server database - not individual files.

Think about using a UBE generated CSV (comma delimited text) output file.

Regards,

Larry Jones
[email protected]
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP15
 

David Robertson

Reputable Poster
There are BSFN's in JDE that you can use from within a UBE or APPL, to write directly to a text file (on a share path that your machine can see on the network).

All you need to do is assemble a string for with the info you want in the format you require, and then call the BSFN to write it to the file. There are options to append etc.

Does this help?

Eg.
(NOTE: The B0500025 BSFN I have illustrated here seems to automatically insert carriage return/Line Feed characters after each insert. If this is a problem then there a several BSFN's available for outputting to text files - eg B0400520 - Write String To File)

VA evt_FileName = "Your text file name"

View.Select (address book?)
FC (selected fields) = TK (selected field)
View.Fetch Next
VA evt_(whatever data you need) <- TK (whatever data you need)
If SV File_IO_Status is equal to CO SUCCESS

VA evt_OutputRecord = concat(put a header record here if you need it)
Export to Flat File (B0500025)
VA evt_OutputRecord -> szRecord
VA evt_FileName -> szPath
VA evt_Status <- cStatus

While SV File_IO_Status is equal to CO SUCCESS
If SV File_IO_Status is equal to CO SUCCESS
VA evt_OutputRecord = concat(detail records constructed here)
Export to Flat File (B0500025)
VA evt_OutputRecord -> szRecord
VA evt_FileName -> szPath
VA evt_Status <- cStatus
End If
View.Fetch Next
VA evt_(whatever data you need) <- TK (whatever data you need)
End While
VA evt_OutputRecord = "any trailer record information here"
Export to Flat File
VA evt_OutputRecord -> szRecord
VA evt_FileName -> szPath
VA evt_Status <- cStatus
End If
 
Top