cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DBIF_RSQL_SQL_ERROR SQL error 1555 when accessing table "BSEG".

siongchao_ng
Contributor
0 Likes
1,347

dbif-rsql-sql-error-28jun.txt

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.                       

Accepted Solutions (1)

Accepted Solutions (1)

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes

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

VXLozano
Active Contributor

please, for the sake of every developer working in the XXIst century... replace the OCCURS blasphemies by proper typed table declarations

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes

He has used it in program.I just enhanced his code give him the appoach. Hope you have gone through the entire thread before juming on the sake of occurs 0.

Answers (1)

Answers (1)

former_member753791
Participant
0 Likes

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