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

Select Query Problem

Former Member
0 Likes
905

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
Read only

venkat_o
Active Contributor
0 Likes
862

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

Read only

Former Member
0 Likes
862

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

Read only

Former Member
0 Likes
862

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

Read only

0 Likes
862

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

Read only

0 Likes
862

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.

Read only

0 Likes
862

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