Hello Martin, I am building an output file for a specific electronic payments, my variables are containers that store string values. below is an example of the first container, which corresponds to the first header of the body Protected container Create_FirstHeaderForBody() { #define.CodeEnreg('06') #define.CodeOperation('59') #define.DateSeqYMD(321) #define.DateDay(2) #define.DateMonth(2) #define.DateYear(2) #define.zero('0') //str tst; str 2 CodeEnreg = #CodeEnreg; str 2 CodeOperation = #CodeOperation; str 9 CodeEmetteur = VendOutPaym_SpecificFmt::StrWithBlanks(CompanyInfo::find().VATNum, 9); str 3 SuffixeFirstHeaderForBody = VendOutPaym_SpecificFmt::StrWithBlanks(#SuffixeFirstHeader,3); str 12 VendorCode = VendOutPaym_SpecificFmt::StrWithBlanks(custVendPaym.custVendTable().VATNum, 12); str 3 NumData = VendOutPaym_SpecificFmt::StrWithBlanks(#numData,3); str 40 VendorName = VendOutPaym_SpecificFmt::StrWithBlanks(custVendPaym.custVendTable().name(), 40); str 30 FreeText6FirstHeader = VendOutPaym_SpecificFmt::StrWithBlanks(custVendPaym.ledgerJournalTrans().Freetextfield06,29); FirstHeader = conIns(FirstHeader,1,CodeEnreg + CodeOperation + CodeEmetteur + SuffixeFirstHeaderForBody + VendorCode + NumData + VendorName + FreeText6FirstHeader); return FirstHeaderPagares; } then, here is the code for the second container (the second header line of the body ): Protected container Create_SecondHeaderForBody() { #define.CodeEnreg('06') #define.CodeOperation('59') #define.SuffixeSecondHeader('001') #define.NumData('011') #define.DateSeqYMD(321) #define.DateDay(2) #define.DateMonth(2) #define.DateYear(2) #define.zero('0') str 2 CodeEnreg = #CodeEnreg; str 2 CodeOperation = #CodeOperation; str 9 CodeEmetteur = VendOutPaym_SpecifiFormat::StrWithBlanks(CompanyInfo::find().VATNum, 9); str 3 SuffixeSecondHeaderForBody = VendOutPaym_SpecifiFormat::StrWithBlanks(#SuffixeSecondHeader,3); str 12 VendorCode = VendOutPaym_SpecifiFormat::StrWithBlanks(custVendPaym.custVendTable().VATNum, 12); str 3 NumData = VendOutPaym_SpecifiFormat::StrWithBlanks(#numData,3); str 45 PostalAddress = VendOutPaym_SpecifiFormat::StrWithBlanks(strReplace(custVendPaym.recieversStreet(),'\n','\r'), 45); str 30 FreeText7FirstHeader = VendOutPaym_SpecifiFormat::StrWithBlanks(custVendPaym.ledgerJournalTrans().Freetextfield07,45); SecondHeader= conIns(SecondHeader,1,'\n'+CodeEnreg + CodeOperation + CodeEmetteur + SuffixeSecondHeaderForBody + VendorCode + NumData + PostalAddress + FreeText7FirstHeader); return SecondHeader; } based on those previous containers, I build a new Container where I insert them private container InsertIntoFile() { specTrans specTrans; container con; LedgerJournalTrans LedgerJournalTrans = custVendPaym.ledgerJournalTrans(); int i; while select specTrans where specTrans.SpecTableId == ledgerJournalTrans.TableId && specTrans.SpecRecId == ledgerJournalTrans.RecId && specTrans.SpecCompany == ledgerJournalTrans.company() { if (specTrans.vendTrans().Invoice) { this.Create_FirstHeaderForBody(); this.Create_SecondHeaderForBody(); record = conIns(record, 1,FirstHeader,SecondHeader); } } return record; } in the end I call the last method from the OutPut method of the vendoutPaymRecord_SpecificFmt like this: public void outPut() { transactionAmount = custVendPaym.paymAmountInSendersCurrency(); file.writeExp(this.InsertIntoFile()); } the file generated in the output contains an extra space at the end of lines extracted from the record container ( First line Header and Second Line Header ) is there a way i can remove that added space from the line? I hope my post is clearer now. If there is an extra information needed please let me know. Kind regards, Jihane
↧