I am having trouble importing a file into a existing table. The table is iix and i am taking a item-code value substinging it and replacing the 1st number with a 1. I then export the stream to a csv file,which i thought i could import back into the table..I do not want to overwrite the old values just add the same line with the new Item-code number....I have never coded in progress. Could someone please help.
Below is a the code i have written to do it.
Define Variable item-codes LIKE iix.item-code.
Define Variable Item-desc-1s LIKE iix.Item-desc-1.
Define Variable Item-desc-2s LIKE iix.Item-desc-2.
Define Variable item-code-alts LIKE iix.Item-code-alt.
Define Variable class-codes LIKE iix.class-code.
Define Variable group-codes LIKE iix.Group-code.
Define Variable user-def-1s LIKE iix.User-def-1.
Define Variable user-def-4s LIKE iix.user-def-4.
Define Variable customers LIKE iix.customer.
Define Variable vendors LIKE iix.vendor.
Define Variable unit-tracks LIKE iix.unit-track.
Define Variable date-createds LIKE iix.date-created.
Define Variable date-modifieds LIKE iix.date-modified.
Define Variable lot-auto-rcvds LIKE iix.lot-auto-rcvd.
Define Variable user-def-2s LIKE iix.user-def-2.
Define Variable user-def-3s LIKE iix.User-def-3.
Define Variable modified-bys LIKE iix.Modified-by.
Define Variable item-units1s Like iix.item-unit[1].
DEFINE VARIABLE item-units2s LIKE iix.item-unit[2].
DEFINE VARIABLE item-units3s LIKE iix.item-unit[3].
DEFINE VARIABLE item-units4s LIKE iix.item-unit[4].
Define Variable unit-ratios1s LIKE iix.unit-ratio[1].
Define Variable unit-ratios2s LIKE iix.unit-ratio[2].
Define Variable unit-ratios3s LIKE iix.unit-ratio[3].
Define Variable unit-ratios4s LIKE iix.unit-ratio[4].
Define Variable cost-ctrs LIKE iix.cost-ctr.
Define Variable acct-nums LIKE iix.acct-num.
Define Variable branch-cost-flgs LIKE iix.branch-cost-flg.
Define Variable active-flgs LIKE iix.active-flg.
Define Variable vat-codes LIKE iix.vat-code.
Define Variable vat-flags LIKE iix.vat-flag.
Define Variable item-type-flags LIKE iix.item-type-flag.
Define Variable mmd-codes LIKE iix.mmd-code.
Define Variable customs-codes LIKE iix.customs-code.
Define Variable country-of-origins LIKE iix.country-of-origin.
Define Variable percent-contents LIKE iix.percent-content.
Define Variable end-use-codes LIKE iix.end-use-code.
Define Variable upc-codes LIKE iix.upc-code.
Define Variable notes-status-strs LIKE iix.notes-status-str.
Define Variable comments LIKE iix.comment.
Define Variable item-colors LIKE iix.item-color.
INPUT FROM v:\iixsptest.txt.
CREATE csv.
IMPORT DELIMITER "," Item-codes Item-desc-1s Item-desc-2s ITem-code-alts Class-codes Group-codes User-def-1s User-def-4s Customers Vendors Unit-tracks Date-createds Date-modifieds Lot-auto-rcvds User-def-2s User-def-3s Modified-bys Item-units1s Item-units2s Item-units3s Item-units4s Unit-ratios1s Unit-ratios2s Unit-ratios3s Unit-ratios4s Cost-ctrs Acct-nums Branch-cost-flgs Active-flgs vat-codes vat-flags Item-type-flags mmd-codes Customs-codes country-of-origins percent-contents end-use-codes upc-codes noTes-status-strs comments item-colors.
DISPLAY Item-codes Item-desc-1s Item-desc-2s ITem-code-alts Class-codes Group-codes User-def-1s User-def-4s Customers Vendors Unit-tracks Date-createds Date-modifieds Lot-auto-rcvds User-def-2s User-def-3s Modified-bys Item-units1s Item-units2s Item-units3s Item-units4s Unit-ratios1s Unit-ratios2s Unit-ratios3s Unit-ratios4s Cost-ctrs Acct-nums Branch-cost-flgs Active-flgs vat-codes vat-flags Item-type-flags mmd-codes Customs-codes country-of-origins percent-contents end-use-codes upc-codes noTes-status-strs comments item-colors.
INPUT CLOSE.
Below is a the code i have written to do it.
Define Variable item-codes LIKE iix.item-code.
Define Variable Item-desc-1s LIKE iix.Item-desc-1.
Define Variable Item-desc-2s LIKE iix.Item-desc-2.
Define Variable item-code-alts LIKE iix.Item-code-alt.
Define Variable class-codes LIKE iix.class-code.
Define Variable group-codes LIKE iix.Group-code.
Define Variable user-def-1s LIKE iix.User-def-1.
Define Variable user-def-4s LIKE iix.user-def-4.
Define Variable customers LIKE iix.customer.
Define Variable vendors LIKE iix.vendor.
Define Variable unit-tracks LIKE iix.unit-track.
Define Variable date-createds LIKE iix.date-created.
Define Variable date-modifieds LIKE iix.date-modified.
Define Variable lot-auto-rcvds LIKE iix.lot-auto-rcvd.
Define Variable user-def-2s LIKE iix.user-def-2.
Define Variable user-def-3s LIKE iix.User-def-3.
Define Variable modified-bys LIKE iix.Modified-by.
Define Variable item-units1s Like iix.item-unit[1].
DEFINE VARIABLE item-units2s LIKE iix.item-unit[2].
DEFINE VARIABLE item-units3s LIKE iix.item-unit[3].
DEFINE VARIABLE item-units4s LIKE iix.item-unit[4].
Define Variable unit-ratios1s LIKE iix.unit-ratio[1].
Define Variable unit-ratios2s LIKE iix.unit-ratio[2].
Define Variable unit-ratios3s LIKE iix.unit-ratio[3].
Define Variable unit-ratios4s LIKE iix.unit-ratio[4].
Define Variable cost-ctrs LIKE iix.cost-ctr.
Define Variable acct-nums LIKE iix.acct-num.
Define Variable branch-cost-flgs LIKE iix.branch-cost-flg.
Define Variable active-flgs LIKE iix.active-flg.
Define Variable vat-codes LIKE iix.vat-code.
Define Variable vat-flags LIKE iix.vat-flag.
Define Variable item-type-flags LIKE iix.item-type-flag.
Define Variable mmd-codes LIKE iix.mmd-code.
Define Variable customs-codes LIKE iix.customs-code.
Define Variable country-of-origins LIKE iix.country-of-origin.
Define Variable percent-contents LIKE iix.percent-content.
Define Variable end-use-codes LIKE iix.end-use-code.
Define Variable upc-codes LIKE iix.upc-code.
Define Variable notes-status-strs LIKE iix.notes-status-str.
Define Variable comments LIKE iix.comment.
Define Variable item-colors LIKE iix.item-color.
INPUT FROM v:\iixsptest.txt.
CREATE csv.
IMPORT DELIMITER "," Item-codes Item-desc-1s Item-desc-2s ITem-code-alts Class-codes Group-codes User-def-1s User-def-4s Customers Vendors Unit-tracks Date-createds Date-modifieds Lot-auto-rcvds User-def-2s User-def-3s Modified-bys Item-units1s Item-units2s Item-units3s Item-units4s Unit-ratios1s Unit-ratios2s Unit-ratios3s Unit-ratios4s Cost-ctrs Acct-nums Branch-cost-flgs Active-flgs vat-codes vat-flags Item-type-flags mmd-codes Customs-codes country-of-origins percent-contents end-use-codes upc-codes noTes-status-strs comments item-colors.
DISPLAY Item-codes Item-desc-1s Item-desc-2s ITem-code-alts Class-codes Group-codes User-def-1s User-def-4s Customers Vendors Unit-tracks Date-createds Date-modifieds Lot-auto-rcvds User-def-2s User-def-3s Modified-bys Item-units1s Item-units2s Item-units3s Item-units4s Unit-ratios1s Unit-ratios2s Unit-ratios3s Unit-ratios4s Cost-ctrs Acct-nums Branch-cost-flgs Active-flgs vat-codes vat-flags Item-type-flags mmd-codes Customs-codes country-of-origins percent-contents end-use-codes upc-codes noTes-status-strs comments item-colors.
INPUT CLOSE.