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: 

sy-subrc = 4 for select statement but SE16N have records

Amitesh
Explorer
0 Kudos

I am running following code in ECC and Oracle 12c: 

PARAMETER : p_bupla TYPE bsis-bupla.
SELECT-OPTIONS: s_perio FOR bsis-bldat.
SELECT bukrs hkont bldat gjahr belnr budat xblnr bupla gsber 
    FROM bsis INTO TABLE it_bsis
    WHERE bukrs = '1000' AND hkont = '25002050' AND bupla = p_bupla
    AND ( bldat le s_perio-high AND bldat ge s_perio-low ).

In debugging  we are no value in it_bsis and  Sy-subrc = 4, sy-msgid = SF ,   sy-msgno = 616

SE16N with same input criteria, we are getting 3 records:

Amitesh_0-1711623993095.png

Checked with different input values and getting same result.

Looking for help to solve this problem.

Regards

 

 

 

 

 

 

5 REPLIES 5

stanislaslemaire
Participant

Hello,
it's a mistake about internal / external format for account ! 🙂
Add zero in from of HKONT field...

0 Kudos

Thanks. Issue resolved.

I didn't notice the G/L length is 10 char.

 

 

BaerbelWinkler
Active Contributor
0 Kudos

Hi Amitesh,

can you please add a screenshot of what s_perio contains when the select happens? It might be due to a date formatting issue.

Cheers

Bärbel

0 Kudos

Issue was with length of HKONT field. It's 10 char while I was giving 8 char value only, as it works in SE16N.

Thanks.

maalam
Newcomer
0 Kudos

Use leading zeros in hkont.