Selection from logical database.

The question is simple. =) Wy does the second part works but not the first one. Isn't it possible to do like that. Anyone that can help with how i can do? 
<b>Event : start-of-selection employees not connected to position</b>
rp-provide-from-last p0001 space pn-begda pn-endda.
  check pnp-sw-found eq 1.
if p0001-plans EQ '99999999'
  AND p0000-stat2 EQ '3'
  AND p0001-vdsk1 EQ 'IT'
  AND ( p0001-persg EQ '1' or
      p0001-persg EQ 'T' )
  AND ( p0001-bukrs EQ 'FR46' or
      p0001-bukrs EQ 'GB21' or
      p0001-bukrs EQ 'PL05' or
      p0001-bukrs EQ 'BE06' or
      p0001-bukrs EQ 'US22' ).
<i>****** What should i write here.
All the condistion are right
But i dont know how/what to select.</i>
  if sy-subrc ne 0.
      ipos-pernr = pernr-pernr.
      ipos-sname = p0001-sname.
      ipos-orgeh = p0001-orgeh.
      ipos-bukrs = p0001-bukrs.
      ipos-plans = p0001-plans.
      append ipos.
      clear: ipos.
  endif.
  endif.
Event : <b>start-of-selection connected to position but no task</b>************************************************************************
  rp-provide-from-last p0001 space pn-begda pn-endda.
  check pnp-sw-found eq 1.
      IF p0001-plans NE '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' OR
p0001-persg EQ 'T' )
AND  ( p0001-bukrs EQ 'FR46' OR
p0001-bukrs EQ 'GB21' OR
p0001-bukrs EQ 'PL05' OR
p0001-bukrs EQ 'BE06' OR
p0001-bukrs EQ 'US22' ).
  <i>  w_objid = p0001-plans.
    select sobid into w_sobid
                  up to 1 rows
                  from hrp1001
                  where otype = 'S'
                     and plvar = '01'
                     and objid = w_objid
                     and rsign = 'B'
                     and relat = '007'
                     and endda ge pn-begda
                     and begda le pn-endda.
    endselect.</i>
    if sy-subrc ne 0.
      itask-pernr = pernr-pernr.
      itask-sname = p0001-sname.
      itask-orgeh = p0001-orgeh.
      itask-bukrs = p0001-bukrs.
      itask-plans = p0001-plans.
      append itask.
      clear: itask, w_objid, w_sobid.
      endif.
     endif.
end-of-selection.
/ Claes

What should i write here.
All the condistion are right
But i dont know how/what to select.
<b>Should be Replaced by</b>
Function call RH_GET_POSITION_TAB. Then you'll get the list if positions!
Is that what you ask ????
Stphn

