09-28-2009 9:00 AM
Hi experts :
When creating / modifying customer data by using t-codes FD01 & FD02, I have to check if field SMTP_ADDR (email address)is empty depending on the value of other field from KNA1.
I can't make email mandatory (that was my first idea), and user exit EXIT_SAPMF02D_001 has the data from KNA1 but not the email addres.
I'm trying to use FM DYNP_VALUES_READ in the user exit mentioned above to read the value from SMTP_ADDR, but it is always returning exception INVALID_DYNPRONAME.
Does anybody knows another user exit to check this field (SMTP_ADDR)?.
Thanks in advance for your answers.
09-29-2009 9:07 AM
Hi,
In that customer exit EXIT_SAPMF02D_001 in SAPMF02D enhancement,
Try to insert this code and check
DATA : lf_adrnr type kna1-adrnr.
data : lf_email type adr6-SMTP_ADDR.
select single adrnr from kna1 into lf_adrnr
where kunnr eq i_kna1-kunnr.
if sy-subrc eq 0.
select single SMTP_ADDR from adr6 into lf_email
where ADDRNUMBER eq lf_adrnr.
if lf_email is initial.
message 'Please Enter Email Id' TYPE 'E'.
endif.
endif.
Thanks & Regards,
Pydi Reddy.
09-29-2009 4:48 AM
steps:
execute program RSMODPRF
give the data element AD_SMTPADR
create functionmodule FIELD_EXIT_AD_SMTPADR
write your code here.
if input is initial.
message E398(00) with 'Enter Email id'.
endif.
actvate this function module.
again execute program RSMODPRF without giving any data element.
from the list you will get the data element name AD_SMTPADR.
select this data element and assign the program and screen name like this.
program : SAPMF02D
Screen: 7000
save your entries.
again select this data element .
go to menu
Field Exit->activate
it will work.
09-29-2009 9:07 AM
Hi,
In that customer exit EXIT_SAPMF02D_001 in SAPMF02D enhancement,
Try to insert this code and check
DATA : lf_adrnr type kna1-adrnr.
data : lf_email type adr6-SMTP_ADDR.
select single adrnr from kna1 into lf_adrnr
where kunnr eq i_kna1-kunnr.
if sy-subrc eq 0.
select single SMTP_ADDR from adr6 into lf_email
where ADDRNUMBER eq lf_adrnr.
if lf_email is initial.
message 'Please Enter Email Id' TYPE 'E'.
endif.
endif.
Thanks & Regards,
Pydi Reddy.
04-29-2010 12:23 PM