08-24-2012 12:24 PM
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
09-12-2012 3:19 PM
Thanks a lot for your reply, I completed the report trying the various combination of field1 & field2 and comparing it using command 'CS'.
08-24-2012 12:42 PM
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
08-24-2012 2:00 PM
Exactly Nick..Problem is I have huge data to compare so can not implement the above method.
08-24-2012 4:14 PM
08-24-2012 12:50 PM
08-24-2012 1:57 PM
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.
08-25-2012 7:02 AM
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
08-25-2012 7:12 AM
dear,
you have to take 6 char of field 1 in 1 varable thaen after use
OCCURRENCE OF command.
08-25-2012 4:16 PM
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
09-12-2012 3:19 PM
Thanks a lot for your reply, I completed the report trying the various combination of field1 & field2 and comparing it using command 'CS'.