Labels

Showing posts with label General Maintainence. Show all posts
Showing posts with label General Maintainence. Show all posts

15 Jul 2009

Scheduling Process Chain multiple times a day using Events

On high level, following are the Steps
1)Create an event Eg : 'Z_REDCOP_DAILY_LOAD_CHAIN_EVENT'
2)Create a Program to call the FM : BW_EVENT_RAISE by passing event id like below ( we used Z_BW_EVENT_RAISE here )
3)Create a Job at frequency of 2 hours.( in SM36 ).In the step information of the job specify the above program created
4)Specify the eventid in the process chain start variant also.

Explanation : Step 1
a) Goto Sm62.
b) Open last tab
c) Click on Creat button and give technical name/desc of the event.


Explanation : Step 2
REPORT ZBW_EVENT_TRIGGER_PROGRAM.
DATA : EVENTID LIKE TBTCO-EVENTID.
DATA : DATE TYPE SY-DATUM.

DATE = SY-DATUM.
IF DATE+06(02) LE 16.
EVENTID = 'Z_REDCOP_DAILY_LOAD_CHAIN_EVENT'.

CALL FUNCTION 'Z_BW_EVENT_RAISE'
EXPORTING
EVENTID = EVENTID
EXCEPTIONS
BAD_EVENTID = 1
EVENTID_DOES_NOT_EXIST = 2
EVENTID_MISSING = 3
RAISE_FAILED = 4
BP_EVENT_RAISE_OTHERS = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
ENDIF.

ENDIF.

Explanation : Step 3
a) Open Sm36.
b) Give Job name and target system. Save

c) If it asks for ABAP program then give our program name ( if notClick on STEP button and it will ask ). Give variants if necessary.

d) Click save. It shows :

e) Now go back to main screen and click on start condition and give 2 hours periodic setting there.
f) Save.
g) Check in Sm37 if job is scheduled….


Explanation : Step 4

Specify the eventid in your Start variant of the process Chain.

18 Mar 2009

Dynamic table name in select statement in ABAP

Here is a sample code piece used :

DATA name_snp_chn(20) TYPE c VALUE '/bic/azmmiv_sc00'.
DATA name_snp_usa(20) TYPE c VALUE '/bic/azmmiv_sU00'.
DATA name_snp_eur(20) TYPE c VALUE '/bic/azmmiv_sE00'.
DATA name_snp(20) TYPE c VALUE '/bic/azmmiv_os00'.

DATA name_mov_chn(20) TYPE c VALUE '/bic/azmmiv_2c00'.
DATA name_mov_usa(20) TYPE c VALUE '/bic/azmmiv_2U00'.
DATA name_mov_eur(20) TYPE c VALUE '/bic/azmmiv_2E00'.
DATA name_mov(20) TYPE c VALUE '/bic/azmmiv_o200'.

DATA : BEGIN OF ITAB OCCURS 0,
FACALID LIKE /BI0/MPLANT-FACTCAL_ID,
END OF ITAB.

if I_ZREGION = 'CHN'.
name_snp = name_snp_chn.
name_mov = name_mov_chn.
elseif I_ZREGION = 'USA'.
name_snp = name_snp_usa.
name_mov = name_mov_usa.
elseif I_ZREGION = 'EUR'.
name_snp = name_snp_eur.
name_mov = name_mov_eur.
endif.



IF i_test = 'X'.
BREAK-POINT.
* xl_plant = 'AA'.
* xl_stor_loc = '7000'.
* xl_material = '000000000000010712'.

xl_plant = 'RYAN'.
xl_stor_loc = '7000'.
xl_material = '000000000007519620'.

* xl_plant = 'CL00'.


SELECT * FROM (name_snp)
INTO CORRESPONDING FIELDS OF TABLE io_snapshot
WHERE plant EQ xl_plant
AND stor_loc EQ xl_stor_loc
AND material EQ xl_material.
ENDIF.

24 Sept 2008

When is reconstruction allowed? Questions

1. When a request is deleted in a ODS/Cube, will it be available under reconstruction.
Ans :Yes it will be available under reconstruction tab, only if the processing is through PSA
Note: This function is particularly useful if you are loading deltas, that is, data that you cannot request again from the source system

2. Should the request be turned red before it is deleted from the target so as to enable reconstruction
Ans :To enable reconstruction you may not need to make the request red, but to enable repeat of last delta you have to make the request red before you delete it.

3. If the request is deleted with its status green, does the request get deleted from reconstruction tab too
Ans :No, it wont get deleted from reconstruction tab

4. Does the behaviour of reconstruction and deletion differ when the target is differnet. ODS and Cube
Ans :Yes

17 Sept 2008

Selective Deletion in Process Chain

The standard procedure :
Use Program RSDRD_DELETE_FACTS
1. Create a variant which is stored in the table RSDRBATCHPARA for the selection to be deleted from a data target.
2. Execute the generated program.

Observations:

The generated program executes will delete the data from data target based on the given selections. The program also removes the variant created for this selective deletion in the RSDRBATCHPARA table. So this generated program wont delete on the second execution.

