Ejemplo para modificar dentro del "Área de Ventas" de un Cliente que correspondería a la tabla KNVV.
En este caso simplemente vamos a modificar el "Centro Suministrador".
Esta BAPI >>> CUSTOMER_UPDATE_SALES_AREA, simula la transacción XD02.
REPORT z_modif_knvv_clientes.
TABLES: knvv.
DATA: gt_knvv LIKE knvv OCCURS 0 WITH HEADER LINE.
************************************************************************
*SELECTION-SCREEN
************************************************************************
SELECT-OPTIONS: s_kunnr FOR knvv-kunnr.
PARAMETERS: p_vkorg LIKE knvv-vkorg OBLIGATORY DEFAULT '3420',
p_vtweg LIKE knvv-vtweg OBLIGATORY DEFAULT '01',
p_spart LIKE knvv-spart OBLIGATORY DEFAULT '00'.
************************************************************************
* START-OF-SELECTION.
************************************************************************
START-OF-SELECTION.
CHECK s_kunnr[] IS NOT INITIAL.
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr IN s_kunnr
AND vkorg = p_vkorg
AND vtweg = p_vtweg
AND spart = p_spart.
LOOP AT gt_knvv.
gt_knvv-vwerk = '3421'.
MODIFY gt_knvv.
ENDLOOP.
CALL FUNCTION 'CUSTOMER_UPDATE_SALES_AREA'
TABLES
t_xknvv = gt_knvv
* T_XKNVD =
* T_XKNVP =
* T_YKNVD =
* T_YKNVP =
.
MESSAGE s000(zy) WITH 'Proceso terminado'.
************************************************************************
* END-OF-SELECTION.
************************************************************************
END-OF-SELECTION.