Create or Update Category Codes

Hi, this post I will show how to create or update category_codes on Inventory Category.

Create

Sem título

DECLARE
    v_return_status     VARCHAR2(1) := NULL;
    v_msg_count         NUMBER  := 0;
    v_msg_data          VARCHAR2(2000);
    v_errorcode         VARCHAR2(1000);
    l_category_rec      INV_ITEM_CATEGORY_PUB.category_rec_type;
    x_category_id       NUMBER;
    v_context           VARCHAR2 (2);
    l_api_version       NUMBER := 1.0;
    l_init_msg_list     VARCHAR2(1000);
BEGIN

    fnd_global.apps_initialize (1139, 20634, 401);
    
    l_category_rec.structure_id   := 50412;
    l_category_rec.segment1       := 'Milton';
    l_category_rec.description    := 'Milton'; 
            
    DBMS_OUTPUT.PUT_LINE('=============================================');
    DBMS_OUTPUT.PUT_LINE('Calling INV_ITEM_CATEGORY_PUB.Create_Category');
           
    INV_ITEM_CATEGORY_PUB.Create_Category ( p_api_version       => 1.0,
                                            p_init_msg_list     => fnd_api.g_true,
                                            p_commit            => fnd_api.g_false,  
                                            x_return_status     => v_return_status,
                                            x_errorcode         => v_return_status,
                                            x_msg_count         => v_msg_count,
                                            x_msg_data          => v_return_status,
                                            p_category_rec      => l_category_rec,
                                            x_category_id       => x_category_id ); 
                                              
    DBMS_OUTPUT.PUT_LINE('===========================================');
    DBMS_OUTPUT.PUT_LINE('Return Status: '||v_return_status);
          
END;

Sem título

Update

DECLARE
v_return_status VARCHAR2(1) := NULL;
v_msg_count NUMBER := 0;
v_msg_data VARCHAR2(2000);
v_errorcode VARCHAR2(1000);
v_category_rec INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE;
v_context VARCHAR2 (2);
BEGIN

fnd_global.apps_initialize (1139, 20634, 401); 

v_category_rec.category_id := 25123;
v_category_rec.disable_date := SYSDATE; 

DBMS_OUTPUT.PUT_LINE('=============================================');
DBMS_OUTPUT.PUT_LINE('Calling INV_ITEM_CATEGORY_PUB.Create_Category');

INV_ITEM_CATEGORY_PUB.UPDATE_CATEGORY ( p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_false,
x_return_status => v_return_status,
x_errorcode => v_errorcode,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data,
p_category_rec => v_category_rec); 

DBMS_OUTPUT.PUT_LINE('===========================================');
DBMS_OUTPUT.PUT_LINE('Return Status: '||v_return_status);

END;

Sem título

Deixe uma resposta

Powered by WordPress.com. Tema: Baskerville 2 por Anders Noren

Acima ↑

%d blogueiros gostam disto: