Logical Database-GET-LOOP.

Hi,
I am debugging a standard code where PYF logical database is used.
START-OF-SELECTION.
GET REGUH.
  CHECK SEL_ZAWE.
  CHECK SEL_UZAW.
  CHECK SEL_HBKI.
  CHECK SEL_HKTI.
  CHECK SEL_WAER.
  CHECK SEL_VBLN.
  PERFORM PRUEFUNG.
  PERFORM EXTRACT_VORBEREITUNG.
  PERFORM SORTBANK.
GET REGUP.
  PERFORM SORTBOLETO.
  PERFORM EXTRACT.
END-OF-SELECTION.
SORT BY
    REGUH-ZBUKR                      
    REGUH-UBNKS                      
    REGUH-UBNKY                      
    REGUH-UBNKL                      
    REGUH-UBKNT                       
    REGUD-XEINZ                       
    REGUH-ZBNKS   
    REGUH-ZBNKY
    REGUH-ZBNKL
    REGUH-ZBNKN
    REGUH-LIFNR
    REGUH-KUNNR
    REGUH-EMPFG
    REGUH-VBLNR
    REGUP-BELNR.
LOOP.
AT END OF REGUH-VBLNR.
ENDAT.
ENDLOOP.
Can anyone here please let me know
1.whether it is looping on REGUH or REGUP.Is it on REGUH ?
2.How to see the records in debugging for this loop.
I mean as in internal table where we will get to see all the records that it is looping (loop at itab..endloop),how to see
all the records that are considered for this loop in debugging.
3.Does it loops both REGUH and REGUP ?
Thanks,
K.Kiran.

INSERT
  reguh
  regup
  regud-gjahr
  regud-xabwz
