‎2011 Feb 05 11:21 AM
hi all,
please let me know how to fetch data.
my requirement is from a table pa0001, get latest record for each personal no as found in this table (pa0001-pernr)
for all records where 2nd and 3rd char in the field pa0001-btrtl = cost center(csks-kostl) which is given in selection screen.
please let me knw <removed by moderator>
Edited by: Thomas Zloch on Feb 5, 2011 5:39 PM - no ASAP please
‎2011 Feb 05 11:37 AM
Hi Arun,
You can use HR_READ_INFOTYPE to read infotype data. Get all the data giving begda = 18000101 and
endda = 99991231. You can get the record which you want by processing the internal table data.
Thanks,
Aravind
‎2011 Feb 07 7:07 AM
thank u aravind,
bt my question is in select statement how to compare 2nd and 3rd char of one field with another field.
means in single select statement i hav to get the data wt i required by checking the condition i.e 2nd and 3rd char
of one fiele should be equal to another field...i need how to write the code for this
‎2011 Feb 05 1:14 PM
Hi arunkumar,
your question is not easy to answer as it is not clear what very basic knowledge you have and what you do not have. Can you explain what do you know about [Select aggregate|http://help.sap.com/abapdocu_702/en/abapselect_aggregate.htm] (for the 'latest' entry and have you ever heard about [SQL pattern|http://help.sap.com/abapdocu_702/en/abenwhere_logexp_like.htm] and/or [range patterns as specified in Select-options|http://help.sap.com/abapdocu_702/en/abapselect-options.htm]?
Please read the linked information and the come back with remaining questions.
Regards,
Clemens
‎2011 Feb 07 7:09 AM
Hi clemens,
i have no idea bt my qustion is
bt my question is in select statement how to compare 2nd and 3rd char of one field with another field.
means in single select statement i hav to get the data wt i required by checking the condition i.e 2nd and 3rd char
of one fiele should be equal to another field...i need how to write the code for this
‎2011 Feb 07 7:16 AM
Arun,
Instead of looking to apply the condition in the Select quiry, why not get the data into internal table and then apply the String
compare options to filter out the desired records..
Regards,
Murthy
‎2011 Feb 07 7:21 AM
yaa ur rite,,,bt im trying in select statement only will it work?
‎2011 Feb 07 7:31 AM
I dont think there is any other way of doing it
Regards,
Murthy
‎2011 Feb 07 7:29 AM
SHinde Saheb ,
Can you tell me the condition in select statement and What you are expecting to happen .
Regards
Deepak.
‎2011 Feb 07 7:42 AM
HI,
Condition which you are trying will not be done in Select Query ... but it can be done after getting in internal table .
Regards
Deepak.