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

Convert a internal table data into OTF Data

Former Member
0 Likes
3,582

Hello all,

I am having an internal table with some data, now i have to convert this internal table data to OTF format.

and create a PDF out of it and again i have to attach the converted PDF to a mail [To trigger this mail].

Is there any solution for this??How to convert a normal internal table data to OTF data??

Is there any function Module available??Do i have to follow any procedures for it??

Waiting for your replies...

6 REPLIES 6
Read only

vijy_mukunthan
Active Contributor
0 Likes
1,814

Hi

Search the forum.

User the FM convert_otf. Pass the internal table and convert the internal table in OTF and use SO_NEW_DOCUMENT_ATT_SEND_API1 this FM for sending the mail.

Regards

vijay

Read only

0 Likes
1,814

But this is with regards to converting classical report output to PDF...

I could not understand how to convert this classical report output to PDF...

Is there any other way???

Read only

Former Member
0 Likes
1,814

Hi,

You need to Call the Function Module : CONVERT_OTF to convert the Internal Table into a PDF Document. And then use the Function Module as mentioned to send it as an attachment in the mail. You need to do a where-used-list to see where all this used and the parameters that are passed. Then you can even look at the documentation of the module.

You can save the file in the Presentation Server using the ABAP Class GUI Frontend Service.

Hope this will help.

Thanks,

Samantak.

Read only

0 Likes
1,814

Hi Samantak,

But how can i convert a classical report output into a OTF file without using spool id???

Read only

0 Likes
1,814

Hi,

Copy paste below code. I hope this is what you are looking for. It will work exactly in the way you want.


DATA: li_receivers       TYPE STANDARD TABLE OF soos1,
      li_listobject      TYPE STANDARD TABLE OF abaplist,
      li_ali             TYPE STANDARD TABLE OF soli,
      li_ali1             TYPE STANDARD TABLE OF soli,
      li_ali2             TYPE STANDARD TABLE OF soli,
      lwa_objecthdchange TYPE sood1,
      lwa_receivers      TYPE soos1,
      lwa_ali            TYPE soli.
DATA: l_lines   TYPE i,
      l_length  TYPE i.

DO 20 TIMES.
  WRITE: /1 'test'.
ENDDO.

CALL FUNCTION 'SAVE_LIST'
  EXPORTING
    list_index         = '0'  "Pass the list index like 0, 1 2...
  TABLES
    listobject         = li_listobject
  EXCEPTIONS
    list_index_invalid = 1
    OTHERS             = 2.
IF sy-subrc NE 0.
  RAISE invalid_list.
ENDIF.

CALL FUNCTION 'TABLE_COMPRESS'
  TABLES
    in             = li_listobject
    out            = li_ali
  EXCEPTIONS
    compress_error = 1
    OTHERS         = 2.
IF sy-subrc NE 0.
  RAISE compress_error.
ENDIF.

CLEAR: lwa_objecthdchange.
DESCRIBE TABLE li_ali LINES l_lines.
DESCRIBE FIELD lwa_ali LENGTH l_length IN CHARACTER MODE.

lwa_objecthdchange-objlen = l_length * l_lines.
lwa_objecthdchange-objla  = sy-langu.
lwa_objecthdchange-objnam = 'List'.

MOVE sy-title TO lwa_objecthdchange-objdes.
MOVE: 1 TO lwa_objecthdchange-objpri,
      0 TO lwa_objecthdchange-objsns.

CLEAR: lwa_receivers.
MOVE: 'X'           TO lwa_receivers-snddr,
      'X'                 TO lwa_receivers-sndex,
      'U'                 TO lwa_receivers-recesc,
      ' '                  TO lwa_receivers-recextnam.  "Pass the E-mail ID here
APPEND lwa_receivers TO li_receivers.

* Send email
CALL FUNCTION 'SO_OBJECT_SEND'
 EXPORTING
   object_hd_change                 = lwa_objecthdchange
   object_type                      = 'ALI'
   owner                            = sy-uname
   sender                           = sy-uname
TABLES
   objcont                          = li_ali
   receivers                        = li_receivers.

Thanks,

Vinod.

Code Tags are not working

<MODIFIED BY MODERATOR - RESPECT THE 2,500 CHARS LIMIT>

Edited by: Alvaro Tejada Galindo on Jan 4, 2010 4:40 PM

Read only

0 Likes
1,814

Hello krishnan,

Could you please share the solution with us? as i have the same question with you, i also need to convert internal table data into OTF data.

Thanks very much!

Best Regards,

Ivy