2010 Feb 26 1:11 PM
Hi All,
I am creating a FM where the input parameter is email id's.
Logic: i am passing this email id to adr6 table and fetching the adress number and personal number. However the emaid id i am getting in the FM is "XYZ@abc". But the email id stored in the user profile(adr6) is "Xyz@abc" in this case i am not able to fetch the required data as both the chars are diff.
Please help me in this regards.
Thansk and Regards,
Vijay.
2010 Feb 26 2:04 PM
In [native SQL|http://help.sap.com/abapdocu_70/en/ABENNATIVESQL.htm], between [EXEC SQL|http://help.sap.com/abapdocu_70/en/ABAPEXEC.htm] and [ENDEXEC|http://help.sap.com/abapdocu_70/en/ABAPENDEXEC.htm] you could use a SELECT ... WHERE UPPER(SMTP_ADDR) = <input field translated to uppercase> but not on OPEN SQL.
Of course you can try to check the short SMTP_SRCH field which is uppercase, but only 20 characters long, or look for the first characters from parameters converted to uppercase, extracting records containing the start, and then checking in a LOOP/ENDLOOP if the whole parameter matches the address, small sample to illustrate
PARAMETER p_mail LIKE adr6-smtp_addr.
DATA: upper_mail LIKE adr6-smtp_addr,
check_mail LIKE adr6-smtp_addr,
itab_adr6 TYPE TABLE OF adr6,
upper_srch LIKE adr6-smtp_srch.
FIELD-SYMBOLS <adr6> TYPE adr6.
SET LANGUAGE sy-langu.
upper_mail = p_mail.
TRANSLATE upper_mail TO UPPER CASE.
upper_srch = upper_mail.
SELECT * INTO TABLE itab_adr6
FROM adr6
WHERE smtp_srch = upper_srch.
LOOP AT itab_adr6 ASSIGNING <adr6>.
check_mail = <adr6>-smtp_addr.
TRANSLATE check_mail TO UPPER CASE.
IF check_mail NE upper_mail.
DELETE itab_adr6.
ENDIF.
ENDLOOP.
Regards,
Raymond
2010 Feb 26 1:39 PM
I probably don't get your problem..
I suggest TRANSLATE <your_field> TO UPPERCASE and selecting ADR6 on SMTP_SRCH...
2010 Feb 26 2:04 PM
In [native SQL|http://help.sap.com/abapdocu_70/en/ABENNATIVESQL.htm], between [EXEC SQL|http://help.sap.com/abapdocu_70/en/ABAPEXEC.htm] and [ENDEXEC|http://help.sap.com/abapdocu_70/en/ABAPENDEXEC.htm] you could use a SELECT ... WHERE UPPER(SMTP_ADDR) = <input field translated to uppercase> but not on OPEN SQL.
Of course you can try to check the short SMTP_SRCH field which is uppercase, but only 20 characters long, or look for the first characters from parameters converted to uppercase, extracting records containing the start, and then checking in a LOOP/ENDLOOP if the whole parameter matches the address, small sample to illustrate
PARAMETER p_mail LIKE adr6-smtp_addr.
DATA: upper_mail LIKE adr6-smtp_addr,
check_mail LIKE adr6-smtp_addr,
itab_adr6 TYPE TABLE OF adr6,
upper_srch LIKE adr6-smtp_srch.
FIELD-SYMBOLS <adr6> TYPE adr6.
SET LANGUAGE sy-langu.
upper_mail = p_mail.
TRANSLATE upper_mail TO UPPER CASE.
upper_srch = upper_mail.
SELECT * INTO TABLE itab_adr6
FROM adr6
WHERE smtp_srch = upper_srch.
LOOP AT itab_adr6 ASSIGNING <adr6>.
check_mail = <adr6>-smtp_addr.
TRANSLATE check_mail TO UPPER CASE.
IF check_mail NE upper_mail.
DELETE itab_adr6.
ENDIF.
ENDLOOP.
Regards,
Raymond