Dynamic select field

Hello,
I have to perform a dynamic select statement with im_field variable.
select single max(im_field)....
I know that I have to use brackets in order to use variables inside the select statements, but what about in this case? I have a short dump with wrong fieldname.
I also tried select single max((im_field))...., but same result.

check this example to get an idea...
MAX( [DISTINCT] fdescriptor )
Addition:
... AS alias
Effect
Returns the largest value for the selected lines in the column identified by the Field descriptor fdescriptor.The DISTINCT specification does not alter the result. NULL values are ignored in the calculation, except when all of the values in a column are NULL. In this case, the result is NULL.
Example
Output a list of all customers on Lufthansa flight 0400 in 1995, along with the highest price paid, sorted by customer name:
TABLES: SCUSTOM, SBOOK.
SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
         MAX( SBOOK~LOCCURAM )
       INTO (SCUSTOM-NAME, SCUSTOM-POSTCODE, SCUSTOM-CITY,
             SBOOK-LOCCURAM)
       FROM SCUSTOM INNER JOIN SBOOK
         ON SCUSTOMID = SBOOKCUSTOMID
       WHERE SBOOK~FLDATE BETWEEN '19950101' AND '19951231' AND
             SBOOK~CARRID   = 'LH '                         AND
             SBOOK~CONNID   = '0400'
       GROUP BY SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
       ORDER BY SCUSTOM~NAME.
  WRITE: / SCUSTOM-NAME, SCUSTOM-POSTCODE, SCUSTOM-CITY,
           SBOOK-LOCCURAM.
ENDSELECT.
Addition
... AS alias
Effect
As in variant 1. You can also use an alternative column name in variants 2 - 6 to sort the result by an aggregate expression. Unlike aggregate expressions, you can use alternative column names in the ORDER-BY clause.
Example
Output a list of all customers on Lufthansa flight 0400 in 1995, along with the highest price paid, sorted by price and customer name:
TABLES: SCUSTOM, SBOOK.
SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
         MAX( SBOOK~LOCCURAM ) AS MAX
       INTO (SCUSTOM-NAME, SCUSTOM-POSTCODE, SCUSTOM-CITY,
             SBOOK-LOCCURAM)
       FROM SCUSTOM INNER JOIN SBOOK
         ON SCUSTOMID = SBOOKCUSTOMID
       WHERE SBOOK~FLDATE BETWEEN '19950101' AND '19951231' AND
             SBOOK~CARRID   = 'LH '                         AND
             SBOOK~CONNID   = '0400'
      GROUP BY SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
      ORDER BY MAX DESCENDING SCUSTOM~NAME.
  WRITE: / SCUSTOM-NAME, SCUSTOM-POSTCODE, SCUSTOM-CITY,
           SBOOK-LOCCURAM.
ENDSELECT.
Ramesh.

