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 with Initial Value

Former Member
0 Likes
839

Hi All,

   I am trying to update Cost Centers using BAPI_COSTCENTER_CHANGEMULTIPLE.  It is working as expected with the fields are having values.  If I change one field value to INITIAL, it is retaining the old value after the updation.  The case is same with both the normal fields and the custom additional fields.

  I could see that it is happening in  K_COSTCTR_BAPI_CHECKMULTIPLE -----> CALL METHOD go_application->change -----------> CALL METHOD lcl_services=>make_struct_to_fvtab. 


IF ( NOT p_keep_empty_fields = true AND

            <source> IS INITIAL ).

         CONTINUE.

       ENDIF.

Here  p_keep_empty_fields is always true and when the field is Initial, this condition is true and the rest of the code is skipped.  Any work around is highly appreciated.

Regards,

Asha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
621

Got the Answer - Mark the fields with initial values with '!' before calling the BAPI.  The BAPI_COSTCENTER_CHANGEMULTIPLE, will make this initial.


Regards,

Asha

Hi All,

   I am trying to update Cost Centers using BAPI_COSTCENTER_CHANGEMULTIPLE.  It is working as expected with the fields are having values.  If I change one field value to INITIAL, it is retaining the old value after the updation.  The case is same with both the normal fields and the custom additional fields.

  I could see that it is happening in  K_COSTCTR_BAPI_CHECKMULTIPLE -----> CALL METHOD go_application->change -----------> CALL METHOD lcl_services=>make_struct_to_fvtab. 


IF ( NOT p_keep_empty_fields = true AND

            <source> IS INITIAL ).

         CONTINUE.

       ENDIF.

Here  p_keep_empty_fields is always true and when the field is Initial, this condition is true and the rest of the code is skipped.  Any work around is highly appreciated.

Regards,

Asha

1 REPLY 1
Read only

Former Member
0 Likes
622

Got the Answer - Mark the fields with initial values with '!' before calling the BAPI.  The BAPI_COSTCENTER_CHANGEMULTIPLE, will make this initial.


Regards,

Asha