package [message #561627] |
Tue, 24 July 2012 06:54 |
hany_marawan
Messages: 198 Registered: April 2005 Location: Cairo - Egypt
|
Senior Member |
|
|
Hello,
Did anyone have an example for this package "GMD_QC_TESTS_PUB.CREATE_TESTS" which load the tests in OPM
|
|
|
Re: package [message #570631 is a reply to message #561627] |
Tue, 13 November 2012 05:18 |
|
Karim_Iceberg
Messages: 1 Registered: November 2012 Location: Cairo, EG
|
Junior Member |
|
|
working fine with me, \PS care to the username select
/* Formatted on 13/11/2012 13:06 (Formatter Plus v4.8.8) */
SET serveroutput on buffer 2560000
DECLARE
CURSOR C1
IS
SELECT *
FROM XX_GMD_QC_TESTS
WHERE TEST_CODE = 'Pack Size';
TYPE GMD_QC_TESTS_REC IS TABLE OF GMD_QC_TESTS%ROWTYPE
INDEX BY BINARY_INTEGER;
P_API_VERSION NUMBER;
P_INIT_MSG_LIST VARCHAR2 (2000);
P_COMMIT VARCHAR2 (2000);
P_VALIDATION_LEVEL NUMBER;
P_QC_TESTS_REC GMD_QC_TESTS%ROWTYPE;
P_QC_TEST_VALUES_TBL GMD_QC_TESTS_PUB.QC_TEST_VALUES_TBL;
P_QC_CUST_TESTS_TBL GMD_QC_TESTS_PUB.QC_CUST_TESTS_TBL;
P_USER_NAME VARCHAR2 (2000);
X_QC_TESTS_REC GMD_QC_TESTS%ROWTYPE;
X_QC_TEST_VALUES_TBL GMD_QC_TESTS_PUB.QC_TEST_VALUES_TBL;
X_QC_CUST_TESTS_TBL GMD_QC_TESTS_PUB.QC_CUST_TESTS_TBL;
X_RETURN_STATUS VARCHAR2 (2000);
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2 (2000);
P_COUNT NUMBER;
BEGIN
FOR I IN C1
LOOP
P_API_VERSION := 1.0;
P_INIT_MSG_LIST := NULL;
P_COMMIT := NULL;
P_VALIDATION_LEVEL := NULL;
-- P_QC_TESTS_REC := NULL; Modify the code to initialize this parameter
P_QC_TESTS_REC.TEST_CODE := I.TEST_CODE;
P_QC_TESTS_REC.TEST_DESC := I.TEST_DESC;
P_QC_TESTS_REC.TEST_CLASS := I.TEST_CLASS;
P_QC_TESTS_REC.TEST_METHOD_ID := TO_NUMBER (0);
-----------------0 for defult
P_QC_TESTS_REC.TEST_TYPE := I.TEST_TYPE; ---- V, N, E,L,T,U
P_QC_TESTS_REC.TEST_TYPE := I.TEST_TYPE;
P_QC_TESTS_REC.TEST_UNIT := I.TEST_UNIT; -------------- UOM
P_QC_TESTS_REC.PRIORITY := TO_NUMBER (I.PRIORITY);
------------------------select id
P_QC_TESTS_REC.MIN_VALUE_NUM := TO_NUMBER (I.MIN_VALUE_NUM);
----- VALUE
P_QC_TESTS_REC.MAX_VALUE_NUM := TO_NUMBER (I.MAX_VALUE_NUM);
-------VALUE
P_QC_TESTS_REC.DISPLAY_PRECISION := I.DISPLAY_PRECISION;
P_QC_TESTS_REC.REPORT_PRECISION := I.REPORT_PRECISION;
P_QC_TESTS_REC.EXPRESSION := I.EXPRESSION;
-------------- test button select from LOV one
P_QC_TESTS_REC.CREATION_DATE := SYSDATE;
P_QC_TESTS_REC.CREATED_BY := I.CREATED_BY;
P_QC_TESTS_REC.LAST_UPDATE_DATE := SYSDATE;
P_QC_TESTS_REC.LAST_UPDATED_BY := I.LAST_UPDATED_BY;
P_QC_TESTS_REC.LAST_UPDATE_LOGIN := I.LAST_UPDATE_LOGIN;
-- P_QC_TEST_VALUES_TBL := NULL; Modify the code to initialize this parameter
-- -- P_QC_CUST_TESTS_TBL := NULL; Modify the code to initialize this parameter
-- SELECT USER_NAME
-- INTO P_USER_NAME
-- FROM FND_USER;
P_USER_NAME := 'GUEST';
-- X_QC_TESTS_REC := NULL; Modify the code to initialize this parameter
-- X_QC_TEST_VALUES_TBL := NULL; Modify the code to initialize this parameter
-- X_QC_CUST_TESTS_TBL := NULL; Modify the code to initialize this parameter
X_RETURN_STATUS := NULL;
X_MSG_COUNT := NULL;
X_MSG_DATA := NULL;
APPS.GMD_QC_TESTS_PUB.CREATE_TESTS (P_API_VERSION
, P_INIT_MSG_LIST
, P_COMMIT
, P_VALIDATION_LEVEL
, P_QC_TESTS_REC
, P_QC_TEST_VALUES_TBL
, P_QC_CUST_TESTS_TBL
, P_USER_NAME
, X_QC_TESTS_REC
, X_QC_TEST_VALUES_TBL
, X_QC_CUST_TESTS_TBL
, X_RETURN_STATUS
, X_MSG_COUNT
, X_MSG_DATA
);
COMMIT;
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);
IF X_MSG_COUNT = 1
THEN
DBMS_OUTPUT.PUT_LINE ('x_msg_data ' || X_MSG_DATA);
ELSIF X_MSG_COUNT > 1
THEN
LOOP
P_COUNT := P_COUNT + 1;
X_MSG_DATA :=
FND_MSG_PUB.GET (FND_MSG_PUB.G_NEXT
, FND_API.G_FALSE
);
IF X_MSG_DATA IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.PUT_LINE ('Message' || P_COUNT || ' ---' || X_MSG_DATA);
END LOOP;
END IF;
END LOOP;
END;
[EDITED by LF: applied [code] tags; code was already formatted]
[Updated on: Tue, 13 November 2012 05:32] by Moderator Report message to a moderator
|
|
|