View Single Post
  #4  
Old 15th September 2017, 18:34
vamsi_gujjula's Avatar
vamsi_gujjula vamsi_gujjula is offline
Senior Member
 
Join Date: Nov 2011
Location: hyderabad ; india
Posts: 240
vamsi_gujjula is on a distinguished road
Baan: ERPLN fp3 and 10.4 - DB: oracle - OS: Aix , Redhat linux 6
Our LN is set up for Unicode Mode ... attached the picture

I think a UTF BOM seq is required at beginning of the file ( but not mandatory for all applications)

delimiter is a comma in this case

Code:
function boolean create.file.and.write.header()
{
	string dummy(30) mb 
	fp = seq.open(creat.tmp.file$( bse.tmp.dir$()),"wt+",file)
| 	fp = seq.open("Customer_details_" & dte$() & ".txt","wt+",file)

	if fp < 1 then
		return(false)
	endif
	|BOM
	seq.puts(chr$(239) & chr$(187) & chr$(191),fp)
	
	
	line = concat$(delimiter,
			tt.label.desc ("tctccom100.bpid",ttadv.cont.general,dummy), 
			tt.label.desc ("tctccom100.nama",ttadv.cont.general,dummy), 
			tt.label.desc ("tctccom110.crep",ttadv.cont.general,dummy), 
			tt.label.desc ("gbcom4401m000s01",ttadv.cont.general,dummy), 
			tt.label.desc ("tctcmcs013.cpay",ttadv.cont.general,dummy), 
			tt.label.desc ("tctccom112.crlr",ttadv.cont.general,dummy), 
			tt.label.desc ("tctcmcs143.cste",ttadv.cont.general,dummy),
			get.desc.of.cdf.field("5glk"), 
			get.desc.of.cdf.field("4khd"), 
			get.desc.of.cdf.field("1hyf"), 
			get.desc.of.cdf.field("6qyj"), 
			tt.label.desc ("tctcmcs031.cbrn",ttadv.cont.general,dummy), 
			get.desc.of.cdf.field("2ywx"), 
			get.desc.of.cdf.field("3qyx"), 			
			tt.label.desc ("tctcmcs029.cbtp",ttadv.cont.general,dummy), 
			tt.label.desc ("tctcgen.cadr",ttadv.cont.general,dummy), 
			tt.label.desc ("tctcnama",ttadv.cont.general,dummy), 
			tt.label.desc ("tctcmcs010.ccty",ttadv.cont.general,dummy), 
			tt.label.desc ("tctccom130.city",ttadv.cont.general,dummy),
			tt.label.desc ("gbcom4400m000s01",ttadv.cont.general,dummy)
			)

	ret = utf8.export(unicode.line,line,UTF8_STD_MODE)
	seq.puts(unicode.line,fp)
	return(true)
}


function write.data()
{
	if not isspace(text) then
		search.and.replace(text,","," ")
		search.and.replace(text,chr$(10),chr$(09))
	endif

	line = concat$("|",
		trim$(tccom100.bpid), 
		trim$(tccom100.nama), 
		trim$(tccom110.crep), 
		trim$(crep.nama), 
		trim$(tccom112.cpay),
		tccom112.crlr,
		trim$(tcmcs143.dsca),
		trim$(tccom110.cdf_5glk), 
		trim$(tccom110.cdf_4khd), 
		trim$(tccom110.cdf_1hyf), 
		trim$(tccom110.cdf_6qyj), 
		trim$(tccom110.cbrn), 
		trim$(tccom110.cdf_2ywx), 
		trim$(tccom110.cdf_3qyx), 			
		trim$(tccom110.cbtp), 
		trim$(tccom100.cadr), 
		trim$(tccom130.nama), 
		trim$(tcmcs010.dsca), 
		trim$(tccom139.dsca))

	search.and.replace(line,","," ")
	search.and.replace(line,"|",",")
	line = trim$(line)&chr$(44)&text
	utf8.export(unicode.line,line,UTF8_STD_MODE)
	seq.puts(unicode.line,fp)
	
}
Attached Images
File Type: png unicode parameter.PNG (12.3 KB, 5 views)
__________________
Regards,
Vamsi
Reply With Quote