Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Mar 30, 2017 at 09:02 AM

    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)

    Add comment
    10|10000 characters needed characters exceeded

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

  • avatar image
    Former Member
    Mar 31, 2017 at 09:01 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 15, 2017 at 06:07 AM

    HI Prasath,

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

    Chandra

    Add comment
    10|10000 characters needed characters exceeded

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

  • Sep 13, 2017 at 11:31 AM

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

    Add comment
    10|10000 characters needed characters exceeded

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