‎2005 Mar 22 1:13 PM
Hi,
I'm trying to call the following function, I have a spool number, which is fine, and can run the function in test mode. The function I am calling is below, but I'm not sure what I need to declare or create for the "TABLES BUFFER" section.
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB_RAW'
EXPORTING
rqident = 507
FIRST_LINE = 1
LAST_LINE =
tables
buffer = it
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.
Hope someon can help!
Many Thanks.
‎2005 Mar 22 1:22 PM
‎2005 Mar 22 1:30 PM
Hi,
I tried:
data: begin of it occurs 3,
f1(65535) type c,
end of it.
which did work, but then I am restricted to 65535 chars,
I tried defining it as string, and this just crashed.
Is there a better way of doing this? The data is in RDI format.
Thanks.
‎2005 Mar 22 2:41 PM
Hi,
This is how you should define your internal table:
data: begin of it OCCURS 0,
precol(1),
data_line(1000),
end of it.
You won't get anything more that 1000 if you're using this FM because SAP extracts only that amount of characters, so defining your 'it' with 65535 won't do anything.
Thanks,
Wojtek
‎2005 Mar 22 3:50 PM
Hi,
thanks for that, it's fixed the problem, not sure if I should be using occurs 0 , because of the memory allocation - any tips?
‎2005 Mar 22 3:56 PM
‎2005 Mar 22 4:38 PM
Hi
Yes, Rich is right. Don't use OCCURS at all. Sorry.
Thanks,
Wojtek
‎2005 Mar 22 4:52 PM
Could you please give some further explanation why "type" syntax is better than the "occurs" one?
‎2005 Mar 22 5:44 PM
‎2005 Mar 23 9:05 AM
Hi
I am trying not to use OCCURS, although it is a habit...The reason behind it is that using TYPE TABLE is more clear and more specific to me. Both work well, though. I can't comment on using OCCURS in ABAP Objects and whether it is obsolete or not.
Many thanks,
Wojtek
‎2005 Mar 23 10:29 AM
Hi,
The use of occurs has become obsolete. In ABAP Objects, you cannot define internal tables using the OCCURS, it won't work in declarative statements like DATA/TYPE. If you go for stricter/extended syntax check, it will give error.
-Tejal