Application Development 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: 

Report to match the Vendor Name & address with SAP Vendor master

vinay_pasalkar
Participant
0 Kudos

Hi,

My requirment is to create a report which will match the Vendor name & address in the list with SAP Vendor master data.

I am using table LFA1, ADRC in SAP ECC for the same, the data which is coming is in XML format.

I did read the XML file from the application server & took all the data in the internal table.

However the matches should be displayed only if any 6 sequential characters in the Vendor Master must be identical to 6 sequential characters in the File record.

What command I can use  while comparing data from file to SAP Vendor master data in order to match the record.

Will 'Contains String (CS)' will suffice my purpose if yes will comparision be like  SAP_VENDOR_MASTER-name1 CS FILE_DATA-name1.

Thanks

Vinay

1 ACCEPTED SOLUTION

vinay_pasalkar
Participant
0 Kudos

Thanks a lot for your reply, I completed the report trying the various combination of field1 & field2 and comparing it using command 'CS'.

9 REPLIES 9

Former Member
0 Kudos

Hi Vinay,

Your line "SAP_VENDOR_MASTER-name1 CS FILE_DATA-name1." will ony match if the SAP data contains all of the characters in the field record.

If your requirement is for 6 characters to match you will need to match SAP_VENDOR_MASTER-name1 against the first 6 characters of CS FILE_DATA-name1, then the second 6, then the third etc until you get a match.

e.g.

SAP_VENDOR_MASTER-name1 CS FILE_DATA-name1(6).

if sy-subrc ne 0.

SAP_VENDOR_MASTER-name1 CS FILE_DATA-name1+1(6).

etc

(note, there's almost certainly a better way of coding this than my example).

Regards,

Nick

0 Kudos

Exactly Nick..Problem is I have huge data to compare so can not implement the above method.

0 Kudos

Hi Vinay,

You might stand a better change with the REGEX functions explained in this article , but it might be that the '6 character' scope of the match may be too much of a limitation to use a pre-existing function.

Regards,

Nick

bharat_rathod2
Active Participant
0 Kudos

Dear,

Can you please explain in detail .

0 Kudos

If I have field 1 & Field 2

I wanted to know how we can we find if any 6 sequencial character in field1 is identical to any 6 sequancial character in field2.

I have to compare many records which contains diffrent fields so performance is also one of the factor.

0 Kudos

Hi ,

Use FIND keyword to find 6 sequential characteristic of field1 in field2 ,the match count will give you how many such occurrence of pattern ,match offset will give you at point pattern is started (Depends on First occurrence ) more information read FIND keyword doc. 

Example,

if field1 is ABCDEF' and field2 is 'WERABCDEFYUIOO'

then

FIND FIRST OCCURRENCE OF field1 in field2 match offset w_offset.

Thanks

Arun

0 Kudos

dear,

you have to take 6 char of field 1 in 1 varable thaen after use

OCCURRENCE OF command.

Former Member
0 Kudos

Hi Vinay,

Do you need to compare any 6 character of you file from SAP if that is the case break the words on 6 letters and store in an internal table , you can use RKD_WORD_WRAP the benefit of using it is your words will not be splitted if it is greater than 6 charaters or better you break it on 10 or 12 character and compare.

You can use SPLIT into tables also that will store splitted data into internal table and then you can compare.

then comparing the six characters this code is best choice

SAP_VENDOR_MASTER-name1 CS FILE_DATA-name1(6).

Please let me know if you still face the issue .

Thanks

Rahul

vinay_pasalkar
Participant
0 Kudos

Thanks a lot for your reply, I completed the report trying the various combination of field1 & field2 and comparing it using command 'CS'.