on ‎2021 Jun 29 8:42 AM
As attached.
What could be the problem?
Anyone knows how to use package size statement to resolve this problem?
DATA gi_bseg LIKE bseg OCCURS 0 WITH HEADER LINE.
SELECT * FROM bseg INTO TABLE gi_bseg |
| 806| WHERE bukrs = vbrk-bukrs |
| 807| AND rebzg = vbrk-vbeln. |
|>>>>>| IF sy-subrc EQ 0. |
| 809| LOOP AT gi_bseg. |
| 810| SUM. |
| 811| ENDLOOP.
Request clarification before answering.
Hi Siong,
Can you please try below 2 ways and see whether it is working for you.
Approach 1:Use of SELECT-ENDSELECT with package size:
DATA:
gi_bseg LIKE bseg OCCURS 0 WITH HEADER LINE.
SELECT *
FROM bseg
APPENDING TABLE gi_bseg_pck
PACKAGE SIZE 1000
where bukrs = vbrk-bukrs
and rebzg = vbrk-vbeln.
ENDSELECT.Approach 2: Use of cursor
DATA: cursor TYPE cursor.
OPEN CURSOR cursor FOR
SELECT *
FROM bseg
WHERE bukrs = vbrk-bukrs
AND rebzg = vbrk-vbeln.
FETCH NEXT CURSOR cursor
APPENDING TABLE gt_bseg
PACKAGE SIZE 1000.Thanks,
Gourab
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please, for the sake of every developer working in the XXIst century... replace the OCCURS blasphemies by proper typed table declarations
Hi Siong Chao Ng,
The problem lies with large amounts of data in select statement.
Solution: I have just modified your code below-
DATA gi_bseg LIKE bseg OCCURS 0 WITH HEADER LINE.
SELECT * FROM bseg INTO TABLE gi_bseg PACKAGE SIZE 4000 |
| 806| WHERE bukrs = vbrk-bukrs |
| 807| AND rebzg = vbrk-vbeln. |
|>>>>>| IF sy-subrc EQ 0. |
| 809| LOOP AT gi_bseg. |
| 810| SUM. |
| 811| ENDLOOP.
ENDSELECT.Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 7 | |
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.