‎2008 Aug 17 12:39 PM
Dear Friends,
In ECC 4.6c, I wrote statement like this.
Read table message with key type = 'E' or 'S'.
if sy-subrc = 0.
Populated the message log to output internal table.
endif.
But when i transported to QA which is ECC 6.0, it is giving error.
Can any one help me in modifying this qurey.
Plse read my question thoroughly and reply me back.
Regards,
Santosh Kumar M
‎2008 Aug 17 1:02 PM
> In ECC 4.6c, I wrote statement like this.
>
> Read table message with key type = 'E' or 'S'.
> if sy-subrc = 0.
>
> Populated the message log to output internal table.
>
> endif.
>
loop at message where key = 'E' or
key = 'S'.
"Populated the message log to output internal table. and now exit for first instance
exit.
endloop.
‎2008 Aug 17 1:36 PM
Hi,
You can't use OR condition with READ table. it is always AND condition.
Here 2 ways for ur problem.
If u want to have just one message in the log then use multiple reads.
READ TABLE message WITH KEY type = 'E'.
If sy-subrc IS INITIAL.
populate log.
ELSE.
READ TABLE message WITH KEY type = 'S'.
If sy-subrc IS INITIAL.
populate log.
ENDIF.
ENDIF.
If u want all messages then u have to loop through and populate the log as sugested by Vijay but
Without exit in loop.(Since u need all the messages)
LOOP AT message into wa WHERE type = 'E' or type = 'S'.
populate log.
ENDLOOP.
Thanks,
Vinod.
‎2008 Aug 17 2:14 PM
Hi,
try this....
Read table itab with key type = 'E' or type = 'S'.
if sy-subrc = 0.
*****
*****
*****
endif.
‎2008 Aug 17 8:02 PM
hiii
you can use like below code..it will work as same as you want with both key conditions.
READ TABLE message WITH KEY type = 'E'.
If sy-subrc EQ 0.
READ TABLE message WITH KEY type = 'S'.
if sy-subrc EQ 0.
perform ....
endif.
endif.
regards
twinkal
‎2008 Aug 17 9:04 PM
>
> Dear Friends,
>
> In ECC 4.6c, I wrote statement like this.
>
> Read table message with key type = 'E' or 'S'.
> if sy-subrc = 0.
>
>
> Santosh Kumar M
Really? Are you sure? To the best of my 10+ years experience, this has never been part of the syntax of READ.