Multiple MBEWH records created when creating new material with BAPI

Hi,
I am using  BAPI_MATERIAL_SAVEDATA to create a material.
When Creating a brand new material, the BAPI will create multiple MBEWH records, which is causing to update Previous Period/Year Moving Average price to update in MBEW.
Any suggestion, why the BAPI would create historical data for MBEWH?
Thank you very much.
Oleg.

Hi,
I am using  BAPI_MATERIAL_SAVEDATA to create a material.
When Creating a brand new material, the BAPI will create multiple MBEWH records, which is causing to update Previous Period/Year Moving Average price to update in MBEW.
Any suggestion, why the BAPI would create historical data for MBEWH?
Thank you very much.
Oleg.

Similar Messages

  • How can I set a value in a field before create when a New button is clicked

    Hi,
    I am using
    JDeveloper 10.1.3.1.0.3984 and
    JHeadstart 10.1.3.1 release 10.1.3.1.26
    I have one group and there is a detail group under that group.
    From main group to detail group there are 3 field relating those groups.
    field1
    field2
    fieldSEQ (auto-generated by database trigger)
    These 3 fields are PK.
    In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
    But I don't want to create the record with that SEQ as that will be created in the trigger.
    How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
    Can anybody help?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hello Syad,
    What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
    So something like:
    protected void create(AttributeList AttributeList) {
    super.create(AttributeList);
    SequenceImpl sequence =
    new SequenceImpl("KCP_SEQ", getDBTransaction());
    setFieldSeq( sequence.getSequenceNumber());
    If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team.

  • Create a new routing with BAPI BAPI_ROUTING_CREATE via JCo

    I try to create a new routing with BAPI BAPI_ROUTING_CREATE via JCo.
    I filled all necessary parameters. I also realized a commit_work. I get in the RETURN parameter of the BAPI the Message "S 000 Routing N/50001641/01". But the routing isn't in the database. Other JCo programs I wrote (create material master or costumer order) are working very well.
    Have anyone an idea?
    Thanks Jörg
    Here's my coding:
    public void createArbeitsplan() {
              doLogin();
    //          connectionAttributes();
              Plan plan = new Plan();
              for (int i = 0; i < planList.size(); i++)
                   plan = (Plan) planList.get(i);
                   //Ein Function-Objekt erzeugen
                   String bapi = "BAPI_ROUTING_CREATE";
                   JCO.Function savePlan = null;          
                   try { savePlan = this.createFunction(bapi); }
                   catch(Exception ex) { ex.printStackTrace(); System.exit(1); }
                   if(savePlan == null) { System.err.println(bapi + " not found in SAP"); System.exit(1); }
                   //Import und Tabellen füllen
                   // Plankopf
                   JCO.Table headData = savePlan.getTableParameterList().getTable("TASK");
                   headData.appendRow();
                   headData.setValue(plan.kurztext,"DESCRIPTION");
                   headData.setValue("1","TASK_LIST_USAGE");
                   headData.setValue(werks,"PLANT");
                   headData.setValue("4","TASK_LIST_STATUS");
                   headData.setValue("ST","TASK_MEASURE_UNIT");
                   headData.setValue("001","RESP_PLANNER_GROUP");
                   headData.setValue("20070101","VALID_FROM");
                   headData.setValue("20991231","VALID_TO_DATE");
                   headData.setValue("1","LOT_SIZE_FROM");
                   headData.setValue("99999999","LOT_SIZE_TO");
                   // Materialzuordnung
                   JCO.Table materialAlloc = savePlan.getTableParameterList().getTable("MATERIALTASKALLOCATION");
                   materialAlloc.appendRow();
                   materialAlloc.setValue(plan.material,"MATERIAL");
                   materialAlloc.setValue(werks,"PLANT");
                   materialAlloc.setValue("20070101","VALID_FROM");
                   materialAlloc.setValue("20991231","VALID_TO_DATE");
                   materialAlloc.setValue("1","GROUP_COUNTER");
                   // Vorgänge
                   JCO.Table operationData = savePlan.getTableParameterList().getTable("OPERATION");
                   for (int j = 0; j < plan.getAnzahl(); j++) {
                        operationData.appendRow();
                        operationData.setValue(plan.getVorgang(j).vorgang,"ACTIVITY");
                        operationData.setValue(plan.getVorgang(j).steuschl,"CONTROL_KEY");
                        operationData.setValue(plan.getVorgang(j).arbplatz,"WORK_CNTR");
                        operationData.setValue("1111","WORK_CNTR");
                        operationData.setValue(plan.getVorgang(j).text,"DESCRIPTION");
                        operationData.setValue(plan.getVorgang(j).basismenge,"BASE_QUANTITY");
                        operationData.setValue(plan.getVorgang(j).vw1,"STD_VALUE_01");
                        operationData.setValue(plan.getVorgang(j).vw2,"STD_VALUE_02");
                        operationData.setValue(plan.getVorgang(j).vw3,"STD_VALUE_03");
                        operationData.setValue(plan.getVorgang(j).ze1,"STD_UNIT_01");
                        operationData.setValue(plan.getVorgang(j).ze2,"STD_UNIT_02");
                        operationData.setValue(plan.getVorgang(j).ze3,"STD_UNIT_03");
                        operationData.setValue("1","DENOMINATOR");
                        operationData.setValue("1","NOMINATOR");
                        operationData.setValue("20070101","VALID_FROM");
                        operationData.setValue("20991231","VALID_TO_DATE");
                        operationData.setValue("ST","OPERATION_MEASURE_UNIT");
                   // Testflag
                   JCO.Structure test = savePlan.getImportParameterList().getStructure("TESTRUN");
                   test.setValue(" ","BAPIFLAG");
                   //BAPI ausführen (incl. Commit)
                   mConnection.execute(savePlan);
                   JCO.Function commit = null;
                   try {commit = this.createFunction("BAPI_TRANSACTION_COMMIT"); }
                   catch (Exception ex) { ex.printStackTrace();System.exit(1); }
                   JCO.ParameterList input = commit.getImportParameterList();
                   input.setValue("X","WAIT");
                   mConnection.execute(commit);
                   //Messages vom SAP-System holen
                   JCO.Table jcoReturn = savePlan.getTableParameterList().getTable("RETURN");
                   for (int k = 0; k < jcoReturn.getNumRows(); k++)
                        jcoReturn.setRow(i);
    //                    System.out.println(jcoReturn.getField("MESSAGE").getValue());
                        System.out.println(jcoReturn.getField("TYPE").getValue());
                        System.out.println(jcoReturn.getField("NUMBER").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V1").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V2").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V3").getValue());
                        System.out.println(jcoReturn.getField("MESSAGE_V4").getValue());
                   JCO.Structure output = commit.getExportParameterList().getStructure("RETURN");;
                   System.out.println(output.getString("MESSAGE"));
                   System.out.println(output.getString("TYPE"));
                   System.out.println(output.getString("NUMBER"));
                   System.out.println(output.getString("MESSAGE_V1"));
              closeConnectionToSAP();
              System.exit(1);

    Hi,
    perhaps you could use
    BAPI_HRMASTER_SAVE_REPL_MULT
    Regards
    Bernd

  • HT1386 I cannot find how to keep previous photo albums loaded on Ipad when syncing new ones with iTunes. The old ones are wiped out every single time

    I cannot find how to keep previous photo albums loaded on Ipad when syncing new ones with iTunes. The old ones are wiped out every single time

    If it's not too late, see Recovering your iTunes library from your iPod or iOS device. As long as you have a backup of the device when the device still held your photos you should stand a chance of recovering them using a tool such as iPhone Backup Extractor.
    tt2

  • Anyone know when the New Tour with the touch pad will ever come out for vzw?

    Anyone know when the New Tour with the touch pad will ever come out for vzw? Date,Day,Year, Month anything?

    My understanding is that the new Bold 9650 is considered the "new Tour" seeing as how the Tour is the Blackberry 9630.

  • How to find when a new Material type is created

    Hi Gurus,
    I need to know when a particular material type has been created in SAP.
    Can i check it some where in SAP, or i need to go through internal CR's. Is that the only way.
    Thanks

    Dear Gameen,
    Check in OMS2->menu>utilities--->change logs,mention some date range and execute and once after getting the
    results,double click on type V and check the user id and the time details for the details.
    Check and revert
    Regards
    Mangalraj.S

  • How to default condition record currency when creating in VK11

    Hello experts,
      I have created a pricing table with fields that are not sales org specific. I have subsequently created a condition type that uses an access sequence that uses this table. The condition type is set up as a cond class B(price) with a calculation type B(fixed amount). All works great, however, when creating the condition record it is requiring an entry for currency. Is there a way I can have currency default in when creating the condition record?

    Hi,
    NO U cannot have it since Currency in sales is in Sales Org which is missing in yr config.
    U need to enter it manually.
    Regards
    Krishna

  • User Home Directory not being created when "Create Home Now" button hit...

    This is a cross post, since I was not sure where this should end up since it touches two pieces- Open Directory and User Management. Any help would be appreciated!
    I am running OS X Server 10.5. All of my user accounts have been migrated over along with their home directories. Problem is that when creating new users and then assiging a home directory the system does not actually create the directory.
    Currently all users are setup to have their home directory setup here:
    afp://172.16.110.100/Users/'username'. The Users folder has been setup to automount, and all users that have folders can be accessed without issue.
    The problem is when I create a new user, select the aft://172.16.110.100/Users option and then select "Create Home Now" button and save as it requests... it does not create the directories.
    I have even tried to change the Home patch to make it local to see if it was an network issue, and used the /Users choice and it will not create the directory in that way either- both location go to the same place.
    The system was obviously able to create the local admin account and directory admin account home folders without issue when the system was installed.
    The permissions for the "Users" folder are as follow:
    directory admin = Read and Write
    local admin= Read and Write
    system user (root)= Read and Write
    admin group= Read Only
    everyone group= Read Only
    The system is in production, so any kind of server resets need to be done after 5pm, so I have not been able to reset AFP service.
    Currently the only services running are AFP, SMB and Open Directory.
    All users have their entire home directories located on the server, and login over Directory Access on their clients, so all user accounts are stored on the server. No one is having issues accessing their files or logging in.
    I just can not create new home directories when I create new accounts.

    You do not have to be logged on as the root user to do this. Launch the terminal and type-
    sudo createhomedir -a
    I run an XServe with Tiger server ( 10.4.11) and this has been the workaround I have been using.
    Good luck.

  • Objects created when creating table maintenance generator

    Hi guru's,
      I heard that when we creating a table maintenance generator for a table, it will create view,search help and some else.Is it true?
      Please tell me what objects will be created when we create table maintenance generator for a table and why? what is the exact use of creating table maintenance generator for a
    table other than reduces the time for entering large volume of data.
    Regards,
    Rakesh.

    Hello Rakesh,
    TMG is a tool meant and designed to maintain Customizing table/views. Customizing essentially means, that the data should be transportable across clients/systems.
    All this, and the facility to maintain data (display, edit, create, delete, translate) is provided by the TMG. When you make the changes like above, the TMG also provides you features to automatically also enter the changes into transport requests.
    Coming to what objects are created when you generate a maintenance dialogue -
    1) A Customizing Object (merely a class C/G table or view does not become a   
                                        customizing object)
    2) A function group (as entered in SE54 details, if the function group does not already
                                  exist)
    3) Lot of coding within the function group (Func modules, subroutines, includes)
    4) Screen(s)  (1 or 2, depending on a setting in the TMG)
    5) An automatic recording of all these objects into a transport request, for you to conveniently ship them to other systems in your landscape (this, if automatic recording is
    switched ON in your system)
    Authorization group - It is not created automatically (unlike function group). You need to specify an existing Auth group, or use a different functionality to create on of your requirements.
    Does this answer most of your questions? Please revert if you need more clarifications.
    Regards
    Rekha
    PS: Actually, why dont you try generating a maintenance dialogue for a sample z-table and see what all gets generated?

  • Creation of new material with reference to other material

    Hi All,
    I have requirement where i have to create new selling unit material with reference to the given material.
    Now, can any buddy suggest which FM or BADI i have to use to read BOM and ROUTING  info of reference material and same to create BOM and ROUTING for new material.
    Doing this with BDC after reading data directally from tables is one option, But i am looking for any BADI or Fm which will serve the purpose.
    Thanks in Advance,
    Rahul

    Hi,
    ... but if you prefer FM, then you can use BAPI_MATERIAL_MAINTAINDATA_RT or BAPI_MATERIAL_SAVEDATA, depending if you are using Retail or not. BDC is usually not possible for all views - which you would need for complete creation.
    Regards,
    Christian

  • Problem when making new connection with user "sys"

    Hi, I'm having trouble on making new connection with user sys against local 10g installation, the password is correct and I've tried making new connection with other
    users which is fine.
    when I click "test" or "connect", the error msg is strange like this:
    "ORA-01017: invalid username/password; logon denied"
    can anybody help.
    Thx.

    Have you used the "Role" drop-down to "SYSDBA"? - if not, you get the ORA-01017 error.

  • "Multiple Validation errors" message when creating new project in   FCPX

    As a test I have now managed to change the file format from older quicktime file to .m4v and  import into FCPX.  I had to use Handbrake to change the file format to .m4v. If a free software can do this then why can't the $300 FCPX - and allow me to import directly?  This would save me MANY hours of extra work!
    But then, when I try and edit this - first trying to create a new project  I get the message "Multiple validation errors occurred"  The same message even if I try and custon settings rather than use the default
    Does this mean that after all the work and hours it took me to tarnscode the file format, import and then render etc - I will be unable to use FCPX - to edit this footage?

    Update on trying to create a new project - and getting "Multiple Validation errors" message
    I quit FCPX and tried to use iMovie to make a clip to send to you.  Decided against this - and so I opened FCPX again
    To my surprise there were now over ten projects - as every attempy had appeared!  This is bizarre - why did they not show up when I tried to create them first? 
    So, I had to delet most and just use one.  This appears to be working as a project and is allowing me to edit clips into it.
    It will be a reall bummer though if I have to do this every time I need to create a new project!

  • Only multiple entries in BP when creating a new table/field with EEW

    Hi,
    I am creating new tables/fields for BP in CRM 4.0 using transaction EEWB.
    This is working quite well but the fields that appear allows multiple entries per BP. I just want one single entry per BP.
    The wizard talks about multiple options but I cannot see how I define that if it should be a single entry or multiple.
    Any idea how to achieve that?
    Thanks,
    //anders

    Hi
    As i know the fields will be multiple only, u can try for 'default'
    and also try in the wizard in step 2
    The Process of EEW will be like this
    1. To add new fields to the business partner, use the business object Business Partner (BUPA) and create an enhancement of the type "Add New Fields". A wizard helps you define the individual enhancements and provides you with the necessary information for each step.
    2 For each field, you must define the field name, data type and, if necessary, the field length.
    3 For each field, define whether a check table should be available.
    4 For each field, you must also determine whether it should be transferred to SAP BI or to CRM Field Applications.
    5 In the last wizard screen, the system shows you an overview of the fields you defined, together with their associated attributes.
    6 To start generation, choose Complete.
    I hope u can solve ur prob in Step 2 data type
    cheers
    Manohar

  • No valid info record price when creating PO

    When I created a PO with an info record, but no valid price for the date, the system used the most current PO to price the new PO.
    Is there a way to have the system give a warning message that there is no valid info record price?

    Rahim
    I made the change to the setting and it did return a warning for NO info record.  But the second time I used the material/vendor, there was no warning theat there was no valid info record price
    The PO just used the price from the previous PO with no message about the source.
    How would a buyer know that he needs to go "do something" about an info record price?
    thanks for you help
    Althea

  • No matching record found when creating Incoming Payment...

    Hi,
    I'm starting a transaction, creating a invoice and then creating a incoming payment.
    The invoice is created successfuly in memory I can see the next DocEntry and DocNum and passing it to the incoming payment as usual but I'm getting the error : No matching records found
    Any idea ?

    I found why.
    The Series used was not there.  But it's not obvious to know that it's because you set a wrong Series code with an error like this.

Maybe you are looking for

  • ICAL UPDATE FIXES!!!

    APPLE, When will there be fixes to the new ical? i,e. Year View Colors (when in year view specified event colors need to show their specified color in YEAR VIEW.....) C'mon!!!

  • SSL handshake with webcache

    Hello, I am having some trouble with using Webcache and WebLogic.  Basically I have narrowed the problem through debug logs down to a certificate error involving the certificate being sent from weblogic to webcache.  Webcache cannot validate it and a

  • Password policy

    I am setting password policy in solaris 10, I want that locked account of user should be unlock after some time with ouit the help of system administrator means the account would be unlock after 30 min automatically.

  • AG2712A microphone is too low

    I've got 2nd AG2712A and it has the same issue with microphone volume being too low. Tried changing all the settings I could and no luck. Any idea?

  • Reports 10 Parameter form

    Hi. I am facing a problem with the parameter form in reports 10g. The number of parameters in this report are huge. After designing the parameter form , i save and close the report. Now if i re-open the report to do changes, the width and height of t