Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Assign component

Former Member
0 Likes
599

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

5 REPLIES 5
Read only

Former Member
0 Likes
564

do you want to compare all the fields or only the key?

Read only

0 Likes
564

Comparison is already working..

I just want to get the field it reads, example, vbeln and display..

Thanks

Keshi

Read only

0 Likes
564

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

Read only

Former Member
0 Likes
564

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

Read only

Former Member
0 Likes
564

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