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

Logical expression?

Former Member
0 Likes
882

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

Former Member
0 Likes
849

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.

Read only

Former Member
0 Likes
849

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

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
849

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.

Read only

Former Member
0 Likes
849

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.

Read only

Former Member
0 Likes
849

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

Read only

Former Member
0 Likes
849

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