Forum Stats

  • 3,726,647 Users
  • 2,245,235 Discussions
  • 7,852,337 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Script to Create Service Contract

Anand Pandya
Anand Pandya Member Posts: 33 Red Ribbon

Please provide Script to Create Service Contract in EBS

Tagged:

Answers

  • Anand Pandya
    Anand Pandya Member Posts: 33 Red Ribbon

    DECLARE

      l_return_status VARCHAR2(200);

      l_msg_count NUMBER;

      l_msg_data VARCHAR2(200);

      l_msg_index_out NUMBER;

      l_data VARCHAR2(2000);

      lp_line_tbl OKS_IMPORT_LINE_PUB.line_tbl_type;

      lx_line_tbl OKS_IMPORT_LINE_PUB.line_tbl_type;

      l_ctc_tbl OKS_IMPORT_LINE_PUB.ctc_line_in_tbl;

      i NUMBER :=1;


    BEGIN

       -- set the org context

      OKC_CONTEXT.SET_OKC_ORG_CONTEXT(204,204);

      FND_GLOBAL.APPS_INITIALIZE(1000200,21708,515);

      

      lp_line_tbl(1).contract_id := 202111;

      lp_line_tbl(1).Line_Type := 'SERVICE';

      lp_line_tbl(1).Inventory_Item_id := 474 ;

      lp_line_tbl(1).invoice_text:= 'createline from api' ;

      lp_line_tbl(2).contract_id := 202111;

      lp_line_tbl(2).Line_Type := 'SERVICE';

      lp_line_tbl(2).Inventory_Item_id := 474 ;

      

      OKS_IMPORT_LINE_PUB.CREATE_CONTRACT_LINE

              (p_api_version =>1.0,

             p_init_msg_list =>OKC_API.G_FALSE,

             x_return_status =>l_return_status,

             x_msg_count =>l_msg_count,

             x_msg_data =>l_msg_data,

             p_line_tbl =>lp_line_tbl,

             X_LINE_TBL => lx_line_tbl

              );

      

      DBMS_OUTPUT.PUT_LINE ('After Calling OKS_IMPORT_LINE_PUB.CREATE_CONTRACT_LINE');

      dbms_output.put_line(l_msg_count);

      dbms_output.put_line(l_return_status);


       IF l_return_status<>'S'

       THEN

          FOR i IN 1 .. fnd_msg_pub.count_msg

          LOOP

             FND_MSG_PUB.GET

                 (p_msg_index => i,

                p_encoded => 'T',

                p_data => l_msg_data,

                p_msg_index_out => l_msg_index_out

                 );

                

             FND_MESSAGE.SET_ENCODED (l_msg_data);

             l_msg_data := fnd_message.get;

             dbms_output.put_line(l_msg_data);

          END LOOP;

       END IF;


    END;

Sign In or Register to comment.