Locking of a Infotype record in BDC

Hi,
I need to lock the infotype record (PA30) before saving the same during the BDC process. I tried to supply the OK code as 'EDQ'. But BDC is skipping the same and updating the record without locking the record. Could you let me know how to make this work?

Proivde the DYNPRO screen number again before updating the data:
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                'EDQ'.
  PERFORM bdc_dynpro      USING 'MP001400'
                                '2000'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                'UPD'.

Similar Messages

  • Locking and Unlocking HR Infotype records

    Hi ,
         Is there is any Function Module / Report to lock and unlock  infotype record ?
    Please suggest me if any wayout is available..
    Regards,
    Vijay

    Hi
    Try "ENQUEUEPREM", "ENQUEUEPREL", and "HRENQUEUE*".
    Sorry for being generic, I am not connected to a SAP system.
    Hope this much helps...
    *-Serdar
    [email protected]

  • Create locked HR record in BDC - possible???

    Is it possible to create a locked infotype record via a BDC session?
    Let me be more specific: We have a strange calculation for benefits eligible salary. So we use a program that performs that calculation and updates insurance records (it0168) with the correct coverage amount in the COVOV field in a BDC session. Now we have a new requirement that places a limit on the coverage amount w/o EoI. The BDC session will need to create two records for persons over the max - one with the limit amount, another locked record with the calc'd amount and EoI indicators. Both records will have the same start and end date.
    I've tried a number of different things, but the infotype key for both records (except for the lock indicator) is identical. So, one record just overwrites the other.
    Any help is greately apreciated.
    - George

    Hi George,
    1. Either we use BDC, or HR_INFOTYPE_OPERATION
       we cannot create duplicate records.
       ( i have tried the same)
    2. The Primary Key fields for any infotype table are
    SUBTY
    OBJPS
    SPRPS
    ENDDA
    BEGDA
    SEQNR
    3. If it is mandatory that BEGDA and ENDA (start and enddate)
    have to be the same, then the only option left is
    using the remaining field combination
    ie. SEQNR
    4. But SEQNR is probably not avaialble in BDC,
    5. For that purpose the other option is using
      FM HR_INFOTYPE_OPERATION
       (specify the SEQNR )
      This will definitely create a new record.
      ( i have tried the same)
    6. ANOTHER MOST IMPORTANT THING IS
       Will sap HR take into consideration this
      new record with SEQNR = 1 or SEQNR = 2
      in its standard business process.
       Or will it ignore it ,etc .
    7. So Before just dumping new record
      with new SEQNR, it is very crucuial to
      identify the problems.
    Hope the above helps.
    Regards,
    Amit M.

  • How to Unlock a Locked Recoed for Infotype 2010..

    Dear Expert,
    How can I unlock a locked record from Infotype 2010. When I am using BDC how should I decide which record to select in PA30 once I have passed the date and Employee Number details on the screen.
    If on the same date if there are more than one record and if the first one is not locked then the BDC is locking them insted of unlocking it.
    Is there any function module which can help me. The Code I have used is as below.
    The field SPRPS is coming during recording but bdc gives error stating this field is not there on the screen so could not use this one as well..
    IF T_REPORT-INFOTYPE = '2010'.
              PERFORM BDC_DYNPRO USING 'SAPMP50A' '1000'.
              PERFORM BDC_FIELD  USING 'BDC_OKCODE' '=LIST'.
              PERFORM BDC_FIELD  USING 'RP50G-PERNR' T_REPORT-PERNR.
              PERFORM BDC_FIELD  USING 'RP50G-TIMR6' 'X'.
              PERFORM BDC_FIELD  USING 'RP50G-BEGDA' TEMP_BEGDA.
              PERFORM BDC_FIELD  USING 'RP50G-ENDDA' TEMP_BEGDA.
              PERFORM BDC_FIELD  USING 'RP50G-CHOIC' '2010'.
              PERFORM BDC_FIELD  USING 'RP50G-SUBTY' T_REPORT-LGART.
             PERFORM BDC_FIELD  USING 'P50G-SPRPS' 'X'.
              PERFORM BDC_DYNPRO USING 'MP200000' '3450'.
              PERFORM BDC_FIELD  USING 'BDC_CURSOR' 'P2010-BEGDA(01)'.
              PERFORM BDC_FIELD  USING 'BDC_OKCODE' '=EDQ'.
              PERFORM BDC_FIELD  USING 'RP50M-BEGDA' TEMP_BEGDA.
              PERFORM BDC_FIELD  USING 'RP50M-ENDDA' TEMP_BEGDA.
              PERFORM BDC_FIELD  USING 'RP50M-PAGEA' ' 1'.
              PERFORM BDC_FIELD  USING 'RP50M-SELE2(01)' 'X'.
              PERFORM BDC_DYNPRO USING 'MP200000' '2450'.
              PERFORM BDC_FIELD  USING 'BDC_OKCODE' '/00'.
              PERFORM BDC_DYNPRO USING 'MP200000' '2450'.
              PERFORM BDC_FIELD  USING 'BDC_CURSOR' 'P2010-LGART'.
              PERFORM BDC_FIELD  USING 'BDC_OKCODE' 'UPD'.
    Unlock the Details to the R/3 using Tcode PA30.
              CALL TRANSACTION 'PA30' USING BDCDATA MODE 'P' MESSAGES INTO MESSTAB.
    Regards,
    Vidya..

    first of all, use a BAPI instead of BDC.. HR_MAINTAIN_MASTERDATA
    you may have to do some up-front logic to determine which records to unlock, if necessary.
    EDIT: that is a FM, not BAPI.
    Edited by: robert phelan on Mar 16, 2009 8:57 PM

  • Creating / Updating Custom Infotype Records

    Hello everbody,
    We implement alot of custom HR infotypes in our system, both PA &  HRP.
    For the past several we have been using BDC (Batch-Input) recorded functions in order to update / create the records in our infotypes.
    We're currently facing an upcoming ECC upgrade , and I would like to lead a change that will eventually lead to us using generic SAP supplied functions.
    I've researched a few functions that might do the trick:
    RH_INSERT_INFTY:
    This one is giving me an SY-SUBRC 2 error code - Insert error, I tried to select a current record and insert it as different objid but this doesnt work.
    HR_INFOTYPE_OPERATION:
    I've read of several people that recommended using this function, but it is not released by SAP and I couldnt get it to work as well.
    BAPI_HRMASTER_SAVE_REPL_MULT:
    This one seems to work for sap infotypes but I dont think it suits custom infotypes.
    What is the "official" way of doing such operations?
    thanks in advance,
    Eli.

    Hello Dilak,
    Im currently trying to insert a new infotype record of infotype HRP9226.
    First I call function RH_GET_NEXT_NUMBER to get an objid.
    then I fill an HRP9226 line.
    after this i call the function:
    call function 'RH_INSERT_INFTY'
    exporting
    FCODE = 'INSE'
    vtask = 'S'
    ORDER_FLG = 'X'
    COMMIT_FLG = 'X'
    AUTHY = ' '
    PPPAR_IMP =
    OLD_TABNR = ' '
    REPID = ' '
    FORM = ' '
    KEEP_LUPD =
    WORKF_ACTV = 'X'
    tables
    innnn = hrp9226_line
    ILFCODE =
    EXCEPTIONS
    NO_AUTHORIZATION = 1
    ERROR_DURING_INSERT = 2
    REPID_FORM_INITIAL = 3
    CORR_EXIT = 4
    BEGDA_GREATER_ENDDA = 5
    OTHERS = 6
    I'm getting an "Error_During_Insert" and Im out of options regarding what I can possibly do.

  • Modifying SPRPS field in an infotype record

    Hi experts,
    I have a requirement in which i need to modify the lock indicator value of an existing 2001 infotype record. That is, initially when a record is created, i need to update the lock inidicator field as 'X'. Then after few approvals, i need to read the same recoed from infotype 2001 and need to modify the lock indicator with blank. Can the same requirement be achieved using HR_INFOTYPE_OPERATION ?
    Is it possible to modify the SPRPS field with the value blank ' ' using HR_INFOTYPE_OPERATION'?
    Regards,
    Shanthi

    Yes it is. All you need is to provide correct key fields of the record vis this FM exporting parameters and for record parameter pass structure for the record with all the target data (new data for the record).
    So basically the structure will hold all the information as it is right now + field SPRPS with changed value. To ensure you provide correct data, you can first read appropriate record entry with HR_READ_INFTY -> get required entry from result list -> then change only field SPRPS and pass it back to HR_INFOTYPE_OPERATION on input.
    Please refer http://www.sapdev.co.uk/fmodules/fms_HR_INFOTYPE_OPERATION.htm.
    Regards
    Marcin

  • Problem in creating 0027 infotype record in background

    Hi Experts,
    I am facing the problem in creating 27(Costs distribution) infotype record in back ground.
    Whenever there is a change in position of the employee or when we hire a new employee (Through PA40)
    i have to ctreate 0027 infotype record in background.For that i am using IN_UPDATE method of BADI
    HRPAD00INFTY.
    Here i am getting 2 problems.
    1. I am unable to get the latest positions that is assigned to the employee.
       Through NEW_IM AGE structure we can get the latest position but if a person is assigned to multiple   positions for the same period then i am getting only one position from NEW_IM AGE but not all.can any body help me?
    2. I am calling HR_INFOTYPE_OPERATION FM to create the IT0027 record in background in the above method (IN_UPDATE). but it is not updating the PA0027 table. any idea?
    Full points will be rewarded.
    Regards,
    Sai.

    I am sending a sample program , which is on infotype 0105 (communication). I hope that this program will help u out............
    REPORT ZSAPHR_SAMP.
    tables: pa0105.
    infotypes: 0105.
    DATA : I_RETURN TYPE BAPIRETURN1,
    I_KEY TYPE BAPIPAKEY,
    PERNR TYPE P0001-PERNR,
    I_P0105 TYPE TABLE OF P0105 WITH HEADER LINE,
    ENDDA TYPE P0105-ENDDA,
    BEGDA TYPE P0105-BEGDA.
    MOVE '00000010' TO PERNR.
    BEGDA = SY-DATUM + 1.
    ENDDA = SY-DATUM + 1.
    i_p0105-pernr = PERNR.
    i_p0105-infty = '0105'.
    i_p0105-subty = '0002'.
    i_p0105-endda = ENDDA.
    i_p0105-begda = BEGDA.
    I_P0105-USRTY = '0002'.
    I_P0105-USRID = '[email protected]'.
    APPEND i_p0105.
    CALL FUNCTION 'DEQUEUE_ALL' .
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = PERNR.
    IF SY-SUBRC = 0.
    WRITE 'Employee Locked Successfully'.
    ENDIF.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0105'
    NUMBER = PERNR
    SUBTYPE = '0002'
    VALIDITYEND = BEGDA
    VALIDITYBEGIN = ENDDA
    RECORD = i_p0105
    OPERATION = 'INS'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    NOCOMMIT = 'X'
    IMPORTING
    RETURN = I_RETURN
    KEY = I_KEY.
    IF SY-SUBRC = 0.
    WRITE : 'FM returns sy-subrc 0'.
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING

  • Difference between changes in OM/PA infotype records

    Hi people,
    can you pls help me with one topic.
    Is there any way to diference changes infotype records between changes done by program upload (lsmw or custom programs) and manually via pa30/pa40.
    Can it be stored somewhere in the infotype structure that records are done by mass uploading.
    Thanks for ideas.
    Best regards,
    Romano

    Hello Romano,
    As mentioned in the earlier posts that all entries have a UNAME attached to it in the Infotypes which tell us the owner who marked/initiated the change.
    There are options to achieve the type of design which you want. Lets say we maintain a Custom Table which would store the UNAME , T-CODE and DATE fields.
    In the PA User Exits we develop the copy that in each PAI action update the Custom Table. It should solve your case.
    It is not a very staright forward solution , but it would serve your cause.
    Thanks & Regards,
    Rohit Sharma

  • Lock specific number of records using ENQUEUE & DEQUEUE

    Hi,
    Is it possible to lock a group of records in R/3?
    My requirement is to update a set of records in VBAP table. I'm not using a BAPI here. Instead, I use a direct UPDATE.
    In this case, i know i can lock individual records by passing VBELN and POSNR. But what if i have to lock 10 records?
    Is this possible in any way?
    Thanks in advance.
    The current solution is:
    1) LOOP at ITAB
    2) LOCK each entry
    3) UPDATE VBAP for that entry
    4) UNLOCK the entry
    5) Endloop
    I thought this solution might work: (Assume 10 records are present in ITAB)
    1) LOOP at ITAB (Lock all 10 entries)
    2) LOCK that entry
    3) ENDLOOP
    4) UPDATE VBAP from ITAB (Updates all 10 entries in one databae access)
    5) LOOP at ITAB(Unlock all 10 entries)
    6) UNLOCK that entry
    7) ENDLOOP
    Any help will be appreciated.
    Tabraiz.

    Hello,
    Both of your solutions will work.
    With solution 1 there will always be only 1 enqueue object created, because you always enqueue, perform the update and dequeue.
    This means that in SM12 you will only see 1 enqueue entry on your user ID at the same time when your program runs.
    Solution 2 is also possible but there you will have different enqueue objects that will be created, because you enqueue everything, then perform the updates and then dequeue everything.
    In SM12 (lock entries) this will result in more enqueue records on your user ID the time your program runs.
    You have to pay attention that lock entries (SM12) are stored in a queue that is limited, so make sure with solution 2 that you don't overflow the enqueue queue ! ! !
    Via tcode RZ11 you can check parameter enque/table_size (Size of lock table).
    Check the parameter value but also its documentation and you will understand why you should limit the number of open lock records.
    Success.
    Wim Van den Wyngaert

  • Adding read infotype records to payroll

    Dear ,
    i 've used the code mentioned in this link to read the infotype records .
    Use SAP defined methods instead of Logical Database(LDB)
    now i want to add this record to the tree in the payroll . could u plz tell me how to add it to a node in the additional payment tree node.
    Edited by: Kathy_Adam on May 22, 2010 3:40 PM

    Hi,
    1. Create new payroll function code in payroll driver exist. Starts with FU<custom name>.
    2. Create new function via PE04 with custome name.
    3. Add custom function to payroll schema.
    Custom name should start with special character, e.g. %, &, :, etc.
    User exit is special for every country driver, check payroll driver program and figure out its name.
    Cheers

  • HR_INFOTYPE_OPERATION - Need help w/Deleting infotype records

    Hello all,
    We have an issue where infotype records got created where the ENDDA is less than the BEGDA (ENDDA = 06/30/2006 and BEGDA = 07/01/2006).  We are trying to delete these using HR_INFOTYPE_OPERATION but we are getting message PG-009 (No data stored for 9001 in the selected period) returned in our tests. 
    BTW, 9001 is one of our customer infotypes. 
    I know I can remove these records using a direct SQL statement, but I would prefer to remove them more gracefully if possible.  Is there a way around this error?  I actually think function module HR_READ_INFOTYPE is raising the error.
    Any suggestions would be greatly appreciated.
    Thanks,
    Al

    You can check report RHRHDC00, I think it can help you with custom infotype too.
    Otherwise you might need to delete the records forcefully using DELETE statement, which is not suggested since all the  standard FM consider BEGDA and ENDDA and in your case they will always return blank.
    You can also check FM -
    HR_ECM_DELETE_INFOTYPE
    Regards,
    Amit
    Reward all helpful replies.

  • FM for delimit the infotype record

    Hi
    I'm new to HR-ABAP.I need to develop function modules to delimit the some infotype records (eg: 0167,0168,0014,2006 etc)
    Presently i developed the function module that has following source code.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number        = empno
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
         tclas                 = 'A'
          pernr                 = empno
          infty                 = '0167'
          begda                 = delimitdate
          endda                 = delimitdate
      BYPASS_BUFFER         = ' '
      LEGACY_MODE           = ' '
    IMPORTING
      SUBRC                 =
        TABLES
          infty_tab             = itab "itab is of the structure p0167
    enddate = itab-endda.
    MOVE delimitdate TO itab-endda.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty                  = '0167'
          number                 = empno
          subtype                = itab-subty
          objectid               = itab-objps
          lockindicator          = itab-sprps
          validityend            = enddate
          validitybegin          = itab-begda
          recordnumber           = itab-seqnr
          record                 = itab
          operation              = 'LIS9'
          tclas                  = 'A'
          dialog_mode            = '0'
      NOCOMMIT               =
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
       IMPORTING
         return                 = return
      KEY                    =
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number        = empno
    when i use 'MOD' operation in FM 'HR_INFOTYPE_OPERATION' that FM runs perfectly.it changes the enddate to delimit date in the table PA0167.
    But, when i use 'LIS9' (delimiting) operation FM is throwing following error message
    "E PG  428 A complex application error has occurred".
    I need help regarding this error statement.can i use 'MOD' operation to delimit the records (time constraint of most of the infotype record to be delimited is 2).In which case we use 'LIS9'??
    Also any SAP function modules for delimiting IT2006 infotypes????
    Pls suggest.
    Thank u,
    shrinivas
    Message was edited by: Shrinivas

    For 167 & 168 have you looked at HR_BEN_TERMINATE_HEALTH_PLAN & HR_BEN_TERMINATE_INSURE_PLAN?
    The error message you got is actually mapped to (00)344 ie "No batch input data for screen & &"
    For the delimit operation, you probably,need to pass the delimit date separately..
    I have a feeling this function call cannot be used for the delimit operation le 'LIS9'.AS the delimit date is usually entered on a pop-up box when you do it via PA30.
    ~Suresh

  • Infotype records not saving when action is performed.

    Hello all-
    We have an action named: personnel information changes which is having Infotype 0002, 0006, 0105 to show up one after the other.
    When we perform the action and click on save, its saving the data and moving to next infotype, but after the action is completed, the infotype records in PA20 or the table pa0002, pa0006 etc does not contain any data.
    Please advice!
    The employee is having a reference personnel number.
    Thanks,
    Chakri.

    Hi Chakri,
    Go to SPRO> Personnel Management>Personnel Administration--> Customizing Procedure -->Actions --> Define Infogroups and then click the Infogroup.
    Give your action number "same used for Personnel Information Changes"
    Check the following items,
    1. check the Reference User Group... is it similar to your required one?
    2. Check the "operation" column....it should be COP, INS or MOD.
    Please check it ...hopefully it will work...Award points if you think so....
    Regards
    Rao

  • Read infotype records using the classes

    Hi All,
    In my system i can see many classes with cl_hrpa*
    Here i want to read a infotype record using these classes. I want finally the data in PA0008 or a record in P0008 format.
    i tried using the various classes like
    cl_hrpa_masterdata_factory
    if_hrpa_infty_bl
    hrpad_infty_container_tab
    I tried using the sevaral calsses passing one class type to other. finally i get is the class cl_hrpa_infotype_0008_in.
    can any one suggest how i should be reading the data for any infotype.
    Pls do not suggest the function module HR_READ_INFOTYPE. I want to use these classes to read the data.
    Pls suggest
    Regards,
    Umesh Chaudhari.

    Hi,
    Did you get any replies to this or have you found an answer on your own?
    Regards,
    LC

  • Uploading data in Background - for CJ27 LSMW recording or BDC

    Hi
    1. please suggest the BAPI for creating project with reference to standard project definition/WBS similar to CJ27 or CJ20N with copy project method
    2. we tried to upload the data in background for LSMW recording and BDC but geting runtime error with raise exception and GUI can not be reach error
    recording done using t.code. cj27
    suggest the suitable method or solution for above

    Hi,
    Refer to this link..creation of project definition and wbs element

