Creating Purchase Info Record in SAP using JCO

I am trying to create a Purchase Info Record (ME11) in SAP using the below JCo code:
It executes without fail and throws no error, but i am not able to get the newly created info record in SAP. In ME13 it says info record not found. Can i know what am i missing?
I am using these FMs :
1. ME_INITIALIZE_INFORECORD
2. ME_DIRECT_INPUT_INFORECORD
3. ME_POST_INFORECORD
IFunctionTemplate ft1 = mRepository.getFunctionTemplate("ME_INITIALIZE_INFORECORD");
    JCO.Function function1 = ft1.getFunction();
    mConnection.execute(function1);
    IFunctionTemplate ft = mRepository.getFunctionTemplate("ME_DIRECT_INPUT_INFORECORD");
    JCO.Function function = ft.getFunction();
    JCO.ParameterList importparams =function.getImportParameterList();
    //  Setting HeadData Structure Information
    JCO.Structure headStructure = importparams.getStructure("I_EINA");
    //headStructure.setValue("105","MANDT");
    //headStructure.setValue("5300259768", "INFNR");
    headStructure.setValue("MYPART0006", "MATNR");     
    //headStructure.setValue("MYPART0006", "IDNLF");
    headStructure.setValue("100002","LIFNR");
    headStructure.setValue("10000","MATKL");
    headStructure.setValue("KGS","MEINS");
    headStructure.setValue("1","UMREZ");
    headStructure.setValue("1","UMREN");
    headStructure.setValue("SG","URZLA");
    headStructure.setValue("KGS","LMEIN");
    //headStructure.setValue("0000005300259768","URZZT");
    JCO.Structure headStructure1 = importparams.getStructure("O_EINA");
    //headStructure1.setValue("105","MANDT");
    //headStructure1.setValue("5300259768", "INFNR");
    headStructure1.setValue("MYPART0006", "MATNR");    
    //headStructure1.setValue("MYPART0006", "IDNLF");
    headStructure1.setValue("100002","LIFNR");
    headStructure1.setValue("10000","MATKL");
    headStructure1.setValue("KGS","MEINS");
    headStructure1.setValue("1","UMREZ");
    headStructure1.setValue("1","UMREN");
    headStructure1.setValue("SG","URZLA");
    headStructure1.setValue("KGS","LMEIN");
    //headStructure1.setValue("0000005300259768","URZZT");
    System.out.println("General Data Set");
    JCO.Structure purchaseDataStructure = importparams.getStructure("I_EINE");
    //purchaseDataStructure.setValue("105","MANDT");
    //purchaseDataStructure.setValue("5300259768", "INFNR");
    purchaseDataStructure.setValue("1000","EKORG");
    purchaseDataStructure.setValue("1000", "WERKS");
    purchaseDataStructure.setValue("003","EKGRP");
    purchaseDataStructure.setValue("USD","WAERS");
    purchaseDataStructure.setValue("3","APLFZ");
    purchaseDataStructure.setValue("1","PEINH");
    purchaseDataStructure.setValue("1","BPUMZ");
    purchaseDataStructure.setValue("1","BPUMN");
    purchaseDataStructure.setValue("1000","EFFPR");    
    purchaseDataStructure.setValue("0001","BSTAE");    
    purchaseDataStructure.setValue("100000","NETPR");
    purchaseDataStructure.setValue("X","KZABS");
    JCO.Structure purchaseDataStructure1 = importparams.getStructure("O_EINE");
    //purchaseDataStructure1.setValue("105","MANDT");
    //purchaseDataStructure1.setValue("5300259768", "INFNR");
    purchaseDataStructure1.setValue("1000","EKORG");
    purchaseDataStructure1.setValue("1000", "WERKS");
    purchaseDataStructure1.setValue("003","EKGRP");
    purchaseDataStructure1.setValue("USD","WAERS");
    purchaseDataStructure1.setValue("3","APLFZ");
    purchaseDataStructure1.setValue("1","PEINH");
    purchaseDataStructure1.setValue("1","BPUMZ");
    purchaseDataStructure1.setValue("1","BPUMN");
    purchaseDataStructure1.setValue("1000","EFFPR");       
    purchaseDataStructure1.setValue("0001","BSTAE");       
    purchaseDataStructure1.setValue("100000","NETPR");
    purchaseDataStructure1.setValue("X","KZABS");
    mConnection.execute(function);
    IFunctionTemplate ft2 = mRepository.getFunctionTemplate("ME_POST_INFORECORD");
    JCO.Function function2 = ft2.getFunction();
    JCO.ParameterList importparams2 =function2.getImportParameterList();
    importparams2.setValue("MYPART0006", "I_MATNR");
    importparams2.setValue("MYPART0006", "O_MATNR");
    mConnection.execute(function2);
