Application Development 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: 

Help required in BAPI_ALM_ORDER_MAIN to change quantity

Former Member
0 Kudos

Hi,

I want ot change the service order quantity..

I am using BAPI_ALM_ORDER_MAINTAIN

can any one help me with parameters to be passed to tjis bapi to change the order quantity??

Regards,

Himanshu.

2 REPLIES 2

Former Member
0 Kudos

DATA:IT_RETURN TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE,

IT_COMPONENT TYPE BAPI_ALM_ORDER_COMPONENT OCCURS 0 WITH HEADER LINE,

IT_METHODS TYPE BAPI_ALM_ORDER_METHOD OCCURS 0 WITH HEADER LINE,

IT_COMPONENT_UP TYPE BAPI_ALM_ORDER_COMPONENT_UP OCCURS 0 WITH HEADER LINE,

ODR_NO LIKE BAPI_ALM_ORDER_HEADERS_I-ORDERID. " Order Number

*&--


CHANGE COMPONENT--


IF it_parts_tmp_ch[] IS NOT INITIAL.

LOOP AT it_parts_tmp_ch INTO wa_parts.

w_sy_tabix = sy-tabix.

CLEAR:wa_resb.

READ TABLE it_resb

INTO wa_resb

WITH KEY rsnum = wa_afko-rsnum

aufnr = w_sord_num

posnr = wa_parts-itemno

xloek = ''.

*&----


Fill values in IT_METHODS

IT_METHODS-METHOD = 'CHANGE'.

IT_METHODS-REFNUMBER = w_sy_tabix.

IT_METHODS-OBJECTTYPE = 'COMPONENT'.

IT_METHODS-OBJECTKEY = w_sord_num.

IT_METHODS-OBJECTKEY+12(4) = WA_AFVC_TMP-vornr.

APPEND IT_METHODS.

CLEAR: IT_METHODS.

IT_COMPONENT-RESERV_NO = wa_resb-rsnum.

IT_COMPONENT-RES_ITEM = wa_resb-rspos.

IT_COMPONENT-MATERIAL = wa_parts-partno.

IT_COMPONENT-PLANT = wa_parts-plant.

IT_COMPONENT-STGE_LOC = wa_parts-sloc.

IT_COMPONENT-BATCH = wa_parts-batch.

IT_COMPONENT-MOVEMENT = 'X'.

IT_COMPONENT-CURRENCY = 'INR'.

IT_COMPONENT-ITEM_CAT = 'L'.

IT_COMPONENT-ITEM_NUMBER = wa_parts-itemno.

IT_COMPONENT-ACTIVITY = WA_AFVC_TMP-vornr.

IT_COMPONENT-UNLOAD_PT = wa_parts-usage.

IT_COMPONENT-REQUIREMENT_QUANTITY = wa_parts-quantity.

IT_COMPONENT-REQUIREMENT_QUANTITY_UNIT = wa_parts-unit.

APPEND IT_COMPONENT.

CLEAR: IT_COMPONENT.

MOVE: 'X' TO IT_COMPONENT_UP-MATERIAL ,

'X' TO IT_COMPONENT_UP-PLANT ,

'X' TO IT_COMPONENT_UP-STGE_LOC ,

'X' TO IT_COMPONENT_UP-BATCH ,

'X' TO IT_COMPONENT_UP-MOVEMENT ,

'X' TO IT_COMPONENT_UP-CURRENCY ,

'X' TO IT_COMPONENT_UP-ITEM_CAT,

'X' TO IT_COMPONENT_UP-ITEM_NUMBER,

'X' TO IT_COMPONENT_UP-ACTIVITY,

'X' TO IT_COMPONENT_UP-UNLOAD_PT,

'X' TO IT_COMPONENT_UP-REQUIREMENT_QUANTITY,

'X' TO IT_COMPONENT_UP-REQUIREMENT_QUANTITY_UNIT.

APPEND IT_COMPONENT_UP.

CLEAR: IT_COMPONENT_UP.

ENDLOOP.

COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

IT_METHODS = IT_METHODS

IT_COMPONENT = IT_COMPONENT

IT_COMPONENT_UP =IT_COMPONENT_UP

RETURN = P_it_RETURN.

*Commit BAPI

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = '5'.

It will help you .

Regards,

Swarup

Edited by: swarup basagare on Jun 6, 2008 10:54 AM

former_member182371
Active Contributor
0 Kudos

Hi,

i don´t know the answer to your question but if found this link relating to the bapi you´re using:

http://sapnet.ru/viewtopic.php?t=483

Maybe you can find something useful there.

Best regards.