on 06-20-2008 11:04 AM
Hi Gurus,
I have one requirement where in the print program the program should fetch the fax number from the partner function TZ and email address from the part function Z1 .
The code i have used:
To EXTRACT ADDRESS
IF sy-uname = 'WF-BATCH'.
SELECT SINGLE adrnr INTO ls_adrnr FROM vbpa CLIENT SPECIFIED
WHERE mandt = sy-mandt
AND vbeln = nast-objky
AND posnr = '000000'
AND parvw = 'Z1'.
To Extract email address and fax number:
CALL FUNCTION 'ADDR1_EXTRACT_TABLES'
TABLES
t_address_keys = lt_address_keys
t_adrc = lt_adrc
t_adr3 = lt_adr3 " type adr3
t_adr6 = lt_adr6 "type adr6
EXCEPTIONS
empty_table = 1
OTHERS = 2.
where lt_adr6 contains email addr and lt_adr3 faxnumber
IF sy-subrc <> 0.
IF nast-nacha = gc_5. " gc_5 = 5
READ TABLE lt_adr6
INTO lwa_adr6
INDEX 1.
IF sy-subrc = 0.
lwa_receivers-receiver = lwa_adr6-smtp_addr.
lwa_receivers-rec_type = gc_u.
lwa_receivers-com_type = gc_int.
lwa_receivers-notif_del = gc_x.
lwa_receivers-notif_ndel = gc_x.
APPEND lwa_receivers TO lt_receivers.
ENDIF.
ELSEIF nast-nacha = gc_8. " gc_8 = 8.
READ TABLE lt_adr3
INTO lwa_adr3
INDEX 1.
IF sy-subrc = 0.
CONCATENATE lwa_adr3-fax_number text-002 INTO lwa_receivers-receiver.
lwa_receivers-rec_type = gc_u.
lwa_receivers-com_type = gc_int.
lwa_receivers-notif_del = gc_x.
lwa_receivers-notif_ndel = gc_x.
APPEND lwa_receivers TO lt_receivers.
ENDIF.
ENDIF.
But i om not getting any neither the fax number nor the email address.
CONCATENATE lwa_adr3-fax_number text-002 INTO lwa_receivers-receiver.
lwa_receivers-rec_type = gc_u.
lwa_receivers-com_type = gc_int.
lwa_receivers-notif_del = gc_x.
lwa_receivers-notif_ndel = gc_x.
APPEND lwa_receivers TO lt_receivers.
ENDIF.
in this change
lwa_receivers-rec_type = 'F'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.