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

ITAB TO SPOOL

Former Member
0 Likes
1,471

Dear Experts,

There are many threads regarding spool.

But here I had given task by functional that I had to develop an object which show a some data list, in which i have to tick mark and send selected list as a mail to particular party.

Also same thing to do as mass mailing for scheduling in back ground for all party.

Now problem is I have an internal table with list of customer and it's particular details which i have to send by email.

Now i know how to convert spool to pdf but i don't know how to convert internal table to spool.

Please note i had try with many example which had already posted in sad.sap.com.

i had got only one binary spool from it successfully. but which is not convert into pdf.

Please i know that if i develop smartform for it is to easy but i want to do mass mailing and i had already developed module-pool for it.

Please guide

how do i convert my internal table to spool in specific layout with out using smart form. if it is in oops then it will be more helpful for conceptually.

thanks & regards,

Nayan Lad

Dear Experts,

There are many threads regarding spool.

But here I had given task by functional that I had to develop an object which show a some data list, in which i have to tick mark and send selected list as a mail to particular party.

Also same thing to do as mass mailing for scheduling in back ground for all party.

Now problem is I have an internal table with list of customer and it's particular details which i have to send by email.

Now i know how to convert spool to pdf but i don't know how to convert internal table to spool.

Please note i had try with many example which had already posted in sad.sap.com.

i had got only one binary spool from it successfully. but which is not convert into pdf.

Please i know that if i develop smartform for it is to easy but i want to do mass mailing and i had already developed module-pool for it.

Please guide

how do i convert my internal table to spool in specific layout with out using smart form. if it is in oops then it will be more helpful for conceptually.

thanks & regards,

Nayan Lad

9 REPLIES 9
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,411

Hello Nayan,

I don't think you've to convert the internal table contents to spool before creating an attachment.

You can leverage any of the BCS_EXAMPLE* demo programs.

BR,

Suhas

Read only

Former Member
0 Likes
1,411

HI Nayan,

If ur programs runs in background.

Display the internal table data in a output using some ALV methods. The output will be in spool . catch the spool id and convert into PDF ans send as mail attaching the same.

if u need in detail i got sample code for this.

Thanks,

Giridhar

Read only

0 Likes
1,411

if it run back ground but i have data in internal table dear.

I need to convert internal table to spool.

then spool to pdf.

then send the mail to customer.

thanks

Nayan

Read only

0 Likes
1,411

Hi Nayan,

Hope ur final data is in GT_FINAL itab

Display the same by REUSE_ALV_GRID_DISPLAY

get thr spool id from TSP01 table

*getting spool-id

p_uname = sy-uname.

lc_rq2name = p_repid+0(12).

  • concatenate p_repid+0(12) into lc_rq2name .

select rqident rq2name rqowner rqcretime from tsp01 into table gt_tsp01

where rq2name = lc_rq2name and

rqowner = sy-uname.

convert spool in PDF by call function 'CONVERT_ABAPSPOOLJOB_2_PDF' and send a mail with tht attachment.

THIS WORKS ONLY iF U RUN PROGRAM IN BACKGROUND.

for source code give ur mail is will forward the same

Thanks,

Giridhar

Read only

Former Member
0 Likes
1,411

Hi Dude.. in your program use FMs JOB_SUBMIT and JOB_CLOSE and these 2 FMs use a SUBMIT program and Return statement.

Just pass your internal table to this submit program and use ur PDF and mail functionality in your submit program. This will work.

Read only

0 Likes
1,411

Hi,

please find below prgroms are use full this Spool program will convert to PDF RSTXPDFT4.

and this program Spool download

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

  • T A B L E S & T Y P E S *

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

TYPES : BEGIN OF ty_mail_data ,

text(4000),

END OF ty_mail_data.

DATA : t_mail_data TYPE TABLE OF ty_mail_data WITH HEADER LINE ,

l_mail_data TYPE TABLE OF ty_mail_data WITH HEADER LINE,

w_char(4000),

w_char1(4000),

filenamee LIKE ibipparms-path.

PARAMETERS: p_spool TYPE tsp01-rqident.

  • Fetching Spool data into internal table

CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'

EXPORTING

rqident = p_spool

TABLES

buffer = t_mail_data.

DELETE t_mail_data WHERE text(1) = '-'.

READ TABLE t_mail_data WITH KEY text(1) = '|'.

IF sy-subrc EQ 0.

  • formatting Internal table according to file fromat...

LOOP AT t_mail_data.

IF t_mail_data-text(1) EQ '|' OR t_mail_data-text(1) EQ '-'.

l_mail_data-text = w_char .

APPEND l_mail_data.

WRITE 😕 w_char.

CLEAR w_char.

w_char = t_mail_data-text.

ELSE.

MOVE t_mail_data-text TO w_char1.

CONCATENATE w_char w_char1 INTO w_char.

ENDIF.

ENDLOOP.

l_mail_data-text = w_char .

APPEND l_mail_data.

WRITE 😕 w_char.

ENDIF.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = filenamee.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = 1024

filename = filenamee

filetype = 'ASC'

TABLES

data_tab = l_mail_data

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • MESSAGE e000 WITH text-i02. "Exception in GUI_DOWNLOAD

ENDIF.

Edited by: BRsankar on Sep 29, 2011 9:13 AM

Edited by: BRsankar on Sep 29, 2011 9:14 AM

Read only

0 Likes
1,411

i didn't get you .

Please explain deeply.

Nayan

Read only

Former Member
0 Likes
1,411

Dear all

Thanks for reply.

Let me check.

See this report runs both ways.

and send mail to each party one by one.

I will check it and reward it.

Please let me check first

Read only

Former Member
0 Likes
1,411

Dear Nayan

Have you tried something like the code below (exporting your list to memory and then fetch it afterwards) ??

There are just some ideas to help you.


   CALL FUNCTION 'LIST_FREE_MEMORY'.

    SUBMIT z_custom_program
     USING SELECTION-SCREEN '1000'
     WITH SELECTION-TABLE lt_sel_params
  EXPORTING LIST TO MEMORY AND RETURN.

    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = lt_lista
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.

  CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
      listasci           = lt_listout
      listobject         = lt_lista
    EXCEPTIONS
      empty_list         = 1
      list_index_invalid = 2
      OTHERS             = 3.
...

Kind Regards

/Ricardo Quintas