#1
|
|||
|
|||
Error en creacion de pedido de servicios
hola,
estoy utilizando la bapi bapi_po_create1 para crear un pedido de compras de servicios imputado a un cecos, y con valores ilimitados, pero me esta sacando este error: ' No existe ninguna imputación para la línea de servicios 0000000000 ' estoy llenando estas tablas: *POHEADER COMP_CODE 1TDM DOC_TYPE POTR CREAT_DATE 22.11.2010 CREATED_BY XXXXXX VENDOR 13 PURCH_ORG 1TDM PUR_GROUP 009 CURRENCY COP DOC_DATE 22.11.2010 *POHEADERX COMP_CODE X DOC_TYPE X CREAT_DATE X CREATED_BY X VENDOR X PURCH_ORG X PUR_GROUP X CURRENCY X DOC_DATE X * POITEM PO_ITEM 00010 SHORT_TEXT SERVICIO PLANT TD07 MATL_GROUP SO99 ITEM_CAT F ACCTASSCAT K PCKG_NO 0000000001 *POITEMX PO_ITEM 00010 SHORT_TEXT X PLANT X MATL_GROUP X ITEM_CAT X ACCTASSCAT X PCKG_NO X * POSCHEDULE PO_ITEM 00010 SCHED_LINE 0000 DEL_DATCAT_EXT M DELIVERY_DATE 11.2010 * POSCHEDULEX PO_ITEM 00010 SCHED_LINE 0000 DEL_DATCAT_EXT M DELIVERY_DATE 11.2010 * POACCOUNT PO_ITEM 00010 SERIAL_NO 01 GL_ACCOUNT 9242109500 COSTCENTER 1999999999 CO_AREA TS01 * POACCOUNTX PO_ITEM X SERIAL_NO 01 GL_ACCOUNT X COSTCENTER X CO_AREA X *POLIMITS PCKG_NO 0000000001 LIMIT 999.999.999,0000 NO_LIMIT X EXP_VALUE 999.999.999,0000 *POSERVICES PCKG_NO 0000000001 LINE_NO 0000000001 EXT_LINE 0000000000 OUTL_IND X SUBPCKG_NO 0000000002 porfa alguien puede decirme que me hace falta, o cmo deberia hacerlo, gracias,
__________________
EVERA |
#2
|
|||
|
|||
Pedidos
Hola hay tienes el codigo, yo no lo hice con limites, pero esta todo lo demas, tu problema esta resuelto ya con esto, si tienes dudas me dices
CALL FUNCTION 'BAPI_PO_CREATE1' EXPORTING poheader = mepoheader poheaderx = mepoheaderx * POADDRVENDOR = testrun = p_test * MEMORY_UNCOMPLETE = * MEMORY_COMPLETE = * POEXPIMPHEADER = * POEXPIMPHEADERX = * VERSIONS = * NO_MESSAGING = * NO_MESSAGE_REQ = * NO_AUTHORITY = * no_price_from_po = no_price_from_po IMPORTING exppurchaseorder = porder * EXPHEADER = * EXPPOEXPIMPHEADER = TABLES return = it_return poitem = mepoitem poitemx = mepoitemx poaddrdelivery = addrdelivery poschedule = meposchedule poschedulex = meposchedulx poaccount = mepoaccount * POACCOUNTPROFITSEGMENT = poaccountx = mepoaccountx * POCONDHEADER = * POCONDHEADERX = * POCOND = * POCONDX = * POLIMITS = * POCONTRACTLIMITS = poservices = esllc posrvaccessvalues = esklc * POSERVICESTEXT = * EXTENSIONIN = * EXTENSIONOUT = * POEXPIMPITEM = * POEXPIMPITEMX = potextheader = mepotextheader * POTEXTITEM = * ALLVERSIONS = popartner = ekkop. *&---------------------------------------------------------------------* *& Form header *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM header. * Sociedad mepoheader-comp_code = wa_ped-bukrs. IF NOT mepoheader-comp_code IS INITIAL. mepoheaderx-comp_code = 'X'. ELSE. mepoheaderx-comp_code = ' '. ENDIF. * Lenguaje * mepoheader-langu = sy-langu. * * IF NOT mepoheader-langu IS INITIAL. * mepoheaderx-langu = 'X'. * ELSE. * mepoheaderx-langu = ''. * ENDIF. * Moneda * mepoheader-currency = wa_ped-waers. * * IF NOT mepoheader-currency IS INITIAL. * mepoheaderx-currency = 'X'. * ELSE. * mepoheaderx-currency = ''. * ENDIF. * Clase documento compras mepoheader-doc_type = wa_ped-bsart. IF NOT mepoheader-doc_type IS INITIAL. mepoheaderx-doc_type = 'X'. ELSE. mepoheaderx-doc_type = ' '. ENDIF. * Proveedor CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = wa_ped-lifnr IMPORTING output = mepoheader-vendor. IF NOT mepoheader-vendor IS INITIAL. mepoheaderx-vendor = 'X'. ELSE. mepoheaderx-vendor = ' '. ENDIF. * Org. compras mepoheader-purch_org = wa_ped-ekorg. IF NOT mepoheader-purch_org IS INITIAL. mepoheaderx-purch_org = 'X'. ELSE. mepoheaderx-purch_org = ' '. ENDIF. * Grupo compras mepoheader-pur_group = wa_ped-ekgrp. IF NOT mepoheader-pur_group IS INITIAL. mepoheaderx-pur_group = 'X'. ELSE. mepoheaderx-pur_group = ' '. ENDIF. * Fecha del documento de compras mepoheader-doc_date = sy-datum. IF NOT mepoheader-doc_date IS INITIAL. mepoheaderx-doc_date = 'X'. ELSE. mepoheaderx-doc_date = ' '. ENDIF. CALL FUNCTION 'BAPI_PO_GETDETAIL' EXPORTING purchaseorder = wa_ped-ebeln header_texts = 'X' TABLES po_header_texts = header_texts[]. * Texto cabecera CLEAR mepotextheader. REFRESH mepotextheader. tdline = 'COPIADO DEL PEDIDO Nº:'. IF header_texts[] IS INITIAL. CONCATENATE tdline wa_ped-ebeln INTO mepotextheader-text_line. APPEND mepotextheader. CLEAR mepotextheader. ELSE. LOOP AT header_texts INTO wa_header_texts. IF wa_header_texts-text_line CS 'COPIA' OR wa_header_texts-text_line CS 'COPIADO'. CLEAR wa_header_texts-text_line. CONCATENATE wa_header_texts-text_line '-' 'COPIADO DEL PEDIDO Nº:' wa_ped-ebeln INTO mepotextheader-text_line. MODIFY mepotextheader INDEX sy-tabix. ENDIF. MOVE-CORRESPONDING wa_header_texts TO mepotextheader. APPEND mepotextheader. ENDLOOP. CONCATENATE tdline wa_ped-ebeln INTO mepotextheader-text_line. APPEND mepotextheader. CLEAR mepotextheader. ENDIF. * Funciones interlocutor * Partner IF NOT wa_ped-lifn2 IS INITIAL. ekkop-partnerdesc = 'DP'. "Dirección de pedido * Clave de idioma ekkop-langu = sy-langu. * Direc. pedido CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = wa_ped-lifn2 IMPORTING output = ekkop-buspartno. APPEND ekkop. CLEAR ekkop. ENDIF. ENDFORM. " header *&---------------------------------------------------------------------* *& Form item *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM item. PERFORM bapi_get_detail_item. * Nº pos. doc. compras mepoitem-po_item = wa_ped-ebelp. mepoitemx-po_item = wa_ped-ebelp. mepoitemx-po_itemx = 'X'. * Texto posición mepoitem-short_text = wa_ped-txz01. IF NOT mepoitem-short_text IS INITIAL. mepoitemx-short_text = 'X'. ELSE. mepoitemx-short_text = ''. ENDIF. * Distribución mepoitem-distrib = wa_ped-vrtkz. IF NOT mepoitem-distrib IS INITIAL. mepoitemx-distrib = 'X'. ELSE. mepoitem-distrib = ''. ENDIF. * Indicador de factura parcial mepoitem-part_inv = wa_ped-twrkz. IF NOT mepoitem-part_inv IS INITIAL. mepoitemx-part_inv = 'X'. ELSE. mepoitemx-part_inv = ''. ENDIF. * Centro mepoitem-plant = wa_ped-werks. IF NOT mepoitem-plant IS INITIAL. mepoitemx-plant = 'X'. ELSE. mepoitemx-plant = ' '. ENDIF. * Almacén mepoitem-stge_loc = wa_ped-lgort. IF NOT mepoitem-stge_loc IS INITIAL. mepoitemx-stge_loc = 'X'. ELSE. mepoitemx-stge_loc = ''. ENDIF. * Material * mepoitem-material = wa_ped-matnr. * * IF NOT mepoitem-material IS INITIAL. * mepoitemx-material = 'X'. * ELSE. * mepoitemx-material = ''. * ENDIF. * Necesidad mepoitem-trackingno = wa_ped-bednr. IF NOT mepoitem-trackingno IS INITIAL. mepoitemx-trackingno = 'X'. ELSE. mepoitemx-trackingno = ' '. ENDIF. * Cantidad pedido * mepoitem-quantity = wa_ped-peinh. * * IF NOT mepoitem-quantity IS INITIAL. * mepoitemx-quantity = 'X'. * ELSE. * mepoitemx-quantity = ''. * ENDIF. * Unidad medida * IF NOT wa_ped-meins IS INITIAL. * * CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' * EXPORTING * input = wa_ped-meins * language = sy-langu * IMPORTING * output = mepoitem-po_unit. * * ENDIF. * * IF NOT mepoitem-po_unit IS INITIAL. * mepoitemx-po_unit = 'X'. * ELSE. * mepoitemx-po_unit = ''. * ENDIF. * Unidad medida precio * mepoitem-orderpr_un = wa_ped-bprme. * * IF NOT mepoitem-orderpr_un IS INITIAL. * mepoitemx-orderpr_un = 'X'. * ELSE. * mepoitemx-orderpr_un = ''. * ENDIF. * Grp. art. mepoitem-matl_group = wa_ped-matkl. IF NOT mepoitem-matl_group IS INITIAL. mepoitemx-matl_group = 'X'. ELSE. mepoitemx-matl_group = ' '. ENDIF. * Packno READ TABLE g_it_bapiekpo_item WITH KEY po_item = wa_ped-ebelp. mepoitem-pckg_no = g_it_bapiekpo_item-pckg_no. IF NOT mepoitem-pckg_no IS INITIAL. mepoitemx-pckg_no = 'X'. ELSE. mepoitemx-pckg_no = ''. ENDIF. CLEAR: lwert, netpr. SELECT * FROM essr INTO TABLE it_essr WHERE ebeln EQ wa_ped-ebeln AND ebelp EQ wa_ped-ebelp. LOOP AT it_essr INTO wa_essr. IF wa_essr-loekz NE 'X'. lwert = lwert + wa_essr-lwert. ENDIF. ENDLOOP. IF lwert GT wa_ped-netpr. netpr = lwert - wa_ped-netpr. ELSE. netpr = wa_ped-netpr - lwert. ENDIF. IF netpr EQ 0. CLEAR l_mensaje. linea = linea + 1. CONCATENATE ' Pedido:'wa_ped-ebeln'Pos:'wa_ped-ebelp text-e08 INTO l_mensaje SEPARATED BY space. insert_log it_error l_mensaje 'PED' 'E' space linea sy-datum sy-uzeit. err_tot = 'X'. CLEAR: mepoitem, mepoitemx. EXIT. ENDIF. IF netpr LT 1 AND netpr NE 0. CLEAR l_mensaje. linea = linea + 1. CONCATENATE ' Pedido:'wa_ped-ebeln'Pos:'wa_ped-ebelp text-e15 INTO l_mensaje SEPARATED BY space. insert_log it_error l_mensaje 'PED' 'E' space linea sy-datum sy-uzeit. err_tot = 'X'. CLEAR: mepoitem, mepoitemx. EXIT. ENDIF. mepoitem-net_price = netpr. IF NOT mepoitem-net_price IS INITIAL. mepoitemx-net_price = 'X'. ELSE. mepoitemx-net_price = ''. ENDIF. * Tipo pos. doc. compras mepoitem-item_cat = wa_ped-pstyp. IF NOT mepoitem-item_cat IS INITIAL. mepoitemx-item_cat = 'X'. ELSE. mepoitemx-item_cat = ''. ENDIF. imputac = wa_ped-knttp. * Tipo imputación mepoitem-acctasscat = imputac. IF NOT imputac IS INITIAL. mepoitemx-acctasscat = 'X'. ELSE. mepoitemx-acctasscat = ' '. ENDIF. * Indicador impuestos mepoitem-tax_code = wa_ped-mwskz. IF NOT mepoitem-tax_code IS INITIAL. mepoitemx-tax_code = 'X'. ELSE. mepoitemx-tax_code = ''. ENDIF. APPEND mepoitem. CLEAR mepoitem. APPEND mepoitemx. CLEAR mepoitemx. * Repartos * Línea pedido meposchedule-po_item = wa_ped-ebelp. meposchedulx-po_item = wa_ped-ebelp. meposchedulx-po_itemx = 'X'. * Línea reparto meposchedule-sched_line = '0001'. meposchedulx-sched_line = '0001'. meposchedulx-sched_linex = 'X'. * Fecha entrega WRITE p_fecha TO meposchedule-delivery_date. IF NOT meposchedule-delivery_date IS INITIAL. meposchedulx-delivery_date = 'X'. ELSE. meposchedulx-delivery_date = ''. ENDIF. * Cantidad meposchedule-quantity = wa_ped-menge. IF NOT meposchedule-quantity IS INITIAL. meposchedulx-quantity = 'X'. ELSE. meposchedulx-quantity = ''. ENDIF. APPEND meposchedule. CLEAR meposchedule. APPEND meposchedulx. CLEAR meposchedulx. ENDFORM. " item *&---------------------------------------------------------------------* *& Form srv *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM srv. CLEAR esllc. REFRESH esllc. LOOP AT services INTO wa_services. esllc-pckg_no = wa_services-pckg_no. esllc-subpckg_no = wa_services-subpckg_no. esllc-line_no = wa_services-line_no. esllc-ext_line = wa_services-ext_line. esllc-outl_level = wa_services-outl_level. esllc-outl_no = wa_services-outl_no. esllc-outl_ind = wa_services-outl_ind. esllc-pln_pckg = wa_services-pln_pckg. esllc-pln_line = wa_services-pln_line. esllc-uom_iso = wa_services-uom_iso. esllc-tax_code = wa_services-tax_code. * Srv CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = wa_services-service IMPORTING output = esllc-service. * Calculamos el precio para los servicios IF wa_services-outl_ind NE 'X'. CLEAR: act_wert, brtwr, act_menge. SELECT SINGLE act_wert brtwr act_menge INTO (act_wert, brtwr, act_menge) FROM esll WHERE packno EQ wa_services-pckg_no AND extrow EQ wa_services-ext_line. IF wa_services-gr_price NE 1. esllc-quantity = brtwr - act_wert. esllc-gr_price = 1. ELSE. esllc-quantity = wa_services-quantity - act_wert. esllc-gr_price = wa_services-gr_price. ENDIF. ENDIF. APPEND esllc. CLEAR esllc. ENDLOOP. CLEAR esklc. REFRESH esklc. LOOP AT srv_values INTO wa_srvalues. esklc-pckg_no = wa_srvalues-pckg_no. esklc-line_no = wa_srvalues-line_no. esklc-percentage = wa_srvalues-percentage. esklc-serno_line = wa_srvalues-serno_line. esklc-serial_no = wa_srvalues-serial_no. CLEAR: act_wert, brtwr, act_menge. SELECT SINGLE act_wert brtwr act_menge INTO (act_wert, brtwr, act_menge) FROM esll WHERE packno EQ wa_srvalues-pckg_no. IF wa_srvalues-net_value NE 1. esklc-quantity = brtwr - act_wert. esklc-net_value = 1. ELSE. esklc-quantity = wa_srvalues-quantity - act_wert. esklc-net_value = wa_srvalues-net_value. ENDIF. APPEND esklc. CLEAR esklc. ENDLOOP. ENDFORM. " srv *&---------------------------------------------------------------------* *& Form account *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM account. REFRESH it_ekkn. CLEAR it_ekkn. SELECT * INTO TABLE it_ekkn FROM ekkn WHERE ebeln = wa_ped-ebeln AND ebelp = wa_ped-ebelp. LOOP AT it_ekkn INTO wa_ekkn. CLEAR knttp. SELECT SINGLE knttp INTO knttp FROM ekpo WHERE ebeln EQ wa_ekkn-ebeln AND ebelp EQ wa_ekkn-ebelp. IF knttp EQ 'P'. * PEP CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' EXPORTING input = wa_ekkn-ps_psp_pnr IMPORTING output = mepoaccount-wbs_element. IF NOT mepoaccount-wbs_element IS INITIAL. mepoaccountx-wbs_element = 'X'. ELSE. mepoaccountx-wbs_element = ' '. ENDIF. ENDIF. IF knttp EQ 'K'. * CeCo CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = wa_ekkn-kostl IMPORTING output = mepoaccount-costcenter. IF NOT mepoaccount-costcenter IS INITIAL. mepoaccountx-costcenter = 'X'. ELSE. mepoaccountx-costcenter = ' '. ENDIF. ENDIF. * Imputaciones * Línea mepoaccount-po_item = wa_ekkn-ebelp. mepoaccountx-po_item = wa_ekkn-ebelp. mepoaccountx-po_itemx = 'X'. * Imputacion mepoaccount-serial_no = wa_ekkn-zekkn. mepoaccountx-serial_no = wa_ekkn-zekkn. mepoaccountx-serial_nox = 'X'. * Centro Beneficio mepoaccount-profit_ctr = wa_ekkn-prctr. IF NOT mepoaccount-profit_ctr IS INITIAL. mepoaccountx-profit_ctr = 'X'. ELSE. mepoaccountx-profit_ctr = ''. ENDIF. * Indicador IVA mepoaccount-tax_code = wa_ekkn-mwskz. IF NOT mepoaccount-tax_code IS INITIAL. mepoaccountx-tax_code = 'X'. ELSE. mepoaccountx-tax_code = ''. ENDIF. * Cantidad mepoaccount-quantity = wa_ekkn-menge. IF NOT mepoaccount-quantity IS INITIAL. mepoaccountx-quantity = 'X'. ELSE. mepoaccountx-quantity = ''. ENDIF. * Número de la cuenta de mayor mepoaccount-gl_account = wa_ped-sakto. IF NOT mepoaccount-gl_account IS INITIAL. mepoaccountx-gl_account = 'X'. ELSE. mepoaccountx-gl_account = ''. ENDIF. * Pos. Presupuestaria mepoaccount-cmmt_item = wa_ped-fipos. IF NOT mepoaccount-cmmt_item IS INITIAL. mepoaccountx-cmmt_item = 'X'. ELSE. mepoaccountx-cmmt_item = ''. ENDIF. * Soc. CO mepoaccount-co_area = wa_ekkn-kokrs. IF NOT mepoaccount-co_area IS INITIAL. mepoaccountx-co_area = 'X'. ELSE. mepoaccountx-co_area = ' '. ENDIF. * Centro gestor mepoaccount-funds_ctr = wa_ekkn-fistl. IF NOT mepoaccount-funds_ctr IS INITIAL. mepoaccountx-funds_ctr = 'X'. ELSE. mepoaccountx-funds_ctr = ' '. ENDIF. * Porcentaje distribucion imputación multiple mepoaccount-distr_perc = wa_ekkn-vproz. IF NOT mepoaccount-distr_perc IS INITIAL. mepoaccountx-distr_perc = 'X'. ELSE. mepoaccountx-distr_perc = ' '. ENDIF. APPEND mepoaccount. CLEAR mepoaccount. APPEND mepoaccountx. CLEAR mepoaccountx. ENDLOOP. ENDFORM. " account |
#3
|
|||
|
|||
hola,
estuve revisando el ejemplo y ajuste algunas cosas en el mio, pero ahora tengo este error: "En caso de imputación, registre los datos de imputación para la posición", sabes porq puede ser ?? ** Poaccount wa_account-po_item = w_pos. wa_account-serial_no = w_serial. wa_account-gl_account = cta. wa_account-costcenter = cecos. wa_account-quantity = '1'. * wa_account-acttype = 'X'. wa_account-co_area = 'TS01'. " Sociedad CO append wa_account to t_account. clear wa_account. ** Poaccount wa_accountx-po_item = w_pos. wa_accountx-serial_no = w_serial. wa_accountx-gl_account = 'X'. wa_accountx-costcenter = 'X'. wa_accountx-quantity = '1'. * wa_accountx-acttype = 'X'. wa_accountx-co_area = 'X'. append wa_accountx to t_accountx. clear wa_accountx. ** Polimits wa_limits-pckg_no = '0000000001'. wa_limits-limit = value. wa_limits-no_limit = true. wa_limits-exp_value = value. append wa_limits to t_limits. clear wa_limits. ** Services wa_services-pckg_no = w_packno. wa_services-line_no = w_lineno. wa_services-ext_line = '0000000000'. wa_services-outl_level = '0'. wa_services-outl_no = ' '. wa_services-outl_ind = 'X'. wa_services-subpckg_no = w_packno + 1. wa_services-edition = '0000' . wa_services-quantity = '0' . wa_services-ovf_tol = '0' . wa_services-gr_price = '0' . wa_services-from_line = '1' . wa_services-quantity = '1' . append wa_services to t_services. clear wa_services. ** Seriales wa_posrvaccessvalues-pckg_no = w_packno. wa_posrvaccessvalues-line_no = w_lineno. wa_posrvaccessvalues-serno_line = w_serial. wa_posrvaccessvalues-quantity = '1'. wa_posrvaccessvalues-serial_no = w_serial. append wa_posrvaccessvalues to t_posrvaccessvalues. clear wa_posrvaccessvalues. gracias.
__________________
EVERA |
#4
|
|||
|
|||
Si eso es que al rellenar la estructura paralela con las x, le debes pasar la posicion a esa estructura no la x como a los demas campos, de todas maneras en el codigo que te adjunte hay tienes todas las estructuras con los correspondientes valores, a mi tambien me dio ese error, estas utilizando la misma bapi que yo?
|
#5
|
|||
|
|||
Solo pasale las x a los campos que tengan valores sino no rellenes la x, fijate bien en mi codigo porque te lo corte y pegue de un report que hice yo y no fallaba, solo que yo no tenia limites, pero el error que te da es por la imputacion,
|
Herramientas | Buscar en Tema |
Desplegado | |
|
|