Similar Messages

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • HR - dynamic selections field name and field value in the program

    HI all,
       I am using dynamic selections for a HR report.
    I have created a view with 20 fields and added it to HR report category ___00003(All fields suppressed).
    I need to check these fields in the program. But i am not able to get the field name and value in the program for dynamic selections fields.
    Please let me know how to get the field names and values in the program for dynamic selections .
    Thanks,
    Kranthi.

    You have to read the itab <i>pnpdynse</i> in your Program to obtain the Dynamic Selection values. This itab has a deep structure.. you can set a break point in one of the events before <b>get pernr</b> & in the debug mode, you will able to display the itab <i>pnpdynse</i>.. you can then identify how to get the values into your code..
    ~Suresh

  • How to hide dynamic selection fields in variants

    hi,
    When a selection variant is saved, we have the option to 'hide' a selection field. That field may contain a value, but it is not shown on the selection screen. There is, however, a button that will display these hidden field when required.
    Is it possible to do this also with dynamic selection fields ?
    The column 'Hide field' is shown in the variant atttributes screen, but it is not active.
    Please suggest
    MS

    Explore SHD0 T code

  • HR-How to use dynamic selection fields in prog ..?

    Hii
         I have written a prog to select data pertaining to details of all employees who belong to a particular country . For this i have provided a dynamic selection field for selecting country (through Selection View).But when i am getting all the records for all countries.
                    How to use the dynamic selection fields in program or they behave in the same way as the standard selection given by the LDB .As if we enter a value in the std screen then the GET event acts accordingly .
    Ajitabh Pradhan

    Hi Ajitabh,
    First off, is the Dynamic Selection working? If so, try the following code.. I am assuming, you only want to look at Permanent Address.
    tables: pernr.
    infotypes: 0001,0006.
    start-of-selection.
    get pernr.
      rp-provide-from-last p0001 space pn-begda pn-endda.
      check pnp-sw-found eq 1.
      rp-provide-from-last p0006 1 pn-begda pn-endda.
      check pnp-sw-found eq 1.
      write:/ pernr-pernr,p0001-ename,p0006-land1.
    end-of-selection.
    Regards,
    Suresh Datti

  • Dynamic selection field display

    Hi
    Can we display field values for a field from Dynamic selection ?

    Hi,
    Yes, you can display field values in dynamic selection field.
    If I understood your question correctly, you are talking about the dynamic selection used in reports ( For eg. ME2N). The field which are appearing in dynamic selection shows the field values. ( you can press F4 and check the field values).
    Rajesh.

  • Addition of dynamic selection fields on FBL3N

    Hi all,
    I want to add LIFNR(vendor accnt) and NAME1(vendor name) on the 'dynamic selections' screen of transaction FBL3N.
    I need to get these fields from LFA1 but LFA1 is not present in the Logical database of this program.
    Please help me and tell me if it is possible.If yes...how??

    Use
    transaction: SE36
    from menu: Extras -> selection views
    choose: origin => SAP , Name of view => Standard
    In right table under "Tables" choose "BSEG" and find LIFNR, enter 03 in the first column. For the name , I didn't have time to check it....
    If this helped you, don't forget to tip some points

  • Adding of new field in dynamic selection for financial statements

    Hi ALL,
    I want to add Trading partner in dynamic selection fields of financial statement report at document level not yet GL master level: S_ALR_87012284 - Balance Sheet / Profit and Loss Statement .
    Can any one tell how to proceed?
    I have referred notes: Note 188663 - Enhancing selection views and dynamic selection.
    But exactly I am unable to find which logical database has to be given?
    regs,
    ramesh b

    Hi,
    If you want to add extra field in your report you can do the setting in Layout selection. If it is not available kinldy check any SAP notes available or not. Otherwise do Zreport with your ABAPer.
    Regards,
    Mohan.

  • Populating text fields from dynamic select

    I have been searching the net for a javascript/ajax solution
    that will populate a number of text fields based on the selection
    from a dynamic select field. Specifically, when the person selects
    a company name, the companies address and phone number gets pulled
    from a second recordset that gets filtered by the choice from the
    dropdown. This needs to be done without postback.
    The page is built using php/mysql and the select is populated
    by one of the recordsets.
    Any direct help or steering to a solution would be
    appreciated.

    Thanks for the reply.
    Right now I'm starting with a blank form and once I get my head wrapped around this then I was going to modify what is already in use.
    I'm attaching my scheme and xml file.
    Thanks!
    Derrick
    I get an error when trying to upload my schema. I am pasting the content of the file here. I call it proofout.xsd
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="userList" type="UserList" />
    <xs:complexType name="User">
      <xs:sequence>
       <xs:element name="csrName" type="xs:string" />
       <xs:element name="csrExt" type="xs:int" />
       <xs:element name="csrFax" type="xs:string" />
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="UserList">
       <xs:sequence maxOccurs="unbounded">
        <xs:element name="user" type="User" />
        </xs:sequence>
        </xs:complexType>
        </xs:schema>

  • Dynamic Selection on report not working

    Dear all,
    I have several reports on which the dynamic selection is not working. For instance, the report CN43N. The report is outputting all data in a year i.e it is disregarding the condition I specified in the dynamic selection fields.
    Is there some configuration to make to this report so that the dynamic selection works?
    Thanks for ur help.
    Nas

    Also Nelmaz,
    I have just checked OSS notes and found below note helpful to you:
    Note 1059465 - CN43N: Dynamic selections for scheduling data of WBS elemnts
    Symptom
    You cannot use transaction CN43N to create dynamic selections for scheduling data of WBS elements (table PRTE). You can use transaction CNS43 to do so.
    Hope this helps.
    Please assign points as way to say thanks

  • How to save a variant with dynamic selections parameters

    Anybody knows how to save a variant for an ABAP that uses a Logical database with Dynamic Selections?
    Have a look for example to the following:
    SE38 - DEMO_PROGRAM_GET - Execute - Shift F4 - Connection Number.
    How to save 0820 as Connection Number?
    Function Group SVAR seems good but FREE SELECTIONs are not easy to manage...

    Hello,
      I tried to save the variant of DEMO_PROGRAM_GET with dynamic selection field (Connection Number) filled. It gets saved without any problem. Just click 'SAVE' and enter the variant name and description.
    Thanks,
    Venu

  • FAGLL03 : Submit syntax for dynamic selections

    Hi Experts,
    My z report contains following fields in selction screen.
    1 . G/ L account
    2. Comapny code
    3. posting date
    4. document type
    5. layout
    In my z report i used following syntax for passing selection screen values to standard program and getting data.
    SUBMIT FAGL_ACCOUNT_ITEMS_GL
                      WITH SD_SAKNR   IN S_SAKNR
                      WITH SD_BUKRS   IN S_BUKRS
                      WITH X_OPSEL    EQ ' '
                      WITH X_CLSEL    EQ ' '
                      WITH X_AISEL    EQ 'X'
                      WITH SO_BUDAT   IN S_BUDAT
                      WITH PA_VARI    EQ P_VAR
                      EXPORTING LIST TO MEMORY
                     AND RETURN. 
    The above syntax is not working for dynamic selection field ( document type ), entire document types data is fetching from standard program. I want to fetch document type data based on my z report selection values for document type field.
    Expect for document type field , submit syntax is working.
    kindly provide submit syntax for my above requirement .
    Any suggestions from experts....
    thanks & regards,
    Hari priya
    Edited by: Hari  Priya on Aug 24, 2009 4:33 PM

    Hi,
    Try like this.
    call function 'RS_REFRESH_FROM_SELECTOPTIONS'
      exporting
        curr_report = 'FAGL_ACCOUNT_ITEMS_GL'
      tables
        selection_table = i_sel[].
    Fill your profit center values in i_sel
    Submit FAGL_ACCOUNT_ITEMS_GL with selection-table i_sel and return
    WITH FREE SELECTIONS TEXPR AND RETURN
    Regards,
    Shamma

  • Selection variable for dynamic selection in QE51n

    Hi All,
    I have a scenario were we have a repetitive Manufacturing and we create one insp. lot of origin 13 and keep creating insp. points for days, so my user wants the insp. points to be displayed only for the past 3 days based of the Date Insp. point identifier which is one of dynamic selection criteria under insp. points, I see with other transaction I can do selection variable on dates for dynamic selection fields but I cannot do that in QE51n, I can do the same in QE51 but not in QE51n, can some tell me if there is a OSS or other way to get this working.
    I appreciate your help.
    Thanks,

    Hi Srikant,
    I think you can meet the requirement in QE51N also.
    In the screen for QE51N :Result Recording Work list", Follow this Path,,,,,,,,,
    Edit--->Dynamic Selection.
    The system will pop-up new small window for "Dynamic selection for insp. lot and operation" here I there is one folder is available named "Inspection point " which is having the selection criteria "Inspection point",  double click on it and enter the desired values.
    Regards,
    Shyamal

  • Execution of report with dynamic selection in method

    Dear Experts,
    I need to execute report 'RCATS_APPROVE_ACTIVITIES' in background in the method after populating field-'Processing status'. Also there is a option of dynamic selections for this report in menu bar. In Dynamic selections, there is a field - 'CREATED BY' which also i want to populate before execution.
    Here I am able to populate field- 'Processing status' like code below:-
    DATA: rspar    TYPE STANDARD TABLE OF rsparams,
         wa_rspar TYPE rsparams.
    wa_rspar-selname = 'LDBSTAT'.
    wa_rspar-kind = 'S'.
    wa_rspar-option = 'EQ'.
    wa_rspar-sign = 'I'.
    wa_rspar-low = '10'.
    APPEND wa_rspar TO rspar.
    CLEAR wa_rspar.
    SUBMIT RCATS_APPROVE_ACTIVITIES
         USING SELECTION-SCREEN 1000
        WITH SELECTION-TABLE rspar
    But I am not able to populate the dynamic selection field- CREATED BY.
    Please suggest(if possible with code) how to resolve this.
    Regards
    Nitin

    Dear KArri,
    Thanks for the reply but this i am performing in the Method of BO and want to execute this method in my workflow. That is the reason, I have posted this in workflow forums.
    For this I have created a customised BO to use in CATS workflow.
    Regards
    Nitin

  • Dynamic Selections in FS10N

    Hi,
    How can i visible the Edit --> Dynamic Selections field in Menu Bar of T. code FS10N...it is coming invisible...
    Thanks..

    Hi,
    Thanks for reply...
    From Ctrl + F1 on screen, it opens Activate Worklist...there is not profit center field...
    now what can i do for profit center.
    Thanks....

