WIP*更新生产批详细信息行产品配料

DECLARE
     l_batch_header_rec    gme_batch_header%ROWTYPE;
     l_material_detail_rec gme_material_details%ROWTYPE;
     x_material_detail_rec gme_material_details%ROWTYPE;
     x_message_count       NUMBER;
     x_message_list        VARCHAR2(240);
     x_return_status       VARCHAR2(240);
BEGIN
     mo_global.set_policy_context('S',
                                                                                  81);
     fnd_global.apps_initialize(user_id      => 0,
                                                                             resp_id      => 50783,
                                                                             resp_appl_id => 555);
                            
                            
     l_batch_header_rec.batch_id              := 41381;
     --l_material_detail_rec.line_type          := -1;
     l_material_detail_rec.material_detail_id := 72641;
     l_material_detail_rec.plan_qty           := 93.706;
     --l_material_detail_rec.material_detail_id := 72642;
     --l_material_detail_rec.plan_qty := 39.3;
     gme_api_pub.update_material_line(p_api_version         => 2.0,
                                                                                             p_validation_level    => gme_common_pvt.g_max_errors,
                                                                                             p_init_msg_list       => fnd_api.g_false,
                                                                                             p_commit              => fnd_api.g_false,
                                                                                             p_batch_header_rec    => l_batch_header_rec,
                                                                                             p_material_detail_rec => l_material_detail_rec,
                                                                                             p_locator_code        => NULL,
                                                                                             p_org_code            => 'NXS',
                                                                                             p_scale_phantom       => fnd_api.g_false,
                                                                                             p_validate_flexfields => fnd_api.g_false,
                                                                                             x_material_detail_rec => x_material_detail_rec,
                                                                                             x_message_count       => x_message_count,
                                                                                             x_message_list        => x_message_list,
                                                                                             x_return_status       => x_return_status);
     dbms_output.put_line('x_message_count:' || x_message_count);
     dbms_output.put_line('x_message_list:' || x_message_list);
     dbms_output.put_line('x_return_status:' || x_return_status);
     IF (x_return_status <> 'S') THEN
           dbms_output.put_line('更新失败');
     
           IF x_message_count >= 1 THEN
                FOR i IN 1 .. x_message_count
                LOOP
                      dbms_output.put_line(i || '. ' || substr(fnd_msg_pub.get(p_encoded => fnd_api.g_false),
                                                                                                                                   1,
                                                                                                                                   255));
                
                END LOOP;
           
           END IF;
     ELSE
           dbms_output.put_line('更新成功');
     END IF;
EXCEPTION
     WHEN OTHERS THEN
           dbms_output.put_line('处理异常');
END;

  

posted @ 2019-11-16 15:36  旺仔丶小馒头  阅读(420)  评论(0编辑  收藏  举报