MUNDOSAP

MUNDOSAP (foro/index.php)
-   Programación ABAP IV (foro/forumdisplay.php?f=4)
-   -   bapi_salesorder_change (foro/showthread.php?t=39078)

julianvc 30/09/10 15:49:20

bapi_salesorder_change
 
Buenas tardes.
Estoy intentando hacer que en los pedidos de venta que tiene alguna línea de regalo, elimine la condicion del punto verde en esa línea.
He logrado eliminar la línea del pedido y el pedido entero, pero no logro actualizar la condición ZIPV (punto verde ) de la línea de regalo.
Hago lo siguiente:

Os pongo el ejemplo para un pedido en concreto:


select * from vbap into corresponding fields of table lt_vbap
where vbeln = '0000313755' and pstyv = 'ZTNN'.

loop at lt_vbap into ls_vbap.
i_itm-itm_number = ls_vbap-posnr.
i_itm-target_qty = ls_vbap-kwmeng.

i_itmx-updateflag = 'U'.
i_itmx-itm_number = ls_vbap-posnr.
i_itmx-target_qty = 'X'.

APPEND i_itm.
APPEND i_itmx.

i_sched-itm_number = ls_vbap-posnr.

i_schedx-updateflag = 'D'.
i_schedx-itm_number = ls_vbap-posnr.

i_schedx-req_qty = 'U'.

APPEND i_sched.
APPEND i_schedx.



i_cond-itm_number = ls_vbap-posnr.
i_cond-cond_value = '0.00'.
i_cond-cond_type = 'ZIPV'.
APPEND i_cond.

i_condx-itm_number = ls_vbap-posnr.
i_condx-cond_type = 'ZIPV'.
i_condx-updateflag = 'D'.
APPEND i_condx.



CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = ls_vbap-vbeln
order_header_in = i_hdr
order_header_inx = i_hdrx
behave_when_error = 'P'
TABLES
return = i_ret
order_item_in = i_itm
order_item_inx = i_itmx
schedule_lines = i_sched
schedule_linesx = i_schedx
conditions_in = i_cond
conditions_inx = i_condx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

endloop.

Me puede ayudar alguien por favor.

Gracias y saludos.


Husos Horarios son GMT. La hora en este momento es 22:23:53.

www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web