Object key in BAPI_ALM_ORDER_MAINTAIN

Dear Experts,
The situation is that I have to change data in the componenten in an order ( IW32 ) and I try to get it done by using a bapi called BAPI_ALM_ORDER_MAINTAIN .
This is how I've done it so far
Fill Method Internal table
      wa_meth-method = 'SAVE'.
      APPEND wa_meth TO t_meth.
Fill components
        wa_meth-refnumber   = sy-tabix.
        wa_meth-objecttype  = 'COMPONENT'.
        wa_meth-method      = 'CHANGE'.
        wa_meth-objectkey(12)   = aufnr.                " ES_HEADER-orderID (order no.)
        wa_meth-objectkey+12(4) = wa_in-activity.       " ET_COMPONENT-activity (operation no.)
        wa_meth-objectkey+16(4) = wa_in-res_item.       " ET_COMPONENT-ITEM (suboperation no.)
        APPEND wa_meth TO t_meth.
Could anyone give me some explanation about BAPI_ALM_ORDER_MAINTAIN and its object key.

CONSTANTS: c_1(1) TYPE c VALUE '1',
             c_header(6) TYPE c VALUE 'HEADER',
             c_change(6) TYPE c VALUE 'CHANGE'.
MOVE: c_1            TO wa_methods-refnumber,
        c_header       TO wa_methods-objecttype,
        c_change       TO wa_methods-method,
        wa_final-aufnr TO wa_methods-objectkey.
  APPEND wa_methods     TO it_methods.
  MOVE: wa_final-aufnr   TO wa_header-orderid,
        wa_final-auftext TO wa_header-short_text.
  APPEND wa_header TO it_header.
  MOVE: wa_final-aufnr TO wa_header_up-orderid,
        gc_x           TO wa_header_up-short_text,
        gc_x           TO wa_header_up-start_date,
        gc_x           TO wa_header_up-finish_date.
  APPEND wa_header_up TO it_header_up.
CONSTANTS: c_operation(9) TYPE c VALUE 'OPERATION',
             c_change(6)    TYPE c VALUE 'CHANGE'.
  gv_tabix = gv_tabix + 1.
*Method Details
  MOVE: gv_tabix         TO wa_methods-refnumber,
        c_operation      TO wa_methods-objecttype,
        c_change         TO wa_methods-method,
        wa_final-aufnr   TO wa_methods-objectkey,
        wa_final-vornr   TO wa_methods-objectkey+12(4).
  APPEND wa_methods TO it_methods.
*Values
  MOVE: wa_final-vornr      TO wa_operation-activity, "Operation
        wa_final-ltxa1      TO wa_operation-description. "Opr. short text
  REPLACE ALL OCCURRENCES OF ',' IN wa_final-arbeit WITH '.'.
  REPLACE ALL OCCURRENCES OF ',' IN wa_final-daunor WITH '.'.
  REPLACE ALL OCCURRENCES OF ',' IN wa_final-anzkap WITH '.'.
  REPLACE ALL OCCURRENCES OF ',' IN wa_final-duration_relation WITH '.'.
  MOVE: wa_final-arbeit     TO wa_operation-work_activity,  "Duration
        wa_final-arbeite    TO wa_operation-un_work, "Unit for Work Activity
        wa_final-daunor     TO wa_operation-duration_normal. "Duration
  MOVE: wa_final-daunore TO wa_operation-duration_normal_unit, "Normal
                                                     "Duration Unit
        wa_final-anzkap  TO wa_operation-number_of_capacities, "# Resources
        wa_final-arbpl   TO wa_operation-work_cntr. "Operation Work Center
  MOVE wa_final-indet TO wa_operation-calc_key.
  APPEND wa_operation TO it_operation.
