jpsst34
Well Known Member
Hey List,
I am currently trying to write a table conversion that reads the contents of a custom table and outputs the data to one of two text files - which file it writes to is based on the value of one field in the table. Before I can output to text, I have to key into one table, get a value and update the other table with that value. Then, I check the new value in the updated table and based on that I update one of the two text files.
The problem I am seeing is that it seems to be checking the value in the updated table before the update command has completed. For instance, if this value is "N" for every record, but then updated to "Y" for every record, the data is output to the file corresponding to "N." But if I look at the table that was updated, this field is "Y" for every record. This leads me to believe that the program is continuing on before the data is actually updated.
Below is the ER Code of my program. Please feel free to read it and let me know anything you may have that explains why I'm seeing this behaviour. Is it due to my suspicion that the program is moving on before the update is done?
In the Row Fetched event of the TC:
// Before we can output anything to the CR flat files, we must first key into
// the F0101Z2 table on EDUS, EDBT, EDTN, and EDLN to get the EDSP
// value and update F550103.EDSP
F0101Z2.Fetch Single
.....IC EDI - User ID = TK EDI - User ID
.....IC EDI - Batch Numerb = TK EDI Batch Number
.....IC EDI - Transaction Number = TK EDI - Transaction Number
.....IC EDI - Line Number = TK EDI - Line Number
.....VA rpt_UpdatedEDSP <- TK EDI - Successfully Processed
F550103.Update
.....VA rpt_UpdatedEDSP -> TK EDI - Successfully Processed
.....IC Long Address Number = TK Long Address Number
// OK, we've updated the F550103.EDSP so we can output the record
If SV File_IO_Status is equal to CO SUCCESS
If VA rpt_UpdatedEDSP is equal to "Y"
// If the records was uploaded into the Address Book, output it to Vendors_CR.tx
OC EDUS (TextLine1) = IC EDUS (EDI - User ID) (F550103)
OC EDTN (TextLine1) = IC EDTN (EDI - Transaction Number) (F550103)
OC EDLN (TextLine1) = IC EDLN (EDI - Line Number) (F550103)
OC EDSP (TextLine1) = [IC EDSP (EDI - Successfully Processed) (F550103)]
OC TNAC (TextLine1) = IC TNAC (Transaction Action) (F550103)
OC EDBT (TextLine1) = IC EDBT (EDI - Batch Number) (F550103)
OC ALPH (TextLine1) = IC ALPH (Name - Alpha) (F550103)
OC MLNM (TextLine1) = IC MLNM (Name - Mailing) (F550103)
OC ADD1 (TextLine1) = IC ADD1 (Address Line 1) (F550103)
OC ADD2 (TextLine1) = IC ADD2 (Address Line 2) (F550103)
OC ADD3 (TextLine1) = IC ADD3 (Address Line 3) (F550103)
OC ADD4 (TextLine1) = IC ADD4 (Address Line 4) (F550103)
OC CTY1 (TextLine1) = IC CTY1 (City) (F550103)
OC ADDS (TextLine1) = IC ADDS (State) (F550103)
OC ADDZ (TextLine1) = IC ADDZ (Postal Code) (F550103)
OC CTR (TextLine1) = IC CTR (Country) (F550103)
OC ATP (TextLine1) = [IC ATP (Address Type - Payables) (F550103)]
OC TAXC (TextLine1) = [IC TAXC (Person/Corporation Code) (F550103)]
OC AC07 (TextLine1) = IC AC07 (1099 Reporting Codes) (F550103)
OC TAX (TextLine1) = IC TAX (Tax ID) (F550103)
OC ALKY (TextLine1) = IC ALKY (Long Address Number) (F550103)
OC AN8 (TextLine1) = IC AN8 (Address Number Test) (F550103)
OC AC30 (TextLine1) = IC AC30 (Category Code - Address Book 30) (F550103)
OC AC06 (TextLine1) = IC AC06 (Category Code - Address Book 06) (F550103)
OC SIC (TextLine1) = IC SIC (Industry Classification Code) (F550103)
OC AC08 (TextLine1) = IC AC08 (Category Code - Address Book 08) (F550103)
TextLine1.Insert Row
Else
// If it wasn't uploaded into AB, output it to Vendors_CR_NotPopulated.txt
OC EDUS (TextLine1) = IC EDUS (EDI - User ID) (F550103)
OC EDTN (TextLine1) = IC EDTN (EDI - Transaction Number) (F550103)
OC EDLN (TextLine1) = IC EDLN (EDI - Line Number) (F550103)
OC EDSP (TextLine1) = [IC EDSP (EDI - Successfully Processed) (F550103)]
OC TNAC (TextLine1) = IC TNAC (Transaction Action) (F550103)
OC EDBT (TextLine1) = IC EDBT (EDI - Batch Number) (F550103)
OC ALPH (TextLine1) = IC ALPH (Name - Alpha) (F550103)
OC MLNM (TextLine1) = IC MLNM (Name - Mailing) (F550103)
OC ADD1 (TextLine1) = IC ADD1 (Address Line 1) (F550103)
OC ADD2 (TextLine1) = IC ADD2 (Address Line 2) (F550103)
OC ADD3 (TextLine1) = IC ADD3 (Address Line 3) (F550103)
OC ADD4 (TextLine1) = IC ADD4 (Address Line 4) (F550103)
OC CTY1 (TextLine1) = IC CTY1 (City) (F550103)
OC ADDS (TextLine1) = IC ADDS (State) (F550103)
OC ADDZ (TextLine1) = IC ADDZ (Postal Code) (F550103)
OC CTR (TextLine1) = IC CTR (Country) (F550103)
OC ATP (TextLine1) = [IC ATP (Address Type - Payables) (F550103)]
OC TAXC (TextLine1) = [IC TAXC (Person/Corporation Code) (F550103)]
OC AC07 (TextLine1) = IC AC07 (1099 Reporting Codes) (F550103)
OC TAX (TextLine1) = IC TAX (Tax ID) (F550103)
OC ALKY (TextLine1) = IC ALKY (Long Address Number) (F550103)
OC AN8 (TextLine1) = IC AN8 (Address Number Test) (F550103)
OC AC30 (TextLine1) = IC AC30 (Category Code - Address Book 30) (F550103)
OC AC06 (TextLine1) = IC AC06 (Category Code - Address Book 06) (F550103)
OC SIC (TextLine1) = IC SIC (Industry Classification Code) (F550103)
OC AC08 (TextLine1) = IC AC08 (Category Code - Address Book 08) (F550103)
TextLine1.Insert Row
End If
Else
End If
Thanks,
I am currently trying to write a table conversion that reads the contents of a custom table and outputs the data to one of two text files - which file it writes to is based on the value of one field in the table. Before I can output to text, I have to key into one table, get a value and update the other table with that value. Then, I check the new value in the updated table and based on that I update one of the two text files.
The problem I am seeing is that it seems to be checking the value in the updated table before the update command has completed. For instance, if this value is "N" for every record, but then updated to "Y" for every record, the data is output to the file corresponding to "N." But if I look at the table that was updated, this field is "Y" for every record. This leads me to believe that the program is continuing on before the data is actually updated.
Below is the ER Code of my program. Please feel free to read it and let me know anything you may have that explains why I'm seeing this behaviour. Is it due to my suspicion that the program is moving on before the update is done?
In the Row Fetched event of the TC:
// Before we can output anything to the CR flat files, we must first key into
// the F0101Z2 table on EDUS, EDBT, EDTN, and EDLN to get the EDSP
// value and update F550103.EDSP
F0101Z2.Fetch Single
.....IC EDI - User ID = TK EDI - User ID
.....IC EDI - Batch Numerb = TK EDI Batch Number
.....IC EDI - Transaction Number = TK EDI - Transaction Number
.....IC EDI - Line Number = TK EDI - Line Number
.....VA rpt_UpdatedEDSP <- TK EDI - Successfully Processed
F550103.Update
.....VA rpt_UpdatedEDSP -> TK EDI - Successfully Processed
.....IC Long Address Number = TK Long Address Number
// OK, we've updated the F550103.EDSP so we can output the record
If SV File_IO_Status is equal to CO SUCCESS
If VA rpt_UpdatedEDSP is equal to "Y"
// If the records was uploaded into the Address Book, output it to Vendors_CR.tx
OC EDUS (TextLine1) = IC EDUS (EDI - User ID) (F550103)
OC EDTN (TextLine1) = IC EDTN (EDI - Transaction Number) (F550103)
OC EDLN (TextLine1) = IC EDLN (EDI - Line Number) (F550103)
OC EDSP (TextLine1) = [IC EDSP (EDI - Successfully Processed) (F550103)]
OC TNAC (TextLine1) = IC TNAC (Transaction Action) (F550103)
OC EDBT (TextLine1) = IC EDBT (EDI - Batch Number) (F550103)
OC ALPH (TextLine1) = IC ALPH (Name - Alpha) (F550103)
OC MLNM (TextLine1) = IC MLNM (Name - Mailing) (F550103)
OC ADD1 (TextLine1) = IC ADD1 (Address Line 1) (F550103)
OC ADD2 (TextLine1) = IC ADD2 (Address Line 2) (F550103)
OC ADD3 (TextLine1) = IC ADD3 (Address Line 3) (F550103)
OC ADD4 (TextLine1) = IC ADD4 (Address Line 4) (F550103)
OC CTY1 (TextLine1) = IC CTY1 (City) (F550103)
OC ADDS (TextLine1) = IC ADDS (State) (F550103)
OC ADDZ (TextLine1) = IC ADDZ (Postal Code) (F550103)
OC CTR (TextLine1) = IC CTR (Country) (F550103)
OC ATP (TextLine1) = [IC ATP (Address Type - Payables) (F550103)]
OC TAXC (TextLine1) = [IC TAXC (Person/Corporation Code) (F550103)]
OC AC07 (TextLine1) = IC AC07 (1099 Reporting Codes) (F550103)
OC TAX (TextLine1) = IC TAX (Tax ID) (F550103)
OC ALKY (TextLine1) = IC ALKY (Long Address Number) (F550103)
OC AN8 (TextLine1) = IC AN8 (Address Number Test) (F550103)
OC AC30 (TextLine1) = IC AC30 (Category Code - Address Book 30) (F550103)
OC AC06 (TextLine1) = IC AC06 (Category Code - Address Book 06) (F550103)
OC SIC (TextLine1) = IC SIC (Industry Classification Code) (F550103)
OC AC08 (TextLine1) = IC AC08 (Category Code - Address Book 08) (F550103)
TextLine1.Insert Row
Else
// If it wasn't uploaded into AB, output it to Vendors_CR_NotPopulated.txt
OC EDUS (TextLine1) = IC EDUS (EDI - User ID) (F550103)
OC EDTN (TextLine1) = IC EDTN (EDI - Transaction Number) (F550103)
OC EDLN (TextLine1) = IC EDLN (EDI - Line Number) (F550103)
OC EDSP (TextLine1) = [IC EDSP (EDI - Successfully Processed) (F550103)]
OC TNAC (TextLine1) = IC TNAC (Transaction Action) (F550103)
OC EDBT (TextLine1) = IC EDBT (EDI - Batch Number) (F550103)
OC ALPH (TextLine1) = IC ALPH (Name - Alpha) (F550103)
OC MLNM (TextLine1) = IC MLNM (Name - Mailing) (F550103)
OC ADD1 (TextLine1) = IC ADD1 (Address Line 1) (F550103)
OC ADD2 (TextLine1) = IC ADD2 (Address Line 2) (F550103)
OC ADD3 (TextLine1) = IC ADD3 (Address Line 3) (F550103)
OC ADD4 (TextLine1) = IC ADD4 (Address Line 4) (F550103)
OC CTY1 (TextLine1) = IC CTY1 (City) (F550103)
OC ADDS (TextLine1) = IC ADDS (State) (F550103)
OC ADDZ (TextLine1) = IC ADDZ (Postal Code) (F550103)
OC CTR (TextLine1) = IC CTR (Country) (F550103)
OC ATP (TextLine1) = [IC ATP (Address Type - Payables) (F550103)]
OC TAXC (TextLine1) = [IC TAXC (Person/Corporation Code) (F550103)]
OC AC07 (TextLine1) = IC AC07 (1099 Reporting Codes) (F550103)
OC TAX (TextLine1) = IC TAX (Tax ID) (F550103)
OC ALKY (TextLine1) = IC ALKY (Long Address Number) (F550103)
OC AN8 (TextLine1) = IC AN8 (Address Number Test) (F550103)
OC AC30 (TextLine1) = IC AC30 (Category Code - Address Book 30) (F550103)
OC AC06 (TextLine1) = IC AC06 (Category Code - Address Book 06) (F550103)
OC SIC (TextLine1) = IC SIC (Industry Classification Code) (F550103)
OC AC08 (TextLine1) = IC AC08 (Category Code - Address Book 08) (F550103)
TextLine1.Insert Row
End If
Else
End If
Thanks,