Standard function for SELECT???

I need to do a dynamic select, because i only know table name dynamically.
I found DB_UPDATE_TABLE for update operations, but i need a similar function for select??
Any ideas???

Hi,
check this code...
For dynamic table name....
REPORT demo_select_dynamic_database .
DATA wa TYPE scarr.
DATA name(10) TYPE c VALUE 'SCARR'.
SELECT *
INTO wa
FROM (name) CLIENT SPECIFIED
WHERE mandt = '000'.
WRITE: / wa-carrid, wa-carrname.
ENDSELECT.
<b>For dynamic field list</b>
REPORT demo_select_dynamic_columns .
DATA: itab TYPE STANDARD TABLE OF spfli,
            wa LIKE LINE OF itab.
DATA: line(72) TYPE c,
list LIKE TABLE OF line(72).
line = ' CITYFROM CITYTO '.
APPEND line TO list.
SELECT DISTINCT (list)
INTO CORRESPONDING FIELDS OF TABLE itab
FROM spfli.
IF sy-subrc EQ 0.
LOOP AT itab INTO wa.
WRITE: / wa-cityfrom, wa-cityto.
ENDLOOP.
ENDIF.
Regards
Sudheer

Similar Messages

  • Functionality for Select and Save layout in a report output

    Hi,
    I had developed a report program containing several fields in the output and requires the Functionality for Select layout and Save layout in a report output.
    Please suggest.
    Thanks,
    Shariq.

    While calling the FM for List Display ( "REUSE_ALV_LIST_DISPLAY" or "REUSE_ALV_GRID_DISPLAY" ) set the Parameter I_SAVE for Setting the Layout and Selecting a different Layouts.
    The possible values for I_SAVE are "A", "U", "X" or others. Depending on the requiement you can set different values for the Parameter I_SAVE.
    ' ' = display variants cannot be saved
    Defined display variants (e.g. delivered display variants) can be selected for presentation independently of this flag.
    Changes can not be saved.
    'X' = standard save
    Display variants can be saved as standard display variants.
    User-specific saving is not possible.
    'U' = only user-specific saving
    The user can only save display variants user-specifically
    'A' = standard and user-specific saving
    The user can save a display variant user-specifically and
    as standard display variant. The user chooses in the display variant
    save popup.
    Reward points if helpful.

  • Anyway to selectivily enable/disable bluetooth function for selected apps like papago in iphone.

    Hi,
    Anyway to selectively enable/disable bluetooth function for selected apps like papago navigator in iphone.
    I want to maintain bluetooth connectivity to car headset for handsfree driving while papago navigator on ky iphone continuously guide me on the road using the  iphone speaker. So when someone called me on the phone, it will use the car headset. is there such as apps?
    Rgds,
    Kpk

    Hi,
    In pageflow definition, "Train Stop-->Skip" property controls the enable/disable state.
    If Skip value is true (it can be controlled with EL expression) than related link and button in train components are disabled.
    They are enabled other If Skip value is false (It is default).

  • Standard function for settlement period

    Hello
    Does someone knows if there is a standard function that could define the settlement period based on a date (DD.MM.YYYY)?
    The aim of this is to use it in report RKO7CO88 thanks to a link with table TVAR because we would like to run in background the settlement without having to change every month the variant.
    Kind regards
    Chris

    Hello Srikanth,
    create 2 variables ...one for fiscal year and another for posting period...
    for the column which should take the previous period...right click on the variable and you will see offset...put in -1....but what if the user enters 2006.001...should it take 2005.012 ?? In that case you should write an abap code i think ....

  • Standard function for returninf time difference in days and hours.

    Hello all,
                Can somebody tell me whether there exists some standard function module which can calculate the time difference and returns the calculated time in the form of days and hours ?
    e.g. the time difference between the date 1.12.2007 from 7.00 pm to the date 1.1.2008 till 9.00 pm is
    30 days  and 2 hours or 30 : 2.
    answer as soon as possible.
    Thanks and regards,
    me

    Thanks a lot ya..
    thats an absolutely correct solution to my problem.  )

  • Lost functionality for selecting multiple photos?

    In iOS previous to 5 I could go into my imported photos, choose select, then tap, hold and drag my finger across multiple photos to select a whole page very quickly. This functionality seems to be gone in iOS 5 and each individual photo needs to be tapped -- one by one. This is a serious step back for those who import many photos from their camaras and then want to clean out the imported photos quickly. Can anyone confirm this functionality is still there and perhaps I am not seeing how to do it?

    I don't whether it was possible prior to iOS 5 (I'm not aware that it was), but I don't appear to be able to do it in iOS 5

  • Query for FREE_SELECTIONS_INIT function for selection screen

    Hi ,
    I am calling this function FREE_SELECTIONS_INIT for implementation of selection screen , but when I am trying to pass a "QUAN" datatype in FIELD_DESC table for TYPE Parameter as importing parameter, its giving a dump . But for other types of datatypes it is working fine . please suggest , if we have to use any other parameter in this function to handle QUAN fields.
    Thanks and Regards,
    Anupam Yadav

    HAI,
    IF you go through the function module, FIELD_DESC is table type. So declare an internal table of type FLDCONVERT(Double Click on this to see its components) and populate the necessary fields and then pass on this table on to the FIELD_DESC parameter.
    Best Regards,
    rama

  • Standard function for specified return

    Hi,
    I have an issue I want your help with.
    This is only valid if numbers 5 or 6 are in the input.
    I want to return the last 2 digits from the input parameter. for example. Input: 123456. Output: 56.
    Or if there's only 12345 I want to return 5.
    I can't do any substring because the input parameter could be whatever. example. 125. Example: 6.
    Summary. I need a function that returns the last digits of the input parameter only if the input includes 5 or 6, or both.
    Hope you understand.
    Regards.

    Below UDF handles all possible inputs as per your requirement.
    public String returnLast2Digits(String var1, Container container) throws StreamTransformationException{
      if( var1.length()>1){
          String str2 = var1.substring(var1.length()-2,var1.length());
            if(str2.substring(0,1).equals("5")&& str2.substring(1,2).equals("6")){
               return  str2;
           else if(str2.substring(1,2).equals("5") || str2.substring(1,2).equals("6")){     
               return str2.substring(1,2);
           else{
              return "";
       }else{
           if(var1.equals("5") || var1.equals("6")){
              return var1;
           } else{
              return "";
    Edited by: Baskar Gopal on May 17, 2011 2:54 PM

  • Additional functions for form creation

    Is there any additional functions for selecting members for forms.
    For example ILvl0Descendants used to be hidden and if you knew the syntax you could type it in. Now of course it is an option but wondering if there might be others that are still hidden but work.
    Specifically I want to use @UDA but if there are others they might fufill my needs.
    Ultimately kind of annoying that forms don't allow for all the standard functions available in Planning and Essbase

    Hi,
    You can't currrently (11.1.1.3) use UDA, the current list is :-
    Member
    Descendants
    Descendants (inc)
    Ancestors
    Ancestors (inc)
    Siblings
    Siblings (inc)
    Parents
    Parents (inc)
    Children
    Children (inc)
    Level 0 Descendants
    DTS (e.g. Y-T-D)
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Regarding Standard function

    Hi
    I am getting 6 digit number from the source.
    ex 103924
    in the target i want 1039.24
    Please tell me is there any standard function for this and tell me how to use it.
    regards
    venkat.

    Hi,
    You can use the FormatNumber API and formulate the no as per your requirment.
    Or Best way if the no of digits are not fixed then Multiply the Source field by 0.01
    Source Field--> Multiply (0.001 Constant) --> Target field
    Thanks
    swarup

  • E-Recruitment and Questionares (Standard function modules)

    Hi,
    On HR E-Recruitment I am trying to get a function which I can used to read answers from a given questionnaire. For example for every candidate applying for a requisition/position I want to be able to find which questionnaires they have completed and what answers they have given to a given question. I am hoping that there is a standard function for this. please point me in the right direction.
    If there is no standard solution have any one of you guys done this sort of thing before.
    Regards and many thanks in advance for your help.
    Andy.

    Hello Tania,
    using class cl_hrrcf_qa_bl is really the easiest way as otherwise you would have to read quite a number of tables. I have never had any substantial troubles w/ this class. You might either have not passed the correct parameters or miss some overall configuration, e.g. no candidate for your user.
    Best approach here is in my opinion to check what the cx_hrrcf exception tells you. If you cannot see this in the debugger just add the following to your test program.
    DATA:
      lr_exc TYPE REF TO CX_HRRCF.
    TRY:
    *   your code
      CACTH cx_hrrcf INTO lr_exc.
        cl_hrrcf_exception_handler=>write_exception_log( ex = lr_exc ).
    ENDTRY.
    This will write the error to the application log where you can check it in T-Code SLG1.
    Best Regards
    Roman
    Best Regrads
    Roman

  • Do we have function for automatic post GI when post GR

    Dear Guru,
    Do we have standard function for automatic post GI when we post GR
    or
    Automatic post GR when we post GI?
    We have this requirement but now we don't have a solution except create a new customize program.
    Please kindly advice.
    Thank you very much.
    Saiyaman

    I'm sorry I did not explain the exactly requirement.
    Actually we have pipeline material but I don't want to use material type PIPE.
    So when we post GI the material (261 or 201), we would like to post GR 501 immediately before GI.
    or
    When we post GR 501 of that material, system will automatic post GI material 261 immediately.
    Please kindly advice.
    Thank you.

  • Standard function modules for selection from vbak/vbup/ekko/ekpo

    hi experts ,
    do you know if there is an existing standard function modules for selection from vbak/vbup/ekko/ekpo.
    please help

    Hi,
    for VBAK
    ADSPCM_READ_VBAK               Read VBAK (with SPEC2KM-data)
    PRS_GET_GLOBAL_VBAK            Get global structure VBAK
    Regards,
    Jyothi CH.
    Edited by: Jyothi Chinnabathuni on Feb 23, 2009 2:46 PM

  • "Control + F5"  standard filter functionality for ALV Grids

    Hi all,
    After an ALV Grid is displayed on screen there is a standard functionality to filter a selected column.
    You can select a column (click on the head) of the ALV, then "Control + F5" and a pop-up appears to insert a value or a range by which the filtration is going to be done.
    But a I have problem with a concrete field. It doesn`t seem different on comparison with other fields (CHAR30), but I don`t know why it doesn`t work correctly as others.
    Have you had any situation like this ??
    Thanks & sorry for my bad english,
    Rubè

    Hi Frank,
    When you are entering  89012  and pressing enter the additional zeros are adding up because of the data type of VBELN We have standard conversion routine attached with this .So when ever u wrtie any text that routine will works.
    Can you please check what data type are you using in the internal table that you are binding  to the node?
    Thanks and Regards,
    NSingh
    Edited by: Nsingh on Feb 17, 2012 4:52 AM

  • Where the documentation is provided for the Standard Function module ?

    If there is no documentation provided for the standard function module in SE37 what is the best way to understand the functionality of the function module?Is there any where we can find the documentation?
    Please dont say the From coding part its too vast to understand
    Ex: HRCM_ORGSTRC_INFO_TABLE_GET
    Paint for me ..
    Regards
    sas
    Edited by: Julius Bussche on Mar 18, 2009 1:17 PM

    O Really thanks amit !!
    Are you able to understand the below code and please provide your valuable inputs what we are understanding is the same.
    PERFORM read_infotypes.
    *-- ********************************************************** NMP
    *-- IF scb frozen then write to itab-scb field.  nmp 11/2001.
    *-- ********************************************************** NMP
    *--Begin of Change by vneld - 01/17/2007
    *  IF PA0001-ZZBERN NE SPACE.
    *    FROZEN = PA0001-ZZBERN.
    *  ENDIF.
    *  ITAB-SCB = FROZEN.
    *-- ********************************************************** NMP
    *--end of Change by  vneld- 01/17/2007
      PERFORM get_date USING '92'
                       CHANGING w_hiredate.
      PERFORM get_date USING '93'
                       CHANGING w_rehire.
      PERFORM get_date USING '94'
                       CHANGING w_termdate.
      IF NOT ( w_rehire IS INITIAL ).
        w_hiredate = w_rehire.
        itab-code = 'R'.
      ELSE.
        itab-code = 'H'.
      ENDIF.
      IF p0001-persg = '3'.
        itab-code = 'T'.
      ENDIF.
    *Change by Mdukes
    ** We need HIRE,Rehire & term  within 13 month`s window
    ** But if someone Hire in IT ,change dept and then terminated .
    ** We need to exclude that person from the list  .
    ** We need to change his Org.Unit by END_DATE 12/31/9999 from Pa0001.
      CLEAR:result_tab.REFRESH:result_tab.
      CALL FUNCTION 'HRCM_ORGSTRC_INFO_TABLE_GET'
        EXPORTING
          PLVAR          = '01'
          ROOT_OTYPE     = 'O'
          ROOT_OBJID     = P0001-ORGEH
          BEGDA          = SY-DATUM
          ENDDA          = P0001-ENDDA
          PATH_ID        = EVPATH
          PATH_DEPTH     = 10
        TABLES
          ORG_INFO_TABLE = result_tab
        EXCEPTIONS
          PATH_ERROR     = 1
          ROOT_ERROR     = 2
          OTHERS         = 3.
    *  CALL FUNCTION 'RH_STRUC_GET'
    *    EXPORTING = 'O'
    *      act_objid       = PA0001-ORGEH
    *      act_wegid       =  EVPATH
    *      act_plvar       =  TYPE
    *      act_tflag       = space
    *      act_vflag       = space
    *      authority_check = space
    *    TABLES
    *      result_tab      = result_tab
    *    EXCEPTIONS
    *      no_plvar_found  = 1
    *      no_entry_found  = 2
    *      OTHERS          = 3.
    * reading the Org.Unit based on employee Org.unit (Evaluation Path 'O-O'.
    * After that making sure the latest Pa0001 org.unit is part of selection org.unit
    * If yes, set the flag to = 1 . Otherwise ignore the rec .
    * We want only IT folks hire/rehire/term within 13 monthu2019s window
    * if somebody change the dept and get term within 13 monthu2019s .it
    * Should show up in hire but not in term report .
      CLEAR:REC.
      lOOP AT result_tab.
        read table PCHOBJID with key low = result_tab-OBJID.
        if sy-subrc = 0 .
          Rec = 1.
          EXIT.
        Endif.
      ENDLOOP.
      if rec  = 1.
    *--begin of change by vneld- 01/17/07
        CHECK ( ( w_hiredate >= w_13th_mnth_date AND w_hiredate <= sy-datum )
          OR
              ( w_termdate >= w_13th_mnth_date AND w_termdate <= sy-datum ) ).
    *--end of change by vneld- 01/17/07
    **---check for hires or terms in the calendar year.
    **---No future terms
    *  CHECK ( ( W_HIREDATE(4) = SY-DATUM(4) ) OR
    *  ( W_TERMDATE(4) = SY-DATUM(4) AND W_TERMDATE <= SY-DATUM ) ).
        CONCATENATE p0002-vorna p0002-nachn INTO itab-name SEPARATED BY ' '.
    *--Begin of change by vneld 03/29/2007
    *--get supervisor name
        data : lname(20),
               fname(20).
        clear: lname,
               fname.
        Select vorna nachn from pa0002 into (fname ,lname)
               where pernr =  p0001-zzsuper_no.
        endselect.
        CONCATENATE lname fname INTO itab-supv SEPARATED BY ' '.
    *  itab-supv = p0001-zzsuper_text.
    *--End of change by vneld 03/29/2007
    *----get employee group text
        CLEAR t501t.
        SELECT SINGLE * FROM t501t WHERE sprsl = 'EN' AND
                                         persg = p0001-persg.
        IF sy-subrc EQ 0.
          itab-group = t501t-ptext.
        ENDIF.
        PERFORM get_dept.
        PERFORM get_position.
        PERFORM append_fields.
      endif.
    ENDFORM.                    " PROCESS_EMPLOYEE
    Edited by: saslove sap on Mar 19, 2009 7:45 AM

Maybe you are looking for