02-20-2013 5:25 AM
Hi experts
I have one requirement that i want
these are the my internal table field and in column "reco quantity" field value 100, 83.193 and 14.704 is coming from the formulas but for the last line item of the internal table where the value is "2.101" it should be come from (100-83.193-14.704).
Please help me how to check last line item in internal table to find the value for last line item.
Thanks and Regard
Bipin
02-20-2013 11:46 PM
#WTF guys!
READ TABLE lt_sflight
REFERENCE INTO lr_sflight
INDEX lines( lt_sflight ).
02-20-2013 5:40 AM
I am not clear with your question. But you can try.
describe internal table lines [Variable_name]
It will give number of records in table.
Then read that internal table with with Index [Variable name.]
It will give last row of internal table.
02-20-2013 6:02 AM
Hi Bipin,
To get the last line of an internal table you can use describe table, and use the result of describe table as index in your read table.
Regards,
Bhushan
02-20-2013 3:44 PM
Bipin,
As Nagabhushan mentioned, you can use describe table to get the number of items are then use it as index.
But since DESCRIBE TABLE takes more execution time, you can think of any alternative.
See how you are populating the internal table. If you are populating the internal table from a select query directly, then you can use SY-DBCNT as index. Else if you are populating the table manually, you can keep track of the SY-TABIX used after the last entry was populated.
Thanks,
Sreekanth
02-20-2013 11:46 PM
#WTF guys!
READ TABLE lt_sflight
REFERENCE INTO lr_sflight
INDEX lines( lt_sflight ).
02-21-2013 10:05 PM
I don't use REFERENCE INTO often, but the lines( internal_table ) have long forced DESCRIBE into retirement.
02-27-2013 6:00 AM
03-04-2013 9:49 PM
03-05-2013 9:45 AM