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: 

Select Query Problem

Former Member
0 Kudos

Hi,

I want to pick the Rate of Excise Duty against Chapter Id from Table j_1iexctax.

We have a problem in picking the Rate because our select query not picking the Rate with right period (means according to Valid From - Valid To)..

Please amend my query...

*SELECT rate FROM j_1iexctax INTO itab6-rate

WHERE j_1ichid = itab5-j_1ichid

AND j_1iexcind = itabc-j_1iexcicu.*

ENDSELECT.

Please insert the condition of Period in my query...

Thanks...

Edited by: Rob Burbank on Mar 10, 2010 9:42 AM

6 REPLIES 6

venkat_o
Active Contributor
0 Kudos

Hi, <li>Try this way


  SELECT rate
    FROM j_1iexctax
    INTO itab6-rate
    WHERE j_1ichid = itab5-j_1ichid
    AND j_1iexcind = itabc-j_1iexcicu
    AND validfrom LE sy-datum
    AND validto   GE sy-datum.
  ENDSELECT.
Thanks Venkat.O

Former Member
0 Kudos

After insertion of this code, debugger not going on this query...

Former Member
0 Kudos

hi,

use for all enteries on the table.

otherwise yuo have to loop at itab5 and itabc.

and then use the select statement.

SELECT rate FROM j_1iexctax INTO itab6-rate
   WHERE j_1ichid = i*tab5-j_1ichid
  * AND j_1iexcind = *itabc-j_1iexcicu*.
endselect.

Edited by: Rob Burbank on Mar 10, 2010 9:43 AM

0 Kudos

what is the problem in this query..

SELECT rate FROM j_1iexctax INTO itab6-rate

WHERE j_1ichid = itab5-j_1ichid

AND j_1iexcind = itabc-j_1iexcicu AND validfrom LE sy-datum AND validto GE sy-datum.

ENDSELECT.

plz guide.

Edited by: Rob Burbank on Mar 10, 2010 9:43 AM

0 Kudos

Hi,

You can check this.

The data type of validfrom and validto is of inverted date.

convert the sy-datum to inverted format and try passing in the query.

data:datc type char08.

data:date type sy-datum.

date = sy-datum.

CONVERT DATE date INTO INVERTED-DATE datc.

0 Kudos

It could be an issue with date formats mm/dd/yyyy and dd/mm/yyyy