If we want to use this program for scheduling in the process chain we can comment the step where the program remove the deletion of the generated variant.

Eg:
REPORT ZSEL_DELETE_QM_C10 .
TYPE-POOLS: RSDRD, RSDQ, RSSG.
DATA:
L_UID TYPE RSSG_UNI_IDC25,
L_T_MSG TYPE RS_T_MSG,
L_THX_SEL TYPE RSDRD_THX_SEL.
L_UID = 'D2OP7A6385IJRCKQCQP6W4CCW'.
IMPORT I_THX_SEL TO L_THX_SEL
FROM DATABASE RSDRBATCHPARA(DE) ID L_UID.
* DELETE FROM DATABASE RSDRBATCHPARA(DE) ID L_UID.
CALL FUNCTION 'RSDRD_SEL_DELETION'
EXPORTING
I_DATATARGET = '0QM_C10'
I_THX_SEL = L_THX_SEL
I_AUTHORITY_CHECK = 'X'
I_THRESHOLD = '1.0000E-01'
I_MODE = 'C'
I_NO_LOGGING = ''
I_PARALLEL_DEGREE = 1
I_NO_COMMIT = ''
I_WORK_ON_PARTITIONS = ''
I_REBUILD_BIA = ''
I_WRITE_APPLICATION_LOG = 'X'
CHANGING
C_T_MSG = L_T_MSG.
export l_t_msg to memory id sy-repid.
UPDATE RSDRBATCHREP
SET DELETEABLE = 'X'
WHERE REPID = 'ZSEL_DELETE_QM_C10'.

The variants are to be created for each data target and based in the set of selection on requirements.

If we wish to create separate program which explains the data to be deleted explicitly, we can hardcode the selection for deletion in the program.

Eg:
REPORT ZSEL_DELETE_ZCSAL_1_A00 .
TYPE-POOLS: RSDRD, RSDQ, RSSG.
DATA:
L_UID TYPE RSSG_UNI_IDC25,
L_T_MSG TYPE RS_T_MSG,
L_THX_SEL TYPE RSDRD_SX_SEL,
LT_THX_SEL TYPE RSDRD_THX_SEL.

DATA LT_TAB TYPE RSDRD_T_RANGE.
DATA WA_TAB TYPE RSDRD_S_RANGE.

**Entry for 0CO_AREA = S999**
CLEAR LT_TAB.
WA_TAB-SIGN = 'I'.
WA_TAB-OPTION = 'EQ'.
WA_TAB-LOW = 'S999'.
WA_TAB-KEYFL = 'X'.
APPEND WA_TAB TO LT_TAB.
L_THX_SEL-IOBJNM = '0CO_AREA'.
L_THX_SEL-T_RANGE[] = LT_TAB[].
INSERT L_THX_SEL INTO TABLE LT_THX_SEL.

**Entry for 0VERSION = A00**
CLEAR LT_TAB.
WA_TAB-SIGN = 'I'.
WA_TAB-OPTION = 'EQ'.
WA_TAB-LOW = 'A00'.
WA_TAB-KEYFL = 'X'.
APPEND WA_TAB TO LT_TAB.
L_THX_SEL-IOBJNM = '0VERSION'.
L_THX_SEL-T_RANGE[] = LT_TAB[].
INSERT L_THX_SEL INTO TABLE LT_THX_SEL.

**Entry for 0CALMONTH BT Current Month till year end
CLEAR LT_TAB.
WA_TAB-SIGN = 'I'.
WA_TAB-OPTION = 'BT'.
WA_TAB-LOW = SY-DATUM+0(6).
CONCATENATE SY-DATUM+0(4) '12' INTO WA_TAB-HIGH.
WA_TAB-KEYFL = 'X'.
APPEND WA_TAB TO LT_TAB.
L_THX_SEL-IOBJNM = '0CALMONTH'.
L_THX_SEL-T_RANGE[] = LT_TAB[].
INSERT L_THX_SEL INTO TABLE LT_THX_SEL.


CALL FUNCTION 'RSDRD_SEL_DELETION'
EXPORTING
I_DATATARGET = 'ZCSAL_1'
I_THX_SEL = LT_THX_SEL
I_AUTHORITY_CHECK = 'X'
I_THRESHOLD = '1.0000E-01'
I_MODE = 'C'
I_NO_LOGGING = ''
I_PARALLEL_DEGREE = 1
I_NO_COMMIT = ''
I_WORK_ON_PARTITIONS = ''
I_REBUILD_BIA = ''
I_WRITE_APPLICATION_LOG = 'X'
CHANGING
C_T_MSG = L_T_MSG.
export l_t_msg to memory id sy-repid.
*UPDATE RSDRBATCHREP
* SET DELETEABLE = 'X'
* WHERE REPID = 'ZSEL_DELETE_QM_C10'.

16 Sept 2008

How to Debugg Update and transfer Rules

1. Go to the Monitor.
2. Select 'Details' tab.
3. Click the 'Processing'
4. Right click any Data Package.
5. select 'simulate update'
6. Tick the check boxes ' Activate debugging in transfer rules' and 'Activate debugging in update rules'.
7. Click 'Perform simulation'.