cancel
Showing results for 
Search instead for 
Did you mean: 

sap abap email functionality using classes issue with html table

vieet
Explorer
0 Kudos

Hi Gurus,

 I have to send email via program . When I created the body of the email without containing any variable but only text, there is no issue in it. But when I wants to get variable values inside table it is not taking the values.

it_email_body[] VALUE #line '<html><body>' )
                           line 'Date:'   "how to use sy-datum here.
                            line '<br>')
                            line 'Subject: Revalidate request' line '<br>')
  line 'QA/ QC Team.' line '<br>')
  line 'Refer to below details of material expiring/ expired. You are requested to kindly review and re-validate the same.' )

   line '<br>')
   line '<table style="font-family:calibri;font-size:15;MARGIN:10px;"' )
   line 'cellspacing="0" cellpadding="1" width="75%" ')
   line =  'border="1"><tbody><tr>' )
   line '<th bgcolor="#C0C0C0">Sr. No.</th>' )
   line '<th bgcolor="#C0C0C0">Material Description</th>' )
   line '<th bgcolor="#C0C0C0">Material code</th>' )
   line '<th bgcolor="#C0C0C0">Expired / Expiring on</th>' )
   line '<th bgcolor="#C0C0C0">Batch No.</th>' )
*   ( line = '<tr><td>' wa-matnr '</td>' )  "facing issue at this line for creating second  row for values to  the table from the worarea WA-matnr wa-batch .
line '<tr><td>' wa-  '</td></tr>' )
   line =   )
*   ( line = '<tr><td>' wa-charg 
*   ( line =  '</td>' )
*   ( line = '<tr><td>' wa-vfdat 
*   ( line = '</td>' )

  line '</html></body>' )

 line 'Post validation, kindly share the re-validated/ validity extension certificate for updates and records.' )

vieet_0-1716810103376.png

This is not working.

it_email_body TYPE bcsy_text,  as per the c ode

note : My aim here is to get html table to be added to program with  email functionality.
 line 'Regards' )
 line 'Stores Team.' ).

Sandra_Rossi
Active Contributor
0 Kudos
( line = |<tr><td>{ wa-matnr }</td></tr>| )

Accepted Solutions (0)

Answers (1)

Answers (1)

peterpersiel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi vieet,

I would recommend use of String Templates: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenstring_templates....

Best regards,
Peter