on 05-22-2007 8:03 AM
Hi All ,
I was trying to send the script mail using the standrad functionality in include RVADOPFO ( form Form open using usscreen us_country). I am able to send the mail to customer conatct persons whose busineess adress is maintained under contact persons tab of general data of customer master . Technicall this Businees address( address no ) is availble customer contact person data table KNVK. and corresponding addreess data in ADR6 table .The following FM 's are used to send based on the addr_key-addrnumber = KNVK-ADRND .
It was working fine when sending to Customer contact Persons .But when i am sending to send our client internal employee instead of customer contact person , I got his address no from USR21 table Passed this to addr_key-addrnumber of First Function Module. But retun code from this FM is 3 ,saying communication type not found . Subsequent FM returns code 1 saying communication type not found .
1) can you please adviuse if do need to maintain any setting any where(already maintained in PA20 ) .
2) Am I mpassing right addreess number that is fetched from USR21 or ADR6 .
table . Or adivise what address no should be used in this scenario ( sending mails to internal emplouyee rather to customer Representative )
Hi Dharma,
Were you able to get this to work as I have similiar requiremen?
Thanks,
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a similar requirement where in i have to send mail from Script output to more than one customers.
For that one way is to create a distribution list in OFFICE - WORKSPACE & then pass the mail to this distribution list.
or..
Try passing multiple E-mail IDs to function module OPEN_FORM.
I tried both & failed in both cases..
Please help.
It works fine for single customer but how to send the mails to more than one customers whose E-mail IDs are maintained via condition records in VV32.
Hi All ,
this is the Piece of code used . For got to paste .Plese guide why FM are not returning Sybrc as 0.
Thanks in advance
Dharma .
_________________________________________________
.. use stratagy to get communication type
CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
EXPORTING
strategy = nast-tcode
ADDRESS_TYPE =
ADDRESS_NUMBER = VBDKA-ADRNR
PERSON_NUMBER = VBDKA-ADRNP
address_number = addr_key-addrnumber
person_number = addr_key-persnumber
IMPORTING
comm_type = lvs_comm_type
comm_values = lvs_comm_values
TABLES
STRATEGY_TABLE =
EXCEPTIONS
address_not_exist = 1
person_not_exist = 2
no_comm_type_found = 3
internal_error = 4
parameter_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
retcode = sy-subrc.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
ENDIF.
convert communication data
MOVE-CORRESPONDING nast TO lvs_snast.
MOVE sy-repid TO lvf_program.
CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
EXPORTING
pi_comm_type = lvs_comm_type
pi_comm_values = lvs_comm_values
pi_screen = us_screen
PI_NEWID =
pi_country = us_country
pi_repid = lvf_program
pi_snast = lvs_snast
IMPORTING
pe_itcpo = lvs_itcpo
pe_device = lvf_device
pe_mail_recipient = lvs_recipient
pe_mail_sender = lvs_sender
EXCEPTIONS
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
retcode = sy-subrc.
syst-msgty = 'E'.
PERFORM protocol_update.
STGK930168 - Changes for ZR13 email output
IF nast-kappl EQ c_kappl AND nast-kschl EQ c_kschl AND
nast-nacha EQ c_nacha AND retcode = 1.
syst-msgty = 'E'.
syst-msgid = 'ZR'.
syst-msgno = '751'.
syst-msgv1 = int_knvk-kunnr.
CLEAR : syst-msgv2, syst-msgv3, syst-msgv4.
PERFORM protocol_update.
ENDIF.
STGK930168 - End of changes for ZR13 email output
ENDIF.
STGK930168 - Changes for ZR13 email output
IF nast-kappl EQ c_kappl AND nast-kschl EQ c_kschl AND
nast-nacha EQ c_nacha AND NOT v_bname IS INITIAL.
INCLUDE <cntn01>.
DATA: l_sender TYPE swc_object.
swc_container lt_container.
swc_clear_container lt_container.
swc_create_object l_sender 'RECIPIENT' space.
swc_set_element lt_container 'AddressString'
v_bname.
swc_set_element lt_container 'TypeID' 'B'.
swc_call_method l_sender 'CreateAddress' lt_container.
IF sy-subrc NE 0.
syst-msgty = 'E'.
syst-msgid = 'ZR'.
syst-msgno = '752'.
CLEAR : syst-msgv1, syst-msgv2, syst-msgv3, syst-msgv4.
PERFORM protocol_update.
sy-subrc = 4.
retcode = sy-subrc.
ELSE.
swc_object_to_persistent l_sender lvs_sender.
ENDIF.
ENDIF.
End of changes for ZR13 output
CHECK retcode EQ 0.
if there is no communication type
IF lvs_comm_type IS INITIAL.
set device
CASE nast-nacha.
WHEN '1'.
lvf_device = 'PRINTER'.
WHEN '2'.
lvf_device = 'TELEFAX'.
lvs_itcpo-tdtelenum = nast-telfx.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
lvs_itcpo-tdfaxuser = nast-usnam.
WHEN '3'.
lvf_device = 'TELETEX'.
lvs_itcpo-tdtelenum = nast-teltx.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
WHEN '4'.
lvf_device = 'TELEX'.
lvs_itcpo-tdtelenum = nast-telx1.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
WHEN OTHERS.
lvf_device = 'PRINTER'.
ENDCASE.
ENDIF.
fill structure itcpo
itcpo = lvs_itcpo.
insert note 508569 {
OTF-Output, wenn Browser-Druck
IF nast-sort1 = 'EBPP'.
lvs_itcpo-tdgetotf = 'X'.
ENDIF.
} end note 508569
open form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
archive_index = toa_dara
archive_params = arc_params
device = lvf_device
dialog = ' '
form = tnapr-fonam
language = nast-spras
options = lvs_itcpo
mail_sender = lvs_sender
mail_recipient = lvs_recipient
MAIL_APPL_OBJECT = ' '
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
OTHERS = 8.
IF sy-subrc NE 0.
CASE sy-subrc.
WHEN 7.
retcode = sy-subrc.
syst-msgid = 'VN'.
syst-msgno = '096'.
syst-msgty = 'E'.
syst-msgv1 = nast-kschl.
syst-msgv2 = nast-kappl.
PERFORM protocol_update.
WHEN OTHERS.
retcode = sy-subrc.
PERFORM protocol_update.
ENDCASE.
ENDIF.
SET COUNTRY us_country.
reset data for CTCV
CALL FUNCTION 'CTCV_INIT_USER_DATA'.
ENDFORM. "form_open
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.