Maybe you are looking for

  • Adobe Acrobat 9 Signatures

    I have set up a signature in Adobe Acrobat 9 and when you draw the box for placing your signature everything behind it is "whited" out.  Is there a way to change the settings so you can see where you are placing your signature?  I have to sign a lot

  • IDVD, DVD -R and DVD +R

    I have iMovie 5.0.2, iDVD 4.0.1 and the following Superdrive: PIONEER DVD-RW DVR-107D: Firmware Revision: A707 Interconnect: ATAPI Burn Support: Yes (Apple Shipped/Supported) Cache: 2000 KB Reads DVD: Yes CD-Write: -R, -RW DVD-Write: -R, -RW, +R, +RW

  • Portal content Transport Packages Export/Import Question.

    Hi,everyone:   I have a problem when Export packages of portal content,the epa-file is correct on the server however become error after download from the server to localhost.   The bug is Function of Download itself,if anyone have meet this case and

  • Sequence ID repeated

    Hi all, We have an interface in serialization mode. We were sending messages each minute during 1 hour and we noticed that some sequence IDs were repeated. Also we saw that sequence ID values were between xxxxxx0000 and xxxxxx0099 is there any way to

  • How do I get photoshop cs6 on my pc?

    I need photoshop cs6 for a college course and I was wondering how I download it.