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: 

How to use BAPI Extension In service master to update tax tariff code?

Former Member
0 Kudos

iam using BAPI_SERVICE_CREATE to create a service master records.. now i want to update the TAX TARIFF CODE in service master records... iam having TAX TARIFF CODE field in AC03 as well as in ASMD table...but i could not find it in BAPI_SERVICE_CREATE.. so i have to use BAPI extension... iam not aware of Bapi extension ... Anybody give me the proper steps to use the bapi extension to update the tax tariff code in service master ..

Thanks in advance

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

First ask functionals, as this field should come from Customizing and other master data.

From this BAPI documentation (BAdI are listed the end of the FM doc.) you should have found that you could either

  • Use one of the following structures in the extensionin/out parameters: BAPISRV_TE_ASMD' or 'CI_ASMDDB', 'BAPISRV_TE_ASMDX' or 'CI_ASMDDBX'. The values of the fields of those structure will be moved to service data with a move-corresponding statements.
  • (DIMP_GENERAL required) Use somer specific structure you create, and then implement the BAdI MMSRV_SM_BAPI_CUST method INBOUND to move the data.

To fill the EXTENSIONIN structure, pass the structure name to STRUCTURE field and map the data to the VALUEPART fields using a class like the generic cl_abap_container_utilities or the more specific cl_nls_struc_container class. (perform some where-used search for samples)

8 REPLIES 8

raymond_giuseppi
Active Contributor

First ask functionals, as this field should come from Customizing and other master data.

From this BAPI documentation (BAdI are listed the end of the FM doc.) you should have found that you could either

  • Use one of the following structures in the extensionin/out parameters: BAPISRV_TE_ASMD' or 'CI_ASMDDB', 'BAPISRV_TE_ASMDX' or 'CI_ASMDDBX'. The values of the fields of those structure will be moved to service data with a move-corresponding statements.
  • (DIMP_GENERAL required) Use somer specific structure you create, and then implement the BAdI MMSRV_SM_BAPI_CUST method INBOUND to move the data.

To fill the EXTENSIONIN structure, pass the structure name to STRUCTURE field and map the data to the VALUEPART fields using a class like the generic cl_abap_container_utilities or the more specific cl_nls_struc_container class. (perform some where-used search for samples)

0 Kudos

Thanks for your valuable comment.... i cannot add the TAXTARRIFCODE in the structure BAPISRV_TE_ASMD and

BAPISRV_TE_ASMDx .... it says ERROE-the ASMD table you cannot specific TAXTARRIFCODE Twice..... but i have added custom field ZTARRIF in BAPISRV_TE_ASMD and BAPISRV_TE_ASMDx and i have pass the value via BAPI and its get updated... now i want to pass the TAXTARRIFCODE via BAPI which is already exist in ASMD and does not exist in BAPISRV_TE_ASMD and BAPISRV_TE_ASMDx ... kindly provide any suggestions... thanks in advance..

Former Member
0 Kudos

hi Prasath,

The following code will be helpful for you i think.but tax is updated in table.tax tariff code is not updated.For taxtariff code BADI should be implemented as Mr.Raymond Giuseppi told.

**Importing
DATA : serv_data TYPE bapisrv_asmd,
serv_datax TYPE bapisrv_asmdx.

**Tables
DATA : lt_desc TYPE TABLE OF bapisrv_asmdt,
ls_desc TYPE bapisrv_asmdt,
lt_return TYPE TABLE OF bapiret2,
ls_return TYPE bapiret2.

DATA : lt_ex_in TYPE TABLE OF bapiparex,
ls_ex_in TYPE bapiparex.

DATA : ls_ext TYPE bapisrv_te_asmd.

serv_data-base_uom = 'EA'.
serv_datax-base_uom = 'X'.

serv_data-serv_cat = 'SERV'.
serv_datax-serv_cat = 'X'.

ls_desc-language = 'EN'.
ls_desc-short_text = 'service master'.
APPEND ls_desc TO lt_desc.
CLEAR ls_desc.

ls_ex_in-structure = 'BAPISRV_TE_ASMD'.
ls_ext-tax = 'NCM01'.
ls_ex_in-valuepart1 = ls_ext.
APPEND ls_ex_in TO lt_ex_in.


ls_ex_in-structure = 'BAPISRV_TE_ASMDX'.
ls_ex_in-valuepart1 = 'X'.
APPEND ls_ex_in TO lt_ex_in.

CALL FUNCTION 'BAPI_SERVICE_CREATE'
EXPORTING
im_service_data = serv_data
im_service_datax = serv_datax
TABLES
return = lt_return
service_description = lt_desc
extension_in = lt_ex_in.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.

Former Member
0 Kudos

HI Prasath,

Have you solved this issue? We are also facing same issue, could you please help us

Chandra

0 Kudos

Still facing the problem,cannot find the exact solution , if you find the solution please post here thanks.

if you are using inside the sap system, you can use ASMD_UPDATE_SINGLE FM which is having TAXTARIFFCODE and we can update, iam using .net system to update taxtariffcode in sap system so the update FM is not accepted.

0 Kudos

me too the same problem...any one got the solution????

0 Kudos

Still facing the problem,cannot find the exact solution , if you find the solution please post here thanks.

if you are using inside the sap system, you can use ASMD_UPDATE_SINGLE FM which is having TAXTARIFFCODE and we can update, iam using .net system to update taxtariffcode in sap system so the update FM is not accepted.

0 Kudos

I am afraid it's not possible to add TAXTARIFFCODE as an extension of BAPI_SERVICE_CREATE, because TAXTARIFFCODE is already an extension of ASMD.

The structure CI_ASMDDB (used in BAPISRV_TE_ASMD) is included in both BAPISRV_TE_ASMD and ASMD standard table. As you have already extended standard field TAXTARIFFCODE, it will duplicate the field trying to extend TAXTARIFFCODE in BAPI.

The solution is maybe use BAPI_SERVICE_CHANGE after CREATE or ASMD_UPDATE_SINGLE.

You can also use LSWM only to update the TAXTARIFFCODE field, if this operation is not a daily operation of course.