FM: HR_READ_INFOTYPE Problem

Hi all you ABAP experts!
I'm working in a program (report mode) that has to read the data from an Infotype (in this case is IT0584) just after the IT has been created (by the same program, using CALL TRANSACTION). I am using the HR_READ_INFOTYPE FM as follows:
    CLEAR: p0584, p0584[].
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr           = l_test_pernr
        infty            = l_infty
        "BYPASS_BUFFER   =  'X'
      TABLES
        infty_tab       = p0584
      EXCEPTIONS
        infty_not_found = 1
        OTHERS          = 2.
    " p0584 was declared using: INFOTYPES: 0584.
As you can notice the BYPASS_BUFFER parameter is commented. The "problem" is that I can see the record just created in SE16 but I can't get anything into p0584.
Now, if I uncomment the BYPASS_BUFFER I get the record(s) into p0584. Could anybody please explain me why this happens? How exactly does the BYPAS_BUFFER parameter is affecting p0584?
This really confuses me because I'm using the same FM without the BYPASS_BUFFER at the begining of the program for the same Infotype and successfully getting the existing records by that moment.
I will really appreciate if any can provide me the answer. Many thanks in advance!

HI
Hope this will help you.
try to make use of FM
'HR_INFOTYPE_OPERATION'
and see the sample code:-
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=13160
REPORT YBDC_NEW_586
no standard page heading line-size 255.
data: begin of i_upload occurs 0,
pernr like pa0586-pernr,
bedda(10) type c,
ebdda(10) type c,
pin01 like pa0586-pin01,
pin02 like pa0586-pin01,
pin03 like pa0586-pin01,
pin04 like pa0586-pin01,
pin05 like pa0586-pin01,
pin06 like pa0586-pin01,
pin07 like pa0586-pin01,
pin08 like pa0586-pin01,
pin09 like pa0586-pin01,
pin11 like pa0586-pin01,
pin12 like pa0586-pin01,
pin13 like pa0586-pin01,
pin14 like pa0586-pin01,
pin16 like pa0586-pin01,
pin17 like pa0586-pin01,
pin18 like pa0586-pin01,
pin19 like pa0586-pin01,
pin20 like pa0586-pin01,
pin21 like pa0586-pin01,
pin22 like pa0586-pin01,
pin23 like pa0586-pin01,
pin24 like pa0586-pin01,
pin25 like pa0586-pin01,
ain01 like pa0586-ain01,
ain02 like pa0586-ain01,
ain03 like pa0586-ain01,
ain04 like pa0586-ain01,
ain05 like pa0586-ain01,
ain06 like pa0586-ain01,
ain07 like pa0586-ain01,
ain08 like pa0586-ain01,
ain09 like pa0586-ain01,
ain11 like pa0586-ain01,
ain12 like pa0586-ain01,
ain13 like pa0586-ain01,
ain14 like pa0586-ain01,
ain16 like pa0586-ain01,
ain17 like pa0586-ain01,
ain18 like pa0586-ain01,
ain19 like pa0586-ain01,
ain20 like pa0586-ain01,
ain21 like pa0586-ain01,
ain22 like pa0586-ain01,
ain23 like pa0586-ain01,
ain24 like pa0586-ain01,
ain25 like pa0586-ain01,
end of i_upload.
data: begin of p586 occurs 0,
icode like pa0586-itc01,
pinvt like pa0586-pin01,
ainvt like pa0586-ain01,
end of p586.
data: p0586 like p0586 ,
ia586 like pa0586 occurs 0 with header line,
return like bapireturn1,
pin_ainvt type pin_ainvt.
S E L E C T I O N - S C R E E N D E F I N I T I O N *
selection-screen begin of block b1 with frame title text-001.
parameters: p_file like rlgrap-filename obligatory,
p_begda like pa0586-begda obligatory,
p_endda like pa0586-endda obligatory.
selection-screen end of block b1.
E V E N T H A N D L I N G - B E G I N *
at selection-screen on value-request for p_file.
perform get_file using p_file.
START OF SELECTION - B E G I N *
start-of-selection.
data: lines like sy-index.
*Getting the file data.
perform upload using p_file.
loop at i_upload.
ia586-pernr = i_upload-pernr.
ia586-endda = p_endda.
ia586-begda = p_begda.
perform col_row.
perform do.
append ia586.
clear : ia586,p586.
refresh : p586.
endloop.
loop at ia586.
move-corresponding ia586 to p0586.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0586-pernr.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0586'
NUMBER = p0586-pernr
LOCKINDICATOR = ''
VALIDITYEND = p0586-endda
VALIDITYBEGIN = p0586-begda
RECORD = p0586
OPERATION = 'INS' or MOD or DEL
NOCOMMIT = ''
tclas = 'A'
IMPORTING
RETURN = RETURN
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0586-pernr.
clear : p0586.
endloop.
*& Form GET_FILE
Show "Open File" dialog box on F4
-->P_W_FILE Name of the file selected by the user
form get_file using p_w_file.
call function 'KD_GET_FILENAME_ON_F4'
CHANGING
file_name = p_w_file
EXCEPTIONS
mask_too_long = 1
others = 2.
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. "GET_FILE
*& Form UPLOAD
Upload the file into the internal table for processing
-->P_LOADFILE Name of file to upload
form upload using p_loadfile.
Read the file into the Internal Table
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_loadfile
filetype = 'DAT'
TABLES
data_tab = i_upload.
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. "UPLOAD
FORM col_row .
if i_upload-ain01 is not initial or i_upload-pin01 is not initial.
p586-icode = '01'.
p586-pinvt = i_upload-pin01.
p586-ainvt = i_upload-ain01.
append p586.
clear p586.
endif.
if i_upload-ain02 is not initial or i_upload-pin02 is not initial.
p586-icode = '02'.
p586-pinvt = i_upload-pin02.
p586-ainvt = i_upload-ain02.
append p586.
clear p586.
endif.
if i_upload-ain03 is not initial or i_upload-pin03 is not initial.
p586-icode = '03'.
p586-pinvt = i_upload-pin03.
reward if help.

Similar Messages

  • Problem with multiple calls to hr_infotype_operation in a loop

    Hi,
    Im using infotyp 2003 with the following situation. For a date, e.g. 2011/07/20 and a person_nr I have several time entries, like 08:00-09:00, 10:00-12:00, 15:00-17:00. Now I read the entries with  HR_READ_INFOTYPE and store them back unmodified with hr_infotype_operation in a loop in the same report.
    data: i_p2003 type standard table of p2003.
    CALL FUNCTION 'HR_READ_INFOTYPE'
             EXPORTING
    *          TCLAS                 = 'A'
               pernr                 = person_nr
               infty                 = '2003'
             BEGDA                 = '20110720'
              ENDDA                 = '20110720'
    *          BYPASS_BUFFER         = ' '
    *          LEGACY_MODE           = ' '
    *        IMPORTING
    *          SUBRC                 =
             tables
               infty_tab             =  i_p2003
            EXCEPTIONS
              INFTY_NOT_FOUND       = 1
              OTHERS                = 2.
    loop at i_p2003 assigning <p>.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '2003'
              number       = person_nr
              validityend   = '20110720'
              validitybegin = '20110720'
              record        = <p>
              operation     = 'MOD'
              dialog_mode   = '0'
            IMPORTING
              return        = return_struct
              key           = personaldatakey
            EXCEPTIONS
              OTHERS        = 0.
    endloop.
    the first call to hr_infotype_operation succeeds but the following operations fail because of collision. This example is stupid, I know, but it shows the core of a problem I have in a more complex report.
    I face the problem that several calls to HR_INFOTYPE_OPERATION cause a collision error even if there cannot be a collision because the data are unchanged.
    Any hints on this.
    Regards,
    JOP

    Hi, you must execute a 'BAPI_EMPLOYEE_ENQUEUE' before 'HR_INFOTYPE_OPERATION' and a 'HR_EMPLOYEE_DEQUEUE' after.
    See next example:
    Bloqueo del empleado
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        NUMBER = PERNR.
    IF SY-SUBRC IS INITIAL.
    Si se pudo bloquear el empleado intenta
    insertar el infotipo
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        INFTY         = '2001'
        NUMBER        = P0001-PERNR
        SUBTYPE       = i_p2001-subty
        VALIDITYEND   = acdate
        VALIDITYBEGIN = acdate
        RECORD        = i_p2001
        RECORDNUMBER  = '000'
        OPERATION     = 'INS'
        TCLAS         = 'A'
        DIALOG_MODE   = '0'
        NOCOMMIT      = ' '
      IMPORTING
        RETURN        = I_RETURN
        KEY           = I_KEY.
    IF SY-SUBRC IS INITIAL.
      VARGT = 'Y'.
    ELSE.
      VARGT = 'N'.
    ENDIF.
    No se hace COMMIT debido que el estandar lo realiza
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    Desbloqueo del empleado
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = PERNR.
    Regards,
    Diego.

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • HR_READ_INFOTYPE in OO context

    Hy everyone,
    I stumbled upon a problem and I kindly ask for your advice. Here is the context:
    - I am inside a BADI implementation
    - need to read the 0001 HR infotype for a given PERNR and target TARGETDATE, specifically I need the BTRTL and PERSK fields.
    I used to do this in 'normal' ABAP programs with something like:
    INFOTYPES: 0001.
    ...(some other code)...
    CALL FUNCTION 'HR_READ_INFOTYPE'
    EXPORTING
        pernr = pernr
        infty = '0001'
        begdata = TARGETDATE
        enddata = TARGETDATE
      TABLES infty_tab = p0001.
    tempBTRTL = p0001-BTRTL.
    tempPERSK = p0001-PERSK.
    Now using this code is not allowed (INFOTYPES is not allowed in OO context).
    Tried to declare DATA: p0001 TYPE TABLE OF p0001 INITIAL SIZE 0. => but then cannot access fields BTRTL or PERSK because p0001 has no header line. (also header line is not allowed in OO context).
    Can you help with suggesting how to get the required info?

    ABAP objects not use internal tables with header line. Because of this you need to create the table without header line and a workarea for manage data. For example
    data lt_p0001 type standard table of p0001.
    data wa_p0001 type p0001.
    loop at lt_p0001 into wa_p0001.
    endloop.
    read table lt_p0001 into wa_p0001 index 1.

  • Dynamic internal table problem in FM - HR_INFOTYPE_OPERATIONS

    Dear All,
    I have a problem when I use a Dynamic internal table in FM - HR_INFOTYPE_OPERTATION..
    Please suggest me on the way to overcome this problem..
    We wanted to have a dynamic Program for Info type operations which can be used for any info types as we are changing only BEGDA and the related actions
    So in my program I have the parameters to accept
    P_BEGDA - 01.10.2007
    P_INFTY - P0008
    P_ACTIO - COPY
    I am able to create a dynamic table based on the parameters P_INFTY and able to read it also using the FM - HR_READ_INFOTYPE
    BUT when I pass the dynamic internal table to a FM - HR_INFOTYPE_OPERTATION I am getting a DUMP
    The DUMP is at the below statement from FM - HR_INFOTYPE_OPERTATION
    ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode
    It gives the below possiblities
    "ASSIGN_BASE_TOO_SHORT" C 
    "SAPLHRMM" or "LHRMMU03"  
    "HR_INFOTYPE_OPERATION"   
    But If I use the below internal table
    Data : g_t_0008 like P0008 occurs 0 with header line.
    And If I use the internal table g_t_0008 instead of dynamic tables then it works. So I strongly feel it's due to not having a header in the dynamic table below see below the sample code on how I am generating a dynamic internal table
    field-symbols: <dyn_table> type standard table.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    to get the srurcute
    perform get_structure using l_f_table.
    perform create_dynamic_itab .
    assign dy_table->* to <dyn_table>.
    perform get_data tables <dyn_table01>
                      using pernr-pernr p_infty.
    below are the forms routine….
    form get_structure using p_table.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    clear : ifc[], dy_table.
    Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    endform.
    form create_dynamic_itab.
    Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
    endform.
    *&      Form  get_data
    form get_data  tables   p_table
                   using    p_pernr
                            p_infty.
    clear : p_table, p_table[].
      CALL FUNCTION 'HR_READ_INFOTYPE'
           EXPORTING
                PERNR           = P_PERNR
                INFTY           = p_infty
                BEGDA           = p_datum
                ENDDA           = p_datum
           TABLES
                INFTY_TAB       = p_table
           EXCEPTIONS
                INFTY_NOT_FOUND = 1
                OTHERS          = 2.
      CHECK SY-SUBRC EQ 0.
    IF lines( p_table ) GT 0.
    *write :/'Record exist' , 'IT', p_infty.
    clear p_table.
    PERFORM hr_operation tables  p_table
                         using  g_t_t588d-actio g_t_t588d-INFTY
                                g_t_t588d-SUBTY.
    else.
    PERFORM append_status using g_t_itab-pernr p_infty ' '
                                'Error' 'No records'.
    ENDIF.
    endform.                    " get_data
    form hr_operation  tables    p_table
                       using     p_actio P_INFTY P_SUBTY.
    data: l_f_return    LIKE bapireturn1.
    ASSIGN COMPONENT 'BEGDA' OF STRUCTURE p_table TO <l_field>.
          <l_field> = p_begda.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = P_infty
                number        = G_T_ITAB-PERNR
                subtype       = P_subty
                validityend   = g_f_endda
                validitybegin = P_datum
                record        = P_TABLE
                operation     = p_actio
              IMPORTING
                return        = l_f_return.
    IF sy-subrc NE 0.
    ENDIF.
    ENDFORM.

    try
    using field symbol for a wrk area instead of Field symbol for a table
    loop your inernal table (again a field symbol) assigning to <fs_wrkarea>
    in loop call HR_INFO.._OP..
    reward if helpful

  • Caching problem two

    Hi again,
    In the ESS you evaluate the belonging employee record in HR via sy-unane and IT0105.
    Problem now.
    My user is connected to record number one. The user of a collegue two record number two.
    We have created a iview with following RFC function.
    We both start the iview with our own users. Be both recive the same values. But we are conected to different employee records and this records have different abcenses.
    When we start the function in the backend everything is fine. Different output.
    The function in a few words:
    User (via sy-uname) checks in INTOTYPE 0105 subtype ESS which personnal number belongs to user.
    With this personal number the function evaluates all abcenses and stores it in a table of the function.
    This table should be shown in the Iview as output.
    FUNCTION zp_get_absences_from_pernr_new.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(BEGDA) LIKE  PRELP-BEGDA
    *"     VALUE(ENDDA) LIKE  PRELP-BEGDA
    *"  TABLES
    *"      ABSENCES STRUCTURE  ZPXX_ABSENCES OPTIONAL
      DATA: lwa_2001 LIKE p2001,
              lt_2001  LIKE TABLE OF lwa_2001.
      TABLES : t554t.
      DATA: p_usrid        LIKE  p0105-usrid,
            p_usrty        LIKE  p0105-usrty,
            usr_pernr    LIKE  p0105-pernr,
            pernr        TYPE prelp-pernr.
      p_usrid = sy-uname.
      p_usrty = 'ESS'.
      TABLES : pa0105.
      SELECT SINGLE * FROM pa0105
      WHERE usrty = p_usrty
      AND usrid EQ p_usrid
      AND begda LE sy-datum
      AND endda GE sy-datum.
      IF sy-subrc = 0.
        pernr = pa0105-pernr.
      ELSE.
        CLEAR pernr.
      ENDIF.
      CALL FUNCTION 'HR_READ_INFOTYPE'
             EXPORTING
             TCLAS           = 'A'
                  pernr           = pernr
                  infty           = '2001'
                  begda           = begda
                  endda           = endda
             TABLES
                  infty_tab       = lt_2001
           EXCEPTIONS
                infty_not_found = 1
                OTHERS          = 2
      IF sy-subrc = 0.
        LOOP AT lt_2001 INTO lwa_2001.
          absences-pernr = pernr.
          absences-begda = lwa_2001-begda.
          absences-endda = lwa_2001-endda.
          absences-awart = lwa_2001-awart.
          SELECT SINGLE * FROM t554t
          WHERE sprsl = sy-langu
          AND moabw = '01' " muß noch geändert werden.
          AND awart = lwa_2001-awart.
          absences-atext = t554t-atext.
          APPEND absences.
        ENDLOOP.
      ENDIF.
    ENDFUNCTION.

    Hi,
    The backend system knows which user to run the function on. However, the model you created in Visual Composer gets only two inout fields begda and endda. It does not get an input field about the user name and obiously it does not send it to the backend. As a result all users get the same resutls.
    Since in VC GA version you can not refer to the user, the only way you can achieve such a task is by adding a new virtual field to the form on which the user will type his id. This field should be mapped to a parametr of the user in the back end.
    Regards, Eyal

  • Function 'HR_READ_INFOTYPE'  not fetching any records in rfc

    Hi All,
       We have created a custom info type 9110 , we have a wrapper RFC build around the function 'HR_READ_INFOTYPE' to read the data from it as we have a separate web dynpro ECC 6.0 system and a 4.7 back end system.
       The rfc is working correctly in the 4.7 system but when we call it from the we dynpro system it does not return any records.
       Is this a problem with the function 'HR_READ_INFOTYPE' ?
    Thanks & Regards
    Gaurav Jain

    hi check this..
    there is no problem with the function module but there may be some wrong data passing into the input of the fm ....mainly at the dates ....the date format is inportant ....otherwise it will not return any thing...

  • HR ABAP - Using of function module HR_READ_INFOTYPE

    Hi,
    I want to replace the below SELECT statement with the function module by HR_READ_INFOTYPE.
    IF l_begda LE '20100331'.
              l_assgnda = '20100401'.
            ELSE.
              l_assgnda = l_begda.
            ENDIF.
    SELECT SINGLE werks
            FROM pa0315
            INTO e_t_data-zz_werks
            WHERE pernr = wa-pernr
            AND endda GE l_assgnda   
            AND begda LE l_assgnda.
    But the problem is, in the where condition i have to use LE or GE condition for endda and begda. So how can i use  the function module  for replacing the select statement without changing the functionality.

    Hi,
    You are selecting a single entry... So you will just need to pass the variable l_assgnda to the BEGDA and ENDDA parameters of the FM...
    added: also, if that infotype can have concurrent records (but in that case the select is not correct), you will have to take the first one from INFTY_TAB...
    Cheers,
    Manu.
    Edited by: Manu D'Haeyer on Dec 29, 2011 2:40 PM

  • Use HR_READ_INFOTYPE or select (for all entries)

    Hi
    As I have understood the difference between FM HR_READ_INFOTYPE and a select directly from PA0001 (as example) is that the FM take the authorization into account. (please correct me if I am wrong).
    My problem is that I need to select from the infotype for a lot of pernr, so I would use this statement:
        SELECT * FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE wt_pa0001
          FOR ALL ENTRIES IN wt_pernr
             WHERE pernr = wt_pernr-pernr
              AND begda LE pn-endda
              AND endda GE pn-begda.
    but then I don't get the authorization check.
    For the FM HR_READ_INFOTYPE I can't use the "FOR ALL ENTRIES".
    Can I do it in an easy way, or do need to do the select, and then use an authority check after the select from each infotype?

    Calling HR_READ_INFOTYPE or selecting directly from the tables may depend on how much data you are processing.  If you only need to retrieve a few records, you could process the PERNR records you need in a loop and call HR_READ_INFOTYPE for each.  If you're processing a larger number of records, check the authorization for the each table first and then do a SELECT for all entries.  Before you read, make sure that your "FOR ALL ENTRIES" table is not empty.  In order to make your code more generic, you may want to use function module HR_CHECK_AUTHORITY_INFTY to check the authorization for each infotype.  This is the FM that the HR_READ_INFOTYPE function module uses.
    .. Craig

  • Read infotype using HR_READ_INFOTYPE

    Hi all,
    I Try to read infotype (pa0021) using HR_READ_INFOTYPE. Its getting fine.
    Im using Web Dynpro ABAP Interactive form.
    I want to insert some value in infotype pa0021, so i used HR_INFOTYPE_OPERATION.
    Data's are Inserting.
    The problem is if i press the Save button, Inserting values are not getting, when i use HR_READ_INFOTYPE in the same session. The new values are updated in the Backend but its not getting
    in the same session. because if i press the save button means, i want to save the data and again i want to show the saved data back .But if i close the session and open once again means its reflection the new values.
    I used BAPI_TRANSACTION_COMMIT also but i no success.
    Please Give some solution for this problem, its very urgent.
    Thanks & Regards,
    Hemachandran.R
    Edited by: hemachandran R on Oct 22, 2008 8:54 AM
    Edited by: hemachandran R on Oct 22, 2008 8:54 AM

    Hi hemachandran R ,
    When all your conditions are satisfied, You can get the updated values from the contexts which you are using to update in the contexts by which you are displaying it on the screen.
    You need not to fetch the data from the back end.
    Regards,
    Rohit

  • Reading Infotype using HR_READ_INFOTYPE

    Hi all,
    I Try to read infotype (pa0021) using HR_READ_INFOTYPE. Its getting fine.
    Im using Web Dynpro ABAP Interactive form.
    I want to insert some value in infotype pa0021, so i used HR_INFOTYPE_OPERATION.
    Data's are Inserting.
    The problem is if i press the Save button, Inserting values are not getting, when i use HR_READ_INFOTYPE in the same session. The new values are updated in the Backend but its not getting
    in the same session. because if i press the save button means, i want to save the data and again i want to show the saved data back .But if i close the session and open once again means its reflection the new values.
    I used BAPI_TRANSACTION_COMMIT also but i no success.
    Please Give some solution for this problem, its very urgent.
    Thanks & Regards,
    Hemachandran.R
    Edited by: hemachandran R on Oct 22, 2008 9:02 AM

    Hi Hema,
    Make a new context attribute 'ca_temp'
    and then
    set single attribute
            lo_el_context->set_attribute(
              EXPORTING
                name =  `CA_TEMP`
                value = <new_value> ).
    And use this CA_TEMP where ever you want. for more than one value make node in place of attribute.
    Hope it works.
    Regards,
    Rohit

  • Problems with ALV refreshing

    I have a button to refresh an ALV. The first time it does it but the nexts doesn't. I want the ALV to have the last modifications of table pa0000 (HR) when I refresh it instead of having the modifications made before, in the last loop. It seems that takes no updated data of pa0000 when I call it, so I don't know how to change it because I am doing a refresh table and clear table to have new data to print.  Perhaps it is something referred to commit but I have tried it and does not work neither.

    When I fill the table once again when I push refresh I am doing something like this.
    clear t_0000.
    refresh t_0000.
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          PERNR     = pernr  -> I am receiving the pernr in the function
          INFTY     = '0000'
        TABLES
          INFTY_TAB = t_0000. -> In this table when I refresh I don´t obtain the data in pa0000 for this pernr. Just other data from the last loop executed for the same pernr so that's the problem but I don't know why.
    FORM user_command USING u_ucomm     TYPE syucomm
                            us_selfield TYPE slis_selfield.
    WHEN 'REFRESH'.      
          us_selfield-refresh = 'X'.
          perform function. -> to obtain new data
          perform listado_alv.
    ENDFORM.

  • Performance problems with RPTIME00

    Hi,
    when we run program RPTIME00 we encounter a performance problem.
    When evaluating the data some infotypes (0000 and 0001) are read much too often. For every day of the period we evaluate (e.g. the month october) these infotypes are read over and over again from the evaluated day down to the first of januari.
    How is this last date definded?
    This way we need over a minut for evaluating a month for one person.
    I'm rather new in this field, but it seems something happened in our system that made occur this problem.
    Has anyone has an idea what might be going on?
    Thanks a lot.
    Kris

    Hi Cris,
    Once a rptime00 execution is done with retro and the results are saved, the retro date will be cleared from I0003 and no more retro will be done until an infotype relevant for time is retroactively changed.
    To see where the bottleneck is, do an abap trace with transaction SE30.
    I did a trace in a test system and the results ordered descending by net time were:
           Net Gross (%) Net (%) Call
    1.517.831      13,5     6,3  Perform BOPER
    1.148.119       4,9     4,8  Call Func. HR_READ_INFOTYPE
      900.470       4,0     3,7  Call Func. HR_QTACC_QUOTAS_TRANSFER
      629.849      20,8     2,6  Perform REGEL
      584.148       4,2     2,4  Perform RE52C5
      560.019       2,3     2,3  Call Func. HR_PL_MOVE_APER_TO_PLOG
      557.773       2,3     2,3  Perform FILLVARGT52C5
    HR_READ_INFOTYPE for 0001 is on top but jusst consumed 4,8% of time which is not that much.
    I might also happen there are database issues. Check that.
    check, just in case you do not use the option "Display log".
    rgds,
    Carlos.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

Maybe you are looking for

  • Itunes wont play anything, windows 7

    itunes wont play anything.i hit play and it goes to pause but does not count down.im guessing it is because of the update that i did to itunes.please help.

  • Producer/consumer inside producer/consumer

    Hello all,  I am using a producer/consumer event structure within a producer/consumer....not sure if this is the best approach.  The main vi is setup to perform several different tests based on the user input.  It does an initialize, setup, and read

  • Is there a way to track calories of a workout with heart rate monitor?

    I got a polar heart monitor and like how it tracks my HR during runs. However, I am wondering if there's  a way to track my calories burnt doing something like circuit training.

  • 2651 only rings half the time on call transfer

    I have a 2561 with T1CAS. Incomming calls hit a call handler and are given the option to transfer direct to an extension. When the transfer occurs, The calling party only hears half of the rings. The called party hears them all. For example outside c

  • Is there any z-depth technology in views of iPhone?

    If two views overlap in some part, can I set the z-depth of views to decide which view be displayed in front? For example view1(0,0,5,5) and view2(3,3,6,6).