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: 

How to find out field value

Former Member
0 Kudos

Hi ,

Requirement : To find out field value whose first charcter is started with 'T' in internal table .

example : table : int_stbp .

1) int_stbp-matnr = 'T044'.

2) int_stbp-matnr = 'SBT'.

output : Only matnr = 'T044' .

I have used : Loop at int_stbp into wa_stbp where matnr like 'T%' .

endloop .

But giving error like not supported .

so any other way .

11 REPLIES 11

Former Member
0 Kudos

Loop at int_stbp into wa_stbp where matnr CP 'T*' .

endloop .

Former Member
0 Kudos

Hi,

Do like this.

select matnr from mara into table it_mara where matnr like 't%'.

(you can take stbp as per you requirement)

now ....

loop at it_mara into wa_mara.

read table it_stbp into wa_stbp with key matnr = wa_mara-matnr.

if sy-subrc = 0.

write 😕 wa_stbp-matnr.

endif.

endloop.

Regards,

Sachchidanand

Former Member
0 Kudos

Loop at int_stbp into wa_stbp where matnr CP 'T*' . will do...........

Former Member
0 Kudos

Hi,

It is better to declare the condition while fetching the data.

i.e. select matnr inti itab where matnr like 'T%'.

Please reward points if helpful.

Former Member
0 Kudos

loop at int_stbp into wA_stbp where matnr cp 'T%'.

endloop .

Even with CP value is not coming .

0 Kudos

use CS instead of CP

0 Kudos

Can you copy paste the exact code and structure of your intenal table and work area?

Former Member
0 Kudos

try this code

Loop at int_stbp into wa_stbp where matnr like 'T*' .

endloop .

former_member195383
Active Contributor
0 Kudos

Hi Declare a character variable wf_c.

then write the loop as....

loop at it_mara into wa_mara.

read table it_stbp into wa_stbp .

wf_c = wa_mara-matnr.

wf_c = wf_c+0(1)

if wf_c EQ 'T'.

write 😕 wa_stbp-matnr.

endif.

endloop.

this will surely work....

Former Member
0 Kudos

yes it is answered .

This is correct syntax.

loop at int_stbp into wa_stbp where matnr CP 'T*' .

endloop .

Previosly using 'T%' so instead of '%' '*' was required .

Edited by: BARNESH DHAMIJA on Jul 7, 2008 8:18 AM

Edited by: BARNESH DHAMIJA on Jul 7, 2008 8:19 AM

0 Kudos

try with this code.

loop at <int.tab body> into <workarea> where matnr = 'T*'

WRITE:/----


ENDLOOP.