Edited by: rs_d123 on Dec 17, 2011 10:46 AM
Edited by: rs_d123 on Dec 17, 2011 10:46 AM

If i give this much code then it throws an error
Exception in thread "main" com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Enter Purch. group :
I have already set the purchase group in the code: EKGRP as 003. Dont know why its still asking for purchase group.
            JCO.Repository mRepository;
         mRepository = new JCO.Repository("SAPConnection", mConnection);
         System.out.println(" Repository Created ");
         IFunctionTemplate ft1 = mRepository.getFunctionTemplate("ZME_INITIALIZE_INFORECORD");
         JCO.Function function1 = ft1.getFunction();
         mConnection.execute(function1);
         IFunctionTemplate ft = mRepository.getFunctionTemplate("ZME_DIRECT_INPUT_INFORECORD");
         JCO.Function function = ft.getFunction();
          JCO.ParameterList importparams =function.getImportParameterList();
          //  Setting HeadData Structure Information
          JCO.Structure headStructure = importparams.getStructure("I_EINA");
          headStructure.setValue("MYPART0006", "MATNR");          
          headStructure.setValue("0000100002","LIFNR");
          headStructure.setValue("000010000","MATKL");
          headStructure.setValue("KGS","MEINS");
          headStructure.setValue("1","UMREZ");
          headStructure.setValue("1","UMREN");
          headStructure.setValue("SG","URZLA");
          headStructure.setValue("KGS","LMEIN");
          System.out.println("General Data Set");
          JCO.Structure purchaseDataStructure = importparams.getStructure("I_EINE");
          purchaseDataStructure.setValue("1000","EKORG");
          purchaseDataStructure.setValue("1000", "WERKS");
          purchaseDataStructure.setValue("003","EKGRP");
          purchaseDataStructure.setValue("USD","WAERS");
          purchaseDataStructure.setValue("1","APLFZ");
          purchaseDataStructure.setValue("1","PEINH");
          purchaseDataStructure.setValue("1","BPUMZ");
          purchaseDataStructure.setValue("1","BPUMN");
          purchaseDataStructure.setValue("1000","EFFPR");          
          purchaseDataStructure.setValue("0001","BSTAE");          
          purchaseDataStructure.setValue("1000","NETPR");
          purchaseDataStructure.setValue("X","KZABS");
          mConnection.execute(function);
         IFunctionTemplate ft2 = mRepository.getFunctionTemplate("ZME_POST_INFORECORD");
         JCO.Function function2 = ft2.getFunction();
          JCO.ParameterList importparams2 =function2.getImportParameterList();
          importparams2.setValue("MYPART0006", "I_MATNR");     
          mConnection.execute(function2);
          System.out.println("Execution Completed");
Edited by: rs_d123 on Dec 19, 2011 9:04 AM

