‎2012 Dec 19 2:40 PM
HI experts,
I am using a custom program for vat report. And in this program I am calling another program which is standard to get the line items of that program in my custom program.
Below is the code.
| DATA: reportlist | LIKE abaplist OCCURS 0. |
DATA listtab LIKE abaplist OCCURS 1.
DATA: BEGIN OF ascitab OCCURS 1,
| line(256), |
| END OF ascitab. |
DATA: jobname LIKE tbtcjob-jobname VALUE
' TRANSFER TRANSLATION'.
DATA: jobcount LIKE tbtcjob-jobcount,
host LIKE msxxlist-host.
DATA: BEGIN OF starttime.
| INCLUDE STRUCTURE tbtcstrt. |
DATA: END OF starttime.
DATA: starttimeimmediate LIKE btch0000-char1,
| print_parameters LIKE pri_params . |
CALL FUNCTION 'JOB_OPEN'
EXPORTING
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
SUBMIT rmimst00
TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
USER sy-uname
VIA JOB jobname
NUMBER jobcount
WITH bukreis = '2010' SIGN 'I'
WITH s_werks IN s_werks
WITH p_milnd = 'GB' SIGN 'I'
WITH p_proto = 'A' SIGN 'I'
WITH p_monat = '1' SIGN 'I'
WITH p_gjahr = '2012' SIGN 'I'
WITH p_waers = 'GBP' SIGN 'I'
AND RETURN.
COMMIT WORK .
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
DATA: tsp01 LIKE tsp01-rqident,
buffer LIKE vbak OCCURS 0.
tsp01 = jobcount.
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
rqident = tsp01
* FIRST_LINE = 1
* LAST_LINE =
TABLES
buffer = buffer
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.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
EXCEPTIONS
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
OTHERS = 99.
IF sy-subrc EQ 0.
"error processing
ENDIF.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = reportlist
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
with_line_break = ' '
TABLES
listasci = ascitab
listobject = listtab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
now the thing is if i run it removing sap-spool and run it using EXPORTING LIST TO MEMORY AND RETURN. I am getting 'set screen not allowed in subscreen..' error.. But if I am running it using sap-spoll I am not getting spool number! Hence not getting the values of internal table of alv from program rmimst00.
Kindly help..Is there anything I am missing!! I searched SCN and tried all possible way.
Points will be rewarded.
Regards,
Ashmita.
‎2012 Dec 19 9:05 PM
Hi Ashmita,
I am just trying to understand.
If you want the output to be capture in the program, can we just try the submit statement with exporting list to memory option.
Or is it really required that a batch job needs to be created.
If yes, please let me know. I may be able to help you out.
Thanks,
Sreekanth
‎2012 Dec 20 6:06 AM
Hi Sreekanth,
As I have already mentioned I tried with exporting to memory list but, it is giving me error set screen not allowed in subscreen!
Yes, I need the content of the internal table of standard alv report in my custom program.
Regards,
Ashmita.
‎2012 Dec 20 4:12 AM
Hi Ashmita,
Check this link "http://wiki.sdn.sap.com/wiki/display/ABAP/Spool+request+generation
Regard's
Smruti