Hi.İ want to ask a question.Sorry for english i dont know well.İ want to take records (ETGItemGroupTable) İN “YE01” company then i want to insert records (ETGItemGroupTable) in “AL01” company.i find another way to use buf2buf function or dicttable … but i must use like this code
(where itemGroupTable2.ItemGroupId != itemGroupTable.ItemGroupId).Because İn “AL01” company there will be records.
ETGItemGroupTable.ItemGroupId is primary key.So this i got error.İ want “AL01” company have records then this code must be updated.if “AL01” company havent racords this code must be insert.Please Help me this problem.Please write this code correctly.
ETGItemGroupTable itemGroupTable;
ETGItemGroupTable itemGroupTable2;
;
ttsbegin;
changecompany(“YE01”)
{
select itemGroupTable;
}
changecompany(“AL01”)
{
while select itemGroupTable2
where itemGroupTable2.ItemGroupId != itemGroupTable.ItemGroupId
{
itemGroupTable2.ItemGroupId = itemGroupTable3.ItemGroupId;
itemGroupTable2.ItemGroupName = itemGroupTable3.ItemGroupName;
itemGroupTable2.ItemGroupDesc = itemGroupTable3.ItemGroupDesc;
itemGroupTable2.ItemGroupLevel = itemGroupTable3.ItemGroupLevel;
itemGroupTable2.insert();
}
while select forupdate itemGroupTable2
where itemGroupTable2.ItemGroupId == itemGroupTable.ItemGroupId
{
itemGroupTable2.ItemGroupId = itemGroupTable3.ItemGroupId;
itemGroupTable2.ItemGroupName = itemGroupTable3.ItemGroupName;
itemGroupTable2.ItemGroupDesc = itemGroupTable3.ItemGroupDesc;
itemGroupTable2.ItemGroupLevel = itemGroupTable3.ItemGroupLevel;
itemGroupTable2.update();
}
}
ttscommit;