Similar Messages

  • Error occured while creating purchase info record in mm

    sir,
    while creating purchase info record  an error occured while inserting net price. it said
    NOT POSSIBLE TO DETERMINE A CONDITION TYPE FOR A PRICE
    when it attempted to generate the time dependent condition for the price you entered the systeem was unable to determine a condition type, price determination is therefore not possible.
    please inform me how to solve this problem.
    thankyou

    I think you are not using the stdard pricing becuse of that it is thrwing error
    Ok First check your pricing procedure which your using for PO
    than in that pricing procedure if you are using PB00 fro Gross price than you will have antoher pricing procedure attached to this condition.
    check in M/06 for your gross price conditon
    now did you assign the pricing procedure to vendor?
    bottom line is somthing missing in your config.
    Check all the config as below
    Pricing Procedure:
    In MM module, pricing procedure is used during RFQ and PO creation. Total value of material based on all addition and subtraction like discount, surcharge, tax, freight, etc. In this we are defining pricing procedure and linking to vendor and purchase department through the virtual schemas.
    Following steps for pricing procedure as,
    1. Define conditions.
    2. Define pricing procedure.
    3. Define virtual purchase organization and vendor.
    4. Info Record.
    Customization for Pricing Procedure :
    1. Definition of Conditions :
    /NMEK0-condition typeu2026condition types- definition (define for basic price, net price, discount, surcharge, tax etc.)
    2. Defining pricing procedure :
    /NMEK0- calculation schema-calculation schemasu2014New entries (Define procedure and put the conditions like formula so that final price will be net price / total value as per company requirement)
    3. Linking pricing procedure to independent condition types.
    /NMEK0-condition typeu2026condition types- definition for position for defined conditions (Enter the defined pricing procedure in the each independent conditions u201CPricing Procedureu201D box)
    4. Defining Schema group for Vendor :
    /NMEK0- calculation schema-schema groupsu2014vendoru2014New Entries.
    5. Defining Schema group for Purchase Organization--- New entries.
    /NMEK0- calculation schema- schema groups---- purchasing organization--- new entries.
    6. Linking Virtual Purchase Organization to actual Purchase Organization.
    /NMEK0- calculation schema- schema groups----- Assign P.Org. (in actual P.Org, enter virtual P.Org)
    7. Linking Pricing procedure to virtual P.Org and virtual vendor :
    /NMEK0- calculation schema- Determine Schema--- -Standard --- New entries (Enter virtual schema and P.Org. along with pricing procedure)
    8. Linking virtual vendor to actual vendor-- /NXK02 then enter schema group vendor in Purchasing Data )
    9. Info Records (/NME11)---- click on u201CPurch. Org. data1u201D and enter condition types and pricing procedure
    What are the steps in pricing determination in MM? Condition, Access sequence and schema.
    In the SAP MM Pricing is more important. Just yesterday I have completed the Pricing as I am doing the SAPMM now. I can give some light on this Topic, not 100%. After 2 days definitely some more I can share.
    The Basic thing is Condition Technique. In which there are
    1. Access Sequence 2. Condition Record 3. Condition Type 4. Condition Table.
    A Access Sequence access a Condition Record of a Condition Type in a Condition Table is a Condition Technique.This is a simple logic
    Here the Condition Type is very important like PB00, PBXX,RA01 etc.
    In the background every Condition Type has its own defition means the purpose of the Condition Type like, is it for Pricing or Percentage, Quntity base, Accrual Feilds etc is to be defined to work this functions.
    Normally we use the existing ones without any risk. But some cases, we have to Create a New Condition Types as per the organisation requirement.
    The Pricing Schema is useful to minimise condition types while mention prices for Vendor on the basis of Pricing Schema which we defined according to organisation requirement.
    The Pricing Schema means the calculations procedure of Condition Type.
    Ex. RA01 - Discoount % is caclulated on PB00 - Gross Price means
    RA01 is based on PB00 like that we have to define in the Pricing Schema
    which makes easy to use in realtime.
    Here PB00 has the Access Sequence - 0002.
    But RA01 does not have the Access Sequence.Why because it is a dependent on PB00. But both are Condition Types.
    In the system, by default some standard Scheme will be there at Vendor Schema Group in the Vendor Master Screen means the standard one is assigned which is very lengthy which may fullfil our requirement. But some cases which may not fullfil our requirement, in such we have to define.
    For the configuration, I may not able to explain properly through here but will give some Idea.
    Configuration: SPRO-IMG-Material Management- Purchasing- Conditions-Define Price Deternmination Process
    1. Define Access Sequence
    2. Define Condition Type
    3. Defince Calculation Schema:- Here you have to define the Schema
    Define Schema group
    1. Define Schema Group vendor
    2. Define Pricing Schema group
    3. Schema group for Purchase Organisation
    4. Assign Schema group to Purchase Organisation
    Define Schema determination
    1.define calculation schema for Standard purchase organisation
    After completion of the Schema Group, we have to assign it to Vendors.
    Then whenever we use any transaction with this Vendor, the concerned Schema will work as configured by us.
    I think this will help you. Actually the Pricing is a vast. Becuase each Condition have its own importance and each Access Sequence have its own importance. So you need not bother about this. First you learn how to define the Calculation Schema through the above.
    Here we can create many Calculation Schemas which can assign one schema to Local vendors
    another schema to out side vendor one more schema to foreign vendors like that we can classify.

  • FM or BAPI for creating purchase info records and purchase conditions

    Hi all,
    i need create purchase info records and purchase conditions from txt-file,
    What FM or BAPI i can used for this?
    Thanks and Regards,
    Andrei

    You can use trasaction SXDA_TOOLS.....
    object type BUS3003
    program type BINP
    program/method RM06IBI0
    but the fields must be sequentially written in the txt, with every space inclusive....

  • Error in Creating Purchasing Info Record

    Hi all,
    I started practicing MM module recently.In the process i created plant,purchasing org., storage location, material,vendor and then i tried to create purchasing info record.In that it is asking to give plnd delay time.When i entered any number it is giving an error to enter valid field.
    Can any one help me in this issue.............
    And also can anyone guide me in practicing MM module.
    Thanks in advance,
    Sunny

    Hi
    Actually if you maintain the nos. in days in that planned delivery time field, system should not give an error message.  I feel the error message could be of different.
    Alternatively the avoid the error message or instead of maintained the value of planned delivery time of the material in inforecord, you can maintain it in material master itself in the field "Plnd Delivery Time" under MRP 2 view.
    Reward points if its useful.
    Best Regards

  • IDoc status 51 - LSMW for Creating Purchasing Info Records using IDoc meth

    Dear All,
    My req is to create a Conversion for Purchasing Info Records. LSMW's IDoc method is used to develop this conversion wherein Message Type "INFREC" and Basic Type "INFRECMASS01" are being used.
    In the 14th step (Start IDoc Processing), I 'am getting the IDoc status "51" and Status Text "Application document not posted". If I double click on respective IDoc number, I got its Control record, Data records, and Status records; in the status records I can see "51" in Red color with the message "Function module not allowed: IDOC_INPUT_INFREC". If I double click on this it asks me to check the process code...
    Request you guys to resolve the issue....
    Solution will b rewarded.. Thanks in advance....

    U should use basic type INFREC01 instead of NFRECMASS01.
    Within the FM there is a check for basic type like:
    check idoc type
        if f_idoc_control-idoctp <> c_idoctp_infrec01. " INFREC01
          raise wrong_function_called.
        endif.
    Edited by: Joyjit Ghosh on Sep 15, 2008 4:57 PM

  • Create Purchase info record using LSMW idoc method

    Hello Friends,
    I am trying to update Purchase Info records using LSMW Standard program RM06IBI0.
    But it is not updating the condition price details and scale Quantity.
    For that the  form  suggessted LSMW IDOC method. with : Message Type         COND_A / COND_A02.
    But i dont know is the info record created earlier to this step or else we can create both using this method
    at a time ?  Does anybody please suggest.
    ( Actually Purchase Info record created using transaction  ME11 ).
    Regards,
    Phaneendra

    you first create the info record and subsequently you load the conditions.
    become familiar with the condition tables and its key first. Check How table A017 and A018 are maintained.
    Intresting is the field VAKEY which is actually the link to your info record.
    This is a combination of vendor, material, purchasing org, plant , and info record indicator.
    data:  begin of ZZVARKEYA,
            ZLIFNR like LFM1-LIFNR,
            ZMATNR like MARc-MATNR,
            ZEKORG like LFM1-EKORG,
            ZWERKS like MARC-WERKS,
            ZINFTYP like EINE-ESOKZ,
            end of zzvarkeyA.

  • Creating Purchasing info records using transaction ME11

    Hello Friends,
    I am trying to post Purchase info records through ME11.
    Everything is fine but we are not able to record the Conditions tab - i.e, Condition Qty & scale Quantities,
    Can anybody Please help is there any BAPI or any Function module to Post Purchase Info records,
    i.e, alternative to ME11 transaction.
    Thanks in advance,
    Regards,
    Phaneendra

    Hello Rahul,
    Thanks for your reply, Here i am using the same.
    But i am not able to update data by konp & konm structures.
    Do you have any idea on this ?
    ie, in flat file only one line is read by the Program for KONM Structure .Please help.
    Regards,
    Phaneendra
    Edited by: phaneendra punukollu on Feb 8, 2010 4:36 PM

  • Purchase Info Record Change (ME12) using BDC

    Hi All,
    We are trying to change the Purchase Info Records using BDCs. We have about 20 condition records to change. Not all condition records change all the time. How can we use page control to identify the particular condition records that we want to change.
    Thanks
    Hari

    Hi Krishna,
    The BDC that we are trying to build will have the changes. For ex: When we created the info record (using a BDC) we had 15 condition records. This is coming from an external source.
    Now, there has been a change in the pricing (outside the system). This is communicated from the external system. We need to pinpoint which condition types to update in SAP, based on the values in the external system through the BDC.
    Regards
    Hari

  • IDoc status 51 - LSMW for Creating Purchasing Info Records

    Dear All,
    My req is to create a Conversion for Purchasing Info Records. LSMW's IDoc method is used to develop this conversion wherein Message Type "INFREC" and Basic Type "INFRECMASS01" are being used.
    In the 14th step (Start IDoc Processing), I 'am getting the IDoc status "51" and Status Text "Application document not posted". If I double click on respective IDoc number, I got its Control record, Data records, and Status records; in the status records I can see "51" in Red color with the message "Function module not allowed: IDOC_INPUT_INFREC". If I double click on this it asks me to check the process code...
    Request you guys to resolve the issue....
    Solution will b rewarded.. Thanks in advance....

    I shouldnot use basic type INFREC01 instead of NFRECMASS01.
    'coz Within the FM there is a check for basic type like:
    check idoc type
    if f_idoc_control-idoctp c_idoctp_infrec01. " INFREC01
    raise wrong_function_called.
    endif.
    Even one can go to WE57 and see the basic Type INFREC01 assigned to the FM IDOC_INPUT_INFREC, hence one shud use this basic type...

  • Bapi for creating purchase info records

    Hi,
    Is there any bapi or standard function to create PIR

    BAPI_REQUISITION_CREATE
    or
    ME_CREATE_REQUISITION_EXT
    see this list as well.
    http://www.sapbapi.com/bapi-list/

  • None approval process for Purchasing Info Record

    Hi,
    Are there some approval process in SAP for Purchasing Info Record?
    Now, we use ME11 to creat Purchasing Info Record. And use ME12 to modify Purchasing Info Record. I feel it is very dangerous. Becase if someone make a mistake. Nobody know.
    If the price is lower than actual price, vendor must ask us modify it. If the price is higher than actual price, I am not very sure what will happen.
    So, we are seeking for an approval process in SAP system.
    Dan Yang

    >
    DanYang!@# wrote:
    > Hi,
    >
    > Are there some approval process in SAP for Purchasing Info Record?
    > Now, we use ME11 to creat Purchasing Info Record.
    And use ME12 to modify Purchasing Info Record. I feel it is very dangerous.
    Becase if someone make a mistake. Nobody know.
    >
    > If the price is lower than actual price, vendor must ask us modify it.
    If the price is higher than actual price, I am not very sure what will happen.
    >
    > So, we are seeking for an approval process in SAP system.
    >
    > Dan Yang
    There is no approval process in standard,Since it serves as master.
    Better provide authorization for ME11 & ME12 to restrict it.
    Raise quotation to maintain vendor prices.

  • Use of Purchase info records in SRM SC in Extended Classic scenario

    Hi All,
    We have implemented SRM 7.13 with Extended classic scenario. If we have Purchase info record in SAP ECC for the material, it gets populated in SRM SC in Source of supply Tab but the price of Purchase info record does not get updated in the SC line item.
    Can anyone let me know which configurations is required to fetch the Purchase info record price or we need to have a customization to achieve this.
    Thanks,
    Ankur

    HI Ankur
    when you say the price did not get updated did you check the sequence which is used for price determination ?
    1. User entry
    2. Contracts
    3.  Info record
    If still you think it is an issue please check the report  EBP_GET_BACKEND_PRICES and let me know if your problem gets fixed?
    Regards
    Vinita

  • Pricing not updated in Purchase Info Record using INFREC01. is it possible?

    Hi Gurus,
    I am using IDoc INFREC01 to create Purchase info record for material, but when I see in ME13 that PIR is created successfully but price is never updated, though I have populated field NETPR and EFFPR hence condition PB00 (basic pricing condition) not created.
    Is it possible to update only single pricing (basic price PB00) condition through INFREC01 ??? or should I use another BAPI or some standard report ...??.
    I am extending Pricing Conditions for Purchase inforec through seprate IDOC: COND_A01, but it could only do that if there is basic pricing condition i.e. PB00.
    Please advice.
    Thanks in advance.
    Robin

    HI,
    You can update pricing field for conditon type PB00, please use correct validity period.
    Even there are no basic Price condition PB00, you can add new condition types with existing types.
    Price vaue can depend on the pricing conditions that you have maintained.
    Thanks....

  • APO CIF issue - Purchase Info Record not getting CIFed from R/3 to APO

    Dear All,
                We are unable to CIF Purchase Info Record from SAP R/3 to APO. Are there any special setting that needs to be done for the same. We have created an Integration Model and using tcodes CFM1/CFM2 but without any success. Can anybody throw some light on this issue?
    Thanks in advance
    Ehsan Ahmed

    Ehsaan
    Can you check the SLG1 logs in R/3 and APO sides for further clues? Try to confine the time range to the exact time of activation of Purch INfo record model.
    Maybe you have already done this check. Can you go to the Purchasing tab of Material Master and see if the Source List checkbox is unchecked ? Do you have any special procurement keys defined by any chance ?
    Regards
    Srinivas

  • Purchasing Group in Purchase Info Record

    Hello Gurus,
    The Purchasing Group in Purchasing Info Record is not read at Purchase Requisitions...
    My operation is as below;
    1. Create Purchasing Requisitions via MRP
    2. Assign Fixed Vendor at MD57 or via Source List ( when source list, Fixed Vendor will be assigned at MRP)
    3. Vendor and sometimes Purchase info rec # are assigned to Purchase Requirement
    But Purchasing Group is not assigned to Purchase Requisition.
    I understood that Price is not assigned at Purchase Requisitions, but nor Purchasing Group is not assigned although it is mandatory field in Purchase Info Record at SAP standard..
    Would you tell me how to read Purchasing Group from Purchasing Info Records into Purchase Requisitions?
    Best Regards,
    AK

    Hello,
    Hm, now it is like this;
    - Actually, One Purchase Organization is fixed for the Plant
    - But since we use the same purchase organization, the organization customization was set as below;
        --  Purchase Organization- Company Code: Blank for the Purchase Organization
        --  Plant - Purchase Organization: one Purchase Organization is set for all the Plants
        --  Plant - default Purchase Organization: blank since this seems to be effective only for consignment etc
    -> And the PR which was created via MRP, there is no Purchase Organization assigned....
    I do not know why...we have Plant in the PR but blank for Purchase Organization..
    And it seems that, if I could assign purchase organization to PR via MRP, Purchase Group should be read into PR..
    Edited by: Asayo Kasai on Jan 18, 2011 2:15 PM
    Edited by: Asayo Kasai on Jan 18, 2011 2:15 PM

