Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTML Code for Email Body

Former Member
0 Likes
2,684
CONCATENATE '<table border = "1">'   "width = "90%" cellpadding = "1" cellspacing = "2">'
              '<tr>' '<th align="left" colspan="1" rowspan="2">' 'Posting Dt' '</th>'
                     '<th align="left" colspan="1" rowspan="2">' 'Mvmt' '</th>'
                     '<th align="left" colspan="1" rowspan="2">' 'St.Loc' '</th>'
      INTO l_message SEPARATED BY space.
      APPEND l_message TO main_text.
      CLEAR l_message.


     CONCATENATE '<th align="left" colspan="1" rowspan="2">' 'Description' '</th>'
                 '<th align="left" colspan="1" rowspan="2">' 'Mat. Code' '</th>'
                 '<th align="left" colspan="1" rowspan="2">' 'Mat. Desc.' '</th>'
                 '<th align="left" colspan="1" rowspan="2">' 'Quantity' '</th>'
      INTO l_message SEPARATED BY space.
      APPEND l_message TO main_text.
      CLEAR l_message.


      CONCATENATE '<th align="left" colspan="1" rowspan="2">' 'UOM' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Created By' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Mvmt.Reason' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Text' '</th>' '<tr>'
      INTO l_message SEPARATED BY space.
      APPEND l_message TO main_text.
      CLEAR l_message.

LOOP AT lt_final INTO ls_final.


     CONCATENATE '<tr>' '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-posting_dt '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-mvmt_type '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.
*
     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-rec_stloc '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-stloc_desc '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-mat_code '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-mat_desc '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CLEAR lv_menge.
     WRITE ls_final-qty TO lv_menge RIGHT-JUSTIFIED UNIT ls_final-uom.
     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' lv_menge '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-uom '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-cust_name '</FONT>' '</td>' '</tr>'  INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-reason '</FONT>' '</td>' INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.


     CONCATENATE '<td colspan="1" rowspan="2">' '<FONT face=CALIBRI size=2>' ls_final-text '</FONT>' '</td>' '</tr>'  INTO l_message.
     APPEND l_message TO main_text.
     CLEAR  l_message.
     ENDLOOP.


     l_message = '</table>'.
     APPEND l_message TO main_text.
     CLEAR l_message.

In the below attachment see the highlighted yellow. why that space is coming?

capture.png

3 REPLIES 3
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
1,695

Because you have "bug" in your HTML code 🙂
Check your TR tags (they seems mixed & not matching). Also check why/how do you use rowspan 2 everywhere.

-- Tomas --
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,695

you have messed up this closing <TR> tag

      CONCATENATE '<th align="left" colspan="1" rowspan="2">' 'UOM' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Created By' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Mvmt.Reason' '</th>'
                  '<th align="left" colspan="1" rowspan="2">' 'Text' '</th>' '</tr>'
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,695

Check your html in w3schools (and Tomas Buryanek is right, you put at least a <tr> instead of a </tr>, read more carefully your code, you should also increase its readability)