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: 

Logical expression?

Former Member
0 Kudos

Hi,

I was written the statement below.

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6 and

tplst = c_tplst2

tplst = c_tplst3

tplst = c_tplst4.

But iam getting the error TRSTA is not expected. when i give the sinlge stament it is not giving error.

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6.

How to write the logical statment for above statement,

Regardsm

srihitha

6 REPLIES 6

Former Member
0 Kudos

READ TABLE t_vttk_vttp INTO w_vttk_vttp

if ( vbeln = t_vbuk-vbeln and

tplst = c_tplst6 ) and

( tplst = c_tplst2 and

tplst = c_tplst3 and

tplst = c_tplst4 ).

else.

endif.

Former Member
0 Kudos

you have to do like this

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6

tplst = c_tplst2

tplst = c_tplst3

tplst = c_tplst4.

Regards,

Satish

Sandeep_Kumar
Advisor
Advisor
0 Kudos

Hi,

Remove the and statement in

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6<b> "and</b>

tplst = c_tplst2

tplst = c_tplst3

tplst = c_tplst4.

Former Member
0 Kudos

Remove the 'and' with the key in the code you have written and execute,

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6 "and

tplst = c_tplst2

tplst = c_tplst3

tplst = c_tplst4.

I hope it will work.

Rewards if useful.

Former Member
0 Kudos

Hi

READ TABLE t_vttk_vttp

INDEX sy-index

INTO w_vttk_vttp WITH KEY vbeln = t_vbuk-vbeln COMPARING (tplst = c_tplst6 ) and

( tplst = c_tplst2) and

tplst = c_tplst3) and

tplst = c_tplst4 ).

Hope this helps you

Regards

Sreenivas

Former Member
0 Kudos

Hi,

When i give the statement like

LOOP AT t_vbuk WHERE trsta = c_trsta_b.

l_count = sy-tabix.

READ TABLE t_vttk_vttp INTO w_vttk_vttp WITH KEY

vbeln = t_vbuk-vbeln

tplst = c_tplst6 OR

tplst = c_tplst2 OR

tplst = c_tplst1 OR

tplst = c_tplst4 OR

tplst = c_tplst3 OR.

IF sy-subrc NE 0.

DELETE t_vbuk INDEX l_count.

ENDIF.

ENDLOOP.

Iam getting the error "Unable to interpt "TPLST".Possible causes of error.Incorrect comma or spelling error".Please give me suggestions.

Regards,

srihitha