Tuesday, February 15, 2011

How oracle apps TCA API handles null values

When any null value is passed to API for update, it takes existing value from table.
If we really want to nullify that field , we have to pass FND_API.G_MISS_NUM or FND_API.G_MISS_CHAR, or miss_date.

Here FND_API.G_ is common.

For return values, it returns
FND_API.G_RET_STS_SUCESS for success
FND_API.G_RET_STS_ERROR for Error
FND_API.G_STS_UNEXP_ERROR for any unexpected error.

So program would be like:

call API
check NVL(x_return_status, FND_API.G_RET_STS_ERROR) to FND_API.G_RET_STS_SUCCESS.

check NVL(x_return_status,FND_API.G_RET_STS_ERROR) to FND_API.G_RET_STS_UNEXP_ERROR

write some error handler for this unexpected error.

It also returns message stack if error occurs.
 task: write a program to examine this mesage stack.
To use message stack we have to initialize message stack
for this use first parameter of API
set it to T.

x_msg_count returns the number of messages on the message stack.

sample program to retrieve this message stack.

FOR I in 1 .. x_msg_count
LOOP
  FND_MSG_PUB.GET(p_encoded <= FND_API.G_FLASE)
END LOOP

Use substr to extract messages in short.

No comments:

Post a Comment