Hi Experts,
I am working on a form routine which is called whenever a Sales document is changed and data is sent through Idoc to another system.
This change Routine runs each time Output determination happens. Instead of VOFM, a form routine is called in Program SAPMV45A , in Include MV45AFZZ.
A custom table is maintained Sales org wise which has the Sales table name and also Field name and Identifier, FLDCHG.
The custom table is to determine which table fields have changed. In other words, it says If only these fields from These table are, changed ,then
Output has to be triggered , if not there has to be no output sent.
Now inside the form routine the logic has to be written in such a way that, as soon as change is found in any field specified in the custom table by comparing with the Sales document table like YKBAK,YVBAP,YVBEP which have Sales doc old data and XVBAK,XVBAP,XVBEP,etc have new/changed data .
But the Client does not want me to directly compare above runtime internal tables(XVBAK/YVBAK,XVBAP/YVBAP) , but instead they want it to be
dynamic. Ex: the table found ix 'VBAK' from custom table,, then find the field that has to be compared from VBAK, Ex: VDATU.
then write code like this: if (custom table-field) = 'VDATU', compare XVBAK-(custom_table-field) <> YVBAK-(custom_table-field) where vbeln = Sales_doc.
the table found ix 'VBAP' from custom table,, then find the field that has to be compared from VBAK, Ex: MATNR.
then write code like this: if (custom table-field) = 'VDATU', compare XVBAP-(custom_table-field) <> YVBAP-(custom_table-field) where vbeln =sales_doc and posnr = sales_doc_posnr.
Any suggestions would be appreciated , as Iam facing the difficulty in the Comaprison ->XVBAK-(custom_table-field) <> YVBAK-(custom_table-field) where vbeln = Sales_doc.