Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

gets error in bapi BAPI_PO_CHANGE

Former Member
0 Likes
416

Hi!

I am trying to use an BAPI in order to mark an PO item for deletion. It works fine but I get an express mail and a dump in ST22 saying

PERFORM was used to call the routine "F0001_UPDATE" of the program "RMCX0022

The current call contains 12 actual parameter(s), but the routine

"F0001_UPDATE"

expects 13 parameters.

parameters.

Anyone that has seen this before?

The code looks like this:

LOOP AT i_poitems INTO wa_i_poitems.

AT END OF ebeln.

LOOP AT i_poitems INTO wa_i_poitems_2 WHERE ebeln =

wa_i_poitems-ebeln.

wa_i_poitem-po_item = wa_i_poitems_2-ebelp+1.

wa_i_poitem-delete_ind = 'X'.

APPEND wa_i_poitem TO i_poitem.

wa_i_poitemx-po_item = wa_i_poitems_2-ebelp+1.

wa_i_poitemx-po_itemx = 'X'.

wa_i_poitemx-delete_ind = 'X'.

APPEND wa_i_poitemx TO i_poitemx.

WRITE: /1 wa_i_poitems_2-ebeln,

12 wa_i_poitems_2-ebelp+1.

CLEAR: wa_i_poitems_2.

ENDLOOP.

wa_poheader-po_number = wa_i_poitems-ebeln.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

PURCHASEORDER = wa_i_poitems-ebeln

POHEADER = wa_poheader

  • POHEADERX =

  • IMPORTING

  • expheader = w_expheader

  • exppoexpimpheader = w_bapieikp

TABLES

return = i_bapiret

poitem = i_poitem

poitemx = i_poitemx.

ENDAT.

ENDLOOP.

with declaration

TYPES: BEGIN OF is_poitems,

ebeln TYPE char10,

ebelp TYPE char5,

END OF is_poitems.

DATA: wa_i_poitems TYPE is_poitems,

wa_i_poitems_2 TYPE is_poitems,

wa_i_poitem TYPE BAPIMEPOITEM,

wa_i_poitemx TYPE BAPIMEPOITEMX,

wa_i_bapiret TYPE BAPIRET2,

w_expheader LIKE bapimepoheader,

w_bapieikp LIKE bapieikp,

wa_poheader LIKE BAPIMEPOHEADER.

************************************************************************

  • I N T E R N A L T A B L E S

************************************************************************

DATA: i_poitems TYPE is_poitems OCCURS 0,

i_bapiret TYPE BAPIRET2 OCCURS 0,

i_poitem TYPE BAPIMEPOITEM OCCURS 0,

i_poitemx TYPE BAPIMEPOITEMX OCCURS 0.

Thank you for your help, best regards Lena

2 REPLIES 2
Read only

Former Member
0 Likes
381

Hello

Try wa_i_poitem-po_item = wa_i_poitems_2-ebelp+10.

instead

wa_i_poitem-po_item = wa_i_poitems_2-ebelp+1.

Read only

Former Member