Answer the question
In order to leave comments, you need to log in
How to compare tabular parts of documents?
I need to create an external processing in the trade for two, in which 2 links are indicated, a link to the RTiU document and a link to the SF document Issued, I need to show the differences in PM goods by nomenclature and quantity between the selected documents. Please tell me how this can be implemented, more precisely, what methods should be used to compare PM
Answer the question
In order to leave comments, you need to log in
The simplest request. Something like
"ВЫБРАТЬ
Номенклатура,
СУММА(Количество)
ИЗ (
ВЫБРАТЬ Номенклатура, Количество
ИЗ Документ.РТиУ.Номенклатура ГДЕ Ссылка = &РТиУ
ОБЪЕДИНИТЬ ВСЕ
ВЫБРАТЬ Номенклатура, - Количество
ИЗ Документ.СФ.Номенклатура ГДЕ Ссылка = &СФ
)
СГРУППИРОВАТЬ ПО Номенклатура
ИМЕЮЩИЕ СУММА(Количество) <> 0"
The fastest and simplest:
1) Unload the tabular parts into tables of values and collapse by item with totals by quantity (but the case if, unlike the SF in RTiU, data was crushed by cost analytics)
2) Loop through the rows in one table and do a search the corresponding line in the second:
2.1) If there is no line, then display a message that there is no such and such item in RTiU
2.2) If there is a line, but the quantity is not right, then display a message about the presence of a delta.
3) The found row of the second table after comparing the quantity is deleted from the second table.
4) After the end of the cycle on the first table, make a cycle on the second table and report that, unlike the SF, new positions with such and such a number have appeared in RTiU.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question