Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8524

Creating Buttons in Web E-mail body through Wedynpro Abap

$
0
0

Hi,

      There was a scenario i am  unable to solve that issue . can anyone help me in dis ?

 

My scenario is :   I need to create  2 buttons in email body through webdynpro applciation .   I tried upto getting Subject message and  adding recipients in TO and CC   and adding any attachements also . but the main problem is i am unable to create a buttons in email body through webdynpor applciaiton ..

 

what i did is

step 1 : in my webdynpro component .. view ..  wddoinit() method . code is

step 2 : go to SOST t.code and  select  the exact mail and execute it.. 

 

  CLASS cl_bcs DEFINITION LOAD.



  DATA:

    lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.



  lo_send_request = cl_bcs=>create_persistent( ).



* Message body and subject

  DATA:

  lt_message_body TYPE bcsy_text VALUE IS INITIAL,

  lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.

  APPEND 'Dear,' TO lt_message_body.

  APPEND ' ' TO lt_message_body.

  APPEND 'Please find the below buttons'

  TO lt_message_body.

    APPEND ' ' TO lt_message_body.

*  APPEND "URL" TO lt_message_body.





******************

*  APPEND '<input type = Submit name = Approve value = Approve />' TO lt_message_body.

*      APPEND ' ' TO lt_message_body.

*  APPEND '<input type = Cancel name = Reject value = Reject />' TO lt_message_body.

*    APPEND ' ' TO lt_message_body.

**************************************

  APPEND 'Thank You,' TO lt_message_body.







*****************************************************************************

*      APPEND '<a href="mailto:sapoffline@essar.com?subject=A - Approve Document"><img src="C:\Users\vlyadav\My Pictures\banner.jpg" alt="APPROVE" ></a>  '

*      TO lt_message_body.

**      <img src="smiley.gif" alt="REJECT" >



*****************************************************************************

  lo_document = cl_document_bcs=>create_document(

  i_type = 'RAW'

  i_text = lt_message_body

  i_subject = 'Personnel Information Form' ).



  DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.



* Pass the document to send request

  lo_send_request->set_document( lo_document ).



* Create sender

  DATA:

  lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,

  l_send TYPE adr6-smtp_addr VALUE 'SENDER_ID',

  l_reci TYPE adr6-smtp_addr.



  l_reci = 'anymailid@gmail.com'.                " 'user_name_at_company_dot_com'. "Approver's email address  """' give your proper email id



*vlyadav@essar.com

*  lo_sender = cl_cam_address_bcs=>create_internet_address( l_send ).

  lo_sender = cl_sapuser_bcs=>create( sy-uname ).

* Set sender

  lo_send_request->set_sender(

  EXPORTING

  i_sender = lo_sender ).



* create recipient

  DATA:

  lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL.

  lo_recipient = cl_cam_address_bcs=>create_internet_address( l_reci ).

** Set recipient

  lo_send_request->add_recipient(

  EXPORTING

  i_recipient = lo_recipient

  i_express = 'X' ).

*  lo_send_request->add_recipient(

*  EXPORTING

*  i_recipient = lo_recipient

*  i_express = 'X' ).

* Send email



  DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.

  lo_send_request->send(

  EXPORTING

  i_with_error_screen = 'X'

  RECEIVING

  result = lv_sent_to_all ).

  COMMIT WORK.


Viewing all articles
Browse latest Browse all 8524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>