2014 Nov 13 12:21 PM
Hi,
My output need to be like this
| Header 1 | Header 2 | Header 3 | Header 4 |
|---|---|---|---|
| BELNR | KPSON | EVENT_DATE | AENAM |
| 123654 | 100 | DO | BGNANK |
| 123654 | 100 | 21 | BGNANK |
But I am getting this only
| BELNR | KPSON | EVENT_DATE | AENAM |
| 123654 | 100 | DO | BGNANK. |
I found the reason as
" READ TABLE IT_EVE IN W_EVE WITH KEY CONT_ITEM = CONT_ITEM
EVENT_DATE = 'DO'.
.
.
.
LS_FINAL-EVENT_DATE = LS_EVE-EVENT_DATE.
APPEND LS_FINAL TO IT_FINAL."
This is the reasn for the disappearance 2nd value. So how can i fix the chage.
2014 Nov 13 12:29 PM
Hi,
" READ TABLE IT_EVE IN W_EVE WITH KEY CONT_ITEM = CONT_ITEM
EVENT_DATE = 'OD'.
take out the condition EVENT_DATE = 'OD'.
Thanks,
Chintu
2014 Nov 13 12:29 PM
if you hard code the read statement with EVENT_DATE = 'DO'. then you'll get only one record.
just use
READ TABLE IT_EVE IN W_EVE WITH KEY CONT_ITEM = CONT_ITEM.
2014 Nov 13 12:31 PM
I have done that...but people are not satisfied with my coding.
They are expecting for another fix
2014 Nov 13 12:38 PM
Hi Bharani,
what logic needs to be followed to fill the Final Output table ?
As said, using READ statement will select only single record that satisfies the condition.
If all records needs to be filled and few manipulation of value needs to be done on LS_FINAL , maybe you can try to use a "LOOP" instead of READ.
2014 Nov 13 12:37 PM
Hi Bharani,
First thing, have you got the required outpur?
and if yes, then you can always fine tune the code..
in your case, use Binary search and make sure you sort the internal table before you do that..
Thanks,
Chintu
2014 Nov 13 1:09 PM
hi bharani,
since your with key is with 'DO' ie EVENT_DATE is only DO.
you need to write
READ TABLE IT_EVE IN W_EVE WITH KEY CONT_ITEM = CONT_ITEM
EVENT_DATE = 'DO' .
IF SYSUBRC NE 0.
READ TABLE IT_EVE IN W_EVE WITH KEY CONT_ITEM = CONT_ITEM EVENT_DATE = '21'.
ENDIF.
hope it helps....