I changed now I am getting error at time of saving into " save table RM_OPEN_TEMP;" duplicate key error:
local 'Current Trx Amount' curr;
local 'Due Date' due;
local 'Document Date' doc;
local 'RM Document Type-All' rm;
local integer virtual_key2;
local reference InventoryTable2;
InventoryTable2 = Table_OpenNewBuffer(table RM_OPEN);
range clear table RM_OPEN_TEMP;
get first table RM_OPEN_TEMP by number 1;
while err() <> EOF do
range table (InventoryTable2) where
physicalname('Document Number' of table (InventoryTable2)) + CH_SPACE + CH_EQUAL + CH_SPACE +
SQL_FormatStrings('Document Number' of table RM_OPEN_TEMP) ;
get first table (InventoryTable2);
if err(table (InventoryTable2)) = OKAY then
curr = 'Current Trx Amount' of table (InventoryTable2);
due= 'Due Date' of table (InventoryTable2);
doc='Document Date' of table (InventoryTable2);
rm='RM Document Type-All' of table (InventoryTable2);
check error;
else
curr = 0;
end if;
'Current Trx Amount' of table RM_OPEN_TEMP = curr;
'Due Date' of table RM_OPEN_TEMP = due;
'Document Date' of table RM_OPEN_TEMP = doc;
'RM Document Type-All' of table RM_OPEN_TEMP = rm;
save table RM_OPEN_TEMP;
check error;
get next table RM_OPEN_TEMP;
end while;
range clear table RM_OPEN_TEMP;
get first table RM_OPEN_TEMP by number 1;
while err() <> EOF do
warning str( 'Current Trx Amount' of table RM_OPEN_TEMP);
get next table RM_OPEN_TEMP;
end while;