Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read Table .....

Former Member
0 Likes
840

Hi,

My output need to be like this

Header 1Header 2Header 3Header 4
BELNRKPSONEVENT_DATEAENAM
123654100DOBGNANK
12365410021BGNANK

But I am getting this only

BELNRKPSONEVENT_DATEAENAM
123654100DO

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.

6 REPLIES 6
Read only

Former Member
0 Likes
814


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

Read only

Former Member
0 Likes
814


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.

Read only

Former Member
0 Likes
814

I have done that...but people are not satisfied with my coding.

They are expecting for another fix

Read only

0 Likes
814

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.

Read only

Former Member
0 Likes
814


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

Read only

former_member206650
Active Participant
0 Likes
814

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....