2007 Sep 26 2:02 PM
Hi All,
I have a question, I have this internal sorted table on nonunique key Acct.Number.
I 'read' this internal table on this key Acct.number (I am using binary search).
The internal table looks like this(just a sample) there are lot of records in the internal table.
Acct.Num Date_start Date_end Amount
12345 20060401 20060502 10.00
12345 20060503 20060610 50.00
12345 20060401 99991231 100.00
My creteria is to read a record 12345 20060401 99991231 100.00,
since all the three records have key 12345 and I cannot have Date_start <= current_date and Date_end >= current_Date.
I am not able to use read with key as it is struck in the first record and I don't want to use 'loop at'.
Please let me know how can I get it worked.
Thanks,
2007 Sep 26 2:12 PM
hi
good
go through this link
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
thanks
mrutyun^
Hi All,
I have a question, I have this internal sorted table on nonunique key Acct.Number.
I 'read' this internal table on this key Acct.number (I am using binary search).
The internal table looks like this(just a sample) there are lot of records in the internal table.
Acct.Num Date_start Date_end Amount
12345 20060401 20060502 10.00
12345 20060503 20060610 50.00
12345 20060401 99991231 100.00
My creteria is to read a record 12345 20060401 99991231 100.00,
since all the three records have key 12345 and I cannot have Date_start <= current_date and Date_end >= current_Date.
I am not able to use read with key as it is struck in the first record and I don't want to use 'loop at'.
Please let me know how can I get it worked.
Thanks,
2007 Sep 26 2:05 PM
Try sorting table with Account no ascending and both dates in descending format.
This will keep the latest record on top of all other entries and as you are looking for latest record, your READ will be successful.
2007 Sep 26 2:08 PM
read table it into wa index 3.
this is the simplest way of reading the table or use following way...
loop at internal table.
check the condition.
if u get ur required record then ok.
else
delete it from wa index sy-tabix.
endif.
endloop
reward points if useful.....
2007 Sep 26 2:12 PM
hi
good
go through this link
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm
thanks
mrutyun^
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |