FM HR_READ_INFOTYPE to read records from 3 infotypes
Hi all,
I am writing a report using PNP as my LDB. So there is a selection screen which can takes in the pernr and the dates as begda and endda. Based on this scenario, how do you normally use this FM 'HR_READ_INFOTYPE' to all the records from let say 2 fields from infotype p0000, 2 fields from p0001 and 3 fields from infotype p9999?
Hi,
Since your are using PNP logical data base, I recomended extract the information via begda and endda limits for each infotype, ie.
GET PERNR. " fill all infotypes
rp_provide_from_last p0001 space pn-begda pn-endda. "extracts the records that meet the criteria
IF pnp-sw-found = '1'. "If found records DO ... whatever you want
write:/ 'Infotipo P001: ', p0001.
ELSE.
REJECT. "If not fount records ... next record.
ENDIF.
This example with infotype 0001, tha same method to infotype 0000, infotype 0002, to infotype 9999.
Regards
José Luis.
Edited by: Aguirre Eguiluz Jose Luis on Dec 9, 2010 10:32 AM
Edited by: Aguirre Eguiluz Jose Luis on Dec 9, 2010 10:33 AM
Edited by: Aguirre Eguiluz Jose Luis on Dec 9, 2010 10:34 AM
Similar Messages
-
How to read records from Relationship table using ABAP API's
Hi All,
I need to retrieve the records from Relationship table. In Java API's I came to know there is an option to retrieve this. I could not find anything in ABAP API's. Is there any option in ABAP API's to do this.
Please Suggest.
Thank You,
Gajendra.Hi Gajendra,
You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
You will find all these methods in the following interface
Interface : IF_MDM_CORE_SERVICES
Hope it helps.
*Please reward points if found useful.
Thanks and Regards
Nitin Jain -
Using ResultSet to read records from multiple tables
Im using a ResultSet object to read records from tables.
I have a database with 5 tables. Initially, I got it to work fine with one of those tables. What Im exactly trying to do is check if there is a record in a table which matches a given string, and if it does, display some text on some JTextFields. I got that to work fine with one table.
Problem is, how do I get it to work with all 5 tables at the same time?
i.e. instead of searching through one table, I want it to look through all 5 tables and look for the matches.
Any help greatly appreciated.
ThanksAfter the first interaction with the first table, I
used a stmt.getMoreResults() followed by instructions
to get data from the second table, and so on.
Worked fine.Sounds remarkably inefficient. (Potential for lots of network traffic.)
is this another way of doing it?Sounds more like a document search type of thing than a database query. What about Lucene? Could it help here?
% -
Read records from VALUES OBJECT using the INTERATOR
Hi
I'm trying to read records from my value object with interator these way:
ValidaUsu usuVO = new ValidaUsu();
for (Iterator it = usuVO it.hasNext(); ) {
System.out.println(" User from VO: " + usuVO.getUsuario());
But i don't know what i`m doing wrong ?
Could help me?
ThanksHi Gajendra,
You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
You will find all these methods in the following interface
Interface : IF_MDM_CORE_SERVICES
Hope it helps.
*Please reward points if found useful.
Thanks and Regards
Nitin Jain -
Function to read wagetypes from infotype 589
Dear Experts,
Is there any function to get all wagetypes along with respective amounts from infotype 0589.
Right now am using function 'HR_READ_INFOTYPE'
and read statement to get wagetypes.because it is stored various fields like lga01,lga02..
and bet01,bet02..
plz let me is there any alternative..
Thanks in advance.
Regards
sivaHi,
Through Transaction SE16 you can download records of IT0589
Table is PA0589
Regards,
Devojit -
Fetching last but one record from Infotype
Hello Everyone,
Can you kindly let me know how to fetch the last but one records of IT0171 and IT0000, then compare the endda of both of the records.
Thank you for your help.
Regards,
VinodHi,
First sort your internal table by ENDDA descending.
Then read index 2. This will give you the last but one record.
INFOTYPES: 0171.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = '506'
infty = '0171'
begda = '18000101'
endda = '99991231'
TABLES
infty_tab = p0171
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
SORT p0171 BY ENDDA descending.
READ TABLE p0171 INDEX 2. ---> reads the previous record of the last entry.
write:/ 'test'.
ENDIF.
Regards,
Soumya. -
Hi,
How can we read texts from the Infotype. There is this function module HR_ECM_READ_TEXT_INFOTYPE, but we need the Employee Number, Begin date and End Date as inputs.
I just want to check if a field with a particular value exists or not.
just like this works to check whether the field DAT35 with value 99991231 exits or not.
SELECT PERNR FROM PA0035 INTO V_PERNR WHERE DAT35 = '99991231'.
IF SY-SUBRC = 0.
ENDIF.
the same way for a text, but this text actually gets stored in a structure thats why we cannot use a select for infotype
Thanks in advance.Hi,
What i am getting from ur explanation is that u are having a probelm in accessing a text field from the infotype, i.e: the value field in included in the infotype table (PA0035) but its text is in another table.
If this is the problem, u should first use select statement on PA0035 to get the required infotype record. Then use F1 help on the required text field on the infotype screen to get the table and field name. Then u can use select statement on that table by specifying the relavant value field from the previous select in the where clause.
Hope this hepls -
Deleting records from infotype 0587 - PF
Hi,
I have a requirement to delete some records from the infotype 0587 which is having the TimeConstraint 1. For that one of my friends suggested me to use the Function module SE16N_INTERFACE to delete those records. Is this method suggestable?
will there be any problem if i delete those records through that function module. Can any body please suggest me.
Thanks
KarthikHi....
the function module which your friend suggested SE16N_INTERFACE is used to Display table as full screen..
it cant be used to delete record for an infotype..
And also there is no function module to do forbidden actions.
but there are lot of indirect methods to delete the data. But when a time constraint is set it is not advisable to delete.
Anyways.. you only can do it with DELETE statement in report program.
select single dbtab from t777d into gv_dbtab where infty = p_infty.
delete from (gv_dbtab) where pernr in p_pernr.
OR
delete (dbname) from (work area).
else ..you can use SE16N with editing mode set to active and then delete it .. BE CAREFUL in doing this ... Not to be used in Production.
Hope this helps!
Regards,
Jhings. -
Hello,
I have a table which is linked (using FK) with a number of other tables which are linked with other tables, etc. (like a tree). Using ADO.NET EF provider within ODAC 11.2.0.3 Release 5 I am trying to get a record from the root table. I coded a test using MSTest and when I do "myContext.MyTable.Where(...).FirstOrDefault();" VS2010 stops the debugging process after a while - no exception is caught in code but I get an error in Test results window: "The test adapter 'UnitTestAdapter' threw an exception while running test '<my test>'. Exception has been thrown by the target of an invocation.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
In the Debug window/view I get this:
A first chance exception of type 'System.AccessViolationException' occurred in Oracle.DataAccess.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter.dll
Step into: Stepping over method without symbols 'Microsoft.VisualStudio.TestTools.Agent.AgentExecution.CallAdapterRunMethod'
W, 7380, 13, 2012/11/09, 23:33:29.803, QTAgent32.exe, AgentExecution: Exception while calling TestAdapter.Run: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oracle.DataAccess.Client.OpsDac.Read(IntPtr opsConCtx, IntPtr opsErrCtx, IntPtr opsSqlCtx, IntPtr& opsDacCtx, OpoSqlValCtx* pOpoSqlValCtx, OpoMetValCtx* pOpoMetValCtx, OpoDacValCtx* pOpoDacValCtx)
at Oracle.DataAccess.Client.OracleDataReader.Read()
at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
at <my code stack>
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.DefaultTestMethodInvoke(Object[] args)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.DefaultTestMethodDecorator.Invoke(Object[] args)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunTestMethod()
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.ExecuteTest()
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.Execute(UnitTestResult result)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.ExecuteSingleTest(UnitTestExecuter executer, UnitTestElement test, ITestContext testContext, UnitTestAdapterContext userContext, Boolean isLoadTest)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.Run(UnitTestElement test, ITestContext testContext, Boolean isLoadTest, Boolean useMultipleCpus)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.Run(UnitTestElement test, ITestContext testContext, Boolean isLoadTest, Boolean useMultipleCpus)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.Run(ITestElement testElement, ITestContext testContext, Boolean isLoadTest)
at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.Run(ITestElement testElement, ITestContext testContext)
at Microsoft.VisualStudio.TestTools.Agent.AgentExecution.CallAdapterRunMethod(Object obj)
The thread 'Agent: adapter run thread for test '<my test>' with id '0779674e-2258-44d4-adfe-65302abbe50f'' (0x13e0) has exited with code 0 (0x0).
W, 7380, 30, 2012/11/09, 23:33:29.869, QTAgent32.exe, Performance warning: m_test should be null when TestResult is serialized. Please find the offending code and correct it.
E, 7380, 30, 2012/11/09, 23:33:29.879, QTAgent32.exe, AgentExecution: Received adapter message during test shutdown: run id {94200779-4759-4b4a-819c-61c55d39acbc}, test '<my test>' with id 0779674e-2258-44d4-adfe-65302abbe50f: MessageKind: Result, Outcome: Error
The thread 'ExecutionUtilities.InvokeWithTimeout helper thread 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.AbortTestRun'' (0x1f98) has exited with code 0 (0x0).
The thread 'Agent: state execution thread for test '<my test>' with id '0779674e-2258-44d4-adfe-65302abbe50f'' (0x2688) has exited with code 0 (0x0).
The thread 'Agent: test queue thread' (0x1c58) has exited with code 0 (0x0).
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Oracle.DataAccess.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
The thread '<No Name>' (0x24c0) has exited with code 0 (0x0).
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Data.Entity.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
The thread '<No Name>' (0x2410) has exited with code 0 (0x0).
The thread '<No Name>' (0x2520) has exited with code 0 (0x0).
E, 7380, 6, 2012/11/09, 23:35:17.912, QTAgent32.exe, AgentObject: Cleanup: Timeout reached in cleaning up the agent.
E, 7380, 6, 2012/11/09, 23:35:22.918, QTAgent32.exe, AgentObject: Cleanup: Timeout reached in cleaning up the agent.
The program '[7380] QTAgent32.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
Any idea is appreciated!
Thanks
Edited by: 917334 on Nov 10, 2012 12:17 AM
The equivalent where statement works well in classic ADO.NET.Hello
Use the below function module
RV_ORDER_FLOW_INFORMATION pass the type as C and pass the number.You will get all the flow.
SELECT VBELN KNUMV BUKRS KUNRG REGIO NETWR FKSTO FKDAT FKART INTO CORRESPONDING FIELDS OF TABLE T_VBRK FROM VBRK WHERE BUKRS IN P_BUKRS AND FKDAT IN P_FKDAT AND VKORG IN P_VKORG AND REGIO = '07'
ORDER BY VBELN KNUMV.
SORT T_VBRK BY vbeln.
LOOP AT T_VBRK.
IF T_VBRK-FKART = 'F2' OR T_VBRK-FKART = 'YF2' OR T_VBRK-FKART = 'ZF2' OR
T_VBRK-FKART = 'ZG2' OR T_VBRK-FKART = 'ZL2' OR T_VBRK-FKART = 'YG2' OR T_VBRK-FKART = 'YL2' .
IF T_VBRK-FKSTO IS INITIAL.
i_vbco6-vbeln = t_vbrk-vbeln.
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
AUFBEREITUNG = '2'
BELEGTYP = ' '
COMWA = i_vbco6
NACHFOLGER = 'X'
N_STUFEN = '50'
VORGAENGER = 'X'
V_STUFEN = '50'
IMPORTING
BELEGTYP_BACK =
TABLES
VBFA_TAB = t_vbfa
EXCEPTIONS
NO_VBFA = 1
NO_VBUK_FOUND = 2
OTHERS = 3
endif.
ENDIF.
endloop.
loop at t_vbfa.
if t_vbfa-vbtyp_V = 'C' OR t_vbfa-vbtyp_V = 'K' OR t_vbfa-vbtyp_V = 'L' OR t_vbfa-vbtyp_V = 'E' .
*clear t_vbfa.
SELECT VBELN BSTNK BSTDK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE T_VBAK FOR ALL ENTRIES IN T_VBFA WHERE VBELN = T_VBFA-VBELV .
endif.
ENDLOOP.
In case of any more help is required do let me know
Regards,
Nabheet Madan -
Reading dates from infotype 41
I need to obtaint a subtype of date from infotype 41 but the problem is that infotype 41 has many fields like
dar01 - dat01, dar02 - dat02, darN - datN the subtype that I need is the '01' but I don't know how to get it becuase sometimes is in the dar01, or in the dar02, or darN, is there any function module that can help me?
Thanx in advanceHi ,
This exactly what you are trying to do
*--Decleare internal table
TYPES : BEGIN OF ty_pa0041,
pernr TYPE pa0041-pernr,
dar01 TYPE pa0041-dar01,
dat01 TYPE pa0041-dat01,
dar02 TYPE pa0041-dar02,
dat02 TYPE pa0041-dat02,
dar03 TYPE pa0041-dar03,
dat03 TYPE pa0041-dat03,
dar04 TYPE pa0041-dar04,
dat04 TYPE pa0041-dat04,
END OF ty_pa0041.
DATA : lt_pa0041 TYPE STANDARD TABLE OF ty_pa0041,
ls_pa0041 TYPE ty_pa0041.
*--Read Secondment end date ( For my case it's RG)
SELECT pernr
dar01 dat01 dar02 dat02 dar03 dat03 dar04 dat04
INTO TABLE lt_pa0041
FROM pa0041
WHERE pernr = gs_final-pernr AND
endda = '99991231'.
*--Find out corrosponding date according to 'RG'
LOOP AT lt_pa0041 INTO ls_pa0041.
IF ls_pa0041-dar01 = 'RG'.
lv_date1 = ls_pa0041-dat01.
ELSEIF ls_pa0041-dar02 = 'RG'.
lv_date1 = ls_pa0041-dat02.
ELSEIF ls_pa0041-dar03 = 'RG'.
lv_date1 = ls_pa0041-dat03.
ELSEIF ls_pa0041-dar04 = 'RG'.
lv_date1 = ls_pa0041-dat04.
ENDIF.
ENDLOOP.
I hope it fits your requirement -
How to Read records from structure to internal table
HI,
Can any body know how to read the records from structure to internal table at runtime.
please give me sample program if possible.
thanks in advance
KPif your internal table is having the same structure as the structure you are reading the values from then you can directly assign like..
internatable table work area or header line = structure.
or else if they are different assign field by field like
internal table-field1 = structure-field1.
internal table-field2 = structure-field2.
award points if it helps. -
hi all,
i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
i am uploading data from excel to form(record wise)and saving.
now i am reading the data from 2nd row by assuming that 1st row followed with columns titles.But, my question is we cannot predict the excel that the record always starts from 2nd row. how check for the starting for the actual data
is its something like if column1 is null and col2 is null and col3 is null
then increment the row and repeat the process.. but, upto which record i should continue this process..
anybody is having better solution than this..
Thanks..Hi,
The nice option would be keep the upload (start from and end) manually, What i mean is in the uploading screen put two more fields like Start Row and End Row and let the user fill these fields before starting the upload process. So, if any error will happen during upload then let the user handle.
-Ammad -
How to read records from Database view
Hi folks,
well...let me know, y im getting error as : V_T52EL is not defined in the ABAP dictionary as Table , Projection view or Database view.
But actually here this View Type is : Maitenance View.
SELECT KOART
from V_T52EL
where ENDDA GE SY-DATUM AND
SYMKO EQ T030-BWMOD.
plz let me know..guys.
Regards,
KumarHello,
Maitenace View reocird can be viewed only through Tcode SM30
Vasanth -
Time out while reading single record from CRMD_ORDERADM_H table on OBJECTID
Hi,
This is the problem i am facing in CRMD_ORDERADM_H.
if i search for a single record in CRMD_ORDERADM_H Table using SE11 on OBJECT_ID field, it is giving me Time out error.
CRMD_ORDERADM_H db size would be > 1 Billion records.
It is having a Secondary Standard index on OBJECT_ID.
If i search for single record with OBJECT_ID and PROCESS_TYPE i am able to get the result within seconds.
But if i take some range in OBJECT_ID and single value in PROCESS_TYPE then i am getting Time out erro.
we have index (custom) on OBJECT_ID and PROCESS_TYPE combination.
What would be the cause?
Thanks in Advance,
-KishoreHello,
there is a special table for reading records from orders: CRMD_ORDER_INDEX.
Regards, R -
Delete Employee Records in Infotype 14
Hi all,
Is there any standard program that will delete records from infotype 14... Thanks a lotHi Jim
I do not know any programs for this but you can write your own utilizing the FM 'HR_INFOTYPE_OPERATION' with delete mode. For more details about the FM you can refer to Re: HR: creating IT "0015 - Additional Payments" item
Maybe you are looking for
-
A JE created from the AP Invoice does not include the project # on all trx
A JE created from the AP Invoice does not include the project # for the amounts entered in the freight box. To duplicate, do the following: 1. Open an AP Invoice 2. Enter BP Code 3. Select Service type 4. Enter a Project Code in drop down box on Acco
-
I downloaded iOS 7 and now in my music library all my songs are not in the order of the original albums. How do I get them back into order?
-
Final Cut Pro version 10.1.1 won't open.
Hi All. My Final Cut Pro version 10.1.1 won't open at all. I am on mavericks. Having read quite a few threads, I have trashed preferences and also reinstalled the software but no joy. The screen flashes up with "Final Cut Pro can't be opened - error
-
I have a screen in screen painter with two fields. if i set 1 field to X , then other should automatically be set to R on that same screen. Is it possible? I think it can be possible by using value-request. Please if u have any suggestion or example
-
EP and Business Process Management
I am curious to learn 1. How does EP (SAP Enterprise Portal) leverages BPM frame-work? 2. Will organizations benefit adapting their Business Process on to EP? 3. What will be economical benefits that can be realized by using technology (EP) for BPM?