How to create a new record in crm?

Hi,
Have any one tried creating a new crm record using the function crm_order_maintain?
I noticed that there is a ref_guid in each of the table structures in the exporting parameters. Is it a standard ref_guid for all creation objects?
Thanks in advance,
Jen

In CRM every object contains a 32 bit guid which is always unique and is generated by the system.You need not to give this guid while creating an object.
Here is a sample code for creation of a quotation:
DATA:
    t_object_to_save    TYPE crmt_object_guid_tab,
    t_saved_objects     TYPE crmt_return_objects,
    t_objects_not_saved TYPE crmt_object_guid_tab,
    t_new_orders        TYPE crmt_orderadm_h_comt,
    s_new_order         TYPE crmt_orderadm_h_comt,
    t_input_field       TYPE crmt_input_field_tab,
    s_input_field       TYPE crmt_input_field,
    s_fieldname         TYPE CRMT_INPUT_FIELD_NAMES.
s_new_order-handle = 1.
s_new_order-mode = 'A'.
s_new_order-process_type = 'QUOT'.
s_input_field-ref_handle  = 1.
s_input_field-ref_kind    = 'A'.
s_input_field-objectname  = 'ORDERADM_H'.
s_input_field-logical_key = space.
CLEAR s_fieldname.
s_fieldname-fieldname = 'MODE'.
APPEND s_fieldname TO s_input_field-field_names.
s_fieldname-fieldname = 'PROCESS_TYPE'.
APPEND s_fieldname TO s_input_field-field_names.
INSERT s_input_field INTO TABLE t_input_fields.
INSERT s_new_order INTO TABLE t_new_orders.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
  CHANGING
    ct_orderadm_h     = t_new_orders
    ct_input_fields   = t_input_fields
  EXCEPTIONS
    error_occurred    = 1
    document_locked   = 2
    no_change_allowed = 3
    no_authority      = 4
    OTHERS            = 5.
if sy-subrc ne 0.
clear s_new_order.
read table t_new_orders
into s_new_order
INDEX 1.
if sy-subrc ne 0.
l_object_to_save = s_new_order-guid.
INSERT l_object_to_save INTO TABLE t_objects_to_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
  EXPORTING
    it_objects_to_save   = t_objects_to_save
  IMPORTING
    et_saved_objects     = t_saved_objects
    et_exception         = t_exceptions
    et_objects_not_saved = t_objects_not_saved
  EXCEPTIONS
    document_not_saved   = 1
     OTHERS               = 2.
if sy-subrc eq 0.
call function 'BAPI_TRANSACTION_COMMIT'.
endif.
endif.
<b>REWARD FULL POINTS.</b>
cheers,
ashish.

