PDA

Ver la Versión Completa : Ayuda 'BAPI_SALESORDER_CREATEFROMDAT2'


Cristiana
10/08/09, 15:01:08
Hola
Alguien me puede ayudar estoy usando la BAPI BAPI_SALESORDER_CREATEFROMDAT2
Lo que quiero es crear una orden de venta en la tabla VBAK el detalle es que yo le agregue un campo a la tabla VBAK ZZ_PCARD

lo que hice fue un extension para pasarle el campo

data: i_so_hd type table of bapisdhd1 with header line, "Z1SOHDIN

move 'BAPE_VBAK' to i_extension2-structure.
move w_so_hdin-zz_pcard to i_extension2-valuepart1.
append i_extension2.
clear i_extension2.

call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
order_header_in = i_so_hd
logic_switch = lw_bapisdls
importing
salesdocument = v_docsap
tables
return = i_so_error
order_items_in = i_so_it
order_partners = i_so_pnr
order_schedules_in = i_so_sch
order_conditions_in = i_so_cond
partneraddresses = i_so_addr
extensionin = i_extension2.

y si me creo la orden pero no me agrego la informacion del campo nuevo que le puse a la tabla VBAK-zz_pcard

alguien me puede ayudar

Se los agradeceria mucho

Saludos

Heran
11/08/09, 10:39:16
Quiza con esto puedas hacerlo:

You must complete the EXTENSION table as follows:

STRUCTURE VALUEPART1 1234561234567890123

BAPE_VBAP 0000004711000020 XYZ
BAPE_VBAPX 0000004711000020 X

Si quieres que te lo explique mas claro avisa.

Atlas
13/08/09, 12:20:29
hola,

no se si lo habrás hecho, pero tienes que activar la exit/badi de la extensión de la bapi y añadír allí el codigo que mueva el contenido de la estructura extension a la vbak

Cristiana
19/08/09, 19:05:02
muchas Gracias el problema era que estaba usando solo una estructura al parecer son dos las que se deben de usar
en la funcion en la parte del function modul documentation encontr eso
por si a alguien le sirve.


At the moment, you can use the BAPI to store enhancements in the following structures:

VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
If you also want to work with checkboxes, each X-structure must also contain an append structure.