How to use LDB PNP with ABAP objects in a program

Hello,
I am wondering if anybody has used the HR logical database(LDB) PNP with user defined ABAP objects in a program? I am using the FM- <b>LDB_PROCESS</b> but its not working. Also assigning PNP in the attributes section of the program -- so that I can use predefined fields from the LDB and then invoking the FM doesn't work -- throwing 'Logical database already active' error.
I suppose even with the ABAP objects and the new FM -- I should still be able to utilize the pre-defined fields of the PNP database -- and also the built in authorizations. I cannot use GET PERNR and REJECT as they give errors. I understand that the use of HR-macros (RP-PROVIDE-FROM-LAST and et al.) are not allowed as they use the table work area -- which is not allowed in ABAP-OOPS.
I would really appreciate if anyone could show me some insight regarding this. Thank you.
Kshitij R. Devre

Hi Kshitij
It would be really good if we could use both together. But as I know, it is not possible. "GET pernr." is an event-like loop statement and so cannot be used in OO context. And I guess, the same restriction holds for the "LDB_PROCESS" since it uses LDB-specific processing.
What I suggest you is to use standard and BAPI functions.
Sorry for giving bad news...
*--Serdar

Similar Messages

  • How to use ldb PNPCE with FM u0091HR_INFOTYPE_OPERATIONu0092

    Hi all,
    I’m creating a report with LDB PNPCE, this report has to create/modify infotypes of an ID person. I’m trying to use de FM ‘HR_INFOTYPE_OPERATION’, but it’s not working… A DUMP is generated, with this description:
    An exception that could not be caught occurred.CX_HRPA_VIOLATED_PRECONDITION
    I think that the problem is due to logical database PNPCE, because if I use PNP, it’s working… Does anybody know anything about using the FM ‘HR_INFOTYPE_OPERATION’ with the LDB PNPCE?
    Thanks!!

    This piece of code it's working with ldb PNP 
    CALL FUNCTION 'ENQUEUE_EPPRELE'
       EXPORTING
      MODE_PREL            = 'E'
      MANDT                = SY-MANDT
         pernr                = wa_p9961-pernr
         infty                = '9961'
      SUBTY                =
      OBJPS                =
      SPRPS                =
    endda                =  wa_p9961-endda                      "'99991231'
    begda                =  wa_p9961-begda                      "'20071201'
      SEQNR                =
      X_PERNR              = ' '
      X_INFTY              = ' '
      X_SUBTY              = ' '
      X_OBJPS              = ' '
      X_SPRPS              = ' '
      X_ENDDA              = ' '
      X_BEGDA              = ' '
      X_SEQNR              = ' '
      _SCOPE               = '2'
      _WAIT                = ' '
      _COLLECT             = ' '
       EXCEPTIONS
         foreign_lock         = 1
         system_failure       = 2
         OTHERS               = 3
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty                   = '9961'
          number                  = wa_p9961-pernr
           subtype                = wa_p9961-subty
            OBJECTID               =
            lockindicator          = 'X'
           validityend            = wa_p9961-endda
           validitybegin          = wa_p9961-begda
            recordnumber           = lwa_pa9961-seqnr
          record                  = wa_p9961
          operation               = 'INS'
          tclas                   = 'A'
          dialog_mode             = '0'
            nocommit               = ' '
            VIEW_IDENTIFIER        =
            SECONDARY_RECORD       =
       IMPORTING
         return                 = l_return
            KEY                    =
      CALL FUNCTION 'DEQUEUE_EPPRELE'
       EXPORTING
      MODE_PREL       = 'E'
      MANDT           = SY-MANDT
         pernr           = wa_p9961-pernr
         infty           = '9961'
      SUBTY           =
      OBJPS           =
      SPRPS           =
    endda                = wa_p9961-endda                       "'99991231'
    begda                = wa_p9961-begda                       "'20071201'
      SEQNR           =
      X_PERNR         = ' '
      X_INFTY         = ' '
      X_SUBTY         = ' '
      X_OBJPS         = ' '
      X_SPRPS         = ' '
      X_ENDDA         = ' '
      X_BEGDA         = ' '
      X_SEQNR         = ' '
      _SCOPE          = '3'
      _SYNCHRON       = ' '
      _COLLECT        = ' '
    But if I use ldb PNPCE instead PNP, with the events:
    GET person.
    GET group.
    GET peras.
    ths dump is generated...
    Thank u!!

  • How to use web service with ABAP Web Dynpro

    Hi.
         do you know, how to web service with ABAP Web Dynpro?

    Hi,
    If you have a webservice ready with you then you can generate a proxy from SE80 and you can use that. You just have to create a port and assign to that generated proxy(CLASS) and you are good to go.
    Let me know if you need more information.
    Thank You,
    Gajendra.

  • How to use data sets with smart objects?

    Hi,
    I have a psd of some mock-up boxes, and I want to apply different text to multiple versions. The solution here: http://helpx.adobe.com/photoshop/using/creating-data-driven-graphics.html is good, but doesn't seem to work with smart objects?
    The file that I have has the box label as a smart object (which opens as a psb). How could I apply a data set to that, and have it pump out multiple jpegs?
    If I apply the data set to the psb layers, then go back to the main image, I cannot export the whole complete picture anymore.
    Thanks!

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • How to use ThreadPoolExecutor / ArrayBlockingQueue with event objects

    I am having some trouble figuring out how to use the new java.util.concurrent library for a simple thread pool that has custom threads pulling off event objects from a queue.
    I started with this kind of code below, which I know is not right but am having trouble seeing the correct approach. Any help is appreciated. Thank You!
    -Paul
    public class testThreadPool {
    public static void main( String [] args ) {
    //work queue actaully only takes runnables,
    //but I need to add my event objects to this queue ??
    ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(20);
    ThreadPoolExecutor pool = new ThreadPoolExecutor(10,//pool size
    20,//max pool size
    1,
    TimeUnit.SECONDS,
    workQueue);//the work queue
    //this will ensure that the pool executor creates worker
    //threads of type MyThreadWorker
    pool.setThreadFactory(new MyThreadFactory());
    pool.prestartAllCoreThreads();
    //throw some events on the queue and let the pool workers
    //start to execute with the given event object
    workQueue.add(MyEvent);
    workQueue.add(AnotherEvent);
    class MyThreadFactory implements ThreadFactory {
    public Thread newThread(Runnable runnable) {
    return new (Thread)MyThreadWorker();
    class MyThreadWorker implements Runnable {
    private boolean m_run = true;
    public void run(){
    Object obj;
    while (m_run) {
    obj = null;
    //get the event object from the blocking queue
    try {
    obj = workQueue.take();
    } catch (InterruptedException e) {
    if ( obj == null ) continue;
    if ( obj == null ) continue;
    if (obj instanceof MyEvent) {
    //do this
    } else if (obj instanceof AnotherEvent) {
    //do this
    public void stopRunning(){
    m_run = false;
    this.interrupt();
    }

    What database and connection type are you using? Are you connecting the report directly to the database, or trying to assign the datasource to object data?
    It sounds like you might be trying to use a linked list, collection or other C# construct to pass your data in. This currently isn't supported by the Crystal Reports SDK. You can use a DataSet or a DataTable, and possibly also an IDataReader depending on which version of Crystal Reports you're referencing in your project. Of course you can also connect directly to the database, even if the database isn't on the same machine as the application.
    The way to show master records with detail information is through the use of subreports and linked subreport parameters. Linked subreports take their parameter value from a record in the main report, so that only the data appropriate to that master record is displayed. The guys over in the [report design|SAP Crystal Reports; forum can help you out with this if you have questions on the specifics.

  • Coding ABAP using LDB PNP and authorizations problems

    This post requires a blend of ABAP and HCM skills.
    When coding my own ABAP using LDB PNP, the LDB will provide me with the employees selected but will skip those for which I do not have access (regarding Authorizations settings) to one or more of the infotypes declared in the program.
    As a programmer I would like to receive from the LDB the information that an employee is skipped so that I can handle the exception.
    Do you know how can I get this information from the LDB?
    Thanks

    I dont know if PNP can do it but PNPCE can:
    at END-OF-SELECTION call macro PNP_GET_AUTH_SKIPPED_PERNRS
    it will provide a list of skiped PERNRs
    for further info see docu PNPCE

  • How to get a default variant screen using LDB.(HR-ABAP)

    Hello,
                   I have created a report using LDB PNP.Used HRBEN000 as a hr report category.
    Got a default selection screen, I want to add one more field, for this I have selected the field from further
    selection button, and displayed on the screen. Now i saved as a variant.
    how to get this default screen using the variant in the report/program when executed?
    Please help me.
    Thanks&Regards,
    Archana.

    Hi ,you camn always make your Z report category...if the field is present in further selection tab..
    if not you can create your own paramerter or select option.....
    but you have to handle it in your code ....as get pernr wont filter on its basis(parameter select optyin created by you)
    but why loop at screen is not working?
    let me know how you are doing...
    have to do it in at selection-screen output

  • Reading Locked records from HR table using LDB PNP

    Hi,
    I am trying to read the table pa0168 using LDB PNP.
    But the problem is that get pernr staement does not retrieve locked records i.e where PA0168-sprps eq "X'.
    Can anybody help me with this.
    I have to use LDB  so i don't want a solution of writing a select * for the pa0168 table.
    hence i have to use get pernr statement but it should also retrieve locked records.
    how can i achieve that.? please help
    Thanks
    GT
    Message was edited by: GT

    Hi GT,
    In the START-OF-SELECTION event, set the parameter value
    pnp-sw-ignorelockedrecords = 'N'.
    Good Luck,
    Suresh Datti
    ( Pl award points if the answer helps you )

  • [ABAP Mapping] Only with ABAP-Objects?

    Hi,
    found <a href="http://https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383">this how-to</a> that describes an ABAP mapping in SAP XI.
    Is ABAP mapping only possible with ABAP Objects? Do I have to use
    the StreamFactory class? Is there an alternative way to do such a mapping?
    Does anyone have another example for ABAP mapping?
    Thanks
    chris

    Hi Christian,
    usually you need that only for special cases. It is not so easy...
    You can find a simple example at my weblog <a href="/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs Performance of Mapping Programs</a>. The same mapping is over there with other mapping kinds; as you see, ABAP seems to be most complex, he, he. One or two days, and you get it
    frohes Basteln,
    Udo

  • How to use Oracle partitioning with JPA @OneToOne reference?

    Hi!
    A little bit late in the project we have realized that we need to use Oracle partitioning both for performance and admin of the data. (Partitioning by range (month) and after a year we will move the oldest month of data to an archive db)
    We have an object model with an main/root entity "Trans" with @OneToMany and @OneToOne relationships.
    How do we use Oracle partitioning on the @OneToOne relationships?
    (We'd rather not change the model as we already have millions of rows in the db.)
    On the main entity "Trans" we use: partition by range (month) on a date column.
    And on all @OneToMany we use: partition by reference (as they have a primary-foreign key relationship).
    But for the @OneToOne key for the referenced object, the key is placed in the main/source object as the example below:
    @Entity
    public class Employee {
    @Id
    @Column(name="EMP_ID")
    private long id;
    @OneToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ADDRESS_ID")
    private Address address;
    EMPLOYEE (table)
    EMP_ID FIRSTNAME LASTNAME SALARY ADDRESS_ID
    1 Bob Way 50000 6
    2 Sarah Smith 60000 7
    ADDRESS (table)
    ADDRESS_ID STREET CITY PROVINCE COUNTRY P_CODE
    6 17 Bank St Ottawa ON Canada K2H7Z5
    7 22 Main St Toronto ON Canada     L5H2D5
    From the Oracle documentation: "Reference partitioning allows the partitioning of two tables related to one another by referential constraints. The partitioning key is resolved through an existing parent-child relationship, enforced by enabled and active primary key and foreign key constraints."
    How can we use "partition by reference" on @OneToOne relationsships or are there other solutions?
    Thanks for any advice.
    /Mats

    Crospost! How to use Oracle partitioning with JPA @OneToOne reference?

  • How to use messages in WebDynpro-ABAP

    Hi,
        How to use messages in WebDynpro-ABAP.
    Does it has any class to manage messages like IWDMessageManager or we can just use standard SAP Message types.. like E,W,X,I,S..
    I hope it have a message container to display messages.
    Thank U for Ur time.
    Cheers,
    Sam

    Hi Sam,
    U can hard code the message or u can use the Assistance class's text elements to store the messages.
    1) Code to display hard coded message:
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = "Enter the correct Connection ID"
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    2) Code to display message from text element of assistance class:
    lv_text = wd_assist->if_wd_component_assistance~get_text( key = '002' ).
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = lv_text
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    Where Message "Enter the Correct Connection ID" is stored in Text Element with key '002'
    Hope this helps,

  • Screen Change when using LDB - pnp

    Hi ,
    I am facing a strange problem.
    I am using LDB -> pnp and HRIN0013 as Master data rep ,
    in one of the programs that i developed.
    The Screen and program behave fine in the development server.
    Once i transport it to the production server, the Screen changes to something completely different.
    What i noticed is that in attributes -->'Report category assignment' , HRIN0013 is not present.
    This means that HRIN0013 has not been transported?
    What can the problem be and how can i fix it?? I need to get this in by tommorow. Help will be highly appreciated.

    Hi Sanchit,
    when I change the report class in an HR report, the system tells me for the change request number.
    This change request, introduces, I think, a new record in some customize tables, like t599C.
    There must be a record in this table, for the report class that you create.
    Hope this helps you,
    Carles

  • How to use Cinema4D lite with no opening After Effects CC ?

    How to use Cinema4D lite with no opening After Effects CC ?
    Is that possible ?
    Open a 3D object Photoshop-type in After Effects CC (without C4D)
    It is also possible?
    thanks
    xav

    It is as Mylenium says.
    See this page for details such as this:
    "You open the version of CINEMA 4D that is installed with After Effects using the New > MAXON CINEMA 4D File command or the Edit Original command in After Effects. You will not see this version of CINEMA 4D installed in the Start menu on Windows or in the Applications directory on Mac OS."

  • Who has the book:Object-Oriented Programming with ABAP Objects

    Hello everyone
    Now i want to learn ABAP OO,and Lots' of guys told me that the book  Object-Oriented Programming with ABAP Objects is realy a good book.but i searched on the net,and could not got PDF of this book,could some one gave me the net address if you know where to download the book or send me to my Mailbox:<email id removed by moderator>,I will very glad to receive any response from you,
    of course,if you have some advise on how to learn ABAP OO or some other material ,hope you could share your meaning with me, hope to receive your response.
    Best regards!
    From Carl
    Moderator message : Moved to career center.
    Edited by: Vinod Kumar on Aug 27, 2011 9:21 AM

    I'm sure you're not asking for illegal, "free" downloads. You can legally purchase the book, also in electronic format, at sap-press.com
    Thomas

  • Filter Data using LDB PNP

    Hi,
    I'm looking to filter data in a report which uses LDB PNP.
    When i enter the 'start dates' and 'end dates' the values goes into PN-BEGDA and PN-ENDDA respectively.
    I want to know whether the GET PERNR statement will filter out the data based on 'start dates' and 'end dates'
    or do i have to loop at each infotype and manually filter out.
    varun

    >
    Rajesh Paruchuru wrote:
    > [Here is the answer from SAP|http://help.sap.com/saphelp_47x200/helpdata/en/4f/d527ba575e11d189270000e8322f96/content.htm]
    >
    >
    GET PERNR fills the internal tables of infotypes that are declared for
    >  each employee  using the INFOTYPES statement. The internal infotype table
    >  is filled with all records existing  between the lowest and highest
    >  system date. The internal table has the name Pnnnn,  where nnnn is the
    > infotype number
    >
    > - Rajesh.
    That means its useless to give a selection criteria on the selection screen.
    GET PERNR will get all records, means it will just filter the employee numbers nothing else, everything you will have to do manually by using loops.
    Varun

Maybe you are looking for

  • Using XML files created with PDF form in Excel

    I have returned survey XML files created by a survey form using Lifecycle Designer. Have been unsuccessful in the importing of multiple XML files into Excel as a 2nd file just overlays the 1st file's data. I have been reading a number of posts that m

  • Manualy renaming tracks in itunes not working properly?

    this being my 5th or 6th ipod since ive started collecting them several years ago, i shouldnt even have this question i manually manage all of my songs/play lists through itunes to begin with when i rename the artist, album or genre i have no problem

  • Problem downloading multiple images in bytearray, Help !

    Hi Everyone, I m trying to download multiple images on my mobile as a part of my application. On server side I have used System.arraycopy to merge arrays.. What I did on server side is as follows: byte[] seperator={'%'}; totalImageArray=image1+sepera

  • How can I get a French for Firefox 5.0 ?

    The English version was installed when I updated to Firefox 5.0

  • The repeat button is gone?

    I sing in a chorus and practice my music when I drive. I use the repeat function everyday when driving so I don't have to physically start the song over every time it ends. This morning I went to play my music and the repeat button is gone?  I have a