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

Similar Messages

  • 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

  • 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 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

  • How to make use of 'Icon Name' in Logical link?

    I see the option 'Icon name' in 'define logical links' in SPRO. It does not however has an F4. I tried giving the name of image in the relevant skin. But no image appears besides the logical link. Is there something else that needs to be done to get an image besides workcenter link? How to make use of this 'Icon Name' in logical link?

    Hi,
    i guess this icon_name is not possible for every skin in CRM70.
    We use nova skin - here it is not possible.
    With default skin i saw icons for example on the salespro startpage.
    Kind regards
    Manfred

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • How to make use of SE37- Function Module & how to find out the table?

    Hi ,
    1.Could anyone help me what's this SE37-Function module is all about,How to make use of this?
    For Eg,If i want to delete a BOM permanently from the system then I have to use the Function module CM_DB_DEL_FROM_ROOT_BOM.
    But after giving the particular name what should i do?
    Please help me.
    2.How to find out the respective table for a particular field sya for T code-COGI, T code MFBF,where its values are getting populated.,Please help in this issue.
    Thanks in adavnce for spending some time
    Raj.S

    Hi Raj
    Function Modules
    Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
    Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating  and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
    Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
    The Function Builder  also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.
    Check this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    You can execute function module in SE37ie you can perform the activiites defined in the function module by executing it.
    By deleting BOM you mention the FM name in se37 and execute. In some function module it will ask input parameters as developed in the program , you have to give the input parameters and execute.

  • 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.

  • How to make use of customer reserve pricing types in copying control

    Hi All
    Please inform how to make use of 'customer reserve' pricing types like 'X,Y,Z & 1-9' keys in copying control.
    Right now I'm on maintenance & supporting project for european client.  They used pricing type 'Z' for copying condition records from stadard sales order to returns(RE) order.  I wanted to know that what is 'Z' and how it is functioning to resolve one urgent ticket assigned to me.
    Could you please guide me where should I verify its logic.
    Thanks & Regards
    Seshu

    Hi Seshu,
    Pricing type changes will done at user exit level. You may want to look at the user exit USEREXIT_PRICING_RULE (module pool SAPLV61A, program RV61AFZA)
    Also, OSS note 24832 will help you to get an understanding.
    Regards,
    Please reward points if helpful

  • How can i use offline & online database in the same time?

    how can i use offline & online database in the same time?
    my database in another server when the connection true it connect
    but if not does not work
    i wanna make offline database if the server not connected it connect offline then the server is on it alter all data from the offline to the server.

    User, please tell us your Jdev version!
    There is no such functionality build into the framework. The offline data base is only for designing the db, not to have a backup db.
    If you can't connect to the db the application will not work.
    Timo

  • How to specify  or link Logical database to a Function Module.

    Hi Experts,
                      If a logical database is used in a function module, then  I want to know how & where to specify Logical database name. Like incase of  a normal se38 program we specify this name via menupath Program----> Attributes of ABAP editor screen.

    Hi,
    There are two ways of using a logical database: Either by linking it with an executable program, or by using the function module LDB_PROCESS in any ABAP program.
    Also check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/60/183d78163011d2953c0000e8353423/content.htm
    Regards,
    Ruthra

  • How to find if a logical database exists for your program requrements?

    hi
    How do you find if a logical database exists for your program requrements?
    Regards

    You probably know the DB table that you'd like to query
    try where used list : 'Logical database'
    then you can see what interests you...

  • How to hide some select-option of Logical Database in report?

    How to hide select-option of  Logical Database in report?eg . In Logical Database 'PNP' , my code is 'GET  PERNR' , excute the report , select-screen is displayed . I want to hide some select-options , such as PNPPERNR-LOW .
    Edited by: rongrong wang  on Mar 26, 2008 9:31 AM

    U need to write code in initialization as
    initialization.
    loop at screen.
    if screen-name = 'PNPPERNR-LOW'.
    screen-active = '0'.
    modify screen.
    endif.
    if screen-name = 'PNPPERNR-HIGH'.
    screen-active = '0'.
    modify screen.
    endif.
    endloop.

  • How to make use of BAPI_CATIMESHEETMGR_CHANGE

    Hi All,
           We need to make use of BAPI_CATIMESHEETMGR_CHANGE for changing entered hours against an activity instead of adding new row for the same(BAPI_CATIMESHEETMGR_INSERT does that ) . Please guide me what all table parameters we should supply while executing this FM.
    Regards,
    Ganga.

    Hi Senthil,
    Now I have got how to make use of BAPI insert and change. But problme is when I need to add an hours entry for , say tuesaday of activity A for which already HAS monday hours,I am using  BAPI_CATIMESHEETMGR_INSERT AND IT IS ADDING ONE MORE ROW AS SHHOWN BELOW
    . But it adding new row. How top overcome this.
    <b>       Monday
          A     2</b>
    After insert
    <b>      Monday  Tuesday
          A     2
          A            3</b>
    =----
    SHould I use delete and insert.
    Please help me..;
    Regards,
    Ganga
    Message was edited by:
            Gangadharayya Hiremath
    Message was edited by:
            Gangadharayya Hiremath

  • How to make use of the presentation variable in SQL result query

    I have 2 prompts in my dashboard.
    Prompt1 decides the values of Prompt2.
    I have set a presentation Variable (selected_comp) in prompt1 which holds the value selected.
    To populate the values for Prompt2, I need to execute a query using the presenation variable set by Prompt1.
    SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=@{selected_comp}
    the query is resulting into
    SQL Issued: SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=0
    but the value in selected_comp is "ABC".
    Can anybody help in how to make use of the presentation variable in query to get the correct value
    thanks
    Shubha

    Just use constrain check box to filter your 2nd prompt values based on the 1st prompt.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

Maybe you are looking for