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: 

Spool to itab

Former Member
0 Kudos

Hi,

When a delivery printed, i can get its spool number but i want to upload this spool's contents into an internal table?

Is that possible?

Thanks.

4 REPLIES 4

former_member588853
Active Contributor
0 Kudos

Hi,

YOu can use the function module

REPORT Ztest.

*Type Declarations

TYPES: BEGIN OF ty_rdidata,

line(1000) TYPE c,

END OF ty_rdidata.

DATA: ws_spool LIKE tsp01-rqident,

i_rdidata TYPE STANDARD TABLE OF ty_rdidata,

wa_rdidata TYPE ty_rdidata.

PARAMETERS: p_sp TYPE tsp01-rqident.

ws_spool = '0000019125'.

CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB_RAW'

EXPORTING

rqident = ws_spool

FIRST_LINE = 1

LAST_LINE =

TABLES

buffer = i_rdidata

EXCEPTIONS

no_such_job = 1

not_abap_list = 2

job_contains_no_data = 3

selection_empty = 4

no_permission = 5

can_not_access = 6

read_error = 7

OTHERS = 8

.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF..

regards,

nazeer

former_member588853
Active Contributor
0 Kudos

Hi,

Please search in SDN before you post, you will get lots of answers.

YOu can use the function module

*Type Declarations

TYPES: BEGIN OF ty_rdidata,

line(1000) TYPE c,

END OF ty_rdidata.

DATA: ws_spool LIKE tsp01-rqident,

i_rdidata TYPE STANDARD TABLE OF ty_rdidata,

wa_rdidata TYPE ty_rdidata.

PARAMETERS: p_sp TYPE tsp01-rqident.

ws_spool = '0000019125'.

CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB_RAW'

EXPORTING

rqident = ws_spool

FIRST_LINE = 1

LAST_LINE =

TABLES

buffer = i_rdidata

EXCEPTIONS

no_such_job = 1

not_abap_list = 2

job_contains_no_data = 3

selection_empty = 4

no_permission = 5

can_not_access = 6

read_error = 7

OTHERS = 8

.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF..

regards,

nazeer

Former Member
0 Kudos

Hi,

Use the FM RSPO_RETURN_ABAP_SPOOLJOB to read the file from the spool by giving the spool number. This brings in to an itab.

hope it'll help u.

Regards,

Sneha.

former_member205763
Active Contributor
0 Kudos

instead of otf data try getting the otf data which comes in form of an internal table.