INTO daten.
this create a structure (field group) for DATEN with every fields of reguh and regup, and two fields of regud.
EXTRACT daten.
move current values of the above mentionned structures to the group field and append it into the extract.
LOOP.
ENDLOOP.
will read the extract, here DATEN, so in each loop the whole data of the above mentionned structures will be available.
There are also SORT and AT options similar to those of internal tables, and a AT field_group when multiple structures were defined by INSERT statements.
Read some documentation at [Extracts|http://help.sap.com/abapdocu_70/en/ABENABAP_EXTRACTS_EXTENDED.htm]
Regards,
Raymond

Similar Messages

  • Problem with Logical Database - Get stmt

    Hi,
       There is a standard LDB which is used in custom developed report.
    GET A
    GET B
    When there is no record fetched from B table, it moves to end-of-selection and finishes the report execution. But in some cases I dont want this to happen. Only GET A needs to be executed. It need not do a GET B statement, since there is no corresponding record in B table.
    If some condition.
        GET A.
    else.
        GET A.
        GET B.
    endif,
    But this is not posiible., since it cant be binded by If stmts.
    Please let me know how can this be achieved.
    Thanks

    Thats fine. But I dont want the GET B to get executed. Since there is no record in tht table for tht condition.
    Get B  -> Fetch wil return no record. So it goes to end-of-selection and completed report processing. But in my case it shouldnt happen. It should proceed further down in processing the report. So only i thought
    If some condition.
      Get B
    endif.
    So when there is no record case, Get B will not be executed. Binding by if is not possible.
    So please let me know how to proceed

  • Splitting "pernrs" in program that is using logical database

    Hello All,
           I have a HR program that uploads data from file into infotype 377. Everything works fine except if the file has like 20000 records the program is taking for ever to run! I am using logical database (GET PERNR) in the program. I populate my pnpindex with all pernrs from file for processing. Is there any way I can aplit pernrs (like 5000 each processing) so that I can speed up the process i.e, I want to process 5000 pernrs at a time. I tried to find solution here but no luck and I am out of ideas. If you happen to have any ideas on this, please let me know.
    Thanks.
    Mithun

    U need to code your program to run parallely ...
    look at the sample code at ..
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/interface%252bprogram%252bfor%252bmaterial%252bdata

  • Logical databases (sorry for not introducing myself)

    New on this forum. Logical databases have any use?
    What is a subprogram?
    Moderator message: please search for available information/documentation.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 2, 2011 11:13 PM

    hi logiacl databases are mostly used in the hrabap.
    Logical databases are programs that read data from database tables and pass it to other programs for processing. The order of reading the database tables is determined by a hierarchy.
    Many tables in the R/3 System are linked using foreign key relationships. Parts of these relationships form tree-like hierarchical structures. Logical databases allow you to read data easily from database tables that form parts of these structures
    Retrieving Data Using a Logical Database:
    GET EVENT
    This is the most important event for executable programs that use a logical database. It occurs when the logical database has read a line from the node <table> and made it available to the program in the work area declared using the statement NODES <table>.
    When you define the corresponding event block in the program, you can specify a field list if the logical database supports field selection for this node:
    GET <table> http://FIELDS <f1> <f 2>....
    Transation is se36
    check this simple example..
    REPORT  Z_LDB_DEMO.
    NODES: SPFLI, SFLIGHT, SBOOK.
    START-OF-SELECTION.
      WRITE 'Test Program for GET'.
    GET SPFLI.
      SKIP.
      WRITE: / 'From:', SPFLI-CITYFROM,
               'TO  :', SPFLI-CITYTO.
    GET SFLIGHT.
      SKIP.
      WRITE: / 'Carrid:', SFLIGHT-CARRID,
               'Connid:', SFLIGHT-CONNID.
      ULINE.
    GET SBOOK.
      WRITE: / 'Fldate:',    SFLIGHT-FLDATE,
               'Bookid:',    SBOOK-BOOKID,
               'Luggweight', SBOOK-LUGGWEIGHT.
      ULINE.
      END-OF-SELECTION.

  • GET (logical database)

    Hi experts,
    I have a get statement with logical database,
    when it is executed,  it should go to END-OF-SELECTION. But it goes to GET statement again. Why is it happening? Do anybody have explanation about it?

    hi,
    Get statement functions as loop and endloop statement .... and comes out of it only when it sees any exit statement after executing that statement ....For more information check out
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/get_.htm
    Regards,
    Santosh

  • Logical Database DDF - GET KNA1 - change KUNNR to another customer....

    Hi
    Question 1a:
    When using logical database DDF I perform a GET KNA1 a check is performed in order to see if customer should be within selection or not. In some cases this customer refers to another customer (fiscal address) that should be used instead.
    So Customer KNA1-KUNNR: 123 should instead be Customer 456 which contains the relevant data for the next step in the selections from the logical database.
    ..GET KNB1
    ..GET BSID...
    How is it possible to replace customer 123 with customer 456 so the continous processing of the logical database will use the new customer number instead.
    Question 1b
    And a follow up question - If there is a solution to question above....
    How can I make sure that IF customer 456 pops up in the regular selection from the logical database - It is excluded since it was already used (when customer 123 was replaced with 456 above)...
    Best regards
    Henrik

    Hi Ranganath!
    Thankyou for looking into my problem.
    Ranganath Ramesh wrote:
    ...If you want to do something like that then you need to manually populate the customer numbers which are related to the selection screen field....
    Could you please clarify how I manually could add this new customer number to my selection screen field...whithout disturbing the origianal selection with GET KNA1 - at the same time as the CHECK-statement for my old customer number fails and is excluded from the selection.
    BR
    Henrik

  • How to get the selection parameters from logical database into one of the t

    Hi Sap ABAP Champians,
    How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
    Please help me for this
    Thanks
    Basu

    Hi
    Thanks, that will work, but then I'll have to insert code into all my reports.
    I can see that "Application Server Control Console" is able to rerun a report.
    This must mean that the Report Server has access to the runtime parameters.
    But how?
    Cheers
    Nils Peter

  • Not getting fields in logical database of infotypes

    Hi All,
    I have created Infotype(9xxx) through PM01, and also maintained the screen for this with 6 feilds..
    BEGDA, ENDDA, SUBTY, OBJPS, Zxxx1, Zxxx2
    every thing is going fine but when im creating logical database for that infotype,
    im getting only 3 feilds there
    PERNR
    Zxxx1
    Zxxx2
    I need to take all the fields there.. please suggest how to do this?
    Regards
    Neha Gupta

    Solved on own.

  • Get mapl gives ' mapl not defined in the current logical database'.

    Hello,
    i am going through the report RCPDRK00, i found a statement get plkod , get mapl .
    When i try to run this statement in my test program it says ' not defined in the curent logical database' .
    How to link with  logical database.
    regards,
    kevin.

    GET statements will provide your program with database records based on the code for the logical database. The program in this case is SAPDBPNM.
    Each GET will be supplied with data by the corresponding PUT subroutine.
    Read the help about the logical databases. This is considered obsolete technology, but still, they can be very useful.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • How to extract current record using get pernr (logical database)

    Hi all,
    I am using logical database in the program and using <b>get pernr</b> method. But there are multiple entries in the infotype for a perticular employee. i want to extract employees current record whose end date is greater than sy-datum.
    how to do this using <b>get pernr</b>?
    Thanks in advance.

    Hi Priti,
    Get Pernr statement will get all the records for each employee spcicified for the Begin and End dates on the selection screen and store in an internal table for the infotypes declared in the infotypes statement.
    You need to read this table and copy only the records that meet the date criteria in an internal table for further use.
    For Ex:
    infotypes : 0001.
    tables : pernr.
    TYPES : BEGIN OF ty_kostl,
             pernr TYPE pernr-pernr,
             kostl TYPE p0001-kostl,
             ename TYPE p0001-ename,
            END   OF ty_kostl.
    Work Areas
    DATA : g_kostl_wa  TYPE ty_kostl.
    Internal Tables
    DATA : i_kostl  TYPE TABLE OF ty_kostl.
    start-of-selection.
       get pernr.
       PROVIDE * FROM p0001 BETWEEN pn-begda AND pn-endda.
        if p0001-endda GT sy-datum.
           g_kostl_wa-pernr = p0001-pernr.
           g_kostl_wa-kostl = p0001-kostl.
           g_kostl_wa-ename = p0001-ename.
           APPEND g_kostl_wa TO i_kostl.
           CLEAR  g_kostl_wa.
        endif.
      ENDPROVIDE.

  • Sorting before get logical database

    Hi,
    I would like to know any way to apply sorting before get logical database?
    for e.g.
    GET regup.
       PERFORM extract.
       IF reguh-zbukr NE regup-bukrs.
         tab_uebergreifend-zbukr = reguh-zbukr.
         tab_uebergreifend-vblnr = reguh-vblnr.
         COLLECT tab_uebergreifend.
       ENDIF.
    END-OF-SELECTION.
    I need to sort regup before GET regup which before it trigger for each line.
    Thanks.

    Hi,
    Instead of going for a sort before GET statement, you can move the required fields into an internal table first and sort that table and use it for your processing.
    A small eg:
    GET bkpf.
      MOVE:bkpf-bukrs TO tb_bkpf-bukrs,
                 bkpf-budat TO tb_bkpf-budat,
                 bkpf-belnr TO tb_bkpf-belnr.
          APPEND tb_bkpf.
          CLEAR  tb_bkpf.
    Please revert back for any further queries.
    Regards,
    Chandra.

  • Getting results from LDB (Logical Database)

    Hi All,
    I have a requirement where i need to pass LDB results to external application. It can be any LDB. Like in SE36 we put the LDB name and execute and final results are shown in ALV. I dont need it to display in ALV but from my custom program, need that output table which stores these results.
    I tried using LDB_PROCESS but that need custom subroutine names to pass in that, i tried  passing the same and results also came but thing is every logical database will have different tables in that, it'll be impossible to create those many subroutine to handle each and every table. So i need a generalized solution like se36 processes the data for any LDB.
    Is anyone knows how can i achieve this?
    Regards
    Munish Garg
    9041793217

    Hello
    Generally any LDB will have a event which triggers the data to be populated in the tables/memory. Now these data retrieval is written in a sub-routine "Perform PUT_<eventnamt>". So any LDB will have the sub-routine named "PUT_<eventname>" in its main program. May be you can create the sub-routine name dynamically using this method.
    Regards
    Ranganath

  • Usage of GET - Basic LOGICAL database question

    Hi,
    I have a few doubts in Logical Databases.
    1.) Why should i include a logical database in a abap program.
    2.) Can i add more than 1 LDB to a abap program
    3.) can Nodes statement used on all nodes on LDB
    4.) Please provide a example program based on F1S LDB with small explanation.
    Thanks in advance,
    Bala.

    >
    Bala Shanmuga Priyan wrote:
    > Thank you all.
    >
    > What is the difference between tables and nodes statement,
    >
    > Thanks in advance,
    > Bala.
    AFAIK, it is expected that we should we the TABLES statement if the node type is a TABLE and if the node type is DDIC type then it is expected that we should use NODES statement, however I found that they can be used interchangeably.
    We can find the node type info in the structure defintion of the LDB(in SE36)
    Also check this extract from the SAP help
    The nodes of the structure are declared with the TABLES statement which generates
    the appropriate table work areas. You can also use the NODES statement to define
    database tables as nodes. If a node of a logical database is not a database table,
    you must use the NODES statement.
    [Example of a Logical Database |http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9be035c111d1829f0000e829fbfe/content.htm]

  • Logical Database PNPCE and inherited Sub Area

    Hi,
    I have asked this in the HR forum but no response......
    I have a report using Logical Database PNPCE to find some values from a couple of info types. When I select a unit (from the 'OrgStructure' button at the top of the screen), say 111, and all its sub-units with no selections in the selection screen, I get one person displayed. This is correct and this person is in a sub-unit 3 levels down (unit 333).
    I then added a selection to only display people in units with Personnel SubArea 'OTEC'. Now I get no results output. When I look in PPOME, I can see that unit 333 has Personnel SubArea 'OTEC' but it is inherited from '111'.
    In PP01, unit 111 has an Account Assignment entry (Info Type 1008) but 333 does not.
    Does anyone know how to report on this?
    Is there a flag somewhere that tells the LDB to check for inherited units?
    If not, any ideas if there is a function out there to find the superior unit for these sub-units?
    Thanks.

    Thanks,
    I am aware of that FM but how do I find the parent unit in a clever fashion?
    The structure could have multiple levels e.g.
    Unit 1 - Unit 2a - Unit3a......
           - Unit 2b
           - Unit 2c
    Unit 1 is the parent and all the below units inherit from it.
    The LDB is looping through an internal table with a list of the units. It finds Unit 1 but not the rest.
    So, when the LDB is looking for Unit 3a, how does it know that Unit 1 is the parent?
    If I use that FM, I think I would have to look for all units above it and see if there is an Info Type 1008 exists. Seems like a lot of processing for something that should be simple?
    Kroc.

  • Logical database HR

    Dear Gurus,
    I m trying to debug a report which is done using logical database programig.
    Report is rnning for all employees and checking whetere for thsi employee contract is expring in 30 days or not.if expring iys just displaying data.
    Report is running using statement Get Pernr.
    I m new to abap..i jsut want to execute an ddebug teh prograom for 1 emplyee,...but when i started debugging its reading employeess 1 by 1 through get pernr...and looping..
    but i just want to debug for 1 employee...and see hoe its working...
    I diont have option to select on selection screen..
    Is this possible as otherwise its taking a long time to debug...
    Please suggest
    Regards
    Manish

    Put a break point on GET PERNR statement.
    So when you execute the report the program will stop on this statement.
    You can look at the field PERNR-PERNR to find out for which employee the code is being run.
    remember from GET PERNR event till END OF SELECTION event its like a loop. So after END OF SELECTION the employee number will get changed at GET PERNR event.
    hope this was usefull
    cheers
    AJ

Maybe you are looking for