declare
x varchar2(200);
v_msg varchar2(2000);
begin

fnd_global.apps_initialize (1090, 51007, 401);

  FND_FLEX_VAL_API.create_independent_vset_value
 (‘XX_IND_VSET’,’10’,’Inserted from API’,’Y’,sysdate,NULL,’N’,NULL,NULL,X);
    DBMS_OUTPUT.PUT_LINE(X);
exception
when others then
v_msg:=fnd_flex_val_api.message;
  DBMS_OUTPUT.PUT_LINE(v_msg);
end;
/

COMMIT


——    Inserting child dependent Value Set Values ——————————-

declare
x varchar2(200);
v_msg varchar2(2000);
begin

fnd_global.apps_initialize (1090, 51007, 401);


 FND_FLEX_VAL_API.create_dependent_vset_value
  (‘XX_DEP_VSET’,’10’,’10.1′,’Dependent Value inserted through API’,’Y’,sysdate,NULL,NULL,x);
    DBMS_OUTPUT.PUT_LINE(X);
exception
when others then
v_msg:=fnd_flex_val_api.message;
  DBMS_OUTPUT.PUT_LINE(v_msg);
end;
/

COMMIT;
declare
p_cust_account_rec    HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;
x_return_status       VARCHAR2(2000);
x_msg_count           NUMBER;
xio_p_object_version  NUMBER;
x_msg_data            VARCHAR2(2000);
v_account_id          NUMBER;
V_OBJECT_VERSION      NUMBER;
BEGIN

—    FND_GLOBAL.APPS_INITIALIZE(<user_id>,<resp_id>,<resp_applicarion_id>);
—    MO_GLOBAL.INIT(‘AR’);
—    MO_GLOBAL.SET_POLICY_CONTEXT(‘S’, <org_id>);

     FND_GLOBAL.APPS_INITIALIZE(1535,50930,222);
     MO_GLOBAL.INIT(‘AR’);
     MO_GLOBAL.SET_POLICY_CONTEXT(‘S’, 807);  

     BEGIN
      SELECT  –HCSU.SITE_USE_ID,
               hcas.CUST_ACCOUNT_ID,
                    HCS.OBJECT_VERSION_NUMBER
            INTO    V_ACCOUNT_ID,
                    V_OBJECT_VERSION
            FROM    HZ_PARTIES HP,
                    HZ_PARTY_SITES HPS,
                    HZ_CUST_ACCT_SITES_ALL HCAS,
                    HZ_CUST_SITE_USES_ALL HCSU,
                    hz_cust_accounts_all hcs
            WHERE   HP.PARTY_ID = HPS.PARTY_ID
            AND     HPS.PARTY_SITE_ID = HCAS.PARTY_SITE_ID
            AND     HCAS.CUST_ACCT_SITE_ID =HCSU.CUST_ACCT_SITE_ID
            AND     HCSU.SITE_USE_CODE = ‘BILL_TO’
            AND     HCS.CUST_ACCOUNT_ID = HCAS.CUST_ACCOUNT_ID
            AND     ltrim(rtrim(upper(HP.PARTY_NAME)))= ltrim(rtrim(upper(‘Spinneys Mussafah Warehouse’)));
   
     EXCEPTION WHEN OTHERS THEN
            DBMS_OUTPUT.PUT_LINE(‘ERROR IS’||SUBSTR(SQLERRM,1,150));           
     END;

    
     p_cust_account_rec.cust_account_id :=  V_account_ID;             — Site USe to be updated
     xio_p_object_version               :=  V_OBJECT_VERSION;          –xio_p_object_version := 1;
   
  p_cust_account_rec.customer_class_code := ‘RULER’;   — ‘DEALER’ , ‘FAMILY’ , ‘GENERAL’
                                                   
       hz_cust_account_v2pub.update_cust_account(
                                                    FND_API.G_FALSE,
                                                    p_cust_account_rec,
                                                    xio_p_object_version,
                                                    x_return_status,
                                                    x_msg_count,
                                                    x_msg_data);

    dbms_output.put_line(‘***************************’);
    dbms_output.put_line(‘Output information ….’);
    dbms_output.put_line(‘x_return_status: ‘||x_return_status);
    dbms_output.put_line(‘x_msg_count: ‘||x_msg_count);
    dbms_output.put_line(‘xio_p_object_version: ‘||xio_p_object_version);
    dbms_output.put_line(‘x_msg_data: ‘||x_msg_data);
    dbms_output.put_line(‘***************************’);
   
    COMMIT;

