Use of Logical Database in function module

Hello Experts,
Is there a way of using logical database and Get enent inside a function module.
I am trying to create a RFC for HR module and need this badly. Any help would be highly appriciated.
Thanks,
Gregory fernando

This fm will work fine with all LDBs including PNP
Have you checked the fm documentation ?

Similar Messages

  • How to use a Logical Database in Function Module.

    Hi Experts,
    I want to use a logical database in a Function Module to fetch data from a standard SAP table into a Internal table for certain filter conditions.
    How can I get get this done????
    I called LDB_PROCESS FM in my FM, but I could not figure out how to store the extract in my IT table since we cant use GET in FM.
    Please provide me a sample code if possible.
    Thanks in Advance,
    Alex.

    Hi,
    i had an example program like this ,in this i want to get the data using pnp logical database with 5 fields in an interface program.
    data: begin of it_final occurs 0,
            pernr like pa0002-pernr,
            vorna like pa0002-vorna,
            nachn like pa0002-nachn,
           usrid like pa0105-usrid,
           usrid_long like pa0105-usrid_long,
           end of it_final.
    get pernr.
      clear : p0000,p0002,p0105.
      rp-provide-from-last p0000 space p_date p_date.
      if p0000-stat2 = '3'.
        v_pernr = pnppernr-low.
      else.
        reject.
      endif.
    *---Get employee pernr, First name ,Last name into final table
      rp-provide-from-last p0002 space p_date p_date.
      if pnp-sw-found = '1'.
       it_final-pernr = p0002-pernr.
       it_final-vorna = p0002-vorna.
       it_final-nachn = p0002-nachn.
      else.
    *---Error message if not infotype 0002 maintained
      T_ERROR-PERNR   = pnppernr-low.
      CONCATENATE TEXT-EMI '0002'
      INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
      APPEND T_ERROR.
      CLEAR T_ERROR.
      endif.
    **--Get SYSTEM USERNAME to final table
      rp-provide-from-last p0105 0001 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid = p0105-usrid.
      else.
    *---Error message if not SYSTEM USERNAME maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-003 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
    **--Get Email ID to final table
      rp-provide-from-last p0105 0010 p_date p_date.
      if pnp-sw-found = '1'.
        it_final-usrid_long = p0105-usrid_long.
      else.
    *---Error message if not Email ID maintained
        T_ERROR-PERNR   = pnppernr-low.
        CONCATENATE TEXT-004 '0105'
        INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
        APPEND T_ERROR.
        CLEAR T_ERROR.
      endif.
       append it_final.
        clear it_final.
    reward points if useful,
    venkat.

  • How to use Logical database in function module?

    I will create a function module in HR.
    but how to use Logical database  in function module ?  Logical database PNP always show screen.in function (RFC) code , it is a matter.

    You cannot attach the LDB to the main program of the function group.
    - So you may [SUBMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=submit&adv=false&sortby=cm_rnd_rankvalue] a report which use the LDB and get back the data (export/import), by default in the syntax of SUBMIT the selection-screen will not be displayed
    - Use [LDB_PROCESS|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ldb_process&cat=sdn_all], fill a structured table for selection, and get data back in another table
    - Use [HR function modules to read Infotypes|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hrfunctionmodulestoread+Infotypes&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • Better alternative to header lines, use of logical database, field-symbols

    Hello experts,
    I am wondering if theres a better and faster alternative than declaring a header line for an itab. are work areas faster?
    What is the use of logical database? can you please give me an example on how to use it in reports.
    how do I use field-symbols? I am confused on how it works.
    P.S. I recently installed SAP netweaver preview abap edition
    in my home PC and I am wondering if I could practice BDC, user exits, etc. If so, how?
    Again, thanks for all your help since I'm kinda new to ABAP.

    I always use this...It uses header lines, but at least is smaller -:)
    <b>DATA: BEGIN OF MY_TAB TYPE STANDARD TABLE OF BKPF WITH HEADER LINE.</b>
    For logical databases, you can check my blog...I always use LDB for HR programs -:)
    <a href="/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports:///people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
    LDB's provides a lot of information, because they gather it from a lot of different tables...
    A Field-Symbols is like a pointer in C++, like an alias for a variable...Here's a small example...
    REPORT Z_ATG_DUMMY.
    FIELD-SYMBOLS: <F1>, <F2> TYPE I.
    DATA: TEXT(20) TYPE C VALUE 'Hello, how are you?',
          NUM TYPE I VALUE 5,
          BEGIN OF LINE1,
          COL1 TYPE F VALUE '1.1e+10',
          COL2 TYPE I VALUE '1234',
          END OF LINE1,
          LINE2 LIKE LINE1.
    ASSIGN TEXT TO <F1>.
    ASSIGN NUM TO <F2>.
    DESCRIBE FIELD <F1> LENGTH <F2>.
    TEXT = 'CHAU'.
    WRITE: / <F1>, 'has length', NUM.
    WRITE: / TEXT, 'has length', NUM.
    ASSIGN LINE1 TO <F1>.
    ASSIGN LINE2-COL2 TO <F2>.
    MOVE <F1> TO LINE2.
    ASSIGN 'LINE2-COL2 =' TO <F1>.
    I just can't install SAPNWSP...I only got MiniSap...But I got all the development enviorment...Don't know about the User-Exits...Actually I don't think so...Because those "mini" systems doesn't come with any functional module.
    Greetings,
    Blag.

  • Parallelization is not happening using asychnronous RFC in a function module

    A BW data source ZTEST
    has been created based on a function module ZTEST_FM to pull the
    data into BW system from R/3.
    (Have checked the parellel jobs running in SM66 transaction).
    Inside the function module, an RFC function
    module ZTEST_RFC1 has been called asynchronously to implement the parallelization
    to improve the data extraction time into BW system.
    Note: In this scenario asynchronous
    RFC is used to implement the parallel processing.
    The logic in the function module is as follows.
    Function module ZTEST_FM Logic:
    Fetch data from HRP1000 table into an internal table IT_HRP1000 for
    OTYPE = ‘TN’.
    Loop at IT_HRP1000 into work area (WA).
    Call the RFC asynchronously by passing OBJID,OTYPE and ENDDA,
    Calculate SOBID which is the required output field from the RFC
    function module.
    Populate the results into final internal table E_T_DATA.
    The output structure contains the following fields.
    OBJID
    BEGDA
    ENDDA
    SOBID
    Could you please give us some suggestions, to implement the parellel processing using asychronous RFC in this scenario.
    Would appreciate your help.

    Your RFC call looks correct. For collecting the result you will need to code the callback routine Write_E_T_data. Inside the callback you can use the statement
    RECEIVE RESULTS FROM FUNCTION ZFHLS_EX_TNM_ACADEMY_RFC1 IMPORTING <parameter list>
    to retrieve the calculated result. For the declaration of the callback routine I recommend
    FORM Write_E_T_data USING iv_name TYPE c.
    The parameter iv_name containing the name of the RFC task turned out to be mandatory in my tests.

  • Can i  use Two DSO 's in Function module

    hi experts,
    Can i  use Two DSO 's in Function module  .That FM is used for Layout
    I actually  want to  fill one DSO Refering the Data in Another DSO.
    Regard
    Naresh.

    In the first way the DSO's are usually called shared libraries or DSO libraries and named libfoo.so or libfoo.so.1.2. They reside in a system directory (usually /usr/lib) and the link to the executable program is established at build-time by specifying -lfoo to the linker command. In the second way the DSO's are usually called shared objects or DSO files and can be named with an arbitrary extension

  • How to use OWN logical database

    Hi all,
    hope somebody can help me.
    I copied a standard logical database (FPMF). The program which I use and have modified is also copied from standard.
    How can I assure that the program use MY logical database instead of the SAP-One?
    In my case I have some get statements. And these get statements all refer to FPMF and not to my copied database.
    Do anybody what's the probelm?
    Cheers
    Philip

    Yes, I know. And I am not happy with this solution.
    But I didn't see another way for my issue.
    Thank you very much.
    Philip

  • Why we should use Macros if we have function Module

    Why we should use Macros if we have function Module and what is the Advantage of Macros than function Module
    Moderator Message: Interview-type questions are not allowed.
    Edited by: kishan P on Oct 7, 2010 2:22 PM

    Put it this way... if you have blueprints for a car you wouldn't want to produce only one car, would you? You would want to produce as many as needed. In another example, you don't want to be able to use only 1 window in Windows. Each window has common features but have different values. That's the purpose of non-static entities
    However, there are instances that you want to have only one value for something. That's when you use static entities.
    Get it? =)

  • Generic Extractor built on an infoset which uses a logical database

    Is anyone aware of any performance issues when building an infoset generic extractor which uses a logical database as the source?  Also would anyone also be aware the process of collecting data for extraction? Thanks

    Hi Arun,
    Thanks for this - I have been informed that there are issues with a small subset of data and I just wanted to get an idea if the steps that would be carried out be the same if the generic extractor is built on table joins or logical data base or does the latter actual carry out say some pre processing steps

  • Pls explain me the use and purpose of following Function modules

    pls explain me the use and purpose of following Function modules
    1. G_MAX_PERIOD_AND_OFFSET_GET
    2.  DEQUEUE_E_TABLE
    3. FI_COMPANY_CODE_CHECK
    4. G_PERIOD_GET
    5. alv_display_function
    6. G_SET_GET_ID_FROM_NAME
    thanks ,
    phyrose

    1. <b>G_MAX_PERIOD_AND_OFFSET_GET</b>
    For given No. of period & periods it gives the offset
    <b>2. DEQUEUE_E_TABLE</b>
    To Unlock the table records
    <b>3. FI_COMPANY_CODE_CHECK</b>
    To validate Company Code
    <b>
    4. G_PERIOD_GET</b>
    Returns no. of Posting period & Special period for give company code, posting date & ledger
    <b>5. alv_display_function</b> -
    No such FM exists
    <b>
    6. G_SET_GET_ID_FROM_NAME -</b> Use this module to derive the internal set Id from the name that appears on the user interface, for example, in order then to import the set (see the function group documentation).
    The function module first determines a candidate list of sets based on the set name and the class that might have been specified that could match the set name. The class can also be masked (e.g. 000+ for all FI-SL sets, including dynamic sets).

  • How to make use of logical database in reports?

    hi,
    I am working on a Cash Flow Forecast report, which requires the usage of 'PSJ' Logical Database for the selection screen with Profit Center(PRCTR) as one field and the other field being Period ( in MM/YYYY format).
    I have not worked on Logical Database before. Since, its for the first time I am working on LDB, I require help on it.
    How to proceed for this, can someone help me with it?
    On receiving further inputs, I will proceed and might come up with some more queries.
    Regards,
    Ravi

    Hi Hari,
    Thanks a lot for being so patient. yeah, I will just send you a code snippet of mine. My code is of 3000 Lines. Hence, I will send few parts of it. Just go through and let me know if you need any further information from my side.
    Here is the snippet:
    *& TABLES
    TABLES: PROJ,                              "Project definition.
            PRPS,                              "WBS Element Master Data
            COSP,                              "CO: External Table.
            COFP,                              "CO: External Table.
            SETLEAF,                       "Value in sets.
            FAGLFLEXT,                         "Profit Center.
            S031,                              "Statistics: Movements for Current Stocks.
            SETHEADERT,                        "short Description of Sets.
            AFVC,                              "Operation within an Order.
            AUFK,                              "Order master data.
            PRHI,                              "Work Breakdown Structure.
            AFKO,                              "Order header data PP orders.
            NRIV,                              "Number range Intervals.
            SKB1,                              "G/L Account Master (company code).
            FMCI.                              "Commitments Item master data.
    Type Pool
    TYPE-POOLS: SLIS.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    DATA: COUNT TYPE I,
          D_PERIOL LIKE COFP-PERIO,
          D_PERIOH LIKE COFP-PERIO,
          D_GJAHRL LIKE COFP-GJAHR,
          D_GJAHRH LIKE COFP-GJAHR,
          D_GJAHR LIKE COFP-GJAHR,
          D_PERIO LIKE COFP-PERIO,
          OBJNR LIKE COSP-OBJNR,
          PKOKR LIKE PRPS-PKOKR,
          G_NRLEVEL LIKE NRIV-NRLEVEL,
          G_BELNR LIKE COFP-BELNR,
         I_OBJ-OBJNR LIKE COFP-OBJNR,
          G_OPNGBAL LIKE FAGLFLEXT-HSL01,
          G_PAYROLL LIKE COSP-WKG001,
          G_PYROL_TAX LIKE COFP-WKGBTR,
          G_PENSION LIKE COFP-WKGBTR,
          G_BTLDGR LIKE COFP-WKGBTR,
          G_REIMPYMT LIKE COFP-WKGBTR,
          G_INTCORCPT LIKE COFP-WKGBTR,
          G_CAPEXP LIKE COFP-WKGBTR,
          G_SLSLDGR LIKE COFP-WKGBTR,
          G_REIMRCPT LIKE COFP-WKGBTR,
          G_TOTPYMNTS LIKE COFP-WKGBTR VALUE 0,
          G_TOTRECPTS LIKE COFP-WKGBTR VALUE 0,
          G_MVMTFRMNTH LIKE COFP-WKGBTR VALUE 0,
          G_CLSGBAL LIKE COFP-WKGBTR VALUE 0.
    DATA: LYEAR(4) TYPE N,
          LMONTH1(2) TYPE N,
          MON1(2) TYPE N.
    DATA: HYEAR(4) TYPE N.
    DATA: LMONTH(2) TYPE N.
    DATA: HMONTH(2) TYPE N.
    DATA: TOTAL(10) TYPE N.
    DATA: SUM(10) TYPE N.
    DATA: G_PSPID LIKE PROJ-PSPID.
    DATA: TOTAL1 LIKE COFP-WKGBTR,
          TOTAL2 LIKE COFP-WKGBTR.
    DATA: G_KOKRS LIKE COFP-KOKRS,
          G_FIPOS LIKE SKB1-FIPOS,
          G_POSIT LIKE COFP-POSIT,
          G_BUKRS LIKE COFP-BUKRS.
    DATA: L_RACCT LIKE FAGLFLEXT-RACCT VALUE '0000220000',
          H_RACCT LIKE FAGLFLEXT-RACCT VALUE '0000227999'.
    DATA: I TYPE I VALUE '74'.
    DATA: P TYPE I VALUE '62'.
    *& SELECT-OPTIONS
    PARAMETERS : S_PRCTR LIKE PROJ-PRCTR.         "Profit Center
    SELECT-OPTIONS: SL_SPMON FOR S031-SPMON OBLIGATORY.            "Period
    *INITIALIZATION
    INITIALIZATION.
      SL_SPMON-SIGN = C_IN.
      SL_SPMON-OPTION = C_BT.
      SL_SPMON-LOW = SL_SPMON.
      SL_SPMON-HIGH = SL_SPMON.
      APPEND SL_SPMON.
    AT SELECTION-SCREEN
    Event which occurs each time the user hits enter on the selection
    Screen.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SL_SPMON-LOW.
      PERFORM MONAT_F4.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SL_SPMON-HIGH.
      PERFORM MONAT_F4.
      SELECT SINGLE * FROM PROJ WHERE PRCTR = S_PRCTR.
      IF SY-SUBRC <> 0 AND NOT ( S_PRCTR IS INITIAL ).
        MESSAGE E019.
      ENDIF.
    ALL WBS ELEMENT SELECTION
      SELECT PSPID INTO TABLE I_PROJTAB FROM PROJ WHERE PRCTR = S_PRCTR.
      IF SY-SUBRC = 0.
        LOOP AT I_PROJTAB.
          CALL FUNCTION 'GET_TREE_FROM_PRHI'
            EXPORTING
              I_POSID                   = I_PROJTAB-PSPID
       I_PSPNR                   = 00000000
       NO_BUFFER                 = ' '
            TABLES
              PSP_TREE                  = I_PRHI
            EXCEPTIONS
              INPUT_ERROR               = 1
              PSP_HIERARCHY_ERROR       = 2
              PSP_NOT_FOUND             = 3
              OTHERS                    = 4
       ENDLOOP. " PROJTAB
      ENDIF.
      SELECT * FROM PRPS INTO TABLE I_PRPSVC FOR ALL ENTRIES IN I_PRHI
                      WHERE PSPNR = I_PRHI-POSNR.
      SELECT * FROM AFVC INTO TABLE I_AFVC FOR ALL ENTRIES IN I_PRPSVC
                      WHERE PROJN = I_PRPSVC-PSPNR.
      SELECT * FROM AUFK INTO TABLE I_AUFK FOR ALL ENTRIES IN I_PRPSVC
                      WHERE PSPEL = I_PRPSVC-PSPNR AND AUTYP NE C_TWENTY.
      SELECT OBJNR FROM PRPS INTO TABLE I_OBJ FOR ALL ENTRIES IN I_PRHI
                      WHERE PSPNR = I_PRHI-POSNR.
      IF SY-SUBRC <> 0.
        MESSAGE E010.
      ENDIF.
    I hope that's of some use.
    Thanks & Regards,
    Ravi

  • Anyone have used FTI_TR_COMM_DEAL_EXP logical database?

    Hi Experts.
    I need to use FTI_TR_COMM_DEAL_EXP (TRM module) logical database in Report. I am very newbie using Logical Databases. Can anyone help me, please?
    Thank you.

    Hi Rochard
    Try running
    catalog.sql, catproc.sql and catpatch.sql. I think that should solve your problem.
    It looks like even the new database created should be run with catpatch.sql after you upgrade you sfotware from your base version 9.2.0.1
    thanks
    devi

  • Use of Logical database in ABAP Queries

    hi,
    Can anybody tell me when/why do we use logical database in Infosets for ABAP Query?
    Regards,
    Divya

    hi,
    pros: -you need not to define so many own tables, fields and additional codings in your info set
    cons: - performance in huge DB's
    A.
    Message was edited by: Andreas Mann

  • Using PNP logical database in report

    Hi i'm using the PNP logical database in my report, and i want to hide all fields in the 'Period' frame.
    is there any way to do it automatically or is it necessary to hide them one by one??
    Thanks in advance.

    If you can put them all in the same screen group, you may be able to do this. But you might run into problems when you re-generate.
    Rob

  • Error 101 using fp_job_open, fp_job_close in a function module

    I have earlier made a program generating a pdf used for printing. Used fp_job_open -> Call function xxx -> fp_job_close. This program works fine.
    Now I want to make a function module to generate this pdf for higher reusability, but when I call my generated FM its return sy-subrc = 1 and sy-msgno = 101. As far as I have investigate this error means "Job already open".
    I tried to comment out the call to the fp_job_open and fp_job_close, but then I have no possibility to mark the ls_outputparams-getpdf = 'X' and ls_outputparams-nodialog = 'X'.
    Any ideas anyone?

    I am not sure if this is the right forum for this question. Maybe: ABAP Developmnet -> Form printing [Output Management; is more proper?

Maybe you are looking for

  • Can I connect my Airport Extreme Time Capsule via ethernet to another router (non-Apple)?

    I've been trying to figure this out for a few hours and have gotten nowhere. I have an Archer C7 AC1750 router set up in my office, connected to my Zoom 5341 DOCSIS 3.0 Modem; this has been my main router and has worked fine. I have moved some things

  • Problem about .xml file from PPro CS5 to FCP with RED and P2 file.

    I have create a Project in Premiere Pro CS5. I import the RED file R3D or P2  file XMF and editing my media. From menù File i select Export to "Final Cut Pro XML.." I open FCP and Import file XML but the media are not reconnect. "Warrnig: Non-critica

  • Held Documents Report

    Hi Experts, Where i can see the list of Held documents report of all users. In SAP there is an option to see the own held documents.. But i need a single report, where i can see the list of all Held doc's posted by all other users. Even i am not able

  • Exception connecting to MS Access Database.

    I'm having problems using the jdbc-odbc bridge with an MS Access database and a file DSN. If I use a system DSN, it works fine but it does not seem to find the file DSN for some reason (And I HAVE to use a file DSN in this instance, for reasons I won

  • HR infotype 0032 screen issue

    When I 'create' an infotype 0032 record I get 1 field i.e. 'Previous Personnel No.'. When I go to overview mode there are many other fields i.e. 'Rule', 'Car Value', 'Plate No', 'Asset Number', etc. How do I maintain or change the entries for the fie