on 10-14-2008 8:49 AM
Hi,
i'm trying to delete selective data from an ODS using the function module "RSDRD_SEL_DELETION".
However this results in return code 1, with the error messages being emtpy (table messages).
Can anybody point me to what i'm doing wrong?
Thanks,
Daniel
form clear_ods.
DATA messages TYPE RS_T_MSG.
DATA L_S_RANGE TYPE RSDRD_S_RANGE.
DATA L_THX_SEL TYPE RSDRD_THX_SEL.
DATA L_SX_SEL TYPE RSDRD_SX_SEL.
CLEAR L_SX_SEL.
CLEAR L_S_RANGE.
L_SX_SEL-IOBJNM = 'ZLOADDATE'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPTION = 'EQ'.
L_S_RANGE-LOW = '20081013'.
APPEND L_S_RANGE TO L_SX_SEL-T_RANGE.
INSERT L_SX_SEL INTO TABLE L_THX_SEL.
CALL FUNCTION 'RSDRD_SEL_DELETION'
EXPORTING
I_DATATARGET = 'DSO_LOG'
I_THX_SEL = L_THX_SEL
CHANGING
C_T_MSG = messages
EXCEPTIONS
X_MESSAGE = 1
INHERITED_ERROR = 2
INVALID_TYPE = 3
OTHERS = 4
.
IF SY-SUBRC <> 0.
WRITE:/ 'Error while selective deleting ODS'.
ENDIF.
endform.
Is this 'DSO_LOG' a standard datatarget ??
If its generic one shouldnt it start with Z or Y ??
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer. But actually it should not make any difference whether you name the ODS with a Z or Y in the beginning. The problem was a missing parameter for the range (L_THX_SEL-T_RANGE[] = LT_TAB[].).
See below coding for a working solution:
form clear_ods using $filename type c
$date type any.
DATA messages TYPE RS_T_MSG.
DATA:
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 ZLOADDATE (Date) **
CLEAR LT_TAB.
WA_TAB-SIGN = 'I'.
WA_TAB-OPTION = 'EQ'.
WA_TAB-LOW = $date.
WA_TAB-KEYFL = 'X'.
APPEND WA_TAB TO LT_TAB.
L_THX_SEL-IOBJNM = 'ZLOADDATE'.
" *****************************************************************************
L_THX_SEL-T_RANGE[] = LT_TAB[]. " this is crucial!
" *****************************************************************************
INSERT L_THX_SEL INTO TABLE LT_THX_SEL.
** Entry for FILENAME (Filename) **
CLEAR LT_TAB.
WA_TAB-SIGN = 'I'.
WA_TAB-OPTION = 'EQ'.
WA_TAB-LOW = $filename.
WA_TAB-KEYFL = 'X'.
APPEND WA_TAB TO LT_TAB.
L_THX_SEL-IOBJNM = 'ZFILENAME'.
L_THX_SEL-T_RANGE[] = LT_TAB[].
INSERT L_THX_SEL INTO TABLE LT_THX_SEL.
CALL FUNCTION 'RSDRD_SEL_DELETION'
EXPORTING
I_DATATARGET = 'DSO_LOG'
I_THX_SEL = LT_THX_SEL
I_THRESHOLD = '1.1'
CHANGING
C_T_MSG = messages
EXCEPTIONS
X_MESSAGE = 1
INHERITED_ERROR = 2
INVALID_TYPE = 3
OTHERS = 4
.
IF SY-SUBRC <> 0.
WRITE:/ 'Error while selective deleting ODS'.
ENDIF.
endform.
" end: clear_ods
see also: http://justnareshbw.blogspot.com/2008/09/selective-deletion-in-process-chain.html
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.