Similar Messages

  • 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

  • How to extend dynamic selection for Logical Database PNPCE

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

  • Is it possible to view the data that is extracted from logical database.

    Hi ,
    i have a standard program(T-code F.38) that uses logical database.This program also uses fields groups to define the structure.
    Now my question how can i see the data that is been fetched from logical database?Is that possible?
    I need to do further modifications on this data.Please advice whether its possible?

    hi,
    one possibility is dat.  goto SLDB give ur ldb name and goto source code.
    u will get code.
    now see dat and by giving same conditions u can check data using se16.

  • Exclude one field from Logical Database's dynamic selection screen

    Hi Guru,
    I have a requirement to amend a program to exclude the document number field (bsik-belnr) from the dynamic selection-screen of the logical database KDF(Vendor Database) so that the program will not filter according to the document number.
    I have use the below syntax in my zprogram.
      selection-screen exclude select-options: doc-no.
    However I get syntax error "The addition EXCLUDE is only allowed in INCLUDE DBKDFSEL".
    Please advice.
    Best Regards,
    Fung

    The selection part of the logical database defines input fields for selecting data.
              The runtime environment displays these on the selection screen when you run an executable program linked to the logical database.
              Include called DB<ldbname>SEL.
            SELECTION-SCREEN BEGIN OF VERSION ver TEXT-xxx.
                                                                    SELECTION-SCREEN EXCLUDE ... .
                                                    SELECTION-SCREEN END OF VERSION ver.
    Defines a selection screen version (with a three-character name ver ). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects for the version ver , i.e. remove them from the selection screen with SELECTION-SCREEN EXCLUDE.
              SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab
    If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a pushbutton called 'Dynamic selections' appears on the selection screen.

  • How to remove spaces at selection screen coming from logical database

    Hi Experties,
    When we hide some selection from the logical database.  The spaces still occupied and this make our selection screen looks awkward.
    How to remove the spaces left by hidden selection ?
    Regards
    Nislina

    Hi,
    I came across your un-answered question while searching for a solution on the similer problem. Though I couldn't fine a solution on SDN, but figured out one myself. Thought its a good idea to share it.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group4 = '003'.
          screen-active = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    Here screen-group4 contains the sequence number of the select-options field starting from 000 onwards.
    You may like to assign points and close the question.
    Kind Regards,
    Khalid Mustafa

  • How to read data from Logical Database ADA for more than one financia year

    Hi,
    I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years – 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
    Kind regards,
    Zbigniew Debowski
    REPORT  ZWRZD075.
    NODES: anlav, anlcv.
    START-OF-SELECTION.
    GET anlav.
    WRITE:/ anlav-anln1, ' ', anlav-anln2.
    GET anlcv.
    WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.

    Hi!
    Have you already tried your luck in Java Programming forum?
    Regards,
    Thomas

  • Can i limit the selection in Logical database ?

    hello  ,
    how can i limit the number of records in Logical
                                  database ( my "yyf"  , not standart )   ?
    i get dump on memory  , when i press F4 , becouse i have to many records ,
    so how can i limit the amount of records .
    in se36 ?
    in my program  ( se38 ) ?
    dump description
    &INCLUDE INCL_INSTALLATION_ERROR
    The current program had to be terminated because of an
    error when installing the R/3 System.
    The program had already requested 386785568 bytes from the operating
    system with 'malloc' when the operating system reported after a
    further memory request that there was no more memory space
    available.

    Hi ,
    Hope this helps you .
      SELECT roll name
      FROM tab
      INTO TABLE it_tab.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ROLL'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'P_ROLL'
          value_org       = 'S'
        TABLES
          value_tab       = it_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.

  • Need to specify LEFT OUTER JOIN while using data from logical database BRM?

    I'm trying to extract data for external processing using SQVI. The fields required are in tables BKPF (Document Header) and BSEG (document detail) so I'm using logical database BRM. Note: required fields include the SPGR* (blocking reasons) which don't appear to be in BSIS/BSAS/BSID/BSAD/BSIK/BSAK, hence I can't just use a Table Join on any of these but have to use BSEG, hence BRM.
    If the document type is an invoice, I also need to include the PO number from table EKKO (PO header), if present, hence I'd like to add this to the list. However, if I do this, it seems that some records are no longer display, e.g. AB documents.
    The interesting thing is that not all records are suppressed, so it's not a simple case of the logical database using an effective INNER JOIN, but the effect is similar.
    In any event, is there a way to specify that the link to table EKKO should be treated as an effective LEFT OUTER JOIN, i.e. records from BKPF/BSEG should be included irrespective of whether any records from EKKO/EKPO exist or not?
    Alternatively, is there some other way to get the SPGR* fields (for example) from BSEG and still join the BKPF? Of course, one solution is to use multiple queries, but I was hoping to avoid this.

    Thanks for everyone's responses, I know how to work around the problem with sql, I am wanting to see if there is a way to make the outer joins filter go in the join clause instead of the where clause with Crystal Reports standard functionality. 
    We have some Crystal Reports users that are not sql users, i.e. benefit specialists, payroll specialists and compensation analysts who have Crystal Reports.  I was hoping this functionality was available for them.  I just made my example a simple one, but often reports have multiple outer joins with maybe 2 or three of the outer joins needing a filter on them that won't make them into an inner join. 
    Such as
    Select person information
    outer join address record
    outer join email record
    outer join tax record (filter for active state record & filter for code = STATE )
    outer join pay rates record
    outer join phone#s  (filter for home phone#)
    I thought maybe the functionality may be available, that I just don't know how or where to use it.  Maybe it is just not available.
    If it is not available, I will probably need to setup some standard views for them to query, rather than expecting them to pull the tables together themselves.

  • Selection-screen logical database PCH

    Hello!!
       I need click a pushbutton (key date) on a selection screen of a logical database (PCH) before the programm is executed.
    Regards.

    For a ABAP I used this "quick and dirty" solution:
    *Add selectoption (or in your case button)
    SELECT-OPTIONS s_ssl FOR iooper-ssavd.
    INITIALIZATION.
    perform hide_selection_screen.
    AT SELECTION-SCREEN output.
    perform hide_selection_screen.
    FORM perform hide_selection_screen.
      LOOP AT SCREEN.
        IF screen-name CS 'S_WERK'.
          MOVE '0' TO screen-active.
          MODIFY SCREEN.
        ENDIF.
    ENDLOOP.
    ENDFORM perform hide_selection_screen.
    You can hide all required radiobuttons by adding them to the loop. The buttonclick can be catched at the previous mentioned event.

  • An sample progam how to reterieve values from logical database

    i need to reterieve prart, vernr, verna, from the table prps using the logical database psj, i know if i give psj in the logical database of the report attributes, but i should not give in the attributes, but i need to use the logical database.
    i need a sample program

    Here is the help on the subject.
    <i>
    Addition 2
    ... DEFINING DATABASE ldb
    Effect
    This addition shows that the current program is the database program of the logical database ldb. The name of this logical database has a maximum length of 20 characters. Logical databases are maintained with the tool Logical Database Builder of the ABAP Workbench, in which the framework program is generated automatically including the statement REPORT. The name of the framework program is SAPDBldb.
    Example
    Introduction of the logical database F1S.
    REPORT sapdbf1s DEFINING DATABASE f1s.
    </i>
    This is leading me to believe that this extension DEFINING DATABASE F1S is used only when actually building the logical database via the LDB Builder, not for use when actually using it in a program.  I don't think that you can use this extension in your case.
    Regards,
    Rich Heilman

  • To reterieve value from logical database psj

    i need to reterieve value from the logical database psj,
    the table name is BPJA1 and the field name is WTJHR, based on the wbs element.

    Hi,
    assign your prog (attributes) to ldb psj and
    try:
    GET BPJA1   FIELDS wtjhr. "-> look F1
    Andreas

  • Reg Dynamic Selections in Logical DataBases

    Hi All,
      I am forcefully scheduling a report to run in background mode even though the users run it online.
    While doing so I have handled all the parameters and the select options in the selection screen in the following way.
    SELECT OPTIONS
      wa_rspar-selname = 'BUDAT'.
       wa_rspar-kind = 'S'.
       if BUDAT[] is not initial.
          loop at BUDAT.
             wa_rspar-sign = BUDAT-sign.
             wa_rspar-option = BUDAT-option.
             wa_rspar-low = BUDAT-low.
             wa_rspar-high = BUDAT-high.
             append wa_rspar to rspar.
          endloop.
       else.
         wa_rspar-low = BUDAT.
         append wa_rspar to rspar.
       endif.
       clear: wa_rspar.
    PARAMETERS.
    wa_rspar-selname = 'SORTART'.
       wa_rspar-kind = 'P'.
       wa_rspar-low = SORTART.
       append wa_rspar to rspar.
       clear: wa_rspar.
    While doing so since the report uses logical database-the dynamic selection portion has to be handled otherwise the dynamic selection is ignored and the report is displayed wrong.
    How can we handle the dynamic selection portion for the forceful conversion of the program to background mode even if it is run online.
    Has anyone faced this kind of issue.If so how was it resolved.
    Thanks in advance.

    Finally it seems not to be possible to fill the dynamic selection of a logical database during INITIALIZATION in a report which is using the respective logical database (under report properties).
    My solution was to create a new select option within the customer program which refers to the respective database column (... FOR bsis-gjahr). If this column is supported by the dynamic selections of the logical database, then the values entered on the selection screen are automatically transferred and used by the logical database selection. It is just important to refer to the correct table, as BSIS-gjahr is working while BSEG-gjahr and BKPF-gjahr are not working in my example.
    See the following link:
    http://help.sap.com/saphelp_470/helpdata/en/9f/dba73935c111d1829f0000e829fbfe/content.htm?frameset=/de/9f/dba76035c111d1829f0000e829fbfe/frameset.htm&current_toc=/de/d3/2e974d35c511d1829f0000e829fbfe/plain.htm&node_id=305

  • How to get dynamic select options from logical database?

    Hi,
    in one of my extended reports (means - overwritten standard SAP functionality in Z-namespace) I'm using LDB 'DDF'. I've been requested to validate some of the dynamic selection options (for example - field HKONT at Document level) and to split the logic depending on the particular value(s).
    Tracking what is happened in the LDB program I found that this select option is added as dynamic WHERE clause to the SELECT statement - in a way:
    WHERE bukrs = p_burks AND ... AND
    (where_tab)
    Is there a way to get values of these LDB dynamic select options into my report and if yes - how?
    Thanks in advance.
    Regards,
    Ivaylo Mutafchiev
    Senior SAP Abap Consultant

    Hi,
    Try to use the following fm in your report and check
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = sy-cprog
          mode_write_or_move = 'M'
        importing
          p_trange           = gt_dyn_trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
    PS please make a whereused of this fm , how it has been used in LDB's to get dynmic selection values

  • Optimising SELECT from a database

    I'm trying to retrieve records from a huge transaction table.
    1. I want to retrieve records into an internal table
    2. If there was a duplicate record that is about to move into the same internal table it will be moved into another internal table.
    3. Someone told me that using a LOOP may not be that effective. Using internal table KEYS and BINARY SEARCH would be ideal.
    I have come here to seek for urgent guidance and knowledge.
    Hope you all can help.

    Hi Andrew,
    do u want to select the records from the databese... then move the duplicate record in to another internal table.. is this u requirement!!
    first select the data into let us say Ex IT_TAB1.
    suppose F1 and F2 Are key fields in u r table.
    then
    SORT IT_TAB1 BY F1 F2.
    THEN
    IT_TAB2[] = IT_TAB1[].
    SORT IT_TAB2 BY F1 F2.
    DELETE ADJACENT DUPLICATE FROM IT_TAB2 COMPLARING F1 F2..
    now u have two tables IT_TAB1 contains all the Records
    IT_TAB2 contains only the single records..

Maybe you are looking for

  • How can I hide iCloud purchases on Apple TV?

    We are a small Christian private school, and we have Apple TVs in each classroom. The album art for U2's freely released album has changed, now showing two shirtless men in an embrace -- Yes, I know it's Larry Mullens Jr and his son. It's upsetting m

  • Can't FTP or use CPanel with router; okay without

    We have a WRT-54G router connected to a Surfboard SBV5222 cable modem. Recently I started having problems connecting to one particular website via FTP and via CPanel.  I get error 530 "Login authentication failed".    I get this error from any comput

  • What is invoice list

    hi gurus what invoice list does.  Where do we use this invoice list how to configure means where do we set customizing settings.   How it will be use ful in a business. Thanks & Regards Poitns will be rewarded

  • FI report using 'Report painter'

    Hi All, I am working on trial balance and created the BADI 'G_SET_FORMULA_EXIT' with the filter 'U001' saved and activated. I am now trying to create the variable with FORMULA '#U001' but i getting the following error: Variable name '#U001' not possi

  • Using Brother printer, can't print on both sides.

    I installed OS 10.5 and now my printer is giving me almost no options other than just to print, including no option to print on both sides. Please help! Thanks.