cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with BETWEEN in transformation routine

Former Member
0 Kudos

I have written the following routine within a transformation:

DATA:
          LV_SUM_DarlPfandbereich
TYPE I.

   
SELECT SUM( t0~/BIC/Z_LOANMNT ) INTO LV_SUM_DarlPfandbereich
     
FROM /BIC/PZ_PAWNNUM AS t0
      INNER
JOIN /BIC/PZ_ACCDOCE AS t2
     
ON (
      t0
~/BIC/Z_FILIALE EQ t2~/BIC/Z_FILIALE
     
AND t0~/BIC/Z_PAWNNUM BETWEEN t2~/BIC/Z_PWNNFRO AND t2~/BIC/Z_PAWNNTO
     
)
      INNER
JOIN /BIC/ADSO_GR0200 AS t1
     
ON ( t1~/BIC/Z_PAWNNUM EQ t0~/BIC/Z_PAWNNUM ).
    RESULT
= LV_SUM_DarlPfandbereich.

If I check the code for syntax errors I get:

E:Wrong Expression "BETWEEN T2~/BIC/Z_PWNNFRO" in logical condition.


What am I doing false. I cannot figure it out.

Accepted Solutions (0)

Answers (2)

Answers (2)

anshu_lilhori
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

DATA:
          LV_SUM_DarlPfandbereich
TYPE I.

   
SELECT SUM( t0~/BIC/Z_LOANMNT ) INTO LV_SUM_DarlPfandbereich
     
FROM /BIC/PZ_PAWNNUM AS t0
      INNER
JOIN /BIC/PZ_ACCDOCE AS t2
     
ON ( t0~/BIC/Z_FILIALE EQ t2~/BIC/Z_FILIALE )
      INNER
JOIN /BIC/ADSO_GR0200 AS t1
     
ON ( t1~/BIC/Z_PAWNNUM EQ t0~/BIC/Z_PAWNNUM )

      WHERE t0~/BIC/Z_PAWNNUM BETWEEN t2~/BIC/Z_PWNNFRO AND t2~/BIC/Z_PAWNNTO.
    RESULT
= LV_SUM_DarlPfandbereich.

The above leads to same error. Thank you for your advice Anshu regarding BETWEEN in ON of JOIN. I was not aware of it.

anshu_lilhori
Active Contributor
0 Kudos

Hi,

Try using BT instead of between...and also do a syntax search on that operator.

Regards,

AL

Former Member
0 Kudos

Can you please give me an example of using BT?

anshu_lilhori
Active Contributor
0 Kudos

Hi,

I just asked to use BT instead of between.I am also not an expert in abap. Moreover i do not have system also to test the code.

So i suggest to post your query in this forum.

http://scn.sap.com/community/abap

You will get quick responses there.

Regards,
AL

BenedictV
Active Contributor
0 Kudos

hi, try using LE and GE instead of using BETWEEN.

WHERE t0~/BIC/Z_PAWNNUM GE t2~/BIC/Z_PWNNFRO AND

             t0~/BIC/Z_PAWNNUM LE t2~/BIC/Z_PAWNNTO

Regards,

Benedict

RamanKorrapati
Active Contributor
0 Kudos

Hi frank,

Seems like you may missed one more condition here. pls recheck your logic

t0~/BIC/Z_PAWNNUM BETWEEN t2~/BIC/Z_PWNNFRO AND t2~/BIC/Z_PAWNNTO   <here needed onem ore field think so>