END;

CREATE OR REPLACE PROCEDURE XX_GL_INTERFACE IS
BEGIN
/*
SELECT * FROM GL_INTERFACE

MANDATORY FIELDS 

            STATUS
            ACCOUNTING_DATE
            CURRENCY_CODE
            DATE_CREATED
            CREATED_BY
            ACTUAL_FLAG
            USER_JE_CATEGORY_NAME
            USER_JE_SOURCE_NAME
*/
 —  GL > JOURNALS  >   IMPORT   >  RUN  
INSERT INTO GL_INTERFACE (
                          LEDGER_ID                     ,
                          STATUS                        ,                                 
                          SET_OF_BOOKS_ID               ,       
                          USER_JE_SOURCE_NAME           ,       
                          USER_JE_CATEGORY_NAME         ,     
                          ACCOUNTING_DATE               ,     
                          CURRENCY_CODE                 ,     
                          DATE_CREATED                  ,     
                          CREATED_BY                    ,     
                          ACTUAL_FLAG                   ,     
                   —       ENCUMBRANCE_TYPE_ID         ,     
                   —       BUDGET_VERSION_ID           ,       
                          USER_CURRENCY_CONVERSION_TYPE ,       
                          CURRENCY_CONVERSION_DATE      ,       
                          CURRENCY_CONVERSION_RATE      ,       
                          SEGMENT1                      ,       
                          SEGMENT2                      ,       
                          SEGMENT3                      ,       
                          SEGMENT4                      ,       
                          SEGMENT5                      ,       
                          SEGMENT6                      , 
                          SEGMENT7                      ,
                          SEGMENT8                      ,
                          SEGMENT9                      ,     
                          ENTERED_DR                    ,       
                          ENTERED_CR                    ,       
                          ACCOUNTED_DR                  ,       
                          ACCOUNTED_CR                  ,       
                          PERIOD_NAME                   ,       
                          REFERENCE1                    ,       
                          REFERENCE2                    ,       
                          REFERENCE4                    ,  
                          REFERENCE5                             
                        )
                    values
                        (
                          2021                        , —  SELECT * FROM GL_SETS_OF_BOOKS
                          ‘Y’                         , —  i.STATUS                                                         
                          2021                        , —  SELECT * FROM GL_SETS_OF_BOOKS      (Trading Companies SOB)
                          ‘Manual’                    , —  SELECT * FROM GL_JE_SOURCES WHERE JE_SOURCE_NAME LIKE ‘Manual’        
                          ‘SSE Manual’                , —  SELECT USER_JE_CATEGORY_NAME FROM GL_JE_CATEGORIES WHERE USER_JE_CATEGORY_NAME LIKE ‘SSE%’      
                          SYSDATE                     , —  i.ACCOUNTING_DATE    
                          ‘AED’                       , —  i.CURRENCY_CODE 
                          sysdate                     , —  DATE_CREATED  
                          1090                        , —  fnd_global.user_id 
                          ‘A’                         , —  i.ACTUAL_FLAG    — A  Actual , B – Budget E – Encumbrance 
                      —  i.ENCUMBRANCE_TYPE_ID       ,     
                      —  i.BUDGET_VERSION_ID         ,       
                          ”                          , —  i.USER_CURRENCY_CONVERSION_TYPE       
                          ”                          , —  i.CURRENCY_CONVERSION_DATE  
                          ”                          , —  i.CURRENCY_CONVERSION_RATE   
                         ’02’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT1 = 02  
                         ’01’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT2 = 01 
                         ’01’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT3 = 01  
                         ’05’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT4 = 05  
                         ’00’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT5 = 00  
                         ’00’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT6 = 00  
                         ’01’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT7 = 01  
                         ‘981100’                     , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT8 = 981100 
                         ’00’                         , —  SELECT * FROM GL_CODE_COMBINATIONS_KFV WHERE SEGMENT9 = 00  
                          2300                        , —  i.ENTERED_DR                          
                          2300                        , —  i.ENTERED_CR                          
                          2300                        , —  i.ACCOUNTED_DR                        
                          2300                        , —  i.ACCOUNTED_CR                        
                          ‘JUN-10’                    , —  i.PERIOD_NAME     (PERIOD SHOULD BE OPEN )                        
                          SYSDATE                     , —  i.REFERENCE1                       
                          ‘INSERTED BY CUSTOM GL INT’ , —  i.REFERENCE2                         
                          ‘INSERT’                    , —  i.REFERENCE4     ( REFERENCE4   it takes in JE NAME  )
                          ‘SSE’                         —  i.REFERENCE5                  
                         );
