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: 

read table for tax code

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

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

Regards,

Sankar

0 Kudos

Hi

BKPF table dont have field mwskz to use where clause.

0 Kudos

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

Former Member
0 Kudos

Hi Sonali,

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

Reward points if helpful,

Best regds,

kiran.M

0 Kudos

hi kiran,

no i cant use like in read table stmt.

Former Member
0 Kudos

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'.

0 Kudos

HI,

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

Former Member
0 Kudos

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