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

Update EIN value in Tcode BP!!!!

Former Member
0 Likes
1,500

Hi,

I need to update the EIN value in BP tcode for which i got 3 bapi's but they are not updaing the EIN value. I haev also tried to update the EIN value in Tcode BP with BDC Recording but it also din't work. Can you tell me other way.

1. BAPI_BUPA_TAX_CHANGEu2019

2. BUPA_TAX_CHANGE

3. ALE_BUPA_C_TAXNUM_CHANGE

data : i_ret like BAPIRET2 occurs 0.

data : wa_tax type BAPIBUS1006TAX-TAXTYPE.

wa_tax = 'US1'.

wa_tax = 'US2'.

wa_tax = 'US01'.

wa_tax = 'DE0'.

wa_tax = 'DE1'.

wa_tax = 'DE2'.

wa_tax = 'FR0'.

wa_tax = 'FR1'.

wa_tax = 'FR2'.

wa_tax = 'MX3'.

  • Update EIN number in BP Tcode.

CALL FUNCTION 'BAPI_BUPA_TAX_CHANGE'

EXPORTING

businesspartner = '0007000006' "Business Partner Number

taxtype = wa_tax

taxnumber = '713020124' "Einumber

TABLES

RETURN = i_ret.

Regards,

Deepthi.

5 REPLIES 5
Read only

Former Member
0 Likes
1,078

Hi, I did some testing on the same issue. There are more BAPI's for tax number changes. Also _ADD, _GETDETAIL and _REMOVE.

So depending on what you want use the right BAPI. I wrote a small program to test the BAPI's and it did not work until I added the COMMIT WORK. First I checked if there ia already a taxnumber with a SELECT SINGLE, but you can also use the GETDETAIL. The COMMIT WORK should be done based on the results, but that test I did not add. Used teh following code:

&----


*& Report ZRVS_TEST_TAX_UPDATE

*&

&----


*&

*&

&----


REPORT zrvs_test_tax_update.

PARAMETER p_part TYPE bu_partner.

PARAMETER p_taxtyp TYPE bptaxtype.

PARAMETER p_taxnum TYPE bptaxnum.

DATA gt_return TYPE STANDARD TABLE OF bapiret2.

DATA gt_taxrec TYPE dfkkbptaxnum.

*----


START-OF-SELECTION.

  • Check if there is a taxnumber is on the partner

SELECT SINGLE *

FROM dfkkbptaxnum INTO gt_taxrec

WHERE partner = p_part.

IF sy-subrc = 0.

  • Tax number already on partner

CALL FUNCTION 'BAPI_BUPA_TAX_CHANGE'

EXPORTING

businesspartner = p_part

taxtype = p_taxtyp

taxnumber = p_taxnum

TABLES

return = gt_return.

ELSE.

  • New taxnumber for partner

CALL FUNCTION 'BAPI_BUPA_TAX_ADD'

EXPORTING

businesspartner = p_part

taxtype = p_taxtyp

taxnumber = p_taxnum

TABLES

return = gt_return.

ENDIF.

COMMIT WORK.

Read only

0 Likes
1,078

This one is not possible as we do not know the vlaues of Tax type...

Read only

Former Member
0 Likes
1,078

Better to use BAPI_TRANSACTION_COMMIT altthough this is just executing the 'COMMIT WORK' statement.

Read only

Former Member
0 Likes
1,078

Hi,

I haev updated through BDc but EIN value is nto updated in SAP.

The code is below:

  • Dequeue Function

CALL FUNCTION 'DEQUEUE_ALL'.

  • To Update EIN No in BP Tcode

PERFORM bdc_dynpro USING 'SAPLBUS_LOCATOR' '3000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SCREEN_1000_MAIN_NOT'.

PERFORM bdc_dynpro USING 'SAPLBUS_LOCATOR' '3000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BUS_MAIN_ENTER'.

PERFORM bdc_field USING 'BDC_CURSOR'

'BUS_JOEL_MAIN-CHANGE_NUMBER'.

PERFORM bdc_field USING 'BUS_JOEL_MAIN-CHANGE_NUMBER'

w_bc001-partner. "'7000006'.

PERFORM bdc_dynpro USING 'SAPLBUS_LOCATOR' '3000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SCREEN_1100_TAB_06'.

PERFORM bdc_dynpro USING 'SAPLBUS_LOCATOR' '3000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BUS_MAIN_SAVE'.

PERFORM bdc_field USING 'BUS_JOEL_MAIN-PARTNER_ROLE'

'000000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'BPDTAX-STCD2'.

  • PERFORM bdc_field USING 'BPDTAX-COUNTRY'

  • 'US'.

IF NOT w_final-stcd2 IS INITIAL.

PERFORM bdc_field USING 'BPDTAX-STCD2'

w_final-stcd2.

ENDIF.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BUS_MAIN_BACK'.

  • Dequeue Function

CALL FUNCTION 'DEQUEUE_ALL'.

*perform bdc_transaction using 'BP'.

IF w_final-stcd2 IS INITIAL.

ELSE.

PERFORM bdc_transaction TABLES i_messtab

USING 'BP'

v_ctu

v_mode

v_update.

    • Commit work

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

endif.

Regrads,

Deepthi.

Read only

Former Member
0 Likes
1,078

BDC only