Skip to Content
author's profile photo Former Member
Former Member

BAPI_ALM_ORDER_MAINTAIN - Requisition not created on Nonstock component

I am using the code below to try and create 2 nonstock components on an existing order 7201081 - which should create a purchase requisition. The 2 nonstock components are created on the order however the purchase requisition is not created.

I feel the Purchase requisition is not created due to the mrp_relevant flag in the bapi. The bapi's component table says that a value '3' for mrp_relevant should set the purchase requisition to 'Immediately' however it is not doing so - the nonstock component when passed a '3' is always set to 'From Release'.

Has anyone had this issue or know of a solution ? Has anyone been able to use this bapi to create a purchase requisition on a nonstock item ?

Thanks, Michelle

=======SOURCE CODE EXAMPLE ===========================

REPORT zbapi .

DATA t_meth TYPE TABLE OF bapi_alm_order_method.

DATA t_comp TYPE TABLE OF bapi_alm_order_component.

**Internal table for BAPI Return code

DATA t_ret TYPE TABLE OF bapiret2.

***WORK AREA DECLARATIONS

**Work Area for Hedaer

DATA:wa_header TYPE caufvdb,

wa_meth TYPE bapi_alm_order_method,

wa_op TYPE afvgb,

wa_comp TYPE resbb,

wa_comp1 TYPE bapi_alm_order_component,

wa_comp_up TYPE bapi_alm_order_component_up,

wa_oper TYPE bapi_alm_order_operation.

PARAMETERS:TEST.

****Fill Method Internal table

wa_meth-refnumber = '0000001'.

wa_meth-objecttype = 'COMPONENT'.

wa_meth-method = 'CREATE'.

wa_meth-objectkey(12) = '000007201081'.

wa_meth-objectkey+12(4) = '0100'.

APPEND wa_meth TO t_meth.

clear: wa_meth.

wa_meth-refnumber = '0000001'.

wa_meth-objecttype = 'COMPONENT'.

wa_meth-method = 'CREATE'.

wa_meth-objectkey(12) = '000007201081'.

wa_meth-objectkey+12(4) = '0100'.

APPEND wa_meth TO t_meth.

CLEAR wa_meth.

wa_meth-method = 'SAVE'.

APPEND wa_meth TO t_meth.

**Component Internal table

clear: wa_comp1.

wa_comp1-plant = 'PDEL'.

wa_comp1-item_Cat = 'N'.

wa_comp1-item_number = '1100'.

wa_comp1-activity = '0100'.

wa_comp1-price = '1.50'.

wa_comp1-price_unit = '1'.

wa_comp1-preq_name = 'ReqUser'.

wa_comp1-matl_desc = 'Test material 1'.

wa_comp1-requirement_quantity = '235.00'.

wa_comp1-requirement_quantity_unit = 'FT'.

wa_comp1-mrp_relevant = '3'.

APPEND wa_comp1 TO t_comp.

clear: wa_comp1.

wa_comp1-plant = 'PDEL'.

wa_comp1-item_Cat = 'N'.

wa_comp1-item_number = '1100'.

wa_comp1-activity = '0100'.

wa_comp1-price = '2.50'.

wa_comp1-price_unit = '1'.

wa_comp1-preq_name = 'ReqUser'.

wa_comp1-matl_desc = 'Test material 2'.

wa_comp1-requirement_quantity = '100.00'.

wa_comp1-requirement_quantity_unit = 'EA'.

wa_comp1-mrp_relevant = '3'.

APPEND wa_comp1 TO t_comp.

**Call Bapi

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

it_methods = t_meth

it_component = t_comp

return = t_ret.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 07:55 PM

    Michelle,

    There are three settings for the mrp relevant flag.

    1) Never - Never create PR

    2) Immediately - Creates PR as soon as order is created

    3) On release. - creates on order release

    I think setting the flag to 2 should help.

    Thanks and Regards,

    Srihari

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Yes - the BAPI does create the non-stock components on the order - however the flag is set to 'From Release' instead of 'Immediately' and the purchase requisition is not created.

      Yes - a Purchase requisition is created in the standard transaction IW32 for the non-stock components, and the flag is always set to 'Immediately'.

      Yes - I also checked the configuration (path specified below) and for the order type/Plant the flag is set to 'Immediately'.

      Configuration Path:

      Plant Maintenance -> Maintenance and Service Processing -> Maintenance

      and Service Orders -> Functions and Settings for Order Types ->

      Define Change Docs, Collective Purc. Req. Indicator, Operation No.

      Interval

      Michelle

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.