Last added record key for UDO

Hi,
I create a UDO , how i get the last added record key after i add document ?
Please Advise. Thanks

Hi,
Or try oCompany.GetNewObjectCode().
Or if this dosent work try the following.... Before adding the record in the before action = True execute a simple query 
select max(docentry)  from OINV
And now store that in a variable and execute the same query after the record is added in the beforeaction = false and check if both are same, if not then u have a new record added.
Hope it helps,
Vasu Natari.

Similar Messages

  • Query to get the last added record in a table for a particular id

    T
    Hi,
    I have 2 tables A, B
    Table A has id,name
    Table B had parentid(foreignkey referring to ID in above table), record_type,created_timestamp
    I want to get the last added record_type from Table B for all the ids present in Table A.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. I know this is
    a skeleton, but could you at least try to do good programming? Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. And sample data also helps. 
    I have 2 tables: Alphas, Betas
    CREATE TABLE Alphas
    (alpha_id CHAR(10) NOT NULL PRIMARY KEY,
     alpha_name VARCHAR(25) NOT NULL);
    Why was that DDL so hard you could not write it? But your narrative about the second table does not tell us if it has a key. I will guess that it is also alpha_id, but thanks to your rudeness, that is all we can do. 
    CREATE TABLE Beta 
    (alpha_id CHAR(10) NOT NULL PRIMARY KEY
       REFERENCES Alphas (alpha_id),
     record_type CHAR(2) NOT NULL,
     creation_timestamp DATETIME2(0) DEFAULT CURRENT_TIMESTAMP
          NOT NULL,
    >> I want to get the last added record_type from Table Beta for all the ids present in Table A.<<
    Think about this. Since Beta.alpha_id is a FOREIGN KEY to Alphas, all of its rows will have a match to Alpha. The SQL engine does this for you! 
    SELECT *
    FROM (SELECT alpha_id, record_type, creation_date,
                  MAX(creation_date) OVER () AS creation_date_max
            FROM Betas)
    WHERE creation_date = creation_date_max;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Getting the last added record

    Hi,
    Am developing an application that needs to record some info in a user table after adding a sales invoice. What i need is an object or method that could give me the info of the last record added in the AR invoices table, i tried using the GetNewObjectKey() but i'm not sure if this method works OK in a scenario where concurrence situations could be present, i mean in situations where multiple users could save documents at the same time, does not the method become imprecise?

    Hi Oscar,
    Have a look at the following post:
    Re: Getting the Document Number
    Hope this helps,
    Owen

  • Get last add record using UI

    Hi is there anyway to get the last added record from UI-API?
    I want to return the last added doc num from the delivery screen after the user press the add button.
    The method i am using now to get the doc num is to return the docnum after the itempressed event = true. After that i will minus 1 to that result. Is this the only way to get the last added number or is there another method to use?
    Thanks

    Thanks Ibai
    I tried making an UDF in the Document/Title part, and created a new field called GUID. When i tried entering the GUID into that field using UI-API, it does not enters. My code are something like this
    sGuid = guid.newguid.tostring
    oitem = odevnote.items.item("U_GUID")
    oedittext = oitem.specific
    oedittext.value = sguid
    pls help
    ps. one more thing, if the UDF screen is not opened, the GUID value would not be entered right? is there a way to force the user to open the UDF screen? or is there any other solution for this?
    Message was edited by: Melvin Teng

  • Setting a Primary Key for a newly added Column

    Is it possible for setting a primary key for a newly added column in a table having records?

    Hi,
    km**** wrote:
    oh if the table has records then it is not possible ah...No, the table can have rows at the time you add the Primary Key constraint. Solomon was just saying that the column(s) that you are making into the Primary Key must already have unique values. A Primary Key can not be NULL, so you must do the steps in this order:
    (1) ALTER TABLE to add the column(s) (if this hasn't been done already)
    (2) UPDATE the table, to put unique values in all rows for the Primary Key column(s)
    (3) Add the PRIMARY KEY constraint
    You need to do step (2) before you do step (3)

  • How to genarate Primary Key for each record in XI  Mapping

    Hi,
    I need to genarate primary key for each record in the paylod in mapping..
    Eg: if i have a 10 reacords i need to have a primary key for each record..starting with the
    Record      Primary key
    First            001
    Secound      002
    Tenth         010
    If i need to write any user defined funtion... can any one provide the code for it.
    Thanks
    Amaresh

    Hi Bavesh,
    I will explain with the example:
    XML:
    <Record 1>
    <Primary key>
    <value1>
    <value2>
    </Record 1>
    <Record 2>
    <Primary Key>
    </Record 2>
    like above i will be getting n number of recored and in each record i need  to genarate primary key in XI.and the key sould be in sequence...
    like for the first record 1 secound 2 like that primary key should add to the privous Primary key.
    and this is for each payload.
    Thanks
    Amaresh

  • Sql query - Selecting last recorded values for each date in specified period

    Hello,
    Can someone please help me with my problem.
    I'm trying to get last recorded balance for each day for specific box (1 or 2) in specified period of days from ms access database using ADOTool.
    I'm trying to get that information with SQL query but so far unsuccessfully...  
    My table looks like this:
    Table name: TestTable
    Date Time Location Box Balance
    20.10.2014. 06:00:00 1 1 345
    20.10.2014. 12:00:00 1 1 7356
    20.10.2014. 18:45:00 1 1 5678
    20.10.2014. 23:54:00 1 1 9845
    20.10.2014. 06:00:02 1 2 35
    20.10.2014. 12:00:04 1 2 756
    20.10.2014. 18:45:06 1 2 578
    20.10.2014. 23:54:10 1 2 845
    21.10.2014. 06:00:00 1 1 34
    21.10.2014. 12:05:03 1 1 5789
    21.10.2014. 15:00:34 1 1 1237
    21.10.2014. 06:00:00 1 2 374
    21.10.2014. 12:05:03 1 2 54789
    21.10.2014. 15:00:34 1 2 13237
    22.10.2014. 06:00:00 1 1 8562
    22.10.2014. 10:00:00 1 1 1234
    22.10.2014. 17:03:45 1 1 3415
    22.10.2014. 22:00:00 1 1 6742
    22.10.2014. 06:00:05 1 2 562
    22.10.2014. 10:00:16 1 2 123
    22.10.2014. 17:03:50 1 2 415
    22.10.2014. 22:00:10 1 2 642
    23.10.2014. 06:00:00 1 1 9876
    23.10.2014. 09:13:00 1 1 223
    23.10.2014. 13:50:17 1 1 7768
    23.10.2014. 19:47:40 1 1 3456
    23.10.2014. 21:30:00 1 1 789
    23.10.2014. 23:57:12 1 1 25
    23.10.2014. 06:00:07 1 2 976
    23.10.2014. 09:13:45 1 2 223
    23.10.2014. 13:50:40 1 2 78
    23.10.2014. 19:47:55 1 2 346
    23.10.2014. 21:30:03 1 2 89
    23.10.2014. 23:57:18 1 2 25
    24.10.2014. 06:00:55 1 1 346
    24.10.2014. 12:30:22 1 1 8329
    24.10.2014. 23:50:19 1 1 2225
    24.10.2014. 06:01:00 1 2 3546
    24.10.2014. 12:30:26 1 2 89
    24.10.2014. 23:51:10 1 2 25
    Let's say the period is 21.10.2014. - 23.10.2014. and I want to get last recorded balance for box 1. for each day. The result should look like this:
    Date Time Location Box Balance
    21.10.2014. 15:00:34 1 1 1237
    22.10.2014. 22:00:00 1 1 6742
    23.10.2014. 23:57:12 1 1 25
    So far I've managed to write a query that gives me balance for ONLY ONE date (date with highest time in whole table), but I need balance for EVERY date in specific period.
    My incorrect code (didn't manage to implement "BETWEEN" for dates...):
    SELECT TestTable.[Date], TestTable.[Time], TestTable.[Location], TestTable.[Box], TestTable.[Balance]
    FROM TestTable
    WHERE Time=(SELECT MAX(Time)
    FROM TestTable
    WHERE Location=1 AND Box=1 );
    Tnx!
    Solved!
    Go to Solution.

    For loop
    following query keep day (here 24 in below query) Variable from ( 1 to 28-29/30/31 as per month)
    SELECT TOP 1 TestTable.[Date], TestTable.[Time], TestTable.[Location], TestTable.[Box], TestTable.[Balance]
    FROM Test Table.
    WHERE  Time=(SELECT MAX(Time) FROM TestTable WHERE Location=1 AND Box=1 )
    AND DATE = "2014-10-24";
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.

  • How to generate keys for the records

    Hi Gurus,
          can anybody explain me how to create keys for the recors while working with keymapping.
    Regards
    Ravikumar

    Hi Yugandher,
    Is your Question pertaining to Key generation in MDM or using the Remote key for importing and syndication in MDM?
    Remote Keys are system specific uniques maintained in MDM while importing source records from different source system.You need to Enable key mapping in Console and then map the <Remote key> field to the unique key in Import manager and do similar mapping in syndicator as well.
    You can view the key mapping for differnt records under the Edit key mapping (context menu) right clicking on any record.
    To know more on this refer the below link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7051c376-f939-2b10-7da1-c4f8f9eecc8c  (Key mapping) 
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30843106-5539-2b10-75a9-da483911b0d9  (Key mapping)
    For Key generation in MDM you can use the Qualified range property of Remote system in Console for Key genearation.However these keys will be genearted only after syndication and are created and assigned within MDM and not maintained from any source remote system.
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • Adding CFL for UDO generated form

    Hi I have created a form through Udo Form generator. i.e. UDO1(with Master Table=Users and master data rows table=OPDS)
    On other form made through screen painter, I want to add cfl for udo generated form(UDO1).
    Can anyone help me?

    You can set the CFL alias like this :
    oEditText.ChooseFromListAlias= "COLUMN_ID"
    I think this is how it's suppose to be - you set the CFL alias as the column id of the master data table ( whose values you want to be placed in the EditText) . The only problem is that it doesn't work - it  won't place the value automatically in the EditText.
    To make it work , you have to catch the CFL Event and put the value in the EditText manually. ( this is also covered in the CFL example in the sample files).

  • Vertical Lines for last Three Records

    hi,
    Guys
    I have dev the smart form... in my final itab ive got 23 records.. i need last three records much hve  vertical lines..
    how to do it...Plz let me know
    Regards

    Hi,
    Good day swarna
    How r u? Hope ur doing well. A small favour to me. 
    A small problem in alv report. plz advice me. I done alv report but client has changed the requirement.
    He Needs the report first record displays Item total. and then displays iteams list. so. i worte the code as below as. but its not working.
    My itab data looks like below.
    Mtpos    Ktgrm_d   Des  Value
    Znam     bomag     xyz     10
    Znam      bomag    fdfj       10
    Nam       bomag    fjfff        20
    znam     volvo        fdkfjkd  40
    nam       volvo       erje       30
    in my report i  need to disply based on the ktgrm_d which is part name. No need to display the mt pos.
    Iam doing the at new also based on ktgrm_d. so report should be like
      Ktgrm_d         Des     Value
      Bomag                        40         "total values"
      Bomag                        10        "these are items
      Bomag                        10
      Bomag                        20
      volvo                           70         "total values
      Volvo                           40
      volvo                            30
    Can you guide me plz. send me smaple code if uve time.
         CLEAR: lwa_out5.
      REFRESH:  lt_machine_sales4.
      DATA: lwa_out1 type  zsalessm.
    SORT lt_machine_sales BY ktgrm_d ascending.
      LOOP AT lt_machine_sales INTO lwa_out5.
        lwa_out1 = lwa_out5.
        AT NEW ktgrm_d.
          SUM.
          lwa_out5-sales_qty = lwa_out5-sales_qty * -1.
          lwa_out5-act_sales_p = lwa_out5-act_sales_p * -1.
          lwa_out5-act_cos_p = lwa_out5-act_cos_p * -1.
          lwa_out5-act_gross_p = lwa_out5-act_gross_p * -1.
          lwa_out5-act_gross_perc_P = lwa_out5-act_gross_perc_p * -1.
          lwa_out5-netwr      = lwa_out5-netwr * -1.
          APPEND lwa_out5 TO lt_machine_sales4.
          clear:lwa_out5.
         ENDAT.
         Append lwa_out1 To lt_machine_sales4.
         clear:lwa_out1.
      ENDLOOP.
    Regards

  • Save required when adding record to avoid multiple record entries@same time

    Hello, just wondering if anyone would be so kind as to help me out. I have a small problem that when a user is adding records to my form I want them to add one, then if they go on to add another at the same time (before commiting the first one) that they will be shown a prompt Which states something along the lines of "Before you add another record you must first save the first record, do you wish to do so" , yes will then commit the first record and allow the user to enter the second record, whilst cancel will not allow a second record to be entered.
    If anyone would helpout i would be very grateful.

    Hi
    Here is my suggestion, the idea is to use a global variable to memorize the fact that a record has been created :
    KEY-CREREC
    begin
              if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'FALSE' then
                   create_record;
                   :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
              else
                   message('Commit or delete before inserting a new record');
                   message('Commit or delete before inserting a new record');
              end if;
    end;
    =====================================================================
    KEY-DELREC
    begin
         if :system.record_status in ('NEW','INSERT') then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
         end if;
         delete_record;
    end;
    ====================================================================
    KEY-COMMIT
    begin
         commit_form;
         :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    end;
    ====================================================================
    POST-SELECT
    :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    ====================================================================
    It's a bit more complicated if you allow the user to go beyond the last record for creating a new record, as KEY-CREREC and KEY-DELREC are not triggered.
    In this case, my suggestion is the following :
    KEY-CREREC
    begin
              if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'FALSE' then
                   if :system.last_record = 'TRUE'then
                        next_record;
                   else
                        create_record;
                        :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
                   end if;
              else
                   message('Commit or delete before inserting a new record');
                   message('Commit or delete before inserting a new record');
              end if;
    end;
    ===============================================================
    WHEN-NEW-RECORD-INSTANCE
    begin
         if :system.mode = 'NORMAL' then
              if :system.record_status = 'NEW' and :system.last_record = 'TRUE' then
                   if :GLOBAL.<BLOCK-NAME>RECORDCREATED = 'TRUE' then
                        message('Commit or delete before inserting a new record');
                        message('Commit or delete before inserting a new record');
                        delete_record;
                   end if;
              end if;
         end if;
    end;
    ================================================================
    KEY-DELREC
    begin
         if :system.record_status in ('NEW','INSERT') then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
         end if;
         delete_record;
    end;
    =================================================================
    KEY-COMMIT
    begin
         commit_form;
         :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    end;
    ===============================================================
    WHEN-VALIDATE-RECORD
    begin
         if :system.record_status = 'INSERT' and :system.last_record = 'TRUE' then
              :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'TRUE';
         end if;
    end;
    ==================================================================
    POST-SELECT
    :GLOBAL.<BLOCK-NAME>RECORDCREATED := 'FALSE';
    ================================================================

  • UCCX 7.0.1SR5 to 8.0 upgrade while also adding LDAP integration for CUCM - what happens to agents and Historical Reporting data?

    Current State:
    •    I have a customer running CUCM 6.1 and UCCX 7.01SR5.  Currently their CUCM is *NOT* LDAP integrated and using local accounts only.  UCCX is AXL integrated to CUCM as usual and is pulling users from CUCM and using CUCM for login validation for CAD.
    •    The local user accounts in CUCM currently match the naming format in active directory (John Smith in CUCM is jsmith and John Smith is jsmith in AD)
    Goal:
    •    Upgrade software versions and migrate to new hardware for UCCX
    •    LDAP integrate the CUCM users
    Desired Future State and Proposed Upgrade Method
    Using the UCCX Pre Upgrade Tool (PUT), backup the current UCCX 7.01 server. 
    Then during a weekend maintenance window……
    •    Upgrade the CUCM cluster from 6.1 to 8.0 in 2 step process
    •    Integrate the CUCM cluster to corporate active directory (LDAP) - sync the same users that were present before, associate with physical phones, select the same ACD/UCCX line under the users settings as before
    •    Then build UCCX 8.0 server on new hardware and stop at the initial setup stage
    •    Restore the data from the UCCX PUT tool
    •    Continue setup per documentation
    At this point does UCCX see these agents as the same as they were before?
    Is the historical reporting data the same with regards to agent John Smith (local CUCM user) from last week and agent John Smith (LDAP imported CUCM user) from this week ?
    I have the feeling that UCCX will see the agents as different almost as if there is a unique identifier that's used in addition to the simple user name.
    We can simplify this question along these lines
    Starting at the beginning with CUCM 6.1 (local users) and UCCX 7.01.  Let's say the customer decided to LDAP integrate the CUCM users and not upgrade any software. 
    If I follow the same steps with re-associating the users to devices and selecting the ACD/UCCX extension, what happens? 
    I would guess that UCCX would see all the users it knew about get deleted (making them inactive agents) and the see a whole group of new agents get created.
    What would historical reporting show in this case?  A set of old agents and a set of new agents treated differently?
    Has anyone run into this before?
    Is my goal possible while keeping the agent configuration and HR data as it was before?

    I was doing some more research looking at the DB schema for UCCX 8.
    Looking at the Resource table in UCCX, it looks like there is primary key that represents each user.
    My question, is this key replicated from CUCM or created locally when the user is imported into UCCX?
    How does UCCX determine if user account jsmith in CUCM, when it’s a local account, is different than user account jsmith in CUCM that is LDAP imported?
    Would it be possible (with TAC's help most likely) to edit this field back to the previous values so that AQM and historical reporting would think the user accounts are the same?
    Database table name: Resource
    The Unified CCX system creates a new record in the Resource table when the Unified CCX system retrieves agent information from the Unified CM.
    A Resource record contains information about the resource (agent). One such record exists for each active and inactive resource. When a resource is deleted, the old record is flagged as inactive; when a resource is updated, a new record is created and the old one is flagged as inactive.

  • Purchasing Cube -- 0PUR_C01.. "Added record" is showing zero in request

    When i try to load the data to this cube, my trasfer record is showing values while Added Record is showing zero values. Whats the problem. Please advise !!

    Hi,
    Check whether do you have defined the industry sector in R/3. This has to be done before filling the setup table. search the forums with note no 353042.
    This is done with the help of Transaction MCB_ which you can find in the OLTP IMG for BW (Transaction SBIW) in your attached R/3 source system.
    Here you can choose your industry sector. 'Standard' and 'Consumer products' are for R/3 standard customers, whereas 'Retail' is intended for customers with R/3 Retail only.
    You can display the characteristics of the process key (R/3 field BWVORG, BW field 0PROCESSKEY) by using Transaction MCB0.
    If you have already set up historical data (for example for testing purposes) by using the setup transactions (Statistical Setup Programs) (for example: Purchasing: Tx OLI3BW, material movements: OLI1BW) into the provided setup tables (for example: MC02M_0SCLSETUP, MC03BF0SETUP), you unfortunately have to delete this data (Tx LBWG). After you have chosen the industry sector by using  MCB_, perform the setup again, so that the system fills a valid transaction key for each data record generated. Then load this data into your connected BW by using 'Full update' or 'Initialization of the delta process'. Check, whether the system updates data into the involved InfoCubes now.
    If all this is not successful, please see Note 315880, and set the application indicator 'BW' to active using Transaction 'BF11'.
    Regards,
    Anil Kumar Sharma .P

  • How can I get the last / newest record of a table?

    Hi,
    I am developing an ecard app that has a create greeting page, a preview page with edit and send buttons and an edit page.
    I got he insert working, and on the preview page I created a master record page (displays all records), and delete all unecessary designs. Doing it this way also gives me the 'edit' button, so people are able to edit their page.
    How do I get only the last record displayed though? At the moment it loops through all records and displays them in sets of 10. I found the variable that holds the totla count of records ('$totalRows_rs7417_content1'), but how do I (re-)write the script so it ONLY diplays the last record?
    I need to get the ID of this record as I am writing this into the PARAMs of the object and embed tags of my message .swf (this picks up the ID and based on that sucks the greetings text out of the database via another php script.
    Also, from this page, how can I send an email to the sender (ie creator of the message) as well as the recipient? Both email addresses are in the databse so should be part of the erecord returned.
    Thanks,
    Nik

    -----
    OK, So how do I recreate what I got in a non-ADDT list?
    well, when you´re just about to display one certain record, the term "list" is somewhat inappropriate anyway.
    What you´d simply need to do IMHO, is using DW´s native functions to create the basic "SELECT * FROM table_name ORDEr BY ID DESC" query, add "LIMIT 1" manually, and display the desired "dynamic text" placeholders in 1 table cell -- don´t think there were any need for all the fancy stuff
    (sorting, filtering etc) provided by ADDT´s list, as it´s just 1 record.
    It also occurred to me just now that finding the last record that has been added *may-* notbe enough if the site gets used a lot by our executives (I am thinking of a situation where 2 or three peolpe create greetings at the same time and press submit and then getting each others messges rather than their own).
    in this case you might want to additionally store the respective executive´s "kt_login_id" session variable -- because it´s this unique "identifier" which should be used to show the last inserted record of the person who actually inserted it, means adding a "WHERE submitter_id" equals the session variable kt_login_id - clause to the query.
    When creating a non-ADDT list that´s at some point based on detecting a user session, you´ll BTW need to insert at line 1
    I can't seemt o insert it on the page as it is looking for a insert, update or delete bahaviour on the page which of course I don't have
    please search these forums for several posts I made which explain my "use dummy table" approach that´s made for cases when you actually don´t have anything to insert/update/delete, but need "something" for ADDT´s send email behaviours.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Issue adding records to Infotype 0002

    Hi All,
    I am trying to insert records into Infotype 0002. I am using HR_INFOTYPE_OPERATION to do this. It works fine for all the employees but fot the ones who have Reference Personnel numbers. The system lets me to add the record to those employees through PA30 online or through BDC program with a warning message "No record with the same key for personnel number xxxxxxx",  but if I use the FM HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA, it sometimes gives me hard error message " The Social Insurance number already assigned to another employee" in the foreground and when executed in background I get a short dump with exception " CX_HRPA_INVALID_BUFFER_ACCESS".
    I debuged the standard code and the exception occurs in Include UP50RU02 in method IF_HRPA_MASTERDATA_BUFFER~INSERT.
    Short dump:
    The exception 'CX_HRPA_INVALID_BUFFER_ACCESS' was raised, but it was not caught
      anywhere along
    the call hierarchy.
    Since exceptions represent error situations and this error was not
    adequately responded to, the running ABAP program
      'CL_HRPA_MASTERDATA_BUFFER=====CP' has to be
    terminated.
    Please let me know if I am doing something wrong.
    Thanks,
    Danny.

    Hi Daniel,
    I would not worry about using FM 'HR_INFOTYPE_OPERATION' or 'HR_MAINTAIN_MASTERDATA' for the purpose of inserting PA infotype records for employees. I had developed a generic module last year to insert any PA infotype record which will use the standard PA business logic framework i.e. include all standard checks and validation, calls all Exits/BAdIs before inserting the record as it would when you are saving the infotype record via PA30. I basically created a wrapper FM to simplify the calling of some other standard FMs. Use it if you like (and if it works in your system keeping in mind config is different in every system) but please do handle all the Exceptions after the call (by reading the Message Handler Interface IF_HRPA_MESSAGE_HANDLER) to confirm there was no data inconsistency or other problems at the time of the update. Below is the sample code:
    The generic customer Function Module
    FUNCTION zpa_insert_any_infty_record.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(IS_PNNNN) TYPE  ANY
    *"     REFERENCE(IT_TEXT_TAB) TYPE  HRPAD_TEXT_TAB OPTIONAL
    *"     REFERENCE(IV_NO_AUTH_CHECK) TYPE  BOOLE_D DEFAULT SPACE
    *"     REFERENCE(IV_LOCK) TYPE  SPRPS DEFAULT TRUE
    *"  EXPORTING
    *"     REFERENCE(EIF_MESSAGE_HANDLER) TYPE REF TO
    *"        IF_HRPA_MESSAGE_HANDLER
    *"     REFERENCE(EV_OK) TYPE  BOOLE_D
    *"  EXCEPTIONS
    *"      EX_PERNR_LOCKED
    * FUNCTION...... ZPA_INSERT_ANY_INFTY_RECORD                           *
    * FUNCTION GROUP.ZPA_FG_EMP_LEAVE_BOOKING                              *
    * TITLE......... Insert any PA infotype record for an employee         *
    * AUTHOR........ Sougata Chatterjee                                    *
    * DATE WRITTEN.. 23/08/2010                                            *
    * SAP RELEASE... ECC 6.0                                               *
    * SPECIFICATION. N/A - Reuseable Object                                *
    * =====================================================================*
    * DESCRIPTION... This function is a generic module that will insert    *
    *                a PA infotype record into the employee master data as *
    *                per the import structure IS_PNNNN. This module wil be *
    *                particularly useful when requirement is to create     *
    *                other infotype records for the same employee within a *
    *                User-Exit or a BAdI.                                  *
    * ASSUMPTIONS... Infotype record to be updated is a PA Infotype.       *
    * =====================================================================*
    * MODIFICATION HISTORY                                                 *
    * Date       Userid       Change No & Description                      *
      DATA:
        lif_msg_handler  TYPE REF TO if_hrpa_message_handler,
        lo_msg_handler   TYPE REF TO cl_hrpa_message_list.
    * instantiate the message handler object
      CREATE OBJECT lo_msg_handler.
    * assign a reference to a rereference variable using the CAST operation
      lif_msg_handler ?= lo_msg_handler.
    * insert the infotype record into the employee master data
      PERFORM insert_infotype USING    is_pnnnn
                                       it_text_tab
                                       iv_no_auth_check
                                       iv_lock
                                       lif_msg_handler
                              CHANGING ev_ok.
    * pass back the message handler to the calling program if it was requested
      CHECK eif_message_handler IS REQUESTED.
      eif_message_handler = lif_msg_handler.
    ENDFUNCTION.
    For some reason I couldn't format the subroutine code here in SDN as it is scrambling the whole page but you could use the link here to find the [subroutine code|http://www.mediafire.com/file/9923qui7dm4xqpg/Form%20Insert_Infotype.html] and an [example code|http://www.mediafire.com/file/ihg83agkf0mbc9k/z_calling_program.html] for the program calling this FM including exception handling etc.
    Let me know if the links are not working...I'm happy to email them to you if you want.
    Hope this helps.
    Cheers,
    Sougata.

Maybe you are looking for

  • TOP n sometimes gives wrong number of lines (SSRS 2008 SP1)

    Hello all, a workmate has created a dashboard report which contains (among other items) a top n chart item. The user can select the value of n using a report parameter. We have observered that for some values of n and specific values of the other par

  • Size of mail sent and received files missing

    How can I reset my mail to see the siZe of messages coming in or ones I send out. I had this feature but it disappeared. Thank you.

  • Viewing thumbnails of picture files in finder

    regarding .jpg files mainly: they appear in the finder with this default logo: http://img.photobucket.com/albums/v19/popeye467/jpg.jpg however, if i edit them in photoshop or whatever, after i save they appear like this: http://img.photobucket.com/al

  • Translate function of oracle, equivalent function in informatica?

    Hi All, I know its off topic but i am stuck very very badly and this place turns out to be he best for my issues, here is my problem: lets say i hve fname coming from a flatfile and the first name is 'rahul' , it should be translated as '12345' usin

  • Automatic payment - urgent

    Hi sap guru's, My client has an account with SBI in three states.  How should be the configuration be done for APP. should create one house bank or three house banks for each state. How should the configuration be done for APP in bank determination--