If you create or update a Business Partner with customer or supplier role you may get the message to enter a VAT registration number if Business Partner is located within the EU. You will get a message pop-up like this
This message is controlled by customizing setting of country definition and check rules at
IMG:ABAP Platform->General settings->Set Countries->Define Countries/Regions
Unfortunately this is a general country specific setting. Independent on type of Business Partner, Person or Organization, VAT registration number is checked.
If you want to control this check routine by your own logic, you can follow my instructions below.
In my example implementation I would like to switch off this check for Business Partners of type Person only.
The solution is quite simple if you know where to step in. May be you know already that BP transaction is controlled by events of BDT (Business Data Toolset). I will create a Function Module with my check logic and assign this to BDT event "DCHCK" where all Business Partner check routines a assigned to.
Event DCHCK is called at two situations:
I created a Function Module Z_CVIC_TEST without any parameters. As an example you can use my coding below:
FUNCTION z_cvic_test.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
DATA: lv_carbgb TYPE sy-msgid,
lv_ctxtnr TYPE sy-msgno,
lv_msgty TYPE sy-msgty,
lv_varbgb TYPE sy-msgid,
lv_vtxtnr TYPE sy-msgno,
lv_cancel TYPE boole_d VALUE 'X'.
lv_carbgb = 'CMD_API'.
lv_ctxtnr = '007'.
lv_varbgb = 'VMD_API'.
lv_vtxtnr = '043'.
* enter your requirements here for which message should be deleted
* in my case it's BP-Type "Person"
DATA: lv_akt TYPE tbz0k-aktyp,
lt_but000 TYPE TABLE OF but000,
ls_but000 TYPE but000,
lr_xo_bdt_adapter TYPE REF TO xo_bdt_adapter.
lr_xo_bdt_adapter ?= xo_bdt_adapter=>get_instance( 'BUPA' ).
lv_akt = lr_xo_bdt_adapter->get_activity( ).
CHECK lv_akt <> '03'.
fsbp_bdt_adapter=>get_current_bp_data(
EXPORTING
i_table_name = 'BUT000'
IMPORTING
e_data_table = lt_but000 ).
READ TABLE lt_but000 INTO ls_but000 INDEX 1.
CHECK ls_but000-type = '1'.
* delete message for customer
CALL FUNCTION 'BUS_MESSAGE_STORE'
EXPORTING
arbgb = lv_carbgb
msgty = lv_msgty
txtnr = lv_ctxtnr
cancel = lv_cancel.
* delete message for supplier
CALL FUNCTION 'BUS_MESSAGE_STORE'
EXPORTING
arbgb = lv_varbgb
msgty = lv_msgty
txtnr = lv_vtxtnr
cancel = lv_cancel.
ENDFUNCTION.
Open BDT menu from SAP Easy Access screen (initial screen you can see directly after logon) by calling transaction BUPT. Alternatively you can run transaction BUS7.
To navigate into function module list of BDT event DCHCK, mark event DCHCK and double-click at "Event->Function Module" from navigation tree at the left.
You will see a list of all defined and assigned check function modules for event DCHCK.
Standard check logic is implemented with function module XO_GENERIC_EVENT_DCHCK (Item 3600000) which writes message CMD_API007 (for customer roles) or VMD_API043 (for supplier roles) message into message memory.
Our own function module will delete this message(s) from memory if Business Partner is type Person.
For this purpose we add a new item directly after item 3600000 to delete the message(s).
Create a new item 3600001 and assign your function module.
Save your changes and test.
Create an Organization first without saving to test message
Create a Person without saving to test
As you can see, there is no message displayed any more for persons.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 |