Saturday 14 May 2011

End dating the Price List line in Service Contracts using the API qp_price_list_pub.process_price_list

Here is sample method of ending dating the Price List line for a Item in Service Contracts using API : qp_price_list_pub.process_price_list



DECLARE

x_price_list_rec                   apps.qp_price_list_pub.price_list_rec_type;
x_price_list_val_rec           apps.qp_price_list_pub.price_list_val_rec_type;
x_price_list_line_tbl           apps.qp_price_list_pub.price_list_line_tbl_type;
x_price_list_line_val_tbl    apps.qp_price_list_pub.price_list_line_val_tbl_type;
x_qualifiers_tbl                     apps.qp_qualifier_rules_pub.qualifiers_tbl_type;
x_qualifiers_val_tbl             apps.qp_qualifier_rules_pub.qualifiers_val_tbl_type;
x_pricing_attr_tbl                apps.qp_price_list_pub.pricing_attr_tbl_type;
x_pricing_attr_val_tbl        apps.qp_price_list_pub.pricing_attr_val_tbl_type;
k               NUMBER:= 1;
l_price_list_line_tbl            apps.qp_price_list_pub.price_list_line_tbl_type;
l_return_status                   VARCHAR2 (1):= NULL;
l_msg_count                       NUMBER:= 0;
l_msg_data                          VARCHAR2 (2000);


BEGIN
        
l_price_list_line_tbl (k).list_line_id := <List Line ID from qp_list_lines_v table>
l_price_list_line_tbl (k).operation := apps.qp_globals.g_opr_update;
l_price_list_line_tbl (k).end_date_active := SYSDATE-1;
--call the API to end date the pricing records for the item

         apps.qp_price_list_pub.process_price_list
                     (p_api_version_number   => 1,
                      p_init_msg_list                => apps.fnd_api.g_false,
                      p_return_values              => apps.fnd_api.g_false,
                      p_commit                          => apps.fnd_api.g_false,
                      x_return_status               => l_return_status,
                      x_msg_count                   => l_msg_count,
                      x_msg_data                      => l_msg_data,
                      p_price_list_line_tbl       => l_price_list_line_tbl,
                      x_price_list_rec               => x_price_list_rec,
                      x_price_list_val_rec       => x_price_list_val_rec,
                      x_price_list_line_tbl       => x_price_list_line_tbl,
                      x_price_list_line_val_tbl  => x_price_list_line_val_tbl,
                      x_qualifiers_tbl                  => x_qualifiers_tbl,
                      x_qualifiers_val_tbl          => x_qualifiers_val_tbl,
                      x_pricing_attr_tbl             => x_pricing_attr_tbl,
                      x_pricing_attr_val_tbl     => x_pricing_attr_val_tbl
                     );

         IF l_return_status <> apps.fnd_api.g_ret_sts_success
         THEN
            apps.fnd_file.put_line (apps.fnd_file.LOG, 'API Failure');

            FOR J3 IN 1 .. l_msg_count
            LOOP
               l_msg_data :=
                    apps.oe_msg_pub.get (p_msg_index      => J3,
                                                           p_encoded        => 'F');
                    apps.fnd_file.put_line (apps.fnd_file.LOG,
                                                                  'err msg ' || J3 || ' is: '
                                                                     || l_msg_data
                                                               );
            END LOOP;

         ELSE
            apps.fnd_file.put_line
                             (apps.fnd_file.LOG,
                                 'End Dated the Price list Line, API SUCCESS'
                              || l_return_status
                             );
       END IF;
END;
/
COMMIT;

How to check whether the Price List line is end dated or not ? :

Here we go ,

Navigate to responsibility : US OM Super User
                                  ->   Pricing
                                  ->   Price Lists
                                  ->   Price List Setup

Query for Price List Name  : USD Current Price List  and then

Query for Price List Line in Product value :  <Item Name>





Check if the Item Price is end dated.

Hope this is helpful. Please feel free to comments.


            


No comments:

Post a Comment