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

BAPI_COSTCENTER_CHANGEMULTIPLE changes to custom defined fields

Former Member
0 Likes
1,017

Hi,

We are trying to update the data for user defined fields by using FM 'BAPI_COSTCENTER_CHANGEMULTIPLE'. To populate the data for user defined fields we have implemented BADI defination 'K_CCA_CUSTOMER_FIELD'.

When we try to update the data for those fields, if we want to pass SPACE (empty) to a field(if it is already have non initial value) , it is not updating with SPACE but it still holds the old value. Can anybody knows how to update user defined fields with SPACE(initial value).

Thanks in Advance

Rajavardhana Reddy

Hi,

We are trying to update the data for user defined fields by using FM 'BAPI_COSTCENTER_CHANGEMULTIPLE'. To populate the data for user defined fields we have implemented BADI defination 'K_CCA_CUSTOMER_FIELD'.

When we try to update the data for those fields, if we want to pass SPACE (empty) to a field(if it is already have non initial value) , it is not updating with SPACE but it still holds the old value. Can anybody knows how to update user defined fields with SPACE(initial value).

Thanks in Advance

Rajavardhana Reddy

3 REPLIES 3
Read only

Former Member
0 Likes
820

Hi,

User defined fields must be in separate structure and that structure should be appende to table parameters EXTENSIONIN and EXTENSIONINX, check your code for populating data to update.

Reward if usefull..

Read only

0 Likes
820

Hi,

I am doing everything whatever you have mentioned. The problem is assume that an userdefined field has some value like US_FIELD = 'TEST'. I want to change this to US_FIELD = ' '. Even though in the structure i am assigning value for this field has SPACE(' '), it is keeping its value as 'TEST' only.

Read only

Former Member
0 Likes
820

Check this..

bapi_te_mvkex-sales_org = mvke-vkorg.

bapi_te_mvkex-distr_chan = mvke-vtweg.

bapi_te_mvkex-matnr_nach = 'X'.

bapi_te_mvkex-user_requested = 'X'.

bapi_te_mvkex-date_requested = 'X'.

g_t_bapiparex-structure = 'BAPI_TE_MVKE'.

g_t_bapiparex-valuepart1 = bapi_te_mvke.

APPEND g_t_bapiparex.

g_t_bapiparexx-structure = 'BAPI_TE_MVKEX'.

g_t_bapiparexx-valuepart1 = bapi_te_mvkex.

APPEND g_t_bapiparexx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = bapimathead

salesdata = bapi_mvke

salesdatax = bapi_mvkex

IMPORTING

return = g_s_return

TABLES

extensionin = g_t_bapiparex

extensioninx = g_t_bapiparexx.

Your userdefined fields should be populated like this..