Maybe you are looking for

  • How to add an attribute to "group" element in the DataTemplate dataStructur

    Hi, I want to add an attribute to the group element in the dataStructure section of DataTemplate. I want my output XML file to look like: <G_EMP xmlns:xsd="http://www.w3.org"> <ENAME>John</ENAME> </G_EMP> This can be done in Oracle Reports 6i by sett

  • Restrict Query Resultset  which uses Analytic Function

    Gents, Problem Definition: Using Analytic Function, get Total sales for the Product P1 and Customer C1 [Total sales for the customer itself] in one line. I want to restrict the ResultSet of the query to Product P1, please look at the data below, quer

  • KKS1 Detailed Spool not going in mail to recepients

    Hi All, I have scheduled KKS1 in background. There are 2 spools which are getting generated - 1. 1 Page report and 2. Detailed report. If I goto SM37 I can see only 1 page report, but in SP01 i can see both. The issue is system is sending only the 1

  • LMS4.2.2 incomplete pre configured logrotation

    Following growing logs exists, but not preconfigured in LMSs log rotation: ConfigMgmtServer.log ani.log ICServer.log CAAMServer.log UDM.log rme_ctm.log could be getting large after weeks

  • Pls just tell me how - CS6 Yosemite Java

    so confused with all the advice over this everywhere i'm looking just updated a 2011 macbook pro to 10.10.2 - now illustrator cs6 won't open it gets "To open "Adobe Illustrator CS6.app" you need to install the legacy Java SE 6 runtime." the link goes