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

BAPI_ALM_ORDER_MAINTAIN - Update multiple components

Former Member
0 Likes
1,392

Hi,

I am trying to use this BAPI to update several components at a time, however it is only updating the first component.

Have anybody updated several components with a sinlge execution of this BAPI.

Thanks

Martin

5 REPLIES 5
Read only

Former Member
0 Likes
734

Fixed it myself.

Read only

Former Member
0 Likes
734

HI,

Here is the sample code

data : methods type standard table of BAPI_ALM_ORDER_METHOD,

userstat type standard table of BAPI_ALM_ORDER_USRSTAT,

zreturn type standard table of BAPIRET2.

data : xmethod like BAPI_ALM_ORDER_METHOD,

xstatus like BAPI_ALM_ORDER_USRSTAT,

xaufnr like aufk-aufnr,

xreturn like bapiret2,

h_tabix like sy-tabix.

xstatus-user_st_text = 'docc'.

xstatus-langu = sy-langu.

xstatus-inactive = ' '.

xstatus-change_event = '01'.

append xstatus to userstat.

h_tabix = sy-tabix.

refresh: methods.

xaufnr = '000000000000'.

xaufnr+4(8) = orders_in-order.

clear: xmethod, xstatus..

xmethod-refnumber = 1.

xmethod-objecttype = 'USERSTATUS'.

xmethod-method = 'CHANGE'.

xmethod-objectkey(12) = xaufnr.

append xmethod to methods.

clear xmethod.

xmethod-refnumber = 1.

xmethod-method = 'SAVE'.

xmethod-objectkey(12) = xaufnr.

append xmethod to methods.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

IT_METHODS = methods

IT_USERSTATUS = userstat

RETURN = zreturn.

Regards

Sudheer

Read only

0 Likes
734

Did you read my question. I said updating components. You have posted code which doesn't do anything with the components table.

Read only

Former Member
0 Likes
734

Hi Martin,

I am facing the similler problem which you had earlier.It is updating only the first component always.

May i know how did u fixed this problem.

Thanks

Lokesh

Read only

0 Likes
734

You need corresponding entries in the table it_component_up.