Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
swr_struct-object_key,
standard table of swr_messag,
standard table of swr_mstruc,
swr_messag,
swr_mstruc,
table of swr_cont,
swr_cont,
table of bapirlgnrq with header line,
table of bapirlcorq with header line,
bapirlcorq,
table of bapirlcorq with header line,
table of bapireturn with header line,
table of ty_eban,
ty_eban,
table of solisti1,
solisti1,
c,
table of ztmm_prwf,
ztmm_prwf,
t16fw,
sy-uname,
ref to cl_bcs value is initial,
ref to if_sender_bcs,
c value is initial,
ref to cl_document_bcs value is initial,
standard table of bapiadsmtp with header line,
standard table of bapiret2 with header line,
bapiaddr3,
ad_smtpadr,
ref to if_recipient_bcs,
c,
c,
c.
*
*
*
*
*
*
*
*
*
*
*
form mail_to_respective_level .
refresh : mess_tab.
clear : lv_subject, wa_mess.
concatenate 'Purchase Requisition:'p_banfn-low'Requires Approval' into lv_subj
ect separated by space.
wa_mess-line = '<TABLE width= "100%">'.
append wa_mess to mess_tab.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">D
ear Approver, </FONT>'
'</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" ><br>' '</br></td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate wa_eban-badat+6(2) '.' wa_eban-badat+4(2) '.' wa_eban-badat(4) int
o v_date.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">
Purchase Requisition:'p_banfn-low'which has been created on:'v_date'requires you
r kind approval. </FONT>'
'</td></tr>' into wa_mess separated by space.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" ><br>' '</br></td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri" >
<u>What action you should perform :</u></FONT>'
'</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">1
. Login to SAP </FONT>'
'</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">2
. Go to ME54N Transaction </FONT>'
'</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">3
. Enter PR number as mentioned in subject Line </FONT>'
'</td></tr>' into wa
_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">4
. Take action to Either Approve or Reject. </FONT>'
'</td></tr>' into wa_mes
s.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
wa_mess-line = '</TABLE>'.
append wa_mess to mess_tab.
clear wa_mess.
wa_mess-line = '<TABLE width= "100%" >'.
append wa_mess to mess_tab.
concatenate '<TR><td align = "LEFT" ><br>' '</br></td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri">
Note:-This is a system generated mail, please do not reply </FONT>' '</td></tr>'
into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
concatenate '<TR><td align = "LEFT" >' '</td></tr>' into wa_mess.
append wa_mess to mess_tab.
clear wa_mess.
wa_mess-line = '</TABLE>'.
append wa_mess to mess_tab.
clear wa_mess.
lo_send_request = cl_bcs=>create_persistent( ).
lo_document = cl_document_bcs=>create_document(
i_type
= 'HTM'
i_text
= mess_tab
i_subject = lv_subject ).
v_uname = wa_eban-ernam.
l_sender = cl_sapuser_bcs=>create( v_uname ). " PR Creator ID
call method lo_send_request->set_sender
exporting
i_sender = l_sender.
refresh : lt_smtp,
lt_ret .
clear v_uname.
if wa_t16fw-objid is not initial.
v_uname = wa_t16fw-objid.
call function 'BAPI_USER_GET_DETAIL'
exporting
username = v_uname
tables
return = lt_ret
addsmtp = lt_smtp.
loop at lt_smtp. "Email Address
clear : l_email,
l_recipient.
if lt_smtp-e_mail is not initial.
l_email = lt_smtp-e_mail.
l_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
call method lo_send_request->add_recipient
exporting
i_recipient = l_recipient
i_express
= 'X'
i_copy
= ''
i_blind_copy = ' '
i_no_forward = ' '.
endif.
endloop.
call method lo_send_request->set_document( lo_document ).
call method lo_send_request->send(
exporting
i_with_error_screen = 'X'
receiving
result
= lv_sent_to_all ).
if lv_sent_to_all is not initial.
commit work.
message 'Mail Sent Successfuly' type 'S'.
endif.
endif.
endform.
*&---------------------------------------------------------------------*
*&
Form MAIL_FINAL_RELEASE
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form mail_final_release .
refresh : lt_smtp,
lt_ret .
clear : v_relcode,
v_uname.
if t_posted-rel_code2 is initial.
v_relcode = t_posted-rel_code1.
elseif t_posted-rel_code3 is initial.
v_relcode = t_posted-rel_code2.
elseif t_posted-rel_code4 is initial.
v_relcode = t_posted-rel_code3.
elseif t_posted-rel_code5 is initial.
v_relcode = t_posted-rel_code4.
elseif t_posted-rel_code6 is initial.
v_relcode = t_posted-rel_code5.
elseif t_posted-rel_code7 is initial.
v_relcode = t_posted-rel_code6.
elseif t_posted-rel_code8 is initial.
v_relcode = t_posted-rel_code7.
else.
v_relcode = t_posted-rel_code8.
endif.
select single frggr
frgco
werks
objid
into corresponding fields of wa_t16fw
from t16fw
where frggr = t_geninfo-rel_group
and frgco = v_relcode
and werks = wa_eban-werks.
if wa_t16fw-objid is not initial.
v_uname = wa_t16fw-objid.
call function 'BAPI_USER_GET_DETAIL'
exporting
username = v_uname
importing
address = s_addr
tables
return = lt_ret
addsmtp = lt_smtp.
refresh : mess_tab.
clear : lv_subject, wa_mess.
concatenate 'Purchase Requisition:'p_banfn-low'has been Approved' into lv_su
bject separated by space.
wa_mess-line = '<TABLE width= "100%">'.
append wa_mess to mess_tab.
concatenate '<TR><td align = "LEFT" >' '<FONT COLOR = "BLACK" face="Calibri"
>Dear Requisitioner, </FONT>'
'</td></tr>' into wa_mess.