Vous êtes sur la page 1sur 3

EDOCUMENT FRAMEWORK - Action handling on mass documents

1) eDocument Cockpit(Framework) Can’t Display/handle more than 10,000 documents


2) You need to execute actions(CREATE/DELETE) for Invoices which are not present in eDocument databse
3) To execute “EDOC_BACKGROUND” as background job you need to create variant in EDOC_COCKPIT transaction.

Customers, who are not able to create variant for selective dates in EDOC_COCKPIT screen due to huge volume
of Invoices(system throw dump or take time), follow below steps.

a. Create a Variant in EDOC_COCKPIT Transaction with selection criteria as mentioned below.


Choose One Company code and Date range, which has less no of Invoices present and save the variant.
Repeat this step for each company code.

b. Create ZTable with TMG with below fields.

Table Name: ZEDOINBG_PROCDT


Delivery Class: C
Data Class: APPL2 Org

Field Key Initial Data Element


MANDT X X MANDT
BUKRS X X BUKRS
VARIANT X X EDOC_SELECTION_VARIANT
ACTION X X EDOC_ACTION
FROMDATE FROMDATE
TODATE TODATE
c. Maintain entries in the table as mentioned below.

Enter company code and Variant selected in previous step.

It helps you to override the date range.

4) Enhance the existing classes


a. Class Name: CL_EDOC_COCKPIT
Create Enhancement and add below parameter in attributes tab

LV_ACTION Instance Attribute Public Type EDOC_ACTION


LV_VARIANT Instance Attribute Public Type EDOC_SELECTION_VARIANT

implement Pre-Exit for method “EXECUTE_ACTION_IN_BACKGROUND” and paste below logic

ME->CORE_OBJECT->LV_ACTION = IV_ACTION.
ME->CORE_OBJECT->LV_variant = is_variant_key-variant.

b. Class Name: CL_EDOC_SEL_CRITERIA


Create Enhancement and implement Pre Exit for method “ SET_CRITERIA_FOR_SELECTION and paste
below logic

DATA: lt_procdt TYPE TABLE OF zedoinbg_procdt,


ls_procdt TYPE zedoinbg_procdt,
ls_range TYPE rsds_range,
ls_bukrs TYPE rsds_frange,
ls_budat TYPE rsds_frange,
lt_selopt TYPE rsds_selopt_t,
ls_selopt TYPE rsdsselopt.
FIELD-SYMBOLS: <fs_range> TYPE rsds_range,
<fs_budat> TYPE rsds_frange,
<fs_fkdat> TYPE rsds_frange,
<fs_selopt> TYPE rsdsselopt.

SELECT * FROM zedoinbg_procdt INTO TABLE lt_procdt WHERE action = me-


>core_object->mo_cockpit->lv_action
AND variant = me-
>core_object->mo_cockpit->lv_variant.

LOOP AT lt_procdt INTO ls_procdt.


READ TABLE me->core_object->mt_range_variant INTO ls_range WITH KEY tabl
ename = 'EDOCUMENT'.
IF sy-subrc EQ 0.
READ TABLE ls_range-frange_t INTO ls_bukrs WITH KEY fieldname = 'BUKRS
'.
IF sy-subrc EQ 0.
READ TABLE ls_bukrs-selopt_t INTO ls_selopt WITH KEY low = ls_procd
t-bukrs.
IF sy-subrc EQ 0.
READ TABLE me->core_object->mt_range_variant ASSIGNING <fs_range>
WITH KEY tablename = 'BKPF'.
IF sy-subrc EQ 0.
READ TABLE <fs_range>-frange_t ASSIGNING <fs_budat> WITH KEY fie
ldname = 'BUDAT'.
IF sy-subrc EQ 0.
CLEAR <fs_budat>-selopt_t.
ls_selopt-sign = 'I'.
ls_selopt-option = 'BT'.
ls_selopt-low = ls_procdt-fromdate.
ls_selopt-high = ls_procdt-todate.
APPEND ls_selopt TO <fs_budat>-selopt_t.
ENDIF.

ENDIF.
READ TABLE me->core_object->mt_range_variant ASSIGNING <fs_range>
WITH KEY tablename = 'VBRK'.
IF sy-subrc EQ 0.
READ TABLE <fs_range>-frange_t ASSIGNING <fs_fkdat> WITH KEY fie
ldname = 'FKDAT'.
IF sy-subrc EQ 0.
CLEAR <fs_fkdat>-selopt_t.
ls_selopt-sign = 'I'.
ls_selopt-option = 'BT'.
ls_selopt-low = ls_procdt-fromdate.
ls_selopt-high = ls_procdt-todate.
APPEND ls_selopt TO <fs_fkdat>-selopt_t.
ENDIF.

ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.

5) Execute the Transaction EDOC_BACKGROUND and enter values as mentioned below

Enter Variant created in Step 3.a. Save as variant and execute the transaction in background by changing the
dates in Customizing table.

Vous aimerez peut-être aussi