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: 

Badi ME_PROCESS_PO_CUST, update tax jurisdiction

Former Member
0 Kudos

Hi Guys,

I'm trying to change the tax jurisdiction of a PO line item in the Invoice tab. This field is currently in 'display only' mode on our system.

Here's my code in method PROCESS_ITEM in Badi ME_PROCESS_PO_CUST:

DATA:

w_data TYPE mepoitem,

v_txjcd(2) TYPE c.

CALL METHOD im_item->get_data

RECEIVING

re_data = w_data.

v_txjcd = w_data-txjcd.

CLEAR w_data-txjcd.

w_data-txjcd = v_txjcd.

CALL METHOD im_item->set_data

EXPORTING

im_data = w_data.

The thing is, after I set the data, nothing changes. I tried immediately doing another get_data and it's back to the original.

Any ideas how I can make this work? This is really urgent so any help you guys can give me would help greatly!

Points will be awarded of course.

Thanks.

3 REPLIES 3

Former Member
0 Kudos

I've been thinking, could the reason I'm unable to update the flied be that the field is only output enabled? If so, is there a way I can make it input enabled?

0 Kudos

hi mahinder,

the field u should take is mwskz.

try the code below.

__________

DATA:

w_data TYPE mepoitem,

v_mwskz(2) TYPE c.

CALL METHOD im_item->get_data

RECEIVING

re_data = w_data.

v_ematn = w_data-mwskz.

CLEAR w_data-mwskz.

w_data-mwskz = '12'.

CALL METHOD im_item->set_data

EXPORTING

im_data = w_data.

-


it will set the tax code to '12' nomatter what ever value u specify

award points if useful

0 Kudos

Hi,

How the data can change? Because you are copying the current value to the variable v_txjcd and then you are clearing the w_data-txjcd and then passing the value stored in v_txjcd to the cleared one.

and hence it expected.

v_txjcd = w_data-txjcd.

CLEAR w_data-txjcd.

w_data-txjcd = v_txjcd.

Try putting some other value and try.

Reward points if you find it helpful.

Regards,

Prasanna