on 04-07-2009 5:10 PM
Hi Guys,
I have a problem to upgrade an OSD-ODS selection routine to the new ABAP version embedded on an autoloop DTP that allow to update particular data in the same ODS.
TABLES: /bic/azgr_od8800.
DATA: l_idx LIKE sy-tabix.
break-point.
READ TABLE l_t_range WITH KEY
fieldname = 'NOTIFICATN'.
l_idx = sy-tabix.
*....
SELECT * FROM /bic/azgr_od8800 WHERE
( /bic/zgr_ch158 = 'I0068' OR
/bic/zgr_ch158 = 'I0070' OR
/bic/zgr_ch158 = 'I0072' OR
/bic/zgr_ch158 = 'I0073' )
AND /bic/zflag01 = '1'.
MOVE 'I' TO l_t_range-sign.
MOVE 'EQ' TO l_t_range-option.
MOVE /bic/azgr_od8800-notificatn TO l_t_range-low.
IF l_idx <> 0.
MODIFY l_t_range INDEX l_idx.
ELSE.
APPEND l_t_range.
ENDIF.
ENDSELECT.
SELECT * FROM /bic/azgr_od8800 WHERE
( /bic/zgr_ch158 = 'I0068' OR
/bic/zgr_ch158 = 'I0070' OR
/bic/zgr_ch158 = 'I0072' OR
/bic/zgr_ch158 = 'I0073' )
AND ausbs = '00000000'.
MOVE 'I' TO l_t_range-sign.
MOVE 'EQ' TO l_t_range-option.
MOVE /bic/azgr_od8800-notificatn TO l_t_range-low.
IF l_idx <> 0.
MODIFY l_t_range INDEX l_idx.
ELSE.
APPEND l_t_range.
ENDIF.
ENDSELECT.
" IF l_idx <> 0.
" MODIFY l_t_range INDEX l_idx.
" ELSE.
" APPEND l_t_range.
" ENDIF.
p_subrc = 0.
The problem is that the code works over all records processed NOT ONLY over the records with ausbs = '00000000' that I need change.
I tried to debug the code and I saw that the code select rightly the data, but lost the data in the end if the loop.
Can anybody help me?
Thanks.
I have a problem with your code:
(1) you have two SELECT's. Witch one don't read with ausbs = '00000000'? the first one.
(2) In the second SELECT there is a condition. Is use problem the full table scan.
=> create a index for /bic/zgr_ch158 and ausbs.
(3) Don't use a SELECT-loop.
(4) Why you use MODIFY - do you want to create many conditions in L_T_RANGE?
=> use this coding
SELECT notificatn
into corresponding fields of table l_t_zgr_od8800
FROM /bic/azgr_od8800 WHERE
( /bic/zgr_ch158 = 'I0068' OR
/bic/zgr_ch158 = 'I0070' OR
/bic/zgr_ch158 = 'I0072' OR
/bic/zgr_ch158 = 'I0073' )
AND ausbs = '00000000'.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
loop at l_t_zgr_od8800 assigning <l_s_zgr_od8800>.
l_t_range-low-/bic/azgr_od8800-notificatn.
APPEND l_t_range.
endloop.
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IF l_idx 0.
MODIFY l_t_range INDEX l_idx.
ELSE.
APPEND l_t_range.
ENDIF.
instead of above please use
MODIFY l_t_range INDEX sy-tabix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.