Every API has 3 OUT parameters as x_return_status, x_msg_count and x_msg_data.
1) x_return_status:
Indicates the return status of the API. The values returned are one of the following:
• FND_API.G_RET_STS_SUCCESS
Success: Indicates the API call was successful
• FND_API.G_RET_STS_ERROR
Expected Error: There is a validation error, or missing data error.
• FND_API.G_RET_STS_UNEXP_ERROR
Unexpected Error: The calling program can not correct the error.
2) x_msg_count:
Holds the number of messages in the message list.
3) x_msg_data:
Holds the encoded message if x_msg_count is equal to one
Using these 3 parameters, one can use below code to log or debug error in API's
dbms_output.put_line (SubStr('x_return_status = '||x_return_status, 1, 255));
dbms_output.put_line ('x_msg_count = '||TO_CHAR(x_msg_count));
dbms_output.put_line (SubStr('x_msg_data = '||x_msg_data, 1, 255));
IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I ||'.'|| SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF;
1) x_return_status:
Indicates the return status of the API. The values returned are one of the following:
• FND_API.G_RET_STS_SUCCESS
Success: Indicates the API call was successful
• FND_API.G_RET_STS_ERROR
Expected Error: There is a validation error, or missing data error.
• FND_API.G_RET_STS_UNEXP_ERROR
Unexpected Error: The calling program can not correct the error.
2) x_msg_count:
Holds the number of messages in the message list.
3) x_msg_data:
Holds the encoded message if x_msg_count is equal to one
Using these 3 parameters, one can use below code to log or debug error in API's
dbms_output.put_line (SubStr('x_return_status = '||x_return_status, 1, 255));
dbms_output.put_line ('x_msg_count = '||TO_CHAR(x_msg_count));
dbms_output.put_line (SubStr('x_msg_data = '||x_msg_data, 1, 255));
IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I ||'.'|| SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF;
No comments:
Post a Comment