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

spool to excel

Former Member
0 Likes
358

hi frnds,

i need to send a spool generated report to excel

the spool generated report output comes in background

help me plzz.

thnx

daniel

hi frnds,

i need to send a spool generated report to excel

the spool generated report output comes in background

help me plzz.

thnx

daniel

1 REPLY 1
Read only

Former Member
0 Likes
331

Hi,

  • CHECK WHETHER STATUS OF JOB IS COMPLETED OR CANCELLED

WHILE 1 = 1.

* GET THE JOB STEPLIST WHICH HAS THE SPOOL NUMBER
    CALL FUNCTION 'BP_JOB_READ'
      EXPORTING
        job_read_jobcount           = w_jobcount
        job_read_jobname            = w_jobname
        job_read_opcode             = '35'
*   JOB_STEP_NUMBER             =
     IMPORTING
       job_read_jobhead            = wa_jobhead
     TABLES
       job_read_steplist           = i_jobsteplist
* CHANGING
*   RET                         =
   EXCEPTIONS
     invalid_opcode              = 1
     job_doesnt_exist            = 2
     job_doesnt_have_steps       = 3
     OTHERS                      = 4
              .
    IF sy-subrc <> 0.
*      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

 

* IF STATUS OF JOB IS COMPLETED(F) OR CANCELLED(A)
* READ THE JOBSTEPLIST & GET THE SPOOL NUMBER
    IF wa_jobhead-status =  c_a OR wa_jobhead-status = c_f.
      READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.
      CHECK wa_jobsteplist-listident <> space.
      w_spool_number = wa_jobsteplist-listident.
      EXIT.
    ENDIF.
  ENDWHILE.

Use FM "RSPO_DOWNLOAD_SPOOLJOB".