基本值集定义

1 帐套:P_LEDGER_ID
值集 GL_SRS_SET_OF_BOOKS
配置文件,
默认值:GL_SET_OF_BKS_NAME

2 OU: ORG_ID
配置文件
默认值:ORG_ID

3 库存组织 P_MFG_ID
配置文件
默认值:ORGANIZATION_ID

4 会计期(默认为当前会计期):p_period_name_f
值集:GL_SRS_ALL_PERIODS
默认类型:SQL语句
默认值:select glp.period_name from gl_sets_of_books gls, gl_periods glp
           where gls.period_set_name = glp.period_set_name
           and gls.set_of_books_id = :$FLEX$.P_LEDGER_ID
           and sysdate between glp.start_date and glp.end_date

5 会计科目
第一个步骤:
   设置COE参数:
   COA
   NUMBER_15
   SQL语句
   默认值:select gls.chart_of_accounts_id from gl_sets_of_books gls
           where gls.set_of_books_id = :$FLEX$.P_LEDGER_ID

第2步:
    p_account_f
    GL_SRS_REPORT_FLEXFIELD
    范围:对

在报表里的做法:
    1定义参数P_COA
    2创建占位列:P_ACCOUNT_WHERE
    3在报表里引用占位列: &p_account_where
    4创建公式列:CF_PERIOD_NAME_F,CF_PERIOD_NAME_T (会计期间从-会计期间到)
    5在报表触发器BEFOREREPORTE里写入代码:
    begin
SRW.USER_EXIT('FND SRWINIT');

if :P_ACCOUNT_F is not null and :P_ACCOUNT_T is not null then
    srw.reference(:P_COA);
    srw.user_exit('FND FLEXSQL CODE="GL#"
                               NUM=":P_COA"
                               APPL_SHORT_NAME="SQLGL"
                               OUTPUT=":P_ACCOUNT_WHERE"
                               MODE="WHERE"
                               DISPLAY="ALL"
                               OPERATOR="BETWEEN"
                               OPERAND1=:P_ACCOUNT_T
                               OPERAND2=:P_ACCOUNT_F
                               TABLEALIAS="GCC"');
                               
    if :P_ACCOUNT_WHERE is not null then
    :P_ACCOUNT_WHERE := ' and ' || :P_ACCOUNT_WHERE;
    end if;
end if;

return (TRUE);
end;

你可能感兴趣的:(值)