END;

begin
XX_GL_INTERFACE;
end;

 Find the URL of the Application in the database:

Option 1:

select HOME_URL from icx_parameters;

Option 2:

Select PROFILE_OPTION_VALUE
From   FND_PROFILE_OPTION_VALUES
WHERE  PROFILE_OPTION_ID =
       (SELECT PROFILE_OPTION_ID
        FROM FND_PROFILE_OPTIONS
        WHERE PROFILE_OPTION_NAME =’APPS_FRAMEWORK_AGENT’)
        AND LEVEL_VALUE=0;

 

What is Function?

A function is a part of an application’s functionality that is registered under a unique name for the purpose of assigning it to, or excluding it from, a responsibility.

What are the Function Types?

There are two types of functions:
a] Form (Form Function)

  •   A form function (form) invokes an Oracle Forms form.
  •   Form functions appear in the Navigate window and can be navigated to.

b] Subfunction (Non–Form Function)

  •   A non–form function (subfunction) is a securable subset of a form’s functionality: in other words, a function executed from within a form.
  •   Subfunctions are frequently associated with buttons or other graphical elements on forms.

Forms vs. Subfunctions?

  • Forms appear in the Navigate window and can be navigated to. Subfunctions do not appear in the Navigate window and cannot be navigated to.
  • Forms can exist on their own. Subfunctions can only be called by logic embodied within a form; they cannot exist on their own.
  • A form as a whole, including all of its program logic, is always designated as a function. Subsets of a form’s program logic can optionally be designated as subfunctions if there is a need to secure those subsets.

Advantages of Form Functions

If you want to open the Form in different modes without creating the copies, we can create a Form Function and pass the parameters based on the requirement. The parameter, which is passed in the form function, must be already defined in the form while designing the Form. A menu can be assigned to more than one Responsibility. If you want to restrict some of the Forms from a particular responsibility, we can include Form Function of those Forms in Menu Exclusions of the Responsibility.

What are the standard function types?

  • FORM                                    — Oracle Applications form functions are registered with a type of FORM.
  • SUBFUNCTION                   — Subfunctions are added to menus
  • JSP                                        — JSP functions
  • WWW                                     –PL/SQL functions
  • WWK                                      –PL/SQL functions that open a new window
  • WWR or WWL                      –used for some products in the Oracle Self–Service Web Applications
  • WWJ                                      –OA Framework JSP portlet
  • SERVLET                              –Servlet functions
  • DBPORTLET                        –Database provider portlet
  • WEBPORTLET                    –Web provider portlet