Application Development and Automation 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: 
Read only

Problem in Query..

Former Member
0 Likes
549

Hi Guru's

I have requirement ,

Take Purchase Req. date from User and then have to calculate, how many of them converted into PO.

For example : if i am entered PR date : 31.01.2006 to 10.02.2006

then it will select all the PR in this range and how many converted into PO

Now my problem begins here

INDATE: Select-Option for BADAT ( Req date)

**LFDAT is Delivered date

SELECT * FROM EBAN WHERE STATU = 'B' AND BADAT IN INDATE

AND FRGKZ = 'B'

AND FRGZU = 'XX'

AND MATNR NE ' '

AND BANPR = '05'

AND EBAKZ NE 'X'

AND ( LOEKZ NE 'L' OR LOEKZ NE 'X' ).

IF EBAN-BADAT0(6) = INDATE0(6) AND EBAN-LFDAT0(6) = INDATE0(6).

ITAB_PR-BANFN = EBAN-BANFN.

ITAB_PR-MATNR = EBAN-MATNR.

ITAB_PR-MENGE = EBAN-MENGE.

ITAB_PR-EBELN = EBAN-EBELN.

APPEND ITAB_PR.

CLEAR ITAB_PR.

CLEAR EBAN.

ENDIF.

ENDSELECT.

but this code is not working at all ,its giving dump error ".Unable to interpret " IBT200" as number .it has some problem in passing Date ..but i am not able to decode the problem...correct the query

thanks

Subham Arya

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
530

You cannot use select-options like you did in your IF statement.. pl change it to compare with either the low or high date as below.

IF EBAN-BADAT+0(6) = INDATE-high+0(6)
 AND EBAN-LFDAT+0(6) = INDATE-high+0(6).

~Suresh

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
531

You cannot use select-options like you did in your IF statement.. pl change it to compare with either the low or high date as below.

IF EBAN-BADAT+0(6) = INDATE-high+0(6)
 AND EBAN-LFDAT+0(6) = INDATE-high+0(6).

~Suresh

Read only

Former Member
0 Likes
530

Hi,

This error mainly caused by your selection-condition structure, for select-options, the structure is not the same as parameter, so yoiu should check this kind of structure to code(Ranges structue, yoiu can refer range in your abap editor using F1 key).

In the range structure, there'are maily four fields, sign, option, low, and high, so if you want point to your input in the screen , please exactly indicate the low field or high field.

Hope this helps

Bob

Read only

Former Member
0 Likes
530

i think this is because of your select-option handling.

by default select-option contain the data like this.


SELECT-OPTIONS : S_OP LIKE SY-DATUM.
suppose you have givaen a range 01.01.2006 to 31.03.2006
(1)            (2)           (8)            (8)
SIGN     OPTION     LOW        HIGH
  I             BT        20060101  20060331

SO WHEN YOU ARE WRITTING 
IF EBAN-BADAT+0(6) = INDATE+0(6) AND EBAN-LFDAT+0(6) = INDATE+0(6).
IT IS BY DEFAULT TAKING FIRST 6 CHAR I.E. IBT200 SO YOU HAVE TO REFFER EITHER S_OP-LOW+0(6) OR S_OP-HIGH+0(6).

REGARDS

SHIBA DUTTA