cancel
Showing results for 
Search instead for 
Did you mean: 

Html Email from abap program itab -> html -> email

Former Member
0 Kudos

hi experts..

i want to convert an itab into html and then with html format send an email , following is the code for that

report, the email is coming but not in the html format,

can any body help me in this regard...

thanks in advance

umer

<< Please only post the relevant portions of your code - and format it.>>

Edited by: Umer Malik on Jun 5, 2009 3:48 PM

Edited by: Umer Malik on Jun 5, 2009 4:03 PM

Edited by: Rob Burbank on Jun 5, 2009 10:11 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Check this.

TABLES: KNA1.

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

  • DATA DECLARATION

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

DATA : IT_DATA_XML TYPE STANDARD TABLE OF KNA1 WITH HEADER LINE.

DATA : XML_RESULT TYPE STRING.

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

  • SELECT OPTIONS

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

selection-screen begin of block abc with frame title text-001.

selection-screen skip.

SELECT-OPTIONS: SO_KUNNR FOR KNA1-KUNNR.

selection-screen skip.

selection-screen end of block abc.

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

*START OF SELECTION

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

START-OF-SELECTION.

PERFORM GET_DATA.

PERFORM GET_INTO_XML_FORMAT.

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

  • FORM GET_DATA

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

FORM GET_DATA.

SELECT * FROM KNA1 INTO TABLE IT_DATA_XML

WHERE KUNNR IN SO_KUNNR.

IF SY-SUBRC <> 0.

MESSAGE 'RECORDS NOT FOUND.' TYPE 'E'.

ENDIF.

ENDFORM. "GET_DATA

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

  • FORM GET_INTO_XML_FORMAT

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

FORM GET_INTO_XML_FORMAT.

call transformation id

source SOURCE = IT_DATA_XML[]

result xml XML_RESULT.

refresh IT_DATA_XML.

CALL TRANSFORMATION id

SOURCE XML XML_RESULT

RESULT SOURCE = IT_DATA_XML[].

write: 'this is test'.

ENDFORM. "GET_INTO_XML_FORMAT

Former Member
0 Kudos

hi l,

Thanks for ur quick response , this problem is solved but i am having the following probelm if u have any idea thanks in advance.

i am having a problem regarding display of exception field ( traffic lights ) in an alv grid.

i want to display this colomn in the 3rd position but it is always displaying in the very first position.

in the field catalog parameters i have decleared the position of this col also but instead its not working ,

following is the code of field catalog

ls_fcat-fieldname = 'TRAFFIC_LIGHT' .

ls_fcat-coltext = 'State'.

ls_fcat-col_pos = 3.

ls_fcat-outputlen = 5.

ls_fcat-tooltip = 'Shows State of Rules'.

ls_fcat-tabname = 'IT_PRID1'.

APPEND ls_fcat TO pt_fieldcat .

but its not working , and is always displayed as a very first colomn,

can anybody plz help me in this regard,

thanks in advance,

umer

Former Member
0 Kudos

hi Umar,

if you use lvc_s_layo-EXCP_FNAME to display the traffic lights, traffic lights should be displayed in the first column.

instead use follwoing code.

types : begin of output,

light type icon-id,

-


-


end of output.

depends on the condition you can assign the symbol.

output-light = '@08@'. green

output-light = '@09@'. yellow

output-light = '@0A@'. red.

Thanks & Regards

Ajay

Former Member
0 Kudos

hi Ajay,

thanks alot for the help, i have allready applied the same solution which u mentioned and that is working fine.

thanks again,

regards,

Umer

Former Member
0 Kudos

Hi,

Check this link how to send email with HTML body http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

Former Member
0 Kudos

hi all,

i am having a problem regarding display of exception field ( traffic lights ) in an alv grid.

i want to display this colomn in the 3rd position but it is always displaying in the very first position.

in the field catalog parameters i have decleared the position of this col also but instead its not working ,

following is the code of field catalog

ls_fcat-fieldname = 'TRAFFIC_LIGHT' .

ls_fcat-coltext = 'State'.

ls_fcat-col_pos = 3.

ls_fcat-outputlen = 5.

ls_fcat-tooltip = 'Shows State of Rules'.

ls_fcat-tabname = 'IT_PRID1'.

APPEND ls_fcat TO pt_fieldcat .

but its not working , and is always displayed as a very first colomn,

can anybody plz help me in this regard,

thanks in advance,

umer

Edited by: Umer Malik on Jul 21, 2009 2:41 PM