Sample API Code for AR_RECEIPT_API_PUB.Apply

Once Receipt created , Amount needs to apply against receipt amount. Inorder to apply amount against receipt , sample API code has been written.




Sample API code to apply amount against Receipt.

DECLARE
   l_return_status   varchar2 (1);
   l_msg_count       number;
   l_msg_data        varchar2 (240);
   l_count           number;
   l_msg_data_out    varchar2 (240);
   l_mesg            varchar2 (240);
   p_count           number;
   l_Rec_num         varchar2 (100);
   l_trx_num         varchar2 (100);
BEGIN
   mo_global.SET_POLICY_CONTEXT ('S', 414);                     -- your org id
   mo_global.init ('AR');



   ar_receipt_api_pub.Apply (
      p_api_version        => 1.0,
      p_init_msg_list      => FND_API.G_TRUE,
      p_commit             => FND_API.G_TRUE,
      p_validation_level   => FND_API.G_VALID_LEVEL_FULL,
      p_cash_receipt_id    => 95951,--- <CASH RECEIPT ID >
      p_customer_Trx_id    => 289864, ----<CUSTOMER TRX ID>
      p_org_id             =>414, --<ORG_ID>>
      x_return_status      => l_return_status,
      x_msg_count          => l_msg_count,
      x_msg_data           => l_msg_data
   );
   DBMS_OUTPUT.put_line ('Status ' || l_return_status);
   DBMS_OUTPUT.put_line ('Message count ' || l_msg_count);

   IF l_msg_count = 1
   THEN
      DBMS_OUTPUT.put_line ('l_msg_data ' || l_msg_data);
   ELSIF l_msg_count > 1
   THEN
      LOOP
         p_count := p_count + 1;
         l_msg_data := FND_MSG_PUB.Get (FND_MSG_PUB.G_NEXT, FND_API.G_FALSE);

         IF l_msg_data IS NULL
         THEN
            EXIT;
         END IF;

         DBMS_OUTPUT.put_line ('Message' || p_count || '.' || l_msg_data);
      END LOOP;
   END IF;
END;

Comments

Popular posts from this blog

REST integration built-in OIC to read Large files with size more than 10MB

Basic Concepts of OAF (Oracle Applications FrameWork )