2 Replies Latest reply: Oct 1, 2012 5:20 AM by Hawkeye 11 RSS

    create sales order using  IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER

    Hawkeye 11
      Hi,
      I am trying to create an sales order using following api. which creates cart from shopping cart.

      SET serveroutput ON
      DECLARE
      P_API_VERSION_NUMBER NUMBER;
      P_INIT_MSG_LIST VARCHAR2(200);
      P_COMMIT VARCHAR2(200);
      X_RETURN_STATUS VARCHAR2(200);
      X_MSG_COUNT NUMBER;
      X_MSG_DATA VARCHAR2(200);
      P_QUOTE_HEADERID NUMBER;
      P_LAST_UPDATE_DATE DATE;
      P_SHAREE_NUMBER NUMBER;
      P_SHAREE_PARTY_ID NUMBER;
      P_SHAREE_ACCOUNT_ID NUMBER;
      P_SC_BOOK_FLAG VARCHAR2(200);
      P_SC_RESERVE_FLAG VARCHAR2(200);
      P_SC_CALCULATE_PRICE VARCHAR2(200);
      P_SC_SERVER_ID NUMBER;
      P_SC_CC_BY_FAX VARCHAR2(200);
      P_CUSTOMER_COMMENTS VARCHAR2(200);
      P_REASON_CODE VARCHAR2(200);
      P_SALESREP_EMAIL_ID VARCHAR2(200);
      P_MINISITE_ID NUMBER;
      X_LAST_UPDATE_DATE DATE;
      X_ORDER_NUMBER NUMBER;
      X_ORDER_HEADER_ID NUMBER;
      X_ORDER_REQUEST_ID NUMBER;
      X_CONTRACT_ID NUMBER;
      X_STATUS VARCHAR2(200);
      X_HOLD_FLAG VARCHAR2(200);
      BEGIN
      P_API_VERSION_NUMBER := 1;
      P_INIT_MSG_LIST := FND_API.G_TRUE;
      P_COMMIT := FND_API.G_FALSE;
      P_QUOTE_HEADERID := 18534;
      P_LAST_UPDATE_DATE := to_date('2012-10-01 04:33:45','YYYY-MM-DD HH24:MI:SS');
      P_SHAREE_NUMBER := FND_API.G_MISS_NUM ;
      P_SHAREE_PARTY_ID := FND_API.G_MISS_NUM ;
      P_SHAREE_ACCOUNT_ID := FND_API.G_MISS_NUM ;
      P_SC_BOOK_FLAG := FND_API.G_MISS_CHAR;
      P_SC_RESERVE_FLAG := FND_API.G_FALSE;
      P_SC_CALCULATE_PRICE := FND_API.G_FALSE;
      P_SC_SERVER_ID := -1;
      P_SC_CC_BY_FAX := FND_API.G_FALSE;
      P_CUSTOMER_COMMENTS := FND_API.G_MISS_CHAR;
      P_REASON_CODE := FND_API.G_MISS_CHAR;
      P_SALESREP_EMAIL_ID := FND_API.G_MISS_CHAR;
      P_MINISITE_ID := 10660;

      IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER(
      P_API_VERSION_NUMBER => P_API_VERSION_NUMBER,
      P_INIT_MSG_LIST => P_INIT_MSG_LIST,
      P_COMMIT => P_COMMIT,
      X_RETURN_STATUS => X_RETURN_STATUS,
      X_MSG_COUNT => X_MSG_COUNT,
      X_MSG_DATA => X_MSG_DATA,
      P_QUOTE_HEADERID => P_QUOTE_HEADERID,
      P_LAST_UPDATE_DATE => P_LAST_UPDATE_DATE,
      P_SHAREE_NUMBER => P_SHAREE_NUMBER,
      P_SHAREE_PARTY_ID => P_SHAREE_PARTY_ID,
      P_SHAREE_ACCOUNT_ID => P_SHAREE_ACCOUNT_ID,
      P_SC_BOOK_FLAG => P_SC_BOOK_FLAG,
      P_SC_RESERVE_FLAG => P_SC_RESERVE_FLAG,
      P_SC_CALCULATE_PRICE => P_SC_CALCULATE_PRICE,
      P_SC_SERVER_ID => P_SC_SERVER_ID,
      P_SC_CC_BY_FAX => P_SC_CC_BY_FAX,
      P_CUSTOMER_COMMENTS => P_CUSTOMER_COMMENTS,
      P_REASON_CODE => P_REASON_CODE,
      P_SALESREP_EMAIL_ID => P_SALESREP_EMAIL_ID,
      P_MINISITE_ID => P_MINISITE_ID,
      X_LAST_UPDATE_DATE => X_LAST_UPDATE_DATE,
      X_ORDER_NUMBER => X_ORDER_NUMBER,
      X_ORDER_HEADER_ID => X_ORDER_HEADER_ID,
      X_ORDER_REQUEST_ID => X_ORDER_REQUEST_ID,
      X_CONTRACT_ID => X_CONTRACT_ID,
      X_STATUS => X_STATUS,
      X_HOLD_FLAG => X_HOLD_FLAG
      );

      DBMS_OUTPUT.PUT_LINE('X_RETURN_STATUS = ' || X_RETURN_STATUS);
      DBMS_OUTPUT.PUT_LINE('X_MSG_COUNT = ' || X_MSG_COUNT);
      DBMS_OUTPUT.PUT_LINE('X_MSG_DATA = ' || X_MSG_DATA);
      DBMS_OUTPUT.PUT_LINE('X_LAST_UPDATE_DATE = ' || X_LAST_UPDATE_DATE);
      DBMS_OUTPUT.PUT_LINE('X_ORDER_NUMBER = ' || X_ORDER_NUMBER);
      DBMS_OUTPUT.PUT_LINE('X_ORDER_HEADER_ID = ' || X_ORDER_HEADER_ID);
      DBMS_OUTPUT.PUT_LINE('X_ORDER_REQUEST_ID = ' || X_ORDER_REQUEST_ID);
      DBMS_OUTPUT.PUT_LINE('X_CONTRACT_ID = ' || X_CONTRACT_ID);
      DBMS_OUTPUT.PUT_LINE('X_STATUS = ' || X_STATUS);
      DBMS_OUTPUT.PUT_LINE('X_HOLD_FLAG = ' || X_HOLD_FLAG);
      END;

      When i use this from a OA_HTML jsp the sales order is created . But when i use it from the sql developer
      i got following error

      X_RETURN_STATUS = E
      X_MSG_COUNT = 1
      X_MSG_DATA = You do not have access to this cart.
      X_LAST_UPDATE_DATE =
      X_ORDER_NUMBER = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      X_ORDER_HEADER_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      X_ORDER_REQUEST_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      X_CONTRACT_ID = 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      X_STATUS =

      I checked logs for both .
      For working one log is ie. using jsp
      01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
      01-OCT-2012:01:24:46 IBE IBE_UTIL.enable_debug_new p_check_profile is N
      01-OCT-2012:01:24:46 IBE Begin validate_user_update10/01/2012:01:24:46
      01-OCT-2012:01:24:46 IBE Incoming party_id is 423832
      01-OCT-2012:01:24:46 IBE Incoming cust_account_id is 140757
      01-OCT-2012:01:24:46 IBE Incoming quote_header_id is 18529
      01-OCT-2012:01:24:46 IBE User id obtained from environment is: -1
      01-OCT-2012:01:24:46 IBE p_save_type is :6
      01-OCT-2012:01:24:46 IBE Entered Validation...T
      01-OCT-2012:01:24:46 IBE no sharee number
      01-OCT-2012:01:24:46 IBE quote_source_code of cart passed in=IStore Account
      01-OCT-2012:01:24:46 IBE In validating Owner flow: 423832,140757 10/01/2012:01:24:46
      01-OCT-2012:01:24:46 IBE Validate_user_update: Before Last update date validation,p_last_update_date= 01-10-12
      01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation START
      01-OCT-2012:01:24:46 IBE Validate_user_update: l_last_update_date=
      01-OCT-2012:01:24:46 IBE Validate_user_update: p_last_update_date=10/01/2012:00:22:07
      01-OCT-2012:01:24:46 IBE Validate_user_update: Last update date validation END
      01-OCT-2012:01:24:46 IBE Before calling validate_quote10/01/2012:01:24:46
      01-OCT-2012:01:24:46 IBE Begin Validate_quote10/01/2012:01:24:46
      01-OCT-2012:01:24:46 IBE Validate_quote: Validation for one-click start
      01-OCT-2012:01:24:46 IBE End validate_quote10/01/2012:01:24:46
      01-OCT-2012:01:24:46 IBE End validate_user_update10/01/2012:01:24:46

      but for the failure it is.
      01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
      01-OCT-2012:01:20:53 IBE IBE_UTIL.enable_debug_new p_check_profile is N
      01-OCT-2012:01:20:53 IBE Begin validate_user_update10/01/2012:01:20:53
      01-OCT-2012:01:20:53 IBE Incoming party_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      01-OCT-2012:01:20:53 IBE Incoming cust_account_id is 9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125
      01-OCT-2012:01:20:53 IBE Incoming quote_header_id is 18529
      01-OCT-2012:01:20:53 IBE User id obtained from environment is: -1
      01-OCT-2012:01:20:53 IBE p_save_type is :6
      01-OCT-2012:01:20:53 IBE Entered Validation...T
      01-OCT-2012:01:20:53 IBE no sharee number
      01-OCT-2012:01:20:53 IBE quote_source_code of cart passed in=IStore Account
      01-OCT-2012:01:20:53 IBE Owner flow with env. userid: 10/01/2012:01:20:53
      01-OCT-2012:01:20:53 IBE partyId::quotehdrId(9.990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+125,18529)
      01-OCT-2012:01:20:53 IBE End:Expected exception:IBE_Quote_Misc_pvt.validate_user_update

      From this u can see that party id and account is fetched when using jsp. but direct running of procedure not getting these values.
      is there sql api running when accessing through jsp . so that these values are got from session.
      Thanks
      Mark
        • 1. Re: create sales order using  IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER
          Pradeep Kalyan
          Try to pass the party_id and cust_account_id while running it from SQL Developer.
          • 2. Re: create sales order using  IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER
            Hawkeye 11
            Hi,
            I have passed that too . still getting same error.
            IBE_Quote_W1_PVT.SUBMITQUOTEWRAPPER calls IBE_Quote_Checkout_Pvt.submitQuote
            which calls another package
            PROCEDURE Validate_User_Update(
            p_api_version_number IN NUMBER := 1.0
            ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
            ,p_quote_header_id IN NUMBER
            ,p_party_id IN NUMBER := FND_API.G_MISS_NUM
            ,p_cust_account_id IN NUMBER := FND_API.G_MISS_NUM
            ,p_quote_retrieval_number IN NUMBER := FND_API.G_MISS_NUM
            ,p_validate_user IN VARCHAR2 := FND_API.G_FALSE
            ,p_privilege_type_code IN VARCHAR2 := 'F'
            ,p_save_type IN NUMBER := FND_API.G_MISS_NUM
            ,p_last_update_date IN DATE := FND_API.G_MISS_DATE
            ,x_return_status OUT NOCOPY VARCHAR2
            ,x_msg_count OUT NOCOPY NUMBER
            ,x_msg_data OUT NOCOPY VARCHAR2)

            in it like this
            IBE_Quote_Misc_pvt.Validate_User_Update(
                 p_init_msg_list => FND_API.G_TRUE
                 ,p_quote_header_id => p_quote_Header_Id
                 ,p_quote_retrieval_number => p_sharee_number
                 ,p_validate_user     => FND_API.G_TRUE
                 ,p_privilege_type_code => 'A'
            ,p_save_type => PLACE_ORDER
            ,p_last_update_date => p_last_update_date
            ,x_return_status => x_return_status
            ,x_msg_count => x_msg_count
            ,x_msg_data => x_msg_data
            );

            from this u can see that there no value passed for party id and account id .
            Thanks
            Mark