Sign Up

Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have permission to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Oraask Logo Oraask Logo
Sign InSign Up

Oraask

  • Write
    • Add A New Post
    • Ask A Question

Oraask Navigation

Search
Ask A Question

Mobile menu

Close
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Dev Tools
    • Online Compiler
    • Base64 Converter
  • Wiki
    • SQL Tutorials
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
Home/ Questions/Q 4846
Next
Answered

Oraask Latest Questions

Question
Jone
  • 2
  • 2
JoneExplorer
Asked: March 24, 20172017-03-24T01:51:18+03:00 2017-03-24T01:51:18+03:00In: Oracle Ebs Api’s

API to create and update Inventory Items in Oracle Apps R12

  • 2
  • 2

Hi guys, please i need an API to create and update items in inventory.

any help will be appreciated

APIapi to create item in oracle apps r12create itemego_item_pubego_item_pub. process items updateego_item_pub.process_itemego_item_pub.process_itemsego_item_pub.process_items sample codeitem creation api in oracle appsitem creation api in oracle apps r12item update api in oracle appsitem update api in oracle apps r12oracleoracle EBS R12update item
1
  • 1 1 Answer
  • 17k Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    Related Questions

    • API to close workflow notifications in Oracle APPS R12
    • INV_ITEM_CATEGORY_PUB.update_category_assignment API returned status 'E' but without error message
    • Payables Import Invoices
    • API to update AR invoice in oracle apps R12?
    • How to Cancel payable invoice using API in oracle apps?

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. Hassan AbdElrahman
      Best Answer
      Hassan AbdElrahman Master Oracle ACE Pro Alum ♠ | Oracle Senior ERP Technical Consultant
      2017-07-11T10:25:24+03:00Added an answer on July 11, 2017 at 10:25 am
      This answer was edited.

      Hello Jone,   you can create or update inventory item by using API (ego_item_pub.process_item) and this an example :  

      Note : before using both API’s be aware that we are not committing the changes. You have to perform explicit commit manually from IDE or set parameter (p_commit = ‘T’) to commit your changes.

      1. Create new inventory item using this API example:
      DECLARE
        l_inventory_item_id   NUMBER;
        l_organization_id     NUMBER;
        l_return_status       VARCHAR2 (4000);
        l_msg_data            VARCHAR2 (4000);
        l_msg_count           NUMBER;
        x_message_list        error_handler.error_tbl_type;
      BEGIN
        fnd_global.apps_initialize (user_id => 1318, --> OPERATIONS
                                    resp_id => 50583, --> Inventory, Vision Operations (USA)
                                    resp_appl_id => 401); --> Inventory
      
        ego_item_pub.process_item (p_api_version                  => 1.0
                                  ,p_init_msg_list                => 'T' -- (F:- False), (T:- True)
                                  ,p_commit                       => 'F' -- (F:- False), (T:- True)
                                  ,p_transaction_type             => 'CREATE' -- UPDATE FOR Updating item
                                  ,p_segment1                     => 'Oraask_Item01' -- ITEM CODE
                                  ,p_description                  => 'Oraask Test Item Description' -- ITEM DESCRIPTION
                                  ,p_long_description             => 'Oraask Test Long Item Description' -- ITEM LONG DESCRIPTION
                                  ,p_organization_id              => 204 -- Vision Operations
                                  ,p_apply_template               => 'ALL'
                                  ,p_template_id                  => 2 -- Purchased Item — select * from mtl_item_templates_vl
                                  -- P_TEMPLATE_NAME => '@Purchased Item',
                                  -- P_ITEM_TYPE => 'P',
                                  ,p_inventory_item_status_code   => 'Active'
                                  ,p_approval_status              => 'A'
                                  ,x_inventory_item_id            => l_inventory_item_id
                                  ,x_organization_id              => l_organization_id
                                  ,x_return_status                => l_return_status
                                  ,x_msg_count                    => l_msg_count
                                  ,x_msg_data                     => l_msg_data);
      
        IF l_return_status = fnd_api.g_ret_sts_success THEN
          dbms_output.put_line ('Item is Created Successfully, Inventory Item ID : ' || l_inventory_item_id);
      
        ELSE
          dbms_output.put_line ('Item Creation is Failed');
          error_handler.get_message_list (x_message_list => x_message_list);
      
          FOR i IN 1 .. x_message_list.count
          LOOP
            dbms_output.put_line (x_message_list (i).message_text);
          END LOOP;
      
          ROLLBACK;
        END IF;
      --> EXCEPTIONS HANDLING PART
      EXCEPTION
        WHEN OTHERS THEN
          FOR i IN 1 .. l_msg_count
          LOOP
            dbms_output.put_line (substr (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255));
            dbms_output.put_line ('message is: ' || l_msg_data);
          END LOOP;
      END;

       

      • Update existing inventory item using this API example:
      DECLARE
        l_inventory_item_id   NUMBER;
        l_organization_id     NUMBER;
        l_return_status       VARCHAR2 (4000);
        l_msg_data            VARCHAR2 (4000);
        l_msg_count           NUMBER;
        x_message_list        error_handler.error_tbl_type;
      BEGIN
        fnd_global.apps_initialize (user_id => 1318, --> OPERATIONS
                                    resp_id => 50583, --> Inventory, Vision Operations (USA)
                                    resp_appl_id => 401); --> Inventory
       
        ego_item_pub.process_item (p_api_version                  => 1.0
                                  ,p_init_msg_list                => 'T' -- (F:- False), (T:- True)
                                  ,p_commit                       => 'F' -- (F:- False), (T:- True)
                                  ,p_transaction_type             => 'UPDATE' -- UPDATE FOR Updating item
                                  ,p_Inventory_Item_Id            => 53899
                                  ,p_description                  => 'Oraask test description' -- ITEM DESCRIPTION
                                  ,p_organization_id              => 204 -- Vision Operations
                                  ,x_inventory_item_id            => l_inventory_item_id
                                  ,x_organization_id              => l_organization_id
                                  ,x_return_status                => l_return_status
                                  ,x_msg_count                    => l_msg_count
                                  ,x_msg_data                     => l_msg_data);
       
        IF l_return_status = fnd_api.g_ret_sts_success THEN
          dbms_output.put_line ('Inventory Item has been updated Successfully, Inventory Item ID : ' || l_inventory_item_id);
      
        ELSE
          dbms_output.put_line ('Update inventory item is Failed');
          error_handler.get_message_list (x_message_list => x_message_list);
       
          FOR i IN 1 .. x_message_list.count
          LOOP
            dbms_output.put_line (x_message_list (i).message_text);
          END LOOP;
       
          ROLLBACK;
        END IF;
      --> EXCEPTIONS HANDLING PART
      EXCEPTION
        WHEN OTHERS THEN
          FOR i IN 1 .. l_msg_count
          LOOP
            dbms_output.put_line (substr (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255));
            dbms_output.put_line ('message is: ' || l_msg_data);
          END LOOP;
      END;
      

      — By executing above code we have updated item description to be “Oraask test description” for inventory item id “53899”

      Hopefully, this code snippet helps you 🙂

        • 7
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Adv 250x250

    Explore

    • Categories
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Dev Tools
      • Online Compiler
      • Base64 Converter
    • Wiki
      • SQL Tutorials
      • Java Tutorials
      • Python Tutorials
      • JavaScript Tutorials

    Footer

    Oraask

    About

    Oraask is a website for developers and software engineers who want to learn new skills, share their knowledge, and solve their coding problems. Oraask provides free content on various programming languages and topics, such as Oracle, Python, Java, etc. Oraask also allows users to ask questions and get answers from other members of the community.

    About Us

    • About Us
    • Contact Us

    Legal Stuff

    • Privacy Policy
    • Terms & Conditions

    Follow

    Oraask is licensed under CC BY-NC-SA 4.0Oraask CopyrightOraask CopyrightOraask CopyrightOraask Copyright

    © 2019 Oraask. All Rights Reserved
    With Love by Oraask.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.