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 30428
Next
In Process

Oraask Latest Questions

Question
PaulG
  • 0
  • 0
PaulGExplorer
Asked: July 15, 20192019-07-15T13:35:45+03:00 2019-07-15T13:35:45+03:00In: Oracle Ebs Api’s

When creating a Work Request via the APIs am I able to set the CREATED_BY?

  • 0
  • 0

I wrote the script below to test this and the resulting Work Request always ends up with Anonymous in the Created By when reviewed in the App. As you can see I try and do an UPDATE after the CREATE as well.

DECLARE

v_work_request_rec wip_eam_work_requests%ROWTYPE;
d_work_request_rec wip_eam_work_requests%ROWTYPE;
v_user_id NUMBER;
o_work_request_id wip_eam_work_requests.work_request_id%TYPE;
o_return_status VARCHAR2(50);
o_msg_count NUMBER;
o_msg_data VARCHAR2(2000);
v_organization_code mtl_parameters.organization_code%TYPE;
v_lookup_type fnd_lookup_values.lookup_type%TYPE;
v_description_240 wip_eam_work_requests.description%TYPE;
v_dummy VARCHAR2(1);
o_oracle_work_request_id NUMBER;
o_oracle_work_request_number VARCHAR2(100);
o_status VARCHAR2(100);
o_error_msg VARCHAR2(2000);

CURSOR c_get_work_request_number IS
SELECT work_request_number
FROM wip_eam_work_requests
WHERE organization_id = 10179
AND work_request_id = o_work_request_id;

BEGIN
—
o_status := ‘SUCCESS’;
—
IF o_status = ‘SUCCESS’ THEN

v_work_request_rec.asset_group := 1135865;
v_work_request_rec.asset_number := ‘VALV-442-MDV-0001’;
v_work_request_rec.description := ‘Test WR with Requestor’;
v_work_request_rec.work_request_priority_id := 5;
v_work_request_rec.work_request_owning_dept := 1578;
v_work_request_rec.work_request_status_id := 3;
v_work_request_rec.work_request_type_id := 11;
v_work_request_rec.organization_id := 10179;
v_work_request_rec.creation_date := SYSDATE;
v_work_request_rec.expected_resolution_date := SYSDATE+60;
v_work_request_rec.work_request_created_by := 120066;  –This is a valid user in fnd_user
v_work_request_rec.created_for := NULL;
v_work_request_rec.created_by := 120066; –This is a valid user in fnd_user
v_work_request_rec.last_update_date := SYSDATE;
v_work_request_rec.attribute15 := 2;
—
— wip_eam_workrequest_pub.work_request_import
wip_eam_workrequest_pub.work_request_import
(p_api_version => 1.0
,p_init_msg_list => FND_API.G_FALSE
,p_commit => FND_API.G_TRUE
,p_validation_level => FND_API.G_VALID_LEVEL_FULL
,p_mode => ‘CREATE’
,p_work_request_rec => v_work_request_rec
,p_request_log => ‘Test WR with Requestor Created by Paul G’
,p_user_id => v_user_id
,x_work_request_id => o_work_request_id
,x_return_status => o_return_status
,x_msg_count => o_msg_count
,x_msg_data => o_msg_data
);
IF o_return_status <> ‘S’ THEN
o_status := ‘FAILURE’;
o_error_msg := ‘Error in CREATE call to wip_eam_workrequest_pub.work_request_import – ‘||o_msg_data||’ – ‘||SUBSTR(SQLERRM,1,200);
ELSE
OPEN c_get_work_request_number;
FETCH c_get_work_request_number
INTO o_oracle_work_request_number;
IF c_get_work_request_number%NOTFOUND THEN
o_status := ‘FAILURE’;
o_error_msg := ‘Error in retrieving work request number after successful call to api for org id ‘||
‘10179’||’ and work request id ‘||o_work_request_id||’ and ivara request ‘||’1’;
END IF;
CLOSE c_get_work_request_number;
–Issue 063452 – ( Oracle eAM) Work request long description is not being sent to Oracle
IF o_work_request_id IS NOT NULL AND o_status = ‘SUCCESS’ THEN
v_work_request_rec := d_work_request_rec;
v_work_request_rec.organization_id := 10179;
v_work_request_rec.work_request_id := o_work_request_id;
v_work_request_rec.work_request_created_by := 120066;
v_work_request_rec.created_for := 120066;
v_work_request_rec.created_by := 120066;
v_work_request_rec.attribute15 := o_oracle_work_request_number;

–wip_eam_workrequest_pub.work_request_import

wip_eam_workrequest_pub.work_request_import
(p_api_version => 1.0
,p_init_msg_list => FND_API.G_FALSE
,p_commit => FND_API.G_TRUE
,p_validation_level => FND_API.G_VALID_LEVEL_FULL
,p_mode => ‘UPDATE’
,p_work_request_rec => v_work_request_rec
,p_request_log => ‘Test WR with Requestor Created by Paul G’
,p_user_id => v_user_id
,x_work_request_id => o_work_request_id
,x_return_status => o_return_status
,x_msg_count => o_msg_count
,x_msg_data => o_msg_data
);

IF o_return_status <> ‘S’ THEN
o_status := ‘FAILURE’;
o_error_msg := ‘Error in UPDATE call to wip_eam_workrequest_pub.work_request_import – ‘||o_msg_data;
END IF;
END IF;
END IF;
END IF;
END;

oracle eam apiwork_request_import
1
  • 1 1 Answer
  • 1k 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
      Hassan AbdElrahman Master Oracle ACE Pro ♠ | Oracle Senior ERP Technical Consultant
      2019-08-02T22:05:45+03:00Added an answer on August 2, 2019 at 10:05 pm

      by default who columns as (CREATED_BY) is one of them is handled automatically from oracle by database triggers like HRMS and when you call any API’s from sql*plus or sql developer. who columns are set also automatically by anonymous user.

      but still you can control of this behavior by calling

      fnd_global.apps_initialize

      before call your API. but keep in mind that it is your responsibility to pass in valid values, as incorrect values are not rejected.

      Regards.

        • 0
      • 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.