Skip to Content
author's profile photo Former Member
Former Member

html

i want my spool into html format and i have to that mail that html format.

urgent

regards

anil

Message was edited by: anil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2006 at 05:24 AM

    HI

    GOOD

    THIS EXAMPLE IS FROM SPOOL TO HTML ACTOBAT FORMAT,YOU CAN TRY THIS LOGIC FOR HTML FORMAT.

    Spool from SAP to Acrobat format

    By Carel Oberholzer

    Print any spool file from SAP in PDF format. Can be viewed/edited by using Acrobat. You need the full version of Acrobat to edit, but can view and print using the free version. This is a very simple but useful program and needs to be built on to make it into a real handy tool (put in your own code and change the SAPScript before downloading into PDF format).

    -


    report ZPDFPRNT no standard page heading.

    TABLES: TST05.

    DATA: BEGIN OF ITAB OCCURS 0,

    TLINE(255),

    END OF ITAB.

    DATA: BEGIN OF ITAB2 OCCURS 0,

    TLINE(255),

    END OF ITAB2.

    DATA: BEGIN OF ITAB3 OCCURS 0,

    TLINE(255),

    END OF ITAB3.

    DATA: BEGIN OF OTF_TAB OCCURS 0,

    TLINE(255),

    END OF OTF_TAB.

    DATA: LEN_OUT LIKE SOOD-OBJLEN.

    DATA: LEN_IN LIKE SOOD-OBJLEN.

    DATA: BEGIN OF DATA_SET OCCURS 200,

    DATA_LENGTH(5),

    PRECOL(1),

    DATA_LINE(1000),

    END OF DATA_SET.

    DATA: BEGIN OF OTF_PAGE OCCURS 200.

    INCLUDE STRUCTURE ITCOO.

    DATA: END OF OTF_PAGE,

    OTF_PAGES TYPE P,

    OTF_MAX_PAGES TYPE P VALUE 10.

    DATA: BEGIN OF OTF_CONTROL.

    INCLUDE STRUCTURE ITCPP.

    DATA: END OF OTF_CONTROL,

    FORCE_RAW_OTF VALUE ' ',

    L100_EXCLUDE(4) VALUE 'OTFJ',

    BEGIN OF OTF_PAGE_INDEX OCCURS 20,

    LINE_NUM TYPE P,

    END OF OTF_PAGE_INDEX,

    CUR_OTF_PAGE VALUE 1.

    DATA: DATA_SET_LINECOUNT TYPE P,

    DATA_SET_MAX_LINES TYPE P VALUE 100000,

    DATA_SET_VALID TYPE C VALUE ' ',

    DATA_SET_IS_OTF TYPE C VALUE ' ',

    DATA_SET_LENGTH(5) TYPE C,

    LINE_SPECIAL LIKE DATA_SET-DATA_LINE,

    NEED_LINE_SPECIAL TYPE C,

    DSN_TYPE(8) TYPE C.

    DATA: FCODE(4) TYPE C,

    DATE TYPE D,

    TIME TYPE T,

    RC(10) TYPE C,

    ERRMSG(100) TYPE C,

    PRINTJOB_CREATED(1) TYPE C,

    PRINTJOB_CLEARED(1) TYPE C,

    PRINTJOB_LIST(1) TYPE C,

    DISPLAY_MODE(1) TYPE C,

    LINE_MAX TYPE P VALUE '100000',

    NEW_SCREEN_300(1) TYPE C,

    MULTI_PRINT_300(1) TYPE C,

    PRINT_ALL_300(1) TYPE C,

    PRINT_COUNT_300 TYPE I,

    SHOW_USER_100 TYPE C VALUE ' ',

    ERROR_DISPLAY_LEVEL TYPE C VALUE '9',

    NEXT_ERROR_DISPLAY_LEVEL TYPE C,

    PREV_ERROR_DISPLAY_LEVEL TYPE C,

    START_300(5) TYPE C, END_300(5) TYPE C,

    SEP LIKE SY-VLINE,

    DEFAULT_PRI,

    TSP01_BUF LIKE TSP01,

    TSP01_CURLINE LIKE SY-STARO,

    TSP01_CURCOL LIKE SY-CUCOL,

    TSP01_CURROW LIKE SY-CUROW.

    DATA: BEGIN OF DATA_SET_LINE,

    DATA_LENGTH(5),

    PRECOL(1),

    DATA_LINE(1000),

    END OF DATA_SET_LINE.

    DATA: STATUS LIKE SY-SUBRC.

    DATA: WGF_MESSAGE(80).

    DATA: H_PATH(20) TYPE C.

    DATA: H_MASK(20) TYPE C VALUE ',.pdf ,.pdf. '.

    DATA: FILE_NAME(20).

    DATA: FILENAME LIKE RLGRAP-FILENAME.

    DATA: IMPORT(132).

    PARAMETERS: IDENT(5) TYPE C.

    PERFORM GET_OTF_TAB.

    LOOP AT OTF_PAGE.

    OTF_TAB-TLINE = OTF_PAGE.

    APPEND OTF_TAB.

    ENDLOOP.

    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'

    EXPORTING

    FORMAT_SRC = 'OTF'

    FORMAT_DST = 'PDF'

    DEVTYPE = 'ASCIIPRI'

    LEN_IN = LEN_IN

    IMPORTING

    LEN_OUT = LEN_OUT

    TABLES

    CONTENT_IN = OTF_TAB

    CONTENT_OUT = ITAB2

    EXCEPTIONS

    ERR_CONV_FAILED = 1

    OTHERS = 2.

    PERFORM GET_PATH USING 'PDF_FILE'.

    CALL FUNCTION 'WS_DOWNLOAD'

    EXPORTING

    FILENAME = FILENAME

    FILETYPE = 'BIN'

    BIN_FILESIZE = LEN_OUT

    TABLES

    DATA_TAB = ITAB2

    EXCEPTIONS

    FILE_OPEN_ERROR = 1

    FILE_WRITE_ERROR = 2

    INVALID_FILESIZE = 3

    INVALID_TABLE_WIDTH = 4

    INVALID_TYPE = 5

    NO_BATCH = 6

    UNKNOWN_ERROR = 7

    OTHERS = 8.

    &----


    *& Form GET_OTF_TAB

    &----


    FORM GET_OTF_TAB.

    DATA: PART(4) VALUE '0001',

    BEGIN OF MSG,

    A(40),

    B(40),

    C(40),

    END OF MSG.

    REFRESH DATA_SET.

    DATA_SET_LINECOUNT = 0.

    DATA_SET_IS_OTF = ' '.

    OTF_PAGES = 0.

    REFRESH OTF_PAGE_INDEX.

    CALL 'RSPOACSD'.

    SELECT * FROM TST05 WHERE DTHREAD = 'X'.

    CALL 'RSPOAOSD'

    ID 'ID' FIELD IDENT

    ID 'TYPE' FIELD TST05-DTYPE

    ID 'RECTYP' FIELD 'VYL----'

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    STATUS = SY-SUBRC.

    IF STATUS = 0.

    DSN_TYPE = TST05-DTYPE.

    IF DSN_TYPE(3) = 'OTF'.

    DATA_SET_IS_OTF = 'X'.

    ENDIF.

    ENDIF.

    IF STATUS <> 24. EXIT. ENDIF.

    ENDSELECT.

    DATA_SET_VALID = 'X'.

    DATA_SET_MAX_LINES = ( LINE_MAX * '1.1' ) + 100.

    DO.

    CLEAR: DATA_SET_LINE, DATA_SET_LENGTH.

    CALL 'RSPOARSD'

    ID 'BUFF' FIELD DATA_SET_LINE+5

    ID 'DATALEN' FIELD DATA_SET_LENGTH

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    STATUS = SY-SUBRC.

    IF STATUS = 36.

    WHILE STATUS = 36.

    CALL 'RSPOACSD'

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    ADD 1 TO PART.

    IF DATA_SET_IS_OTF = ' '.

    CALL 'RSPOAOSD'

    ID 'ID' FIELD IDENT

    ID 'TYPE' FIELD DSN_TYPE

    ID 'PART' FIELD PART

    ID 'RECTYP' FIELD 'VYL----'

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    ELSE.

    CALL 'RSPOAOSD'

    ID 'ID' FIELD IDENT

    ID 'PART' FIELD PART

    ID 'TYPE' FIELD DSN_TYPE

    ID 'RECTYP' FIELD 'VYL----'

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    ENDIF.

    IF SY-SUBRC NE 0. EXIT. ENDIF.

    CLEAR: DATA_SET_LINE, DATA_SET_LENGTH.

    CALL 'RSPOARSD'

    ID 'BUFF' FIELD DATA_SET_LINE+5

    ID 'DATALEN' FIELD DATA_SET_LENGTH

    ID 'RC' FIELD RC

    ID 'ERRMSG' FIELD ERRMSG.

    STATUS = SY-SUBRC.

    ENDWHILE.

    ENDIF.

    IF STATUS <> 0 AND STATUS <> 40. EXIT. ENDIF.

    DATA_SET = DATA_SET_LINE.

    IF NOT ( DATA_SET_LENGTH IS INITIAL ).

    DATA_SET-DATA_LENGTH = DATA_SET_LENGTH - 1.

    ENDIF.

    APPEND DATA_SET.

    ADD 1 TO DATA_SET_LINECOUNT.

    IF DATA_SET_IS_OTF = ' '.

    IF DATA_SET_LINECOUNT >= DATA_SET_MAX_LINES.

    CLEAR DATA_SET.

    APPEND DATA_SET.

    MOVE '----


    ' TO DATA_SET-DATA_LINE.

    APPEND DATA_SET.

    CLEAR DATA_SET.

    APPEND DATA_SET.

    WRITE: 'Abbruch nach'(029) TO MSG-A.

    WRITE: DATA_SET_MAX_LINES TO MSG-B.

    WRITE: 'Zeilen.'(030) TO MSG-C.

    CONDENSE MSG.

    DATA_SET-DATA_LINE = MSG.

    APPEND DATA_SET.

    EXIT.

    ENDIF.

    ELSE.

    MOVE DATA_SET_LINE-DATA_LINE TO OTF_PAGE.

    APPEND OTF_PAGE.

    IF OTF_PAGE(2) = 'EP'.

    ADD 1 TO OTF_PAGES.

    IF OTF_PAGES >= OTF_MAX_PAGES.

    MESSAGE S229(PO) WITH OTF_MAX_PAGES.

    EXIT.

    ENDIF.

    ELSEIF OTF_PAGE(2) = 'OP'.

    OTF_PAGE_INDEX-LINE_NUM = DATA_SET_LINECOUNT.

    APPEND OTF_PAGE_INDEX.

    ENDIF.

    ENDIF.

    ENDDO.

    IF STATUS <> 0 AND STATUS <> 12.

    CALL 'RSPOACSD'.

    MESSAGE E112(PO) WITH STATUS RC ERRMSG.

    ENDIF.

    CALL 'RSPOACSD'.

    STATUS = SY-SUBRC.

    IF STATUS <> 0.

    MESSAGE E112(PO) WITH STATUS RC ERRMSG.

    ENDIF.

    ENDFORM. " GET_OTF_TAB

    &----


    *& Form GET_PATH

    &----


    FORM GET_PATH USING P_FILENAME.

    CLEAR: H_PATH, FILE_NAME.

    FILE_NAME = P_FILENAME.

    CALL FUNCTION 'WS_QUERY'

    EXPORTING

    QUERY = 'CD' "// Current Directory

    IMPORTING

    RETURN = H_PATH.

    CONCATENATE FILE_NAME '.pdf' INTO FILE_NAME.

    CALL FUNCTION 'WS_FILENAME_GET'

    EXPORTING

    DEF_FILENAME = FILE_NAME

    DEF_PATH = H_PATH

    MASK = H_MASK

    MODE = 'O'

    IMPORTING

    FILENAME = FILENAME"dbname

    EXCEPTIONS

    INV_WINSYS = 1

    NO_BATCH = 2

    SELECTION_CANCEL = 3

    SELECTION_ERROR = 4

    OTHERS = 5.

    ENDFORM. " GET_PATH

    GO THROUGH THESE LINKS

    http://help.sap.com/saphelp_nw04/helpdata/en/84/1f14b817aa11d5b67b006094192fe3/content.htm

    THANKS

    MRUTYUN

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2006 at 05:49 AM

    Hai Anil

    report zemail no standard page heading line-size 220.

    data: message_content like soli occurs 10 with header line,

    receiver_list like soos1 occurs 5 with header line,

    w_object_hd_change like sood1.

    start-of-selection.

    • Receivers

    receiver_list-recextnam = 'dude@domain.com'.

    receiver_list-recesc = 'E'.

    receiver_list-sndart = 'INT'

    receiver_list-sndpri = '1'.

    append receiver_list.

    • General data

    w_object_hd_change-objla = sy-langu.

    w_object_hd_change-objnam = 'Object name'.

    w_object_hd_change-objsns = 'P'.

    w_object_hd_change-file_ext = 'HTM'. "<--this is important

    • Mail subject

    w_object_hd_change-objdes = 'HTML from SAP/ABAP'.

    • Mail body

    append 'Message content' to message_content.

    append '<b>How''s this for sending HTML E-mail from SAP?</b>' to

    message_content.

    append '<p>New paragraph</p>' to message_content.

    append '<p>Apostrophe&#8217s</p>' to message_content.

    • Call function to send email - SAPConnect needs to be configured

    call function 'SO_OBJECT_SEND'

    exporting

    object_hd_change = w_object_hd_change

    object_type = 'RAW'

    owner = sy-uname

    tables

    objcont = message_content

    receivers = receiver_list.

    Thanks & Regards

    Sreenivasulu P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2006 at 05:54 AM

    Hi anil,

    1. SCOT

    2. Such settings are maintained in scot

    (ask basis team to help)

    3. In that there is the setting

    whether the spool (which should be sent for mail)

    should be converted into

    HTML, PDF, TEXT or RAW format as attachment.

    regards,

    amit m.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 18, 2006 at 06:00 AM

    HI,

    try using function module 'RSPO_RETURN_SPOOLJOB' to retrieve the contents of the spool and then use function module 'SX_OBJECT_CONVERT_ALI_HTM' to decompress the contents and converting them to HTML

    rgds,

    latheesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.