Similar Messages

  • How to creat a new record in the Db table

    Dear all,
    I am trying to update a DB table and i want to create new records in this table every time the user changes something on the screen,
    I want to append the DB table and not update it how should  i go about this???
    Regards,
    Vijay.
    PS:

    Hi
    User INSERT statement for the same...
    Please read the help...
    Cheers,
    Hakim

  • How to create a new record using a custom method?

    Hi I want to create Jdev 11 a new record using the contructor following in the footsteps of http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtAnchor.CACCIJAG/vtTopicFile.adfdevguide%7Cweb_adv~htm/.
    My problem is the following.
    Messages for this page are listed below.
    Error
    JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    Error
    java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    Error
    Object: null is not a known entity type.
    Someone can help me?
    Cristian.

    Hello Frank, this tutorial make it and was successful but, what I am trying to do is add a new record in the table departments. The steps undertaken are suguientes
    drag over page the contructor department, with a submit, this will drag on the button, the method presistencia, set binding action with "$ (bindings.Departments.result)", and when running the application gives me the error
    Nov 2, 2007 10:06:22 PM oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ADFc: JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    I need to know if what I am doing is right, because I followed the steps of the tutorials and it is not functioning the insertion of a new record.
    Thank you thank you.

  • How to create a new component in CRM 7.0?

    while creating a new component with search and result options... main window is not created automatically.
    when tried to create it manually its giving short dump. kindly let me know what could be the reason for this problem?
    thanks alot.

    Hi Vijay,
    could you please specify what kind of short dump you are getting? The short dumps can be looked at in the sapgui transaction st22.
    Best regards,
    Erika

  • How to create a new record using ODataModel?

    Hi,
    I am new to UI5 and so ODataModel. I have tied one table to an ODataModel.
    How would I send request to a server so that I will have a new entry created at server end?
    I googled this and I tried following:
    1. Called createEntry method on ODataModel as follows:
    sap.ui.getCore().byId("maintainRolesTable").getModel().createEntry("DERMASSIGNMENTSet",{
    "DeUser":"C5192081",
    "SeqNo":"X",
    "Childbp":"C5192081",
    "ChildbpName":"",
    "Id":"2",
    "RelationType":"",
    "Parentbp":"I0656568",
    "ParentbpName":""
    2. I called then submitChanges method on the model as follows:
    sap.ui.getCore().byId("maintainRolesTable").getModel().submitChanges();
    This is giving error as follows:
    POST https://lsftdc00.wdf.sap.corp:1443/sap/opu/odata/sap/ZSECENTRAL_SRV/DERMASSIGNMENTSet 403 (Forbidden) datajs.js:17
    2014-06-05 16:53:32 The following problem occurred: HTTP request failed403,Forbidden,CSRF token validation failed -
    When I try to use ajax call instead of these methods, I get error as follows:
    var obj={
      "Childbp": "C5192081",
      "ChildbpName": "Supriya Kale",
      "DeUser": "C5192081",
      "Id": "8",
      "Parentbp": "I0656568",
      "ParentbpName": "",
      "RelationType": "RESOURCE MANAGER",
      "SeqNo": "1",
                 "metadata":{
                     "id":"https://lsftdc00.wdf.sap.corp:1443/sap/opu/odata/sap/ZSECENTRAL_SRV/DERMASSIGNMENTSet(DeUser='C5192081',SeqNo='x')",
                     "uri":"https://lsftdc00.wdf.sap.corp:1443/sap/opu/odata/sap/ZSECENTRAL_SRV/DERMASSIGNMENTSet(DeUser='C5192081',SeqNo='x')",
                     "type":"ZSECENTRAL_SRV.DERMASSIGNMENT"
      $.ajax({
      type: "PUT",
      dataType: "json",
      url: "https://lsftdc00.wdf.sap.corp:1443/sap/opu/odata/sap/ZSECENTRAL_SRV/DERMASSIGNMENTSet",
      data: JSON.stringify(obj)
      }).success(function( msg ) {
      alert('HI read operation complete....................................');
      }).error(function(msg){
      alert("error occurred");
    I get following error:
    PUT https://lsftdc00.wdf.sap.corp:1443/sap/opu/odata/sap/ZSECENTRAL_SRV/DERMASSIGNMENTSet 403 (Forbidden)
    Can anyone tell me if I am going wrong in calling methods? Help would be appreciated.
    Thanks,
    Supriya Kale

    Hi Supriya,
    you can take a look at this blog. Building a CRUD Application with SAPUI5 Using Odata Model
    Scroll down to Create Operation.
    There you can see that the author is also first fetching CSRF and the calling CREATE operation.
    For simple example see correct answer in this thread.
    HTTP request failed403,Forbidden,CSRF token validation failed
    Best regards,
    Peter

  • How to create the new competitor products in CRM

    Dear Sir,
    How to create the new competitor products in CRM and  it will not synchonize to SAP R/3 for this products?
    Thanks and best regards,
    Vimol

    Hi,
    Have a look at these following thread for some more information on New Competitor Products in CRM
    Competitor Products (WETT) in CRM 5.2
    Hope this will somewhat help.
    Thanks,
    Samantak.

  • When creating a new record in a list, I want to create a new record in another list, too, together with the ID of the first record

    OK, for anyone who has ever programmed a database, this one is easy. However, I am EXTREMELY limited. I work with SharePoint 365 (2013). I am pretty proficient in a number of programing languages, but I really don't know how to program SP. I wouldn't even
    know where to put code.
    Say, I have two lists: List A, with Items A1 (ID), A2, A3 and List B, with Items B1 (Lookup to A1), B2, B3. What I want this: When I create a new record in List A I want that also an empty record (except for the B:A1 item) is created. Is that possible without
    any major programing?

    you can create a workflow to achieve your requirement
    http://sharepoint.stackexchange.com/questions/50059/create-a-list-item-when-item-is-created-in-another-list
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Crystal Reports XI - How  to create a new field using a formula field

    I'm quite new to CR, but have been learning quickly!
    I would like to know how to automatically create a new record/field based on another field in that row...
    I have a report showing the following data:
    Run Code     Start KM    Stop KM    Status 
    H2                 100            150           Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    The status is generated by comparing the 'Start KM' and 'Stop KM' against fields in another table called 'Start Odo' and 'Stop Odo'
    In this example...
    H2 has 'Start Odo' and 'Stop Odo' values of 90 to 160, therefore there is still 90-100 to check.  The 'Start KM' and 'Stop KM'  is equal to the 'start Odo' and 'stop Odo' for S3, therefore it shows completed.
    My question is how do you create a formula field, which will add an entire row...displaying the values 90-100.
    I've been trying to use a conditional check in the 'Start KM' column, that sees if status is equal to partial than if start km is greater than start odo (Which is the reference km) then display the value of start odo in the new row. I'm stuck at how to create a new row.
    I want the final result to look like this...
    Run Code     Start KM    Stop KM    Status 
    H2                  90              100         Partial
    H2                 100             150          Partial
    H2                 150             155          Partial
    H2                 155             160          Partial
    S3                 120             150       Completed
    Any suggestions would be more than appreciated

    Hi Adi
    Looking at your examples it seems that you want to add a row to the existing recordset (rows fetched from the database).
    If it is the case (even if based on a formula) then you can not do it within crystal. Crystal is designed to display data and ideally it should not generate the new data.
    However, as per your requirement you can try to add this logic at database end. May be a command object within Crystal Reports can help you.
    Let me know if you do not understand anything.
    Regards
    Nikhil

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • How to Create A new Database in the oracle 10g XE

    i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

    Hi there 785434,
    (This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
    Moderator, please move this if able
    I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
    Example:
    CREATE TABLE TEST
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE
    LOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE TABLE TEST_HISTORY
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE,
    CHANGE_DESCRIPTION
    NOLOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE OR REPLACE TRIGGER TRG_BU_TEST
    BEFORE UPDATE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
    END;
    CREATE OR REPLACE TRIGGER TRG_BD_TEST
    BEFORE DELETE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
    END;
    Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
    Note that this method might not be suitable for very high transaction rates.
    You will need to 'clear' these history tables as part of routine maintenance.
    Hope that this Helps.
    Ronald.

  • About create a new record in MM01

    hi,all
    I have created a new record of MARA-MATNR = 'Raffin_001' in MM01.
    But I don't know how I can find some fields like "MARA-WRKST".
    Can I write
               UPDATE MARA
                  SET WRKST = 'XXX'
                WHERE MATNR = 'Raffin_001' "
    to replace it?
    Is it right?

    Hi,
    WRKST - Is the field name for Basic material
    Basic Materia is defined in OMT6 tcode
    Path - LG - MM - Settings for Key fields - Define Basic Material.
    After defining in the SPRO settings then you can enter this basic material in BASIC DATA 2 under basic material field for the material code you wanted.
    Thanks & Regards,
    Kiran

  • Filling datarows before creating a new record  frm-40735 ora-01422

    Hello
    I want to create a user-control table where I Store in the Mastertable the user informations. in the 2 detail tables I store the programmnames of the first level, in the second table I store the name of the form and if the user is allowed to insert, amend or delete.
    I use a Master/2 Detail-Form. When I create a new record in the master block, I want to fill in the first and second detail block, informations of another user of the 2 detail tables. therefore I created a when-new-block-instance trigger with the following code:
    select programm
    into :k_zugriff.Programm
    from k_zugriff, K_benutzer
    where r_benutzer_zaehler=k_benutzer.zaehler
    and oracle_user='ROBERT';
    because this sql serves more than one row I receive the error code frm-40735 ora-01422
    so how could I solve the problem to insert 5-10 rows in :k_zugriff.Programm. I can not make an insert before I go to the block k_zugriff, because the user number is not commited known. Also I want to commit the form when all informations are filled in. in case of a mistake I want to exit the form with no commit;
    has anyone a usefull Idea?
    regards
    robert

    it works thank you. where can I get further information about this technik. are there any turtorials or something where I get information how to build this complex forms??
    right statement
    DECLARE
    CURsOR cr IS
    select programm
    from k_zugriff, K_benutzer
    where r_benutzer_zaehler=k_benutzer.zaehler
    and oracle_user='ROBERT';
    BEGIN
    FOR rec IN cr LOOP
    IF :SYSTEm.RECOrD_STATUS!='NEW' THEN
    CREATE_RECORD;
    END IF;
    :k_zugriff.Programm:=rec.PROGRAMM;
    END LOOP;
    END;

  • Generate extra record when create a new record in secondary form

    I have been troubshooting this for a logn time:
    I have exemption form ties to exemption table. because there are two many info on exemption form, I create a second form called exemption (2) form and ties to exemption(2) table. Then, I create a "Go to exemption(2) form" button from the first form and it will redirect the user to the second form once they click it.
    Once the users complete the second form entry, and click the Create(which is the save record) button, it not only creates a new record in exemption (2) table but also create an extral record in the first exemption table.
    I used the exemption sequence to genertate the id so for example,
    Exemption (1) has 3 records so far, but after the user add the record in the second form, Exemption (1) has 4 records.
    How do I make the first form and the second form consistent in the ID?
    Thanks so much in advance!

    Thank you Tauceef for your help,
    If I get your problem exactly, you are using a sequence for the ID, and you want to insert the same ID in both Tables 1 & 2 - Yes, it is exactly what I want to do
    for that what you can do is, in the first form submit process, you can assign the sequence value to a hidden or application - I use exemption sequence and the first form takes nextval of it.
    item in your first form and use that item in your second form. - then, I went to the second form, and assign the ID to the first form ID (the page item in application)
    I got error message saying can not insert NULL value to second table, can not process the row.
    Can you show me the submit process in the first form?
    Hope it won't take too much of your time,
    Kitty,

  • I have added a new field in IT0006 ,Now when try to create a new record for

    Hi Experts,
    I have added a new field in IT0006 ,Now when try to create a new record for a employee.
    1,If I give the SUBTY in the PA30 screen getting an error "Don't Specify a subty error"
    if and remove the subty and press CREATE button popup's comes and list the subty values.......It was allowing me to enter the subty in the PA30 screen prior to my new field addition in IT0006... is't a problem with the new field addition?
    2, After I choose the subty value from the pop-up I am able to see the next screen....BUT GETTING AN INFORMATION MESSAGE THAT "Assignment to feature P0006 did not take place"?
    3,, In the next screen after I have passed all mandatory fields while attempting SAVE I am getting an error called " Time constraint table in T777D is incorrect" what could be the cause?

    How are u adding fields to table using append in se11 or pm01.
    if you are adding fields using se11 delete it and add it0005 in transaction pm01 and generate object.
    add fields to structure CI_XX_R0005 and generate screen and maintain entry and screen in maintance view add entry and activate program.

  • Form Creating an new Record

    Hello,
    I have a simple form for entering records in a table. After entering data and pressing the create button it creates a new record. However it clears the fields for the next record to be entered. I've got two questions:
    1. If I want the form to stay within the new created record instead of emptiying the fields, how do I do that?
    2. Is there a posibility to search on a form? An example would be appreciated.
    Thanks in advance,
    Denes

    1. If I want the form to stay within the new created
    record instead of emptiying the fields, how do I do
    that?Ahh exactly the same question I was just searching for an answer to! =)
    Anyone got any ideas?
    - JMW

Maybe you are looking for

  • Why can't I use the extra -$20/5GB- storage that I purchased?!!

    I bought the EXTRA $20/5GB of storage, BUT when I tried to update my iPad Mini, it says that I need 1+GB to be able to download the update?! The new extra storage does show up in the place where the total storage is shown. In fact, it says that I sti

  • Failed to create object.Help needed

    Hi, I have some program here, the BPDU class and also the RootBridge class. The BPDU class is just a simple class with all the getMethods and the setMethods. For the RootBridge class, it is suppose to connect to the JDBC ODBC database, and create arr

  • Replace a single character in a textual column in sql server

    Hello, could you confirm to me that: UPDATE TableName SET LastName = REPLACE(LTRIM(RTRIM(LastName)), 'A', 'B') replaces every occurrence of character A with character B, in selected column, regardless  of the position of the letter A? (I.E., it could

  • Does anyone know how to authorise a computer in itunes please

    does anyone know how to authorise a computer to my itune account im not having much luck  thanks

  • Inconsistent IO Wait Time

    I'm trying to comprehend why oracle seems to more efficiently table scan a table when it has more rows than when it has less. I have run a bunch of queries against the database, and I have tracked their wait events stats. And it seems that this ratio