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

read table for tax code

Former Member
0 Likes
1,237

hi,

i want to read table in a function module for all tax codes starting with C , code is as follows:

LOOP AT t_bkpf WHERE awtyp = 'RMRP'.

CLEAR : wa_bkpf.

MOVE-CORRESPONDING t_bkpf TO wa_bkpf.

READ TABLE t_bset INTO wa_bset

WITH KEY bukrs = t_bkpf-bukrs

belnr = t_bkpf-belnr

gjahr = t_bkpf-gjahr

MWSKZ = 'C%'

kschl = 'JCSN'.

CHECK : sy-subrc = 0.

LOOP AT t_bseg INTO wa_bseg WHERE bukrs = wa_bset-bukrs

AND belnr = wa_bset-belnr

AND gjahr = wa_bset-gjahr

AND matnr <> space.

here how to write condition for mwskz. mwskz = 'C%' is not working.

Pls help.

8 REPLIES 8
Read only

Former Member
0 Likes
1,109

Hi,

U can't use C% in read table. So better to use loop at ..where.

Regards,

Sankar

Read only

0 Likes
1,109

Hi

BKPF table dont have field mwskz to use where clause.

Read only

0 Likes
1,109

Hi Sohali

can you please check this BSEG table and t007a

MWSKZ - Tax Code TXJCD - Tax Jurisdiction

T007A-MWSKZ

Reward points for hepful answers,

best regds,

kiran.M

Read only

Former Member
0 Likes
1,109

Hi Sonali,

can you try like this: mwskz like 'C%'.

Reward points if helpful,

Best regds,

kiran.M

Read only

0 Likes
1,109

hi kiran,

no i cant use like in read table stmt.

Read only

Former Member
0 Likes
1,109

Please define one range for Tax code as below;

Ranges: s_mwskz for bseg-mwskz.

s_mwskz-sign = 'I'.

s_mwskz-option = 'CP'.

s_mwskz-low = 'C*'.

append s_smwskz.

READ TABLE t_bset INTO wa_bset

WITH KEY bukrs = t_bkpf-bukrs

belnr = t_bkpf-belnr

gjahr = t_bkpf-gjahr

MWSKZ in s_mwskz

kschl = 'JCSN'.

Read only

0 Likes
1,109

HI,

THANKS FOR UR REPLY BUT 'IN' DOESNT WORK WITH READ TABLE.

Read only

Former Member
0 Likes
1,109

Hi sonali

i think it is not possible using '%' in read stmt ,

the better way is when u r filling the internal table at that time you use in where stmt for this condition

this will work

Reward points if helpful.

thanks,

kiran.m