Skip to Content
0
Dec 14, 2011 at 11:19 AM

BAPI_PO_CHANGE with ME083 because WBS_ELEMENT is not recognised

273 Views

Hello experts,

I am facing a problem when I am changing item account category (ACCTASSCAT) with 'Q' and the WBS_ELEMENT in Account table (for the same item), it is returning the error ME083 with the message "That the WBS_ELEMENT should be filled", I have tested some conversion FMs but, with the ABPSP_OUTPUT, it did not raise an error with ".. the field is wrong', so this is the actual piece of my program:

CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'

EXPORTING

input = t_pep-ps_psp_pnr

IMPORTING

output = vl_pep.

lv_ebeln = t_ekpo-ebeln.

IF t_ekkn-zekkn IS INITIAL.

t_ekkn-zekkn = '01'.

ENDIF.

t_item-po_item = t_ekpo-ebelp.

t_item-acctasscat = 'Q'.

t_item-tax_code = 'E1'.

APPEND t_item.

t_itemx-po_item = t_ekpo-ebelp.

t_itemx-acctasscat = 'X'.

t_itemx-po_itemx = 'X'.

t_itemx-tax_code = 'X'.

APPEND t_itemx.

t_poacc-po_item = t_ekpo-ebelp.

t_poacc-serial_no = t_ekkn-zekkn.

t_poacc-wbs_element = vl_pep.

APPEND t_poacc.

t_poaccx-po_item = t_ekpo-ebelp.

t_poaccx-serial_no = t_ekkn-zekkn.

t_poaccx-wbs_element = 'X'.

APPEND t_poaccx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = lv_ebeln

testrun = p_teste

TABLES

return = t_return

poitem = t_item

poitemx = t_itemx

poaccount = t_poacc

poaccountx = t_poaccx.

.

Thank you in advance.

Edited by: R.Araujo on Dec 14, 2011 12:33 PM