Application Development 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: 

Create a Job log with spool with Internal Table

Former Member
0 Kudos

Hi Experts,

I want know how to create job with spool for an internal
table, I have tried with some of the function module but I was failed to
create.

Please help me on the below.

My requirement is to pass the internal table ascilist[] to SPOOL. I tried as
below but it is not creating the job log. Please help me on this.

  SUBMIT zmmapi12_bg WITH SELECTION-TABLE

                 lt_sel_tab USER sy
-uname

                
EXPORTING LIST TO MEMORY

                
AND RETURN.

 
REFRESH: listtab, ascilist.

 
CALL FUNCTION 'LIST_FROM_MEMORY'

   
TABLES

      listobject
= listtab

   
EXCEPTIONS

      not_found 
= 1

     
OTHERS     = 2.

 
IF sy-subrc <> 0.

 
ENDIF.

 
CALL FUNCTION 'LIST_TO_ASCI'

   
TABLES

      listasci          
= ascilist

      listobject        
= listtab

   
EXCEPTIONS

      empty_list        
= 1

      list_index_invalid
= 2

     
OTHERS             = 3.



 
IF sy-subrc <> 0.

 
ENDIF.

IF ascilist[] IS NOT INITIAL.

    LOOP AT ascilist.

     
MOVE-CORRESPONDING ascilist TO wa_data.

     
APPEND wa_data TO it_data.

     
CLEAR wa_data.

   
ENDLOOP.

   
DESCRIBE TABLE it_data.

    file_length
= sy-tfill * 1022.

   
CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'

     
EXPORTING

        i_file_length
= file_length

     
IMPORTING

        e_spoolid    
= spoolid

     
TABLES

        it_textdata  
= it_data.



   
IF sy-subrc EQ 0.

     
WRITE spoolid.

   
ENDIF.

Endif.

2 REPLIES 2

former_member212002
Active Contributor
0 Kudos


Try this -


SUBMIT zreport and return
  with p_param1 = 'value'
  with p_param2 = 'value'
  user sy-uname
  via job jobname
  number jobcount.


Abhinab

Former Member
0 Kudos

Hi Siva,

Try using list ALV to display it_data. Then it will show in 'spool list' of Job log.

regards,

Archer