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: 

List contains no data in spool list for alv list display

Bharath84
Participant
0 Kudos

HI All,

I have a ZTEST1 report which I will execute in foreground and I select the file from presentation server and upload using FM WS_UPLOAD and internal table t_objectid contains the records from the uploaded file.

In debug mode(I change the value of SY-BATCH to 'X' for ZTEST2) and I am getting the ALV LIST DISPLAY with some records.

If the execute ztest1 using F8, and goto SM37 I can see the spool number generated. But in the spool it is showing List contains no data.

Am I missing anything. Please help me.

Below is my code.

report ZTEST1.

start-of-selection.

  perform open_file.

  export t_objectid to memory id 'ZBGR'.

  perform job_open.

  perform sel_opt.

  export t_selection to memory id 'ZBGR1'.

  perform submit_report.

  perform close_job.

submit ztest2

                with selection-table t_selection

                with p_tcode = p_tcode

                with p_fname = p_fname

                user sy-uname

                via job jobname

                number jobcount

                and return.

---------------------------------------------------

Below is my code for ZTEST2report.

start-of-selection.

  if sy-batch = 'X'.

import t_objectid to t_objectid from memory id 'ZBGR'.

import t_selection to t_selection from memory id 'ZBGR1'.

refresh s_udate.

loop at t_selection into wa_selection.

   move-corresponding wa_selection to s_udate.

   append s_udate.

endloop.

    perform fetch_cdhdr.

    perform fetch_cdpos.

    perform final_table.

    perform build_fcat.

    perform build_events.

    perform display_data.

  endif.

Thanks,

Haritha

1 ACCEPTED SOLUTION

0 Kudos

Hi Haritha.

The EXPORT TO MEMORY command writes the data to the ABAP-Memory. The ABAP-Memory exists only in your actual mode. That is the reason, why it works in debug mode and it does not work in the batch-Job, which has its own mode.

Regards,

Peer

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

In perform open_file, did you manage the returned sy-subrc when calling WS_UPLOAD (obsolete) in background, I guess no ?

Regards,

Raymond

thanga_prakash
Active Contributor
0 Kudos

Hello Haritha,


Try using  TO SAP-SPOOL in the Submit statement.


Regards,

Thanga

0 Kudos

Hi Haritha.

The EXPORT TO MEMORY command writes the data to the ABAP-Memory. The ABAP-Memory exists only in your actual mode. That is the reason, why it works in debug mode and it does not work in the batch-Job, which has its own mode.

Regards,

Peer