BAPI_ALM_ORDER_GET_DETAIL

Hi all,
i want to call  bapi 'BAPI_ALM_ORDER_GET_DETAIL' for multiple entries of existing order .
how do i call this bapi for the same for multiple entries.
thanks,
Supriya

Hi Jani,
Refer to Note 1164193
Jogeswara Rao k

Similar Messages

  • How to populate complete E_text structure  of BAPI_ALM_ORDER_GET_DETAIL???

    Dear All,
    I want E_text structure of BAPI_ALM_ORDER_GET_DETAIL to be completely populated with data.Currently I am getting data in below fields:
    ORDERID     
    LANGU
    LANGU_ISO
    TEXTSTART
    TEXTEND
    But not getting data in below given fields:
    ACTIVITY
    SUB_ACTIVITY
    RESERV_NO 
    RES_ITEM
    Could you please help me to get data in the above mentioned fields not getting populated.
    I mean where i need to maintain a data to get these fields populated.
    Thanks,
    Neha

    Hi Jani,
    Refer to Note 1164193
    Jogeswara Rao k

  • Error when calling BAPI_ALM_ORDER_GET_DETAIL

    Hi,
    I have a problem a problem when calling this BAPI.
    First I call the BAPI_ALM_ORDERHEAD_GET_LIST where I search for orders entered by myself (with IW31 in the webgui, plant maintenance orders).
    This returns a response with 4 orders and their header data, so far so good.
    When I call the BAPI_ALM_ORDER_GET_DETAIL with the following XML
    <n:BAPI_ALM_ORDER_GET_DETAIL xmlns:n="urn:sap-com:document:sap:rfc:functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <NUMBER>000000815943</NUMBER>     
    </n:BAPI_ALM_ORDER_GET_DETAIL>
    Then I get this in the response:
         <RETURN>
              <item>
                   <TYPE>E</TYPE>
                   <ID>CO</ID>
                   <NUMBER>112</NUMBER>
                   <MESSAGE>Enter order number</MESSAGE>
                   <LOG_NO/>
                   <LOG_MSG_NO>000000</LOG_MSG_NO>
                   <MESSAGE_V1/>
                   <MESSAGE_V2/>
                   <MESSAGE_V3/>
                   <MESSAGE_V4/>
                   <PARAMETER/>
                   <ROW>0</ROW>
                   <FIELD/>
                   <SYSTEM>CF5CLNT800</SYSTEM>
              </item>
              <item>
                   <TYPE>E</TYPE>
                   <ID>IWO_BAPI</ID>
                   <NUMBER>121</NUMBER>
                   <MESSAGE>Error reading the order  in the document tables</MESSAGE>
                   <LOG_NO/>
                   <LOG_MSG_NO>000000</LOG_MSG_NO>
                   <MESSAGE_V1/>
                   <MESSAGE_V2/>
                   <MESSAGE_V3/>
                   <MESSAGE_V4/>
                   <PARAMETER/>
                   <ROW>0</ROW>
                   <FIELD/>
                   <SYSTEM>CF5CLNT800</SYSTEM>
              </item>
         </RETURN>
    If I search for that ID with the webgui then it is found and I can see the details. The ID is also one of the four orders returned by the BAPI_ALM_ORDERHEAD_GET_LIST call.
    Any ideas?
    Thanks
    /Anders
    Edited by: Anders Berglund on Oct 6, 2008 1:39 PM

    Ok, it works if i remove this: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    Looks like a bug but at least it works now..

  • Error in getting details from Bapi BAPI_ALM_ORDER_GET_DETAIL

    Hi,
    I have created Maintenance order by using the bapi BAPI_ALM_ORDER_MAINTAIN.I have used BAPI_ALM_ORDER_GET_DETAIL to get the created maintenance order details.
    i have given the Maintenance order no(4000030) as input for this BAPi(BAPI_ALM_ORDER_GET_DETAIL ).I got the error as "Error reading the 4000030 order in the document table".
    Please any one give me the solution for this and how to get the details for the created maintenance order.
    Thanks,
    guru.

    Hi ,
    In my case the problem is the data is not saving into SAP.I have used customized bapi.
    I think it will be  the same problem for you.Afterusing  this Bapi BAPI_ALM_ORDER_GET_DETAIL you need to commit it inorder to save the data into SAP.So you have to use BAPI_TRANSACTION_COMMIT.
    If you are calling the BAPi BAPI_ALM_ORDER_GET_DETAIL from  xMII , the data will not save in SAP even though you use COMMIT bapi.In that case you need to use Customized Bapi.
    Thanks
    guru.

  • BAPI_ALM_ORDER_GET_DETAIL  : Using Error ?

    When I call this BAPI throw se37 + test - all is OK , I enter order number , smth like 900003 and  obtain result tables.
    But When I write the same in ABAP: 
    DATA:
           BRET LIKE TABLE OF BAPIRET2,
           BRETREC LIKE BAPIRET2.
    START-OF-SELECTION.
    ORDNUM = '900003'.
    CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
      EXPORTING
        NUMBER                 = ORDNUM
      TABLES
       RETURN                 = BRET.
    LOOP AT BRET INTO BRETREC.
      WRITE: / BRETREC-TYPE , BRETREC-MESSAGE.
    ENDLOOP.
    I obtain error :  BRETREC-TYPE  = 'E'  ,
                           BRETREC-MESSAGE = 'Error reading the order in document tables'
    We have only 2 non-optional params , but I try to propose all - the result was th same.
    What's the problem ?

    I think the order number is not exissting or the format is wrong..
    try the conversion functionmodule
    DATA:
    BRET LIKE TABLE OF BAPIRET2,
    BRETREC LIKE BAPIRET2.
    START-OF-SELECTION.
    ORDNUM = '900003'.
    <b>call function 'conversion_exit_alpha_input'
    exporting
    input = ordnum
    importing
    output = ordnum.</b>
    CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
    EXPORTING
    NUMBER = ORDNUM
    TABLES
    RETURN = BRET.
    LOOP AT BRET INTO BRETREC.
    WRITE: / BRETREC-TYPE , BRETREC-MESSAGE.
    ENDLOOP.

  • RFC Failure: Processing Repairable Materials: BAPI_ALM_ORDER_MAINTAIN

    Hello,
    We are using a Function Module BAPI_ALM_ORDER_MAINTAIN Process Maintenance-/Service Order with in
    custom RFC for "Autocreate repair order" and Executes in a separate LUW,
    called in the User Exit EXIT_SAPLMBMB_001 (Customer Function Exit in the Case of Updating a Material Document),
    in the Function Module MB_POST_DOCUMENT.
    We are getting the Short Dump with RFC as Connection Closed no data, where as the Destination is NONE.
    And the respective data is locked, while de-bugging no dump is resulted, seems like before getting the connection closed data is passed to the RFC, but here Destination is NONE,

    Hello,
    Please find the following Code.
    function Z_PM_0491_REPAIR_ORDER.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(T_MSEG) TYPE  CCRCTT_MSEG
    *"     VALUE(T_MKPF) TYPE  CCRCTT_MKPF
    *"  EXCEPTIONS
    *"      PROBLEM
    Description: Autocreate repair order                       *
    Get plant value
      loop at t_mseg into lw_mseg.
      Check if udd is active
        refresh lt_dev.
        call function 'Z_PM_XXXX_DEV_GET_PARAMETERS'
        exporting
          i_udd     = lc_udd_0491
          i_werks   = lw_mseg-werks
        importing
          e_dev     = lt_dev
        exceptions
          not_found = 1
          others    = 2.
        check sy-subrc eq 0 and not lt_dev[] is initial.
      Only for movement type 261
        read table lt_dev into lw_dev index 1.
        check lw_mseg-bwart = lw_dev-zzparameter1(3).
      Check if material is repairable
        move lw_mseg-matnr to lv_objek.
        call function 'CLAF_CLASSIFICATION_OF_OBJECTS'
            EXPORTING
              classtype          = lc_class_001
              object             = lv_objek
              inherited_char     = lc_x
            TABLES
              t_class            = lt_class[]
              t_objectdata       = lt_value_class[]
            EXCEPTIONS
              no_classification  = 1
              no_classtypes      = 2
              invalid_class_type = 3
              OTHERS             = 4.
        if sy-subrc eq 0.
          read table lt_value_class into lw_value with key atnam = lc_ypm_repairable.
          if sy-subrc eq 0.
            if lw_value-ausp1 eq lc_repairable.
            Material is repairable -> get PM order data
              CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
                EXPORTING
                  NUMBER                 = lw_mseg-aufnr
                IMPORTING
                  ES_HEADER              = lw_pheader
                TABLES
                  RETURN                 = lt_bapiret2.
            Continue if data read successfully
              read table lt_bapiret2 with key type = lc_e.
              check sy-subrc ne 0.
            Refresh all tables
              clear: lw_methods, lw_header, lw_operation, lw_component, lw_extension_in.
              refresh: lt_methods, lt_header, lt_operation, lt_extension_in, lt_component, lt_return, lt_numbers.
            Prepare data for suborder creation
            Append following info in the IT_METHODS
              lw_methods-refnumber = 1.
              lw_methods-objecttype = 'HEADER'.
              lw_methods-method = lc_create.
              lw_methods-objectkey = lc_objectkey.
              append lw_methods TO lt_methods.
              lw_methods-refnumber = 1.
              lw_methods-objecttype = 'OPERATION'.
              lw_methods-method = lc_create.
              lw_methods-objectkey = lc_objectkey.
              append lw_methods TO lt_methods.
            We will create a component
              lw_methods-refnumber = 1.
              lw_methods-objecttype = 'COMPONENT'.
              lw_methods-method = lc_create.
              lw_methods-objectkey = lc_objectkey.
              append lw_methods TO lt_methods.
              lw_methods-refnumber = 1.
              lw_methods-objecttype = space.
              lw_methods-method = lc_save_method.
              lw_methods-objectkey = lc_objectkey.
              append lw_methods TO lt_methods.
            Specify header information in IT_HEADER
              lw_header-orderid = lc_orderid.
              lw_header-order_type = lw_pheader-order_type.
              lw_header-planplant = lw_pheader-planplant.
              lw_header-mn_wk_ctr = lw_pheader-mn_wk_ctr.
              lw_header-plant = lw_pheader-planplant.
              lw_header-pmacttype = lc_rev.
              lw_header-funct_loc = lw_pheader-funct_loc.
              lw_header-equipment = lw_pheader-equipment.
              lw_header-priority = lc_3.
              lw_header-start_date = sy-datum.
              lw_header-finish_date = sy-datum + lc_30.
              lw_header-short_text = lw_mseg-matnr.
              shift lw_header-short_text left deleting leading lc_0.
              concatenate lc_repairof lw_header-short_text into lw_header-short_text separated by space.
              lw_header-assembly = lw_mseg-matnr.
              append lw_header to lt_header.
            Update IT_OPERATION
              lw_operation-activity = lc_0010.
              lw_operation-control_key = lc_ypm1.
              lw_operation-plant = lw_pheader-maintplant.
              lw_operation-assembly = lw_mseg-matnr.
              lw_operation-work_cntr = lw_pheader-mn_wk_ctr.
              lw_operation-description = lw_header-short_text.
              append lw_operation to lt_operation.
            Update component in IT_COMPONENT
              lw_component-material = lw_mseg-matnr.
              lw_component-plant = lw_pheader-maintplant.
              lw_component-stge_loc = lw_mseg-lgort.
              lw_component-activity = lc_0010.
              lw_component-item_cat = lc_l.
              lw_component-requirement_quantity = - lw_mseg-menge.
              lw_component-requirement_quantity_unit = lw_mseg-meins.
              append lw_component to lt_component.
            Linking to the superior order: will happen in Badi IBAPI_ALM_ORD_MODIFY
              lw_extension_in-structure = lc_struc.
              lw_extension_in-valuepart1 = lw_mseg-aufnr.
              append lw_extension_in to lt_extension_in.
            Create subordinate order
              call function 'BAPI_ALM_ORDER_MAINTAIN'
                tables
                  it_methods = lt_methods
                  it_header = lt_header
                  it_operation = lt_operation
                  extension_in = lt_extension_in
                  it_component = lt_component
                  return = lt_return
                  et_numbers = lt_numbers.
              read table lt_return into lw_return with key type = lc_e.
              if sy-subrc ne 0.
              If all went well, commit order creation
                clear lw_return.
                call function 'BAPI_TRANSACTION_COMMIT'
                    exporting
                      wait   = 'X'
                    importing
                      return = lw_return.
              else.
              Otherwise raise exception
                raise problem.
              endif.
            endif.
          endif.
        endif.
      endloop.
    endfunction.

  • Error while using BAPI_ALM_ORDER_MAINTAIN

    Dear Experts,
    Greetings.
    I am using BAPI_ALM_ORDER_MAINTAIN to change the quantity of the Material Components of a Process Order using BAPI_ALM_ORDER_MAINTAIN. The BAPI returns an error message saying 'Entry Pegged requirement = 12345(Header Material of the Process Order) does not exist in  (check entry)'.
    Request you to throw some light on this so that i can fix this issue with your guidance.
    Also, Can I add new material components obtained from external source using the same BAPI? If Yes, Request you to provide some pointers for the same.
    Below is the code that I have written to achieve my first requirement. Please do let me know in case any correction is required.
        CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number            =  l_aufnr
        IMPORTING
          es_header        = wa_header
        TABLES
          et_partner         = it_partner
          et_operations    = it_oper
          et_components = it_comp
          et_relations      = it_relat
          et_texts           = it_text
          et_text_lines     = it_text_lines
          et_prts             = it_prt
          et_costs_sum     = it_cost
          et_costs_details = it_cost_det
          return           = it_return.
      w_anfme = w_pqty.
      LOOP AT it_comp WHERE batch = l_charg.
    * Change the component qty of the process order
        MOVE-CORRESPONDING it_comp TO it_component.
        CLEAR : w_anfme.
        w_anfme = it_comp-withd_quan.
        it_component-requirement_quantity =  w_anfme.
        APPEND it_component.
        CLEAR it_component.
        it_component_up-requirement_quantity = 'X'.
        APPEND it_component_up.
    * Fill the method used in the BAPI
        it_method-refnumber = '1'.
        it_method-objecttype = ' '.
        it_method-method = 'SAVE'.
        it_method-objectkey = l_aufnr.
        APPEND it_method.
        CLEAR it_method.
        it_method-refnumber = '1'.
        it_method-objecttype = 'COMPONENT'.
        it_method-method = 'CHANGE'.
        it_method-objectkey = l_aufnr.
        APPEND it_method.
        CLEAR it_method.
      ENDLOOP.
    * Update the qty of the component
      CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
        TABLES
          it_methods      = it_method
          it_component    = it_component
          it_component_up = it_component_up
          return          = it_return.
    Thanks a lot in advance.
    Regards,
    Ram

    Hi Saipriya,
    Thanks for your response to my query.
    As far as the flag in the internal table it_component is concerned, I have already done that. I shall put the internal table it_method outside the loop now.
    However, when I try doing a dry run of the mentioned BAPI by passing the appropriate parameters in SE37, I am getting the same error. Here, the internal table it_method is not inside the loop. It must work right? I suppose the reason could be something else.
    Please do let me know your views on the same.
    Thanks again for your time.
    Regards,
    Ram

  • BAPI_ALM_ORDERHEAD_GET_LIST by CREATE_DATE does not return expected result.

    Hi,
    I am trying to retrieve an Order I have manually created on an ECC6.0 system with Order ID 816149.
    I can retrive the order fine using BAPI_ALM_ORDER_GET_DETAIL passig in the Order ID.
    However, if I use BAPI_ALM_ORDERHEAD_GET_LIST with IT_RANGE set on the ENTER_DATE criteria, I get a bunch of Orders back from the search but not mine. However, the creation date of my Order is within the search range. I suspect the problem might be the System Status of my order (but I am just guessing) which is CRTD MANC NMAT NTUP. The User Status is CRTD though, so I am a bit puzzled as to why my order is not in the returned result set. For instance Order 816148 (created by someone else) is returned and it looks very similar to mine (except for the status).
    If any help from SAP people, I am using an ICC Test system so maybe you can have a look for yourself. My system is CF5 / cpcf501 / 05 client 800.
    Cheers.
    JR

    Please pass
    Exporting
    DISPLAY_PARAMETERS
    CALL FUNCTION 'BAPI_ALM_ORDERHEAD_GET_LIST'
    EXPORTING
       DISPLAY_PARAMETERS       =
    " IMPORTING
    "   NAVIGATION_DATA          =
      TABLES
        IT_RANGES                =
        ET_RESULT                =
    "   ET_TEMPLATE              =
        RETURN                   =
    Regards,
    Lalit Mohan Gupta.

  • Change components and Routing of production order

    Hi, experts, I have such requirement that change quantity of a component or add a component, add a operation into current routing.
    I have look up answer, but can not find the right one.
    BAPI_PRODORD_CHANGE only can change header data.
    BAPI_ALM_ORDER_MAINTAIN seems can not change production orders, it is for service orders.
    CO_XT_ORDER_CHANGE will assign a new  routing number and a new bom number.
    Could somebody give me some FM and BAPI for reference? Thanks in advance.

    Hi Rick,
    Follow the below sample steps for changing component quantity:
    DATA:
        l_methods TYPE bapi_alm_order_method,
        it_boperations TYPE STANDARD TABLE OF  bapi_alm_order_operation_e WITH HEADER LINE,
        it_components TYPE STANDARD TABLE OF bapi_alm_order_component_e WITH HEADER LINE,
        it_components1 TYPE STANDARD TABLE OF bapi_alm_order_component WITH HEADER LINE.
    1. Call BAPI :BAPI_ALM_ORDER_GET_DETAIL , it will give existing order component details.
    CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number        = <production order number>
        TABLES
          et_operations = it_boperations
          et_components = it_components
          return        = it_bapiret2.
    2. Move it_components to components table compatibel to BAPI "BAPI_ALM_ORDER_MAINTAIN".
    LOOP AT it_components.
    MOVE-CORRESPONDING it_components TO it_components1.
    _*"Note here while moving change the component quantity"*_
    APPEND it_components1.
    CLEAR it_components1.
    ENDLOOP.
    3. Build the methods table for change production order :
    it_methods-refnumber = v_refnumber.
                it_methods-objecttype = 'COMPONENT'.
                it_methods-method = 'CHANGE'.
                it_methods-objectkey = v_objectkey.
                APPEND it_methods.
    "Note v_refnumber has 1 to 1 relation ship with the components table, if you want to change First component in it_components1 then you have to enter value '1' here for v_refnumber.
    it_methods-method = 'SAVE'.
            APPEND it_methods.
    4 . Call
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
              TABLES
                it_methods   = it_methods
                it_component = it_components1
                return       = it_bapiret2.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  • IDoc creation on save and change of production order

    I am looking for a way to create, and send if possible (if not I'll send with a batch job), on the save (creation and change) of production orders.  This will be a modified LOIPRO iDoc.  Currently we have a customer exit on the save of the production order but because it is before the save we must predict the number of the prod order.  This has worked but now we are creating one production order per line item in a sales order (automatically) so this is causing us to predict the same production order number twice.  We need a way to automatically create and send an iDoc for all production orders for given plants.  Right now the solution we are looking at is creating an output type and running through those output types a few times a day, sending them down to the Shop Floor system (proprietary system). 
    Is there anything setup in SAP that we can utilize?
    Regards,
    Davis

    Hi Rick,
    Follow the below sample steps for changing component quantity:
    DATA:
        l_methods TYPE bapi_alm_order_method,
        it_boperations TYPE STANDARD TABLE OF  bapi_alm_order_operation_e WITH HEADER LINE,
        it_components TYPE STANDARD TABLE OF bapi_alm_order_component_e WITH HEADER LINE,
        it_components1 TYPE STANDARD TABLE OF bapi_alm_order_component WITH HEADER LINE.
    1. Call BAPI :BAPI_ALM_ORDER_GET_DETAIL , it will give existing order component details.
    CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number        = <production order number>
        TABLES
          et_operations = it_boperations
          et_components = it_components
          return        = it_bapiret2.
    2. Move it_components to components table compatibel to BAPI "BAPI_ALM_ORDER_MAINTAIN".
    LOOP AT it_components.
    MOVE-CORRESPONDING it_components TO it_components1.
    _*"Note here while moving change the component quantity"*_
    APPEND it_components1.
    CLEAR it_components1.
    ENDLOOP.
    3. Build the methods table for change production order :
    it_methods-refnumber = v_refnumber.
                it_methods-objecttype = 'COMPONENT'.
                it_methods-method = 'CHANGE'.
                it_methods-objectkey = v_objectkey.
                APPEND it_methods.
    "Note v_refnumber has 1 to 1 relation ship with the components table, if you want to change First component in it_components1 then you have to enter value '1' here for v_refnumber.
    it_methods-method = 'SAVE'.
            APPEND it_methods.
    4 . Call
    CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
              TABLES
                it_methods   = it_methods
                it_component = it_components1
                return       = it_bapiret2.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  • FM for Service Order

    hi,
    require a FM for Service order Details IW73.
    cheers,
    Aditya.

    Did you try BAPI_ALM_ORDER_GET_DETAIL?
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • How to get worj orders for a plant maintanance

    hai gurus can any one tell me what are the function modules or  bapis which are used for creation and reading the work orders
    thanx afzal

    hi
    check the following Bapis
    <b>BAPI_ALM_ORDER_MAINTAIN</b>
    COXT_BAPI_ORDER_CREATE
    BAPI_ALM_ORDER_GET_DETAIL
    BAPI_ALM_ORDER_MAINTAIN
    BAPI_STANDING_ORDER_CREATE
    BAPI_PLANNEDORDER_CHANGE
    BAPI_PLANNEDORDER_CREATE
    IBAPI_R_REL_SET_WORKCENTER
    IBAPI_R_CHECK_WORKCENTER
    Have a look at the following documentation.
    BAPI_ALM_ORDER_MAINTAIN
    Text
    Process Maintenance-/Service Order
    Functionality
    This Business Application Programming Interface (BAPI) is used for changing maintenance- or service orders and their lower-level objects. The following objects of an order can be processed (for restrictions, see the note at the end of the documentation):
    Order header
    Partner
    User status
    Order operations
    Relationships
    Components
    Long texts for order header, operations, and components
    Function
    Calling up this BAPI once allows you to perform all the operations. For this the system supplies the function module with a method table containing the methods to be performed. The entries in the method table refer to data records in the optionally filled-out data tables. All the methods from the method table are performed. Alternatively, just lower- level objects from existing orders can be changed.
    You can process the transferred data with the Business Add-In (BAdI) IBAPI_ALM_ORD_MODIFY to, for example, merge data from the external system with data from the R/3 system. The BAdI is called up as soon as the transferred data is converted into the internal format. The tests then take place after this.
    Construction of Method Table
    REFNUMBER Reference number for linking object methods - attributes
    The reference number is the line of the database which contains the corresponding data. The data table is determined by the object type.
    OBJECTTYPE Object category
    The object category specifies which object from the order should be processed. The key words listed here are not language-dependent and must be transferred exactly as they are. The following objects exist:
    HEADER Order header
    PARTNER Partner data
    USERSTATUS User status
    OPERATION Operation data
    RELATION Relationships
    COMPONENT Components
    TEXT Long texts
    (empty) ,General BAPI functions (save)
    METHOD Methods
    The methods with which the data should be processed. The following functions exist:
    CREATE Create objects
    CHANGE Change objects
    DELETE Delete objects
    RELEASE Release
    TECHNICALCOMPLETE Technically complete
    ATPCHECK Availability check
    CALCULATE Calculate
    SCHEDULE Schedule
    DELELTEDSEX Delete the status for external scheduling at operation level
    SAVE Save all data
    DIALOG Call-up dialog. See explanation below.
    TRACE Write trace file in the specified file to the frontend
    OBJECTKEY SAP external object key
    This key is for assigning the lower-level objects correctly to the corresponding objects, as there is always just one key in the data table. The key must have the following structure:
    1-12 Order number
    When creating orders with internal number assignment, a reference number beginning with % must be entered here. The BAPI then returns this number and the number actually assigned.
    13-16 Operation number
    17-20 Sub-operation number
    For relationships, the key is structured as follows:
    1-12 ,Order number from
    13-16 Operation number from
    17-28 Order number to
    29-32 Operation number to
    The following methods are permissible for the individual objects:
    HEADER:
    CREATE, CHANGE, RELEASE, TECHNICALCOMPLETE, ATPCHECK, CALCUALTE, SCHEDULE
    OPERATION
    CREATE, CHANGE, DELETE, DELETEDSEX
    PARTNER, RELATION, COMPONENT, USERSTATUS, TEXT:
    CREATE, CHANGE, DELETE
    (empty):
    SAVE, DIALOG, TRACE
    Data tables and update tables
    The objects have one or more data tables. For some objects you can specify which of the fields specified in the structure should be changed. For this you must set the field in the corresponding table to X as in the data table. If no update-table is transferred, then only those fields are set that have a value that is not initial. This simplifies the transfer data. However, this means it is not possible to delete fields. If an update structure should only be specified for some data records, the table with the update fields must nonetheless have the same amount of lines as the data table. The empty lines are then treated as if no update structure was transferred. The objects "Partner", "User Status", and "Text" have no update tables. The whole data record is always copied here.
    References
    The objects use the field REFNUMBER from the method table to refer to the lines in the data table. Counting always begins with 1. In doing this, REFNUMBER also refers to the update table. However, in the method table there is a second reference to higher-level objects for lower-levels objects. The field OBJECTKEY must be filled with order number, operation number, and sub-operation number, as specified above. If lower-level objects of a newly-created order should be changed, then you must enter a temporary order number that must begin with %. Several orders can be numbered serially, for example, with %00000000001, %00000000002 ... .
    The following objects have special treatment for REFNUMBER:
    Partner
    Texts
    Partners have an order number in the data table. During processing of the method table, all those entries in the data table are processed which have an order number that is the same as that in the line to which the method refers. Thus, through just one entry in the method table, several partners can be changed.
    Texts are composed of two tables. The first table (IT_TEXT) is made up of the header data of the text. Here you must specify the object and the first and last line of the text table (respectively inclusive, counting from 1). Through this, a line segment is specified in the text line table (IT_TEXT_LINES).
    Peculiarities in processing
    The BAPI processes the transferred methods in a particular sequence, which must not correspond to the sequence in the methods table.
    Write trace file
    Change user status time period 1
    Delete objects (dependent first)
    Create new objects
    Change existing or newly-created objects
    Change user status time period 2
    Status change of order
    Save data
    The methods are performed such that lower-level objects can also be assigned to newly-created objects. For example, first the operations are created, and then the components. Long texts can also be created for the objects.
    Components have an exceptional position. Components are created through the assignment to an operation, that is, using the "key" order/ operation (item number). However, as this is not the unique component key, you can only access the components to change them, delete them, or add long texts by using the reservation number/-item, which is only given after saving. This means that, for example, you cannot create a long text when you create the component.
    User status changes can take place at two different time points. Time point 1 is before the object changes, time point 2 is after the object changes and before the status change of the system. These time points should be defined in the transfer table in the field CHANGE_EVENT. The field documentation contains the possible values.
    The external scheduling is offered by the BAPI as a special function. THe BAPI can set the date field directly at the operation level, and select the operation with the status DSEX "Date set by external system". This status prevents any further scheduling of the operation, it keeps the transferred dates. For this, set the category 'X' in the restriction categories. When reading the operation, this category is also returned, independent of the category of restriction set in the dialog. To delete the status, you can call up the method DELETEDSEX for the object operation. The external scheduling cannot be influenced in the dialog. All changes to the scheduling restrictions in the dialog are saved as normal, but are not relevant for the scheduling as long as the status DSEX is active.
    Every time the BAPI is called up, a SAVE or DIALOG method must be transferred. Normally, calling up a BAPI is seen as a transaction. All data that is changed in the BAPI should be saved to the database immediately. The BAPI checks whether a SAVE method exists, otherwise it terminates processing. A test run of the BAPI is composed of a normal call-up using the SAVE method and a subsequent BAPI_TRANSACTION_ROLLBACK. To call up the BAPI without the SAVE method, for example, to realize dialog transactions, the BAPI can be called up with the DIALOG method. This switches off the check for the SAVE method. The processor must then ensure that later either a SAVE method or a BAPI_TRANSACTION_ROLLBACK is called up.
    A BAPI_TRANSACTION_COMMIT without SAVE method terminates processing in the update to ensure that no inconsistent data is written to the database. The processor who called up the BAPI does not receive any confirmation for the termination of the update in the target system. This logic is necessary as the order data was flagged for updating with BAPI_TRANSACTION_COMMIT through the SAVE method. However, the status information was already flagged for updating when the BAPI was called up. A BAPI_TRANSACTION_COMMIT without SAVE method then just saves the status information and would generate inconsistent orders, if the updating was not terminated.
    Customer Enhancement
    The BAdI IBAPI_ALM_ORD_MODIFY can be used to change the transferred data. The BAdI is called up after the conversion of the transfer structure into the structures used internally. Additional data can be transferred using the table EXTENSION_IN. Only then is the data checked.
    Example
    The following examples should clarify the use.
    Creating an order
    OBJECTKEY should be filled with a temporary key. The BAPI returns this key together with the assigned order number in the return table ET_NUMBERS . The order number in the HEADER table should also be filled with the number. For external number assignment, the external number should be specified. The update structure can be transferred if necessary.
    Methods table
    REFNUMBER OBJECTTYPE METHOD OBJECTKEY
    1 HEADER CREATE %00000000001
    IT_HEADER
    ORDERID ORDER_TYPE PLANPLANT ...
    %00000000001 PM01 1000 ...
    Creating an order with operation and long text
    Methods table
    REFNUMBER OBJECTTYPE METHOD OBJECTKEY
    1 HEADER CREATE %00000000001
    1 OPERATION CREATE %00000000001
    1 TEXT CREATE %000000000010010
    IT_HEADER
    ORDERID ORDER_TYPE PLANPLANT ...
    %00000000001 PM01 1000 ...
    IT_OPERATION
    ACTIVITY SUB_ACTIVITY CONTROL_KEY WRK_CNTR ...
    10 PM01 MECHANIC ...
    IT_TEXT
    ACTIVITY ... TEXTSTART TEXTEND
    10 ... 1 2
    IT_TEXT_LINES
    TDFORMAT TDLINE
    Longtext for operation 10, line 1
    Line 2 of the long text
    Notes
    Using the BAPI to process the order data cannot support all the functions of the transaction. This applies in particular for the following functions:
    Order header data
    The object list cannot be processed.
    Refurbishment orders are not supported.
    The estimated costs cannot be processed - only the estimated overall costs of the order.
    Notification data cannot be processed with the order BAPI. Even if the settings in Customizing are such that the orders and notifications can be maintained on one screen, no notification is created for the order.
    Permits cannot be processed.
    The order addresses cannot be processed.
    Individual partner addresses cannot be maintained.
    The settlement rule cannot be maintained.
    Order functions
    Printing the papers is not possible.
    Locking and unlocking the order is not possible.
    Accepting and rejecting quotations is not possible.
    Business completion is not possible.
    Flagging for deletion is not possible.
    The log cannot be displayed.
    User default values are not used.
    The field selection is not checked.
    The Customer Exits/BAdIs are not executed completely.
    Joint ventures are not supported.
    Funds Management is not supported.
    Investment orders are not supported.
    No integration of service products with task lists possible.
    No integration of configurable service products possible.
    Assignment of sales document items with service products in accordance with the aforementioned conditions.
    Operation data
    A change of the control key in the operation is not possible, if this leads to a change of the processing type (internal-/external processing)
    User status change not possible.
    Production resources and tools cannot be processed.
    Service lines cannot be processed.
    Task list integration is not supported.
    Linking operations with object list is not supported.
    Component data
    User status change not possible.
    BOM data cannot be processed.
    The delivery address cannot be processed.
    Further Information
    See also the documentation for the individual transfer tables.
    Parameters
    IT_METHODS
    IT_HEADER
    IT_HEADER_UP
    IT_HEADER_SRV
    IT_HEADER_SRV_UP
    IT_USERSTATUS
    IT_PARTNER
    IT_PARTNER_UP
    IT_OPERATION
    IT_OPERATION_UP
    IT_RELATION
    IT_RELATION_UP
    IT_COMPONENT
    IT_COMPONENT_UP
    IT_TEXT
    IT_TEXT_LINES
    EXTENSION_IN
    RETURN
    ET_NUMBERS
    Exceptions
    Function Group
    IBAPI_ALM_ORDER
    regards
    vijay
    <b>reward points if helpful</b>

  • Work order header information from BAPI_ALM_ORDERHEAD_GET_LIST

    Upfront I'll admit that this question likely falls outside of MII as I am getting bad results in SE37 as well.  Was hoping others in this group have experience with this.
    When I use BAPI_ALM_ORDERHEAD_GET_LIST there are several work orders that do not get returned, and I can't figure out why, or even what is the common thread between them.  The missing orders are viewable via iw33, and information can also be returned from BAPI_ALM_ORDER_GET_DETAIL.
    Right now, the only thing I pass in OPTIONS_FOR_ORDERID with a range of orders (ie 20 or so).  Orders are returned in the correct range, just not the one I am looking for.
    Rod

    Hi Rod,
    The only thing I can think of is that there are times where orders (or other objects) are created outside of normal procedures.  My experience was with Batch histories, but if the objects are not created in the normal process (a nebulous term at best), they will sometimes not be stored in all the proper tables.  Can you check the processing history of the orders missing to see if there are any discrepancies there? 
    Otherwise, you may need to get some ECC side help.  The ABAP code in the underlying function module may direct you to all the tables which should be populated with the correct data so you can check which tables are not populated. 
    An alternative option for getting the work order header information would be to go back to the old reliable RFC_READ_TABLE.
    Good luck,
    Mike
    Edited by: Michael Appleby on Feb 12, 2011 4:13 PM

  • Processing happens only in debug mode.

    Hi,
    I am calling an RFC enabled FM BAPI_ALM_NOTIF_DATA_MODIFY and BAPI_ALM_NOTIF_SAVE to modify the data of a notification. These function modules are called within another FM which is also a RFC called in background as a separate task. The problem here is that, the data gets modified fine only when I am in the debugging mode and execute it. But if I execute without going to the debug mode, I cannot modify the notification data. Kindly suggest why this is happening and what the solution is. Thanks

    I am not using any destination. The code is as shown:
      WAIT UP TO 5 SECONDS.
      CALL FUNCTION 'BAPI_ALM_ORDER_GET_DETAIL'
        EXPORTING
          number                 = aufnr
       IMPORTING
         es_header              = gf_header
        TABLES
         et_olist               = it_ord_notif
          return                 = it_ret
    CALL FUNCTION 'BAPI_ALM_NOTIF_GET_DETAIL'
      EXPORTING
        number                   = gf_header-notif_no
    IMPORTING
       NOTIFHEADER_EXPORT       = gf_notif_exp
            CLEAR: gf_notif_no.
            DESCRIBE TABLE it_notif_no LINES g_line.
            READ TABLE it_notif_no into gf_notif_no INDEX g_line.
            IF gf_notif_no-short_text+0(3) = 'PRB'.
             clear: gf_notif_imp, gf_notif_imp_x.
                gf_notif_imp-desstdate = gf_notif_exp-desstdate.
                gf_notif_imp-desenddate = gf_notif_exp-desenddate.
                gf_notif_imp_x-desstdate = 'X'.
                gf_notif_imp_x-desenddate = 'X'.
                CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
                      EXPORTING
                        number                   = gf_notif_no-notif_no
                       NOTIFHEADER              = gf_notif_imp
                       NOTIFHEADER_X            = gf_notif_imp_x
                     IMPORTING
                       NOTIFHEADER_EXPORT       = gf_notif_result
                     TABLES
               CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
      EXPORTING
        number            = gf_notif_no-notif_no
    IMPORTING
      NOTIFHEADER       = gf_qmnum_save
    TABLES
       RETURN            = it_ret2.
              endif.
                clear: gf_notif_no.
            LOOP AT it_notif_no INTO gf_notif_no.
              IF gf_notif_no-short_text+0(3) = 'PRB'.
                SELECT SINGLE objnr FROM viqmel
                                                      INTO g_objnr
                                                     WHERE qmnum = gf_notif_no-notif_no.
                SELECT SINGLE stsma INTO g_stsma FROM jsto WHERE objnr = g_objnr.
                SELECT SINGLE estat INTO g_stat FROM tj30t WHERE stsma = g_stsma AND
                  spras = 'EN'
                  AND txt04 = 'SFMR'.
                CALL FUNCTION 'STATUS_CHANGE_EXTERN'
                  EXPORTING
                    check_only          = ' '
                    client              = sy-mandt
                    objnr               = g_objnr
                    user_status         = g_stat
                    set_inact           = ' '
                    set_chgkz           = 'X'
                    no_check            = ' '
                  EXCEPTIONS
                    object_not_found    = 1
                    status_inconsistent = 2
                    status_not_allowed  = 3
                    OTHERS              = 4.
                IF sy-subrc = 0.
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.

  • How to archive Account Maintenance Documents created by MR11

    Hello,
    when I have goods receipts but no invoice is sent from the vendor for these receipt the items stay on the GR/IR clearing account. As a result the purchase order cannot be archived. I can clear these items using MR11 and I receive an account mainenance document for this. Now the according purchase order can be archived but how can I archive the account maintenance document itself and the according FI documents?
    Thanks

    HI,
    Have you tried BAPI_ALM_ORDER_GET_DETAIL for fetching components details. Actually we have used it to get some other details.
    Regards
    Shakti

Maybe you are looking for

  • Client authentication not working

    Hi all, I am using Apache's HTTPClient to connect with a server running https. The server is the latest stable Tomcat (version 4.1.27). If I set clientAuth="false" in the Tomcat configuration, everything is working fine. I am able to comunicate with

  • Creative Mp3 Players MTP Problem Solution

    Hi,because of the firmware and windows problems,if you have a mp3 player with a firmware that doesn't support MTP problem,sometimes even if you reformat your computer,you can get "player not connected" error. To solve this you must install MTP suppor

  • Has anyone had trouble connecting Macbook Pros to Bluetook enabled Speaker?

    I've been trying to connect a Bluetooth enabled Soundlink stereo to my MacBook Pro via bluetooth, but am having great difficulty keeping the two devices connected.  Anyone else experienced this/know a fix?  I've done all necessary software updates. 

  • Function module for converting number to exponential???

    Hi All   please tell me Function module for converting number to exponential. Deepak

  • How to get new SDK licence

    Hi all, I download a licence from bea.com at Apr 1, the licence at Apr 20 EXPIRATION, now I download it ,the EXPIRATION is Apr 20 too. I don't know why. jack