‎2007 Mar 09 10:29 AM
Hi,
I'm trying to compare 2 internal tables to match any mis matches and it works. Now i want to get the original field name and write that infront of the data..
For example now i can get
3000150 6000150 mismatch
But i want to get the field name infront of the data, for example
Sales order 3000150 6000150 mismatch
ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB_OD_HEADER TO <FS1>.
Can you tell me how to get the table field name it reads, not the index ?
Thanks
Keshi
‎2007 Mar 09 10:36 AM
‎2007 Mar 09 10:37 AM
Comparison is already working..
I just want to get the field it reads, example, vbeln and display..
Thanks
Keshi
‎2007 Mar 09 10:41 AM
I think you can simply hard code the value when ur comparison is successful line there will be some return parameter like sy-subrc or something else check that with an if and hardcode the value
‎2007 Mar 09 10:44 AM
try this...
Use REUSE_ALV_FIELDCATALOG_MERGRE function module
and after that
ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB_OD_HEADER TO <FS1>.
read table it_fieldcat into wa_fieldcat index SY-INDEX.
wa_fieldcat-fieldname will contain the fieldname
‎2007 Mar 09 11:26 AM
Hi,
If you want to compare two internal tables and to extract differences, do like this:
Down load two internal tables into two different text files usin GUI_DOWNLOAD.
And then compare these two files using the DOS command comp.
i.e, COMP file1.txt file2.txt /a >> file3.txt.
This is the option list for compare command:
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]]
data1 Specifies location and name(s) of first file(s) to compare.
data2 Specifies location and name(s) of second files to compare.
/D Displays differences in decimal format.
/A Displays differences in ASCII characters.
/L Displays line numbers for differences.
/N=number Compares only the first specified number of lines in each file.
/C Disregards case of ASCII letters when comparing files.
/OFF[LINE] Do not skip files with offline attribute set.
To compare sets of files, use wildcards in data1 and data2 parameters.
Reward if helpful
Regards,
Sandhya.M