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 safe is CUSTOMER_UPDATE_SALES_AREA for deletion of Partner functions of customer

sanjay_deshpande4
Participant
0 Kudos
256

Dear All,

I am supposed to delete the Partner function in XD02 in my code.

Sap has provided the std CUSTOMER_UPDATE_SALES_AREA for deletion of part function.

The code snippet I have written is as below:

        CALL FUNCTION 'CUSTOMER_UPDATE_SALES_AREA' in update task<br>          TABLES<br>*           T_XKNVV =<br>*           T_XKNVD =<br>*            t_xknvp = it_knvp<br>*           T_YKNVD =<br>           T_YKNVP = it_YKNVP<br>          .<br>        commit work.

Code inside the function module is as below, WIll it lead to data inconsistency in system? as the direct deletion on KNVP being done inside func. module.Can anybody kindly guide how safe is this function module is as

LOOP AT T_YKNVP.<br>    YKNVP = T_YKNVP.<br>    KNVP  = T_YKNVP.<br>    IF YKNVP-KZ = SPACE.<br>      DELETE KNVP.<br>      IF SY-SUBRC NE 0.<br>        MESSAGE A801(F2) WITH 'KNVP' KNVP-KUNNR.<br>      ENDIF.<br>    ENDIF.<br>  ENDLOOP.
1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos
199

Basically this is an update task FM, those FM are called at end of transaction and usually only contain the statements to update database, and no check for data consistencies, only check defined in database will be executed (unique key)