财务要求
需要把CO类型的凭证去掉,经过调试发现
筛选条件在GT_selection
在这个函数里面做个增强试试
*----------------------------------------------------------------------*
***INCLUDE FAGL_FILL_GT_SELECTIONS .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form fill_gt_selections
*&---------------------------------------------------------------------*
* fill gt_selections
*----------------------------------------------------------------------*
FORM fill_gt_selections TABLES ut_racct TYPE fagl_range_t_racctut_rbukrs TYPE fagl_range_t_bukrsUSING ut_rldnr TYPE rldnrCHANGING ct_gt_selection TYPE gusl_t_selection.DATA ls_selection TYPE gusl_s_selection.DATA lt_rangetab TYPE gusl_t_range.DATA ls_rangetab TYPE gusl_s_range.* fill racct into gt_selection.ls_selection-fieldname = 'RACCT'.LOOP AT ut_racct.ls_rangetab-sign = ut_racct-sign.ls_rangetab-option = ut_racct-option.ls_rangetab-low = ut_racct-low.ls_rangetab-high = ut_racct-high.APPEND ls_rangetab TO lt_rangetab.ENDLOOP.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.* fill rbukrs into gt_selection.CLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'RBUKRS'.LOOP AT ut_rbukrs.ls_rangetab-sign = ut_rbukrs-sign.ls_rangetab-option = ut_rbukrs-option.ls_rangetab-low = ut_rbukrs-low.ls_rangetab-high = ut_rbukrs-high.APPEND ls_rangetab TO lt_rangetab.ENDLOOP.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.* in transaction FAGLB03 only actual values are shown.CLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'RRCTY'.ls_rangetab-sign = 'I'.ls_rangetab-option = 'EQ'.ls_rangetab-low = '0'.ls_rangetab-high = '0'.APPEND ls_rangetab TO lt_rangetab.IF NOT x_glyec IS INITIAL OR NOT x_glyec2 IS INITIAL. "1830344ls_rangetab-sign = 'I'. "1830344ls_rangetab-option = 'EQ'. "1830344ls_rangetab-low = '5'. "1830344ls_rangetab-high = '5'. "1830344APPEND ls_rangetab TO lt_rangetab. "1830344CLEAR ls_rangetab. "1852423ENDIF. "1830344ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.** Added with note 1735824
* CLEAR ls_selection.
* REFRESH lt_rangetab.
* ls_selection-fieldname = 'RVERS'.
* ls_rangetab-sign = 'I'.
* ls_rangetab-option = 'EQ'.
* ls_rangetab-low = '001'.
* ls_rangetab-high = '0'.
* APPEND ls_rangetab TO lt_rangetab.
* ls_selection-t_range = lt_rangetab.
* APPEND ls_selection TO ct_gt_selection.* fill ryear into gt_selectionCLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'RYEAR'.ls_rangetab-sign = 'I'.ls_rangetab-option = 'EQ'.ls_rangetab-low = ryear.APPEND ls_rangetab TO lt_rangetab.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.* fill rldnr into gt_selectionCLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'RLDNR'.ls_rangetab-sign = 'I'.ls_rangetab-option = 'EQ'.ls_rangetab-low = ut_rldnr.APPEND ls_rangetab TO lt_rangetab.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.
*{ INSERT DEVK904683 1DATA:LV_ID TYPE ZTEXIT-ID, "增强序列号LV_STATUS TYPE CHAR1. "增强状态LV_ID = 'ZFI108'.CALL FUNCTION 'ZABAP_CHECK_EXIT'EXPORTINGID = LV_IDIMPORTINGE_STATUS = LV_STATUS.IF LV_STATUS = 'S'.CLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'BLART'.ls_rangetab-SIGN = 'E'.ls_rangetab-option = 'EQ'.ls_rangetab-low = 'CO'.APPEND ls_rangetab TO lt_rangetab.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.ENDIF.*} INSERT* Begin of note 2974898:
* Select only ACDOCA line items with MIG_SOURCE SPACE, G and F
* so that only 'normal' line items and archived line items (not e.g. MIG_SOURCE R and U)
* are displayed
* If also MIG_SOURCE R or U records (which are created e.g. without AUFNR) are displayed, there is the
* danger that FAGLB03 doesn't display the correct line items if e.g. an additional selection on AUFNR is usedDATA: ld_param_name LIKE FAGL_SETTINGS-PARAM_NAME,ld_param_value LIKE FAGL_SETTINGS-PARAM_VALUE.ld_param_name = 'FAGLB03_RESTRICT_MIG'.CALL FUNCTION 'FAGL_GET_FAGL_SETTINGS'EXPORTINGID_PARAM_NAME = ld_param_nameIMPORTINGED_VALUE = ld_param_value.IF not ld_param_value IS INITIAL.CLEAR ls_selection.REFRESH lt_rangetab.ls_selection-fieldname = 'MIG_SOURCE'.ls_rangetab-sign = 'I'.ls_rangetab-option = 'EQ'.ls_rangetab-low = ' '.APPEND ls_rangetab TO lt_rangetab.ls_rangetab-low = 'G'.APPEND ls_rangetab TO lt_rangetab.ls_rangetab-low = 'F'.APPEND ls_rangetab TO lt_rangetab.ls_selection-t_range = lt_rangetab.APPEND ls_selection TO ct_gt_selection.endif.
* End of note 2974898ENDFORM. " fill_gt_selections
结果与对比