Maybe you are looking for

  • Webex Connect "An unknown error ocurred connecting the server" Error Message

    Hi, We have the latest Cisco Webex Connect Clients (7.1.1 Build 16597) in use in our company. With no obvious reason one of our employees now can't connect to Webex Connect getting the Error Message "An unknown error ocurred while connecting to the s

  • Sign Out in IC Agent Role CRM 6.O

    Hi All, I am implementing CIC in SAP CRM 6.O. The standard is not having the sign out option in IC Agent Role , rather the session will end if we close the window. But ou client is willing to have the same in 6.O as all other Bussiness Roles is havin

  • C240 M3 Stuck at "Configuring and testing memory .."

    Hi, This server's just been returned to us from Cisco, who had it on loan since it was new.   We're trying to put it back into service, but have hit the following problem. On first power-up the server gets as far as the "Configuring and testing memor

  • Error while running SSIS package from Integration service or via Job

    Hi All, I encounter the below error while running SSIS Package from Job or integration service. However on execution completes success fully while running from data tools. The issue occurs after migration to 2012 from 2oo5 dtsx. PFB the error. SSIS E

  • Need new notebook for video editing

    I've been shopping for a new notebook for my friend. He will be editing 50 p loaded from his Panasonic HC - X920, using Premier Pro. It must be a notebook, a desktop is not an option. I've narrowed it down to a particular Asus system here in Northern