*Update Flag
  MOVE: gc_x TO wa_operation_up-activity, "Operation
        gc_x TO wa_operation_up-description, "Opr. short text
        gc_x TO wa_operation_up-work_activity,  "Duration
        gc_x TO wa_operation_up-un_work,  "Unit for Work Activity
        gc_x TO wa_operation_up-duration_normal, "Duration
        gc_x TO wa_operation_up-duration_normal_unit,
                                             "Normal Duration Unit
        gc_x TO wa_operation_up-number_of_capacities, "# Resources
       gc_x to wa_operation_up-start_cons, "Start Date
       gc_x to wa_operation_up-fin_constr, "Finish Date
        gc_x TO wa_operation_up-work_cntr, "Operation Work Center
        gc_x TO wa_operation_up-calc_key.    "calculation key
  APPEND wa_operation_up TO it_operation_up.
CONSTANTS: c_relation(8) TYPE c VALUE 'RELATION',
             c_change(6)   TYPE c VALUE 'CHANGE'.
  IF wa_final-order_predecessor IS NOT INITIAL.
    gv_relation = gv_relation + 1.
    MOVE: gv_relation     TO wa_methods-refnumber,
          c_relation      TO wa_methods-objecttype,
          c_change        TO wa_methods-method,
          wa_final-aufnr  TO wa_methods-objectkey,
          wa_final-aufnr  TO wa_methods-objectkey+16(12).
    "Pass this value for Operations
    APPEND wa_methods TO it_methods.
    MOVE: wa_final-order_predecessor     TO wa_relation-order_predecessor,
          wa_final-operation_predecessor TO wa_relation-operation_predecessor,
          wa_final-order_successor       TO wa_relation-order_successor,
          wa_final-operation_successor   TO wa_relation-operation_successor,
          wa_final-relation_type         TO wa_relation-relation_type,
          wa_final-duration_relation_unit TO wa_relation-duration_relation_unit,
          wa_final-duration_relation      TO wa_relation-duration_relation.
    APPEND wa_relation TO it_relation.
    MOVE: gc_x TO wa_relation_up-relation_type,
          gc_x TO wa_relation_up-duration_relation_unit,
          gc_x TO wa_relation_up-duration_relation.
    APPEND wa_relation_up TO it_relation_up.
  ENDIF.
MOVE c_save TO wa_methods-method .
  APPEND wa_methods TO it_methods.
  CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
    TABLES
      it_methods      = it_methods
      it_header       = it_header
      it_header_up    = it_header_up
      it_operation    = it_operation
      it_operation_up = it_operation_up
      it_relation     = it_relation
      it_relation_up  = it_relation_up
      return          = it_return.

Similar Messages

  • Object key mapping in KSSK table

    Hi All,
    We are facing an issue wherein SAP BW Job is failing as it is not able to pull the data for Hierachy from SAP.
    When we checked the details it seems that there is an error entry in table KSSK.
    However- the table has class type 026 and object key value.
    We are not able to figure it based on the object key that what is error entry.
    I need info to trace back how to find out the error entry based on Object key from table KSSK.

    We had found out the entry which was erroneous and removed the entry.
    Find out the object key and connection between KLAH and KSSK table and they we deleted the erroneous entry from KSSK table. We spoke to SAP in this regards and the entry was created due to reclassification by user for one article.
    The entry was deleted from Table using SE16n.

  • How to get object key before load data into form?

    I need to get object key (e.g. ItemCode in Item Master Data From ,docEntry in A/R Invoice From) to calculate and do something  before data is loaded into this form .
    I try to use SAPbouiCOM.BusinessObjectInfo.objectKey as in this code.
    Private Sub oApp_FormDataEvent(ByRef pVal As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent
           If pVal.FormTypeEx = "672" And pVal.BeforeAction = True And pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD Then
                   oApp.MessageBox(pVal.ObjectKey)
           End If
    End Sub
    But this fields doesn't valid under this condition (form DI help file).
    - The property returns an empty value in the before notification of the Load action (et_FORM_DATA_LOAD) triggered by a Find operation.
    How can I get this value(key)?

    Janos
    I can't do a calculation after data is loaded because what I'm going to do is that if the opening entry match my condition , the system will not let that user see that entry (bubbleEvent = False).
    I think when formDataEvent is triggered B1 know which entry are going to load because before this event is triggered we did one of following ways
    1. choose from "choose from list windows"
    2. enter docEntry or itemCode or cardCode  and then press Find Button
    3. press "next/previous record button"
    4. press linked button (orange arrow)
    Choice 3 and 4 can be done by retrieve data from BusinessObjectInfo.objectKey (I've tested and it return entry key that is going to open correctly).
    but 1 and 2 can't (it return empty as I mention before).
    thanks
    Edited by: daron tancharoen on Aug 5, 2008 2:34 PM

  • Creation of new Personalization object keys

    Hi All,
    Is it possible to create new personalization object key for a role for eg: in SRM we have personalization objects keys BBP_SPEND_LIMIT and BBP_APPROVAL_LIMIT already defined by SAP. In case we need to define the same kind of spend limits for users in MM. Can we define new personalization objects keys ? If yes let me know what are the steps
    I am aware of the transaction PERSREG, but not sure of its uses.
    Regards,
    SC

    Hi,
    PERSREG is the right one for defining the pers.key.
    I think the problem will be, if and how your new key shall be handled by the applications coding....
    Maybe MM offers some exits or whatever to verify own personalizaiton keys?
    b.rgds, Bernhard

  • To get the Workflow status using the Object Key

    Hi Experts,
    Do we have any transaction code or a Standard table where I can see the status of the Workflow using the Object Key.
    For example I have an Invoice Document number for which a Workflow has been triggered and now I want to see the which workflow has been triggered and what is the status for the same. I have only the Invoice Document Number.
    I think I can use the SWI1, SWEL etc but I don't have Object key as Input field.
    Thanks in advance.
    Regards,
    SRinivas

    Hi,
    You can find the workitem id in table SWW_WI2OBJ.
    Here you need to pass the invoice number in "Instacne ID" with leading zeros, business object in Object type.
    This may take little bit longer time.
    After getting the workitem number then look into table SWWWIHEAD for the workitem status.
    Thanks and regards,
    SNJY

  • Event finds no receiver even though object key is OK

    Hello,
    can’t see what goes wrong here. I have a work item waiting for an event. I trigger the event for with the matching object key, but the event finds no receiver, and nothing happens.
    To elaborate,
    the asynchronous ‘Document review’ task has terminating events REJECT etc. from my ABAP (business) class ZCL_PROL. On the terminating events tab:
    _WI_OBJECT_ID  CL ABAP Class  ZCL_PROL   REJECTED
    I trigger the event using cl_swf_evt_event=>raise and from SWEL I see that the event has been created correctly, for the right object type and object key.
    On the other hand, from SWEINST I see that the ‘Document review’ work item is registered for the event. Table entry
    CL ABAP Class ZCL_PROL   REJECTED   WORKITEM  10000000000392    000000045550
    The class ZCL_PROL and the object key 10000000000392 in SWEINST are identical to what I see in SWEL.
    The method FIND_BY_LPOR must be fine, as the wf has proceeded to this point. And no issues to be seen in SWEQADM.
    Now, what goes wrong? Why doesn’t my work item react to the event?
    Message was edited by: Arto Pihlaja

    Anjan, Prakash, thanks for your lightning fast replies!
    I actually found the issue myself.
    I had
    cl_swf_evt_event=>raise(
         im_objcateg        = cl_swf_evt_event=>MC_OBJCATEG_BC
         im_objtype         = mv_objtype
         im_event           = gc_rejected
         im_objkey          = mv_instid
         im_event_container = mr_event_container
    Once I changed the object category to MC_OBJCATEG_CL, it started working. Clearly I had misunderstood the meaning of 'Business Class'. I changed back to regular CL, and it's fine.
    Once again, thanks for your activity!

  • How to create new object key in BDS?

    Hello,
    I need to create custom class in BDS (OT type) and object key for it.
    In this forum (and in the whole Internet) I found information only about custom class. However there's nothing about object key.
    How could I create new object key in BDS class?
    Great thanx in advance!

    Hi Max,
    you can create BOR object in business object repository, Transaction SWO1, SWO2, search documentaion for BOR obkect.
    Regards,
    Clemens

  • Workflow status based on object key

    Hi all,
    How can we  know the status of workflow(Processing or completed) based on object key?
    Thanks,

    Hi
    1.If you have the BOR key and the name of the BOR then you can make use of the FM SAP_WAPI_WORKITEMS_TO_OBJECT the result of the function module would return you the top/parent workitem ID of the worklow which acted asa receiver.
    2. Once you have the top/parent workitem ID then try to pass the same workitem ID to SAP_WAPI_GET_WORKITEM_DETAIL  this would return you the SWWWIHEAD table entry. From the result structure check the field value WI_STAT ,  this would have the right status of the workflow whether it got completed or still in process state.
    Regards
    Pavan

  • Object Key in the table BKPF

    hi,
    can somebody tell me how the data is filling to the filed " object key"(AWKEY) in the table "BKPF". do we define this in the configuration in FI?  is there any link with the document number ??
    G

    Hi
    For every document you create the system creates automatically on reference key number and that stores in table 'BKPF' in field 'AWKEY'.
    To see the reference key number  for the document, just goto document display and click on Header Data icon.
    Regards
    Laxmiprasad

  • For a BO and Object Key a particular workflow already triggered or not?

    Hi ,
    I want find for an Object Key and Event is there any workflow Trigger or not.
    e.g. My ObjectKey = “400001210000000626” and Event = “CREATED” and Worflow No = “WS91100022”.
    I want to Know Whether this workflow (WS91100022) is triggered for this same Object Key (400001210000000626). Where I can find is there any table will have entry .
    Can you please tell me?
    Regards,
    Surjith

    Hi surjith,
    Us this FM to get all the wfs triggered. This really works
    /Function Module to get all the work items created based on the key of object
          CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
            EXPORTING
              objtype                  = lws_objtype
              objkey                   = lws_objkey
              top_level_items          = 'X'
              selection_status_variant = 0000
              text                     = 'X'
              language                 = sy-langu
            TABLES
              worklist                 = lws_worklist.
    regards,
    sheron

  • Object key for PORDER (document links, table DRAD)

    Hi,
    the object key for PORDER entries in table DRAD looks like:
    000003054845O00000000000020000000020000
    what i know:
    character 1 to 12: ordernumber (AFKO-AUFNR)
    character 18 to 23: sequencenumber (AFVC-PLNFL)
    character 24 to 27: operationnumber (AFVC-VORNR)
    character 28 to 35: counter (AFVC-APLZL)
    so whats about character 13 to 17 and 36 to 40?
    Thanks, Martin

    Hello Martin,
    Look at the field OBJECT which indicates which is the table for which the key OBJECT Key is populated. Check the table indicated in the OBJECT field and the key for the field is the same as the value for OBJECT KEY.

  • Object Key for PO

    Hi Guys,
    I had a requirement where i need to call a particular FM whenever a PO is getting created/changed. I had the Object Type and the event which is called when a PO is changed. How can i link the Event and the FM in R/3.So that whenever that event is called it triggers that FM Importing the Object Key.
    Thanks,
    Kittu.

    Hi Kittu,
    As far as i know we cannot link a Business Object - Event to a FM directly. We can trigger a workflow whenever a Business Object - Event occurs and in this WF we can create a Step Type: Task to which we can attach the FM.
    So whenever this event occurs the WF is triggered and you FM gets executed.
    Please let me know if further details are required.
    Regards,
    Goutham.

  • Creating new business object key.

    Hi experts,
    i created a new z business object and created its keys but when i am trying to release the business object key 'personnelnumber' it's showing following error:
    "Function 'Change status' is not supported by the selected object 'PersonnelNumber' ".
            Please suggest me the solution.

    But in program of  my Z business object ZANNUAL_COMP error is shown as follows so i can't generate my business object.
    The data object "OBJECT-_ZANNUAL_COMP" does not have a component
    "PERSONNELNUMBER".
        please suggest me solution.
    thanks
    Snehasish Das

  • What does "object-key-..." refers to ?

    Hello Workflow Fans !
    Another question... when I look at the ABAP code of a BOR Object Method that refers to, as an example, object-key-customerno... what does "object-key" truly refers to ?  Does it refers to "&_WI_OBJECT_ID& ?
    See code example:
    begin_method o23_maj_ecd changing container.
    SET PARAMETER ID 'KUN' FIELD object-key-customerno.
    CALL TRANSACTION 'XD05'.
    Thanks in advance for your precious help.
    José

    Hello Rick,
    Thanks for your prompt answer.  Considering that my workflow handles multiple different business object through the course if it's lifecycle, I am just wondering how SAP translates "object-key" considering it uses different business objects.  Does it come from the "binding" ? If so, the binding of this particular task looks like this:
    &ZBusObj1& -> &ZBusObj1&
    &ZBusObj2& <-> &_WI_OBJECTY_ID&
    ... then, if I use "object-key" in the code of my methode being called by this task, does it refer to &ZBusObj1& or &_WI_OBJECT_ID& ?  I'm trying to understand how SAP translates "object" in this context !
    Thanks.
    José

  • Error:- The object key has the following invalid value: R3TR TABU

    Hi,
    My request have already been transported to Production server. Now In Dev. I'm deleting an entry from table V_T001K_ASSIGN. When I try to save its asking me to create a request. When I create a new request and save I get the following error:
    Object key values invalid (internal syntax error).
    Please help.
    Regards,
    Sriram

    are you deleting a unique primary key entry? I mean to transport an entry to further clients, the TR needs the primary key information, so that it knows which entries are included in the TR. Please check the TR object details if the information is correct..
    It should basically have
    R3TR TABU V_T001K_ASSIGN
    and in the key details, it should have the primay key of the entry u deleted.
    Thanks,
    Bikash

Maybe you are looking for

  • How do I backup the iTunes Library to an external hard drive?

    I have no space on my computer anymore for anything and I need to export and save all my music on an external hard drive (MYbook) is that possible??? Do I really need to just backup everything on OUTDATED CDs or what???!!! That just seems like an ins

  • How to build a Dashboard with one maps

    Hi guys. I have one question for you. I want to buil a dashboard in which i want to insert map of Italy divided into regions. My idea is that: when i create a dashboard for the pc sales in the year 2008, I want to see an aggregate area on the interes

  • 8800 Problems, don't know if it's early 2008 or 1st Generation

    Okay I feel like an idiot! Any help would be appreciated. I just recently bought a refurb Mac Pro 3.0GHz Quad Xeon with the ATI1900X installed. I want to upgrade to the Nvidia card but I don't know how to tell if it's a 1st Generation or an Early 200

  • Problem with upgrade Windows 2003 to Windows 2008

    Hi, I have problem with upgrade Windows 2003 to Windows 2008 R2 When I run installer it check compatibility drivers and programs after that appear message that I need to uninstall  "adaptec storage manager" but I already remove this driver from the s

  • Oracle Equivalent user

    Hi, OS: IBM-AIX Oracle: Oracle10g 10.2.0.3.0 I created Oracle user with relavent groups. With logging in as oracle user, I can perform DBA activities. My senario is that, I have to create oracle equivalent user say (neworacle). So I have created newo