Single Parameter using 2 fields

Hi Experts,
I have a requirement where in i have to create a parameter on two fields ID and Description. These are two different fields and i have to give them to user in a parameter separated a '-'.
Also i have 2 date fields Start Date and End Date. But i have to give them to the user as a single Date Range Parameter.
Any Help??
Regards,
Raja

Hi Abhilash,
Thanks for your reply.
I will try the first one like you said.
Where as the second one, what i am not sure here is, since Start Date and End Date are 2 different fields, how can i set them up in select expert to form a single parameter?
If i create a parameter on Start date then i will be setting it up in Select Expert as:
Start Date ={StartDate}
So i can create 2 different parameters for both Start Date and End Date. How can create a range parameter such that the first selection will be Start Date and the second selection will be End Date?
Regards,
Raja

Similar Messages

  • How can i concatenate single quote to a field symbol

    hi
    i have a senario where i have to concatenate a single quote (') to the field symbol. it is simple but i' m not able to do that.
    concatenate ''' <f> ''' into lv_f.
    CONCATENATE lv_condition_temp lv_f INTO
                                   lv_condition_temp
                                           SEPARATED BY space.
    this is the code which i used. could someone help me in solving this...
    thanks & regards,
    subha....

    hi
    i tried using the following code
    data : lv_text(10) type c.
    concatenate ''' <f> ''' into lv_text.
    it is giving me a spelling or incorrect comma error.
    thanks & regards,
    subhashini.

  • Answers - would like to use calculated field's name, not expression

    Hi Everyone,
    I'am trying to make several calculated fields in a single query in Answers. Each field references the previous one, and the expression of the first one is already 5 rows long.
    Now I reference it in the second calculated field by using "Edit Formula" -> "Column" -> 'Colum name'.
    My problem is, that it puts the expression of the previous field, not it's name. I have to use it for almost 10 times in this single expression, so -although it works fine- it is totally unreadable, and very hard to debug for example.
    And after all, I should use this field again, in several next calculated fields.
    Does anyobody have an idea, how to make calculated fields having only the name of referenced other fields in it?
    The repo is set for ad hoc reporting also, so using session variables which need to be set in Administrator Tool, is not an option.
    Thanks for help in advance.
    Tom
    Message was edited by:
    user608765

    Hi Venkat,
    thanks for the response. It would work, no doubt, in this special case, the problem is, that users use the repo for ad-hoc reporting aswell (and they don't have access to repo administration of course), so one can count on it, that there would be a new request of this kind every day to change the repo with customized user variables. I would like to avoid this of course.
    Having the name of a referenced field in a new expression would be a simple solution. Is it possible, that it can't be done?
    Tom

  • Var-arg doesn't work as I think for single parameter methods

    Hello,
    I was playing with var-args and after running the following code I really couldn't understand why the compiler picks the answer for the single parameter method call, when surely it should find an exact match with the var-arg method?
    The first two obviously use the var-arg call, but why the last? I would have thought the compiler would only go back up the class until it reached an exact match then stop, which the single parameter version matches exactly the var-arg.
    class FourByFour {
         public void changeGear(long x) {
              System.out.println("4x4");
    class Ford extends FourByFour {
         public void changeGear(int... x) {
              System.out.println("Ford");     
    public class trial {
         public static void main(String[] args)
              Ford c = new Ford();
              c.changeGear(1,2);
    c.changeGear(new int[]{1});
              c.changeGear(1);
    btw, the base is only a long because I wanted to see whether it would still prefer casting to the var-arg.

    But surely the int var-arg matches exactly the single parameter call? var-arg takes 0 or more parameters, so passing in one parameter is a full match and more so than it's base class long? Maybe I'm just getting mixed up with how var-args are interpreted as internally?
    As for 'back up the class' I assumed it first checks the current objects methods, then checks it's super methods, etc. but if it finds an exact match on a method, to save wasted time it would stop right there, e.g.
    class A { void method(long x){}}
    class B extends A {void method(int x){}}
    calling new B.method(x) with an int would obviously call B's and not A's and would not bother checking with A's because it is an exact match with B, which is sort of how I interpreted passing in a single int to a var-arg. Or, swapping the two signatures around it would call A's because if B's had a long it would not be an exact match and so it's base class is called.

  • How to pass value to select-option parameter using SET PARAMETER Command

    Hi,
        Am passing values to selection-screen fields in report RV13A004 ( used in VK11, VK12 and VK13). using below statement but material number is select-option in this report. am able to pass  MATERIAL FROM using SET PARAMETER ID, can i know how to pass values MATERIAL TO range in select-options fields using SET PARAMETER Command ??
    Passing values to parameter id
    set parameter id 'VKS' field kschl.
    set parameter id 'VKO' field vkorg.
    set parameter id 'VTW' field vtweg.
    set parameter id 'KDA' field erdat.
    set parameter id 'MAT' field matnr_from.
    Change condition price.
    call transaction 'VK12' and skip first screen.
    Thanks in advance.
    Regards,
    Balamurugan.

    Hi,
    instead of using set parameters and dden call transaction use this..........
    submit RV13A004  WITH SELECTION-TABLE rspar
    Effect
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    Notes
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
    When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.
    Cheers
    Will.

  • Proper use of Field symbol .. please help

    what is the proper use of field symbol in sap abap ?
    Moderator Message: Please do a proper search for such basic questions.
    Edited by: kishan P on Sep 13, 2010 4:01 PM

    hi Gopal,
    The parameter is used to color a cell in ALV grid.
    See this example how it is used
    http://www.sap-img.com/abap/line-color-in-alv-example.htm
    take a closer look at the code where the info is passed
    MOVE 'MATNR' TO wa_color-fname.
            MOVE '6'         TO wa_color-color-col.
            MOVE '1'         TO wa_color-color-int.
            MOVE '1'         TO wa_color-color-inv.
            APPEND wa_color TO it_color.
    Cheers
    VJ
    If it helps dont forget to mark points

  • OneToManyMapping using 2 fields to join

    I have a Note object that can be joined with several different tables. I've accomplished this by using 2 fields in my relationships. For example, lets say Notes can be attached to Users and Documents.
    Notes
    ID
    NOTETEXT
    OBJCODE - determines the type of object it is linked to
    OBJID - FK to one of several tables
    Users
    ID
    OBJCODE - always "USER"
    Documents
    ID
    OBJCODE - always "DOCU"
    A Note with OBJCODE="USER" and OBJID="2" links with User(ID=2). OBJCODE="DOCU" and OBJID="1002" links with Document(ID=1002)...
    My OneToManyMappings are set up in User as follows:
    setAttributeName("_notes");
    setReferenceClass(Note.class);
    useCollectionClass(ArrayList.class);
    setUsesIndirection(true);
    setTargetForeignKeyFieldNames( new String[]{"T_NOTES.OBJID", "T_NOTES.OBJCODE"}, new String[]{"T_USERS.ID", "T_USERS.OBJCODE"});
    This works great. However, I don't want to map the OBJCODE field in User. That is I don't want a separate DirectToFieldMapping for that field in the User Descriptor. The value is defaulted by the DB, my object returns the same value, and it's just a waste.
    However, if I don't have this DirectFieldMapping in User for OBJCODE, TopLink gives me an error trying to load Notes.
    If I call user.getNotes();// this causes the ValueHolder to trigger a query for related Notes
    The error is:
    Exception [TOPLINK-6094] (OracleAS TopLink - 10g (10.0.3) Developer Preview (Build 040222)): oracle.
    toplink.exceptions.QueryException
    Exception Description: The parameter name [OBJCODE] in the query's selection criteria does not match
    any parameter name defined in the query.
    Query: ReadAllQuery(test.project.Note)
    at oracle.toplink.exceptions.QueryException.parameterNameMismatch(QueryException.java:686)
    at oracle.toplink.internal.expressions.ParameterExpression.getValue(ParameterExpression.java
    :158)
    at oracle.toplink.internal.databaseaccess.DatasourceCall.translateQueryString(DatasourceCall
    .java:541)
    at oracle.toplink.internal.databaseaccess.DatabaseCall.translate(DatabaseCall.java:852)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(Datasourc
    eCallQueryMechanism.java:128)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(Datasourc
    eCallQueryMechanism.java:110)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(Dat
    asourceCallQueryMechanism.java:190)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(Datasou
    rceCallQueryMechanism.java:503)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(Ex
    pressionQueryMechanism.java:776)
    at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQ
    ueryMechanism.java:751)
    at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:447)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:518)
    at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:108)
    at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2088)
    at oracle.toplink.threetier.ServerSession.internalExecuteQuery(ServerSession.java:620)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1101)
    at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHold
    er.java:57)
    at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java
    :63)
    at oracle.toplink.internal.indirection.UnitOfWorkQueryValueHolder.getValueFromWrappedValueHo
    lder(UnitOfWorkQueryValueHolder.java:60)
    at oracle.toplink.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHold
    er.java:149)
    at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java
    :63)
    If I put the DirectToFieldMapping for OBJCODE back in User, then it works fine.
    My question is, why does my DirectToFieldMapping effect the definition of my OneToManyMapping? I really don't want to have to query for this, as I mentioned it's just a waste.
    Are there any workarounds?
    Nate

    Thanks for the feedback.
    Yes, I was referring to the Batch Reading issue. It is the big reason we can't plug 10.1.3 into our dev code (of course haven't tested JTS support and JMS cache synch with 10.1.3 either).
    My idea here was that perhaps by using setSelectionCriteria(), I could work around this issue by replacing my mapping with a more or less equal solution.
    Granted the M-M relationship is a good solution as it enables you to take advantage of FK relationships. However, I have 1 major problem with designing it this way: I have a common use case of querying "Notes" and displaying properties of its "referencedObject" (User, Document, etc.) which all implement a "NotesAttachable" interface. VariableOneToOneMapping works perfectly for this.
    The other thing I like about using SelectionCriteria is that I don't have to have a mapping for the "OBJCODE" field which essentially the same value for every row. The only reason I have mapped that field now is so that the 1-M mapping works.
    My goal was to kill 2 birds with 1 stone: gain a workaround for a bug in 10.1.3, eliminate the need for a redundant mapping.
    It sounds like this may be an option to explore.
    Thanks,
    Nate

  • Filter two prompts based on selection of single parameter

    <p>The following is the scenerio that I want to implement in my enviorment using dynamic and cascading parameters, please suggest; if this is at all possible, if so, any pointers will be helpful:</p><p>I have four parameters namely ParaA, ParaB, ParaC and ParaD</p><p>On ParaA selection selection; the parameter values of ParaB, ParaC and ParaD should get filtered. </p><p>In examples; I could only find single parameter cascading; not multiple parameter cascading</p><p>Thanks<br />Srinath</p>

    Hi ,
    You can do that by Binding Parameters Create Dynamic Paramater for ParaA and in the Same Parameter Group Create ParaB,C,D and then Bind Parameter D .....
    You can use Business Views to do that...........If you are using Crystal Reports XI click in the Parameters option for ParaD to bind ....
    Thanks
    RahulÂ

  • FB01 - Can we use assignment field to mention GL Account ?

    Dear Experts,
    We have a requirement regarding India GAAP and in this regard kindly share your valuable inputs.
    We are going with account solution ( maintaining multiple accounts)
    Current Plan
    In this context, we have to maintain many GL Accounts.
    Hence we want to maintain  few GL Accounts say a single P&L Accounts for IGAAP, wherein while posting IGAAP accounting entry.
    We wish to use assignment field to reference the original GL Account against which this valuation entry is posted
    Eg: As per US GAAP
           400000 GL Depreciation  Plant & Machinery Debit $5500
           200000 GL Accumulated Depreciation Plant & Machinery Credit $5500
          As Per IGAAP, Depreciation amount is $6100, hence the valuation difference ( $6100-$5500= $600)
    Line 1-     999999 IGAAP Depreciation Valuation Difference Debit $600
    Line 2-      299999 I GAAP Accumulated Difference Credit $600
    In the Line Item 1 , in the assignment field , we mention GL Account 400000 as reference and
    in the Line Item 2 , in the assignment field , we mention GL Account 299999 as reference.
    Query
    Can we make a setting in assignment field that GL Account only should be used for the document type, otherwise it should an error.
    Note: We would be using seperate document type for the above IGAAP postings.
    Regards
    Sanjai 

    Hi,
    You can set up a validation for this through OB28.
    Thanks,
    Vinod.

  • How to link a search help to a parameter using which syntax

    hi
    how to link a search help to a parameter using which syntax

    Hi
    by useing this <b>F4IF_INT_TABLE_VALUE_REQUEST</b> you can creat a search help for a parameter on the screen
    under <b>AT SELCTION-SCREEN ON FIELD</b>
    write a selct query and store that values in the internal table and call that internal table in that FM
    <b>example</b>
    TYPES : BEGIN OF ST_OBJID_SH,
             OTYPE TYPE HRP1000-OTYPE,
             OBJID TYPE HRP1000-OBJID,
            END OF ST_OBJID_SH.
    DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
    DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
    *  IF S_OBJID IS NOT INITIAL.
        SELECT OTYPE OBJID FROM HRP1000
                     INTO TABLE IT_OBJID_SH
                     WHERE OTYPE = 'D'.
    IF SY-SUBRC EQ 0.
    * SEARCH HELP FOR QUALIFICATION.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
    *              DDIC_STRUCTURE         = ' '
            RETFIELD               =  'OBJID'
    *              PVALKEY                = ' '
           DYNPPROG               = SY-REPID
           DYNPNR                 = SY-DYNNR
           DYNPROFIELD            = 'S_OBJID'
    *              STEPL                  = 0
    *              WINDOW_TITLE           =
    *              VALUE                  = ' '
           VALUE_ORG              = 'S'
    *              MULTIPLE_CHOICE        = ' '
    *              DISPLAY                = ' '
    *              CALLBACK_PROGRAM       = ' '
    *              CALLBACK_FORM          = ' '
    *              MARK_TAB               =
    *            IMPORTING
    *              USER_RESET             =
          TABLES
            VALUE_TAB              =  IT_OBJID_SH
    *              FIELD_TAB              =
    *              RETURN_TAB             = RETURN_TAB
    *              DYNPFLD_MAPPING        =
    *            EXCEPTIONS
    *              PARAMETER_ERROR        = 1
    *              NO_VALUES_FOUND        = 2
    *              OTHERS                 = 3
        IF SY-SUBRC <> 0.
    *           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    <b>Reward if usefull</b>

  • Any way of specifying a single parameter in the workbook title? - Disc. 10g

    Hi!
    I'm looking for a way to insert a single parameter value in my report title. I'm using Discoverer Desktop 10g.
    Can anyone guide me on this?
    Thanks and regards,
    Aparna

    Hi,
    You should be able to add a reference to the parameter in your report title. So if you parameter is called Employee Number add &Employee Number into the report title.
    Rod West

  • Passing ALL values to a single parameter

    In Bi Publisher Report, I need to pass 'ALL' values to a single parameter
    Here is brief explanation about my requirement,
    I have 3 parameters
    Parameter A,
    Parameter B,
    Parameter C
    I have to pass ALL values to last parameter i.e; Parameter C and the rest should pass only single value, how should I do that?
    Any help would be greatly appreciated.
    Thank you

    Hi,
    have a look here: http://www.oracle.com/global/de/community/bip/tipps/dynamische_queries/index_en.html
    This might give you an idea how to work with multi-value parameters.
    Regards
    Rainer

  • ALV report using the field catalog

    which is the quickest way to generate an ALV report using the field catalog merge.  without needing to build the field catalog manually .
    is it easier to create a structure and passe it in the field catalog merge .  if yes can i have an example plzzzz

    hI
    Supports the creation of the field catalog for the ALV function modules
    based either on a structure or table defined in the ABAP Data
    Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its
    Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for
    rapid prototyping since the following restrictions apply:
    o Performance is affected since the code of the table definition must
    always be read and interpreted at runtime.
    o Dictionary references are only considered if the keywords LIKE or
    INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields
    are output in the list by default whereas the remaining fields are only
    available in the field selection.
    If the field catalog is passed with values, they are merged with the
    'automatically' found information.
    Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
    display it using the basic ALV grid functionality(including column total). The example details the main
    sections of coding required to implement the ALV grid functionality:
                             Data declaration
                             Data retrieval
                             Build fieldcatalog
                             Build layout setup
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
    *            i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
    *            IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
    *            is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL

  • [Forum FAQ] How to use multiple field terminators in BULK INSERT or BCP command line

    Introduction
    Some people want to know if we can have multiple field terminators in BULK INSERT or BCP commands, and how to implement multiple field terminators in BULK INSERT or BCP commands.
    Solution
    For character data fields, optional terminating characters allow you to mark the end of each field in a data file with a field terminator, as well as the end of each row with a row terminator. If a terminator character occurs within the data, it is interpreted
    as a terminator, not as data, and the data after that character is interpreted and belongs to the next field or record. I have done a test, if you use BULK INSERT or BCP commands and set the multiple field terminators, you can refer to the following command.
    In Windows command line,
    bcp <Databasename.schema.tablename> out “<path>” –c –t –r –T
    For example, you can export data from the Department table with bcp command and use the comma and colon (,:) as one field terminator.
    bcp AdventureWorks.HumanResources.Department out C:\myDepartment.txt -c -t ,: -r \n –T
    The txt file as follows:
    However, if you want to bcp by using multiple field terminators the same as the following command, which will still use the last terminator defined by default.
    bcp AdventureWorks.HumanResources.Department in C:\myDepartment.txt -c -t , -r \n -t: –T
    The txt file as follows:
    When multiple field terminators means multiple fields, you use the below comma separated format,
    column1,,column2,,,column3
    In this occasion, you only separate 3 fields (column1, column2 and column3). In fact, after testing, there will be 6 fields here. That is the significance of a field terminator (comma in this case).
    Meanwhile, using BULK INSERT to import the data of the data file into the SQL table, if you specify terminator for BULK import, you can only set multiple characters as one terminator in the BULK INSERT statement.
    USE <testdatabase>;
    GO
    BULK INSERT <your table> FROM ‘<Path>’
     WITH (
    DATAFILETYPE = ' char/native/ widechar /widenative',
     FIELDTERMINATOR = ' field_terminator',
    For example, using BULK INSERT to import the data of C:\myDepartment.txt data file into the DepartmentTest table, the field terminator (,:) must be declared in the statement.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,:’,
    The new table contains like as follows:  
    We could not declare multiple field terminators (, and :) in the Query statement,  as the following format, a duplicate error will occur.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,’,
    FIELDTERMINATOR = ‘:’
    However, if you want to use a data file with fewer or more fields, we can implement via setting extra field length to 0 for fewer fields or omitting or skipping more fields during the bulk copy procedure.  
    More Information
    For more information about filed terminators, you can review the following article.
    http://technet.microsoft.com/en-us/library/aa196735(v=sql.80).aspx
    http://social.technet.microsoft.com/Forums/en-US/d2fa4b1e-3bd4-4379-bc30-389202a99ae2/multiple-field-terminators-in-bulk-insert-or-bcp?forum=sqlgetsta
    http://technet.microsoft.com/en-us/library/ms191485.aspx
    http://technet.microsoft.com/en-us/library/aa173858(v=sql.80).aspx
    http://technet.microsoft.com/en-us/library/aa173842(v=sql.80).aspx
    Applies to
    SQL Server 2012
    SQL Server 2008R2
    SQL Server 2005
    SQL Server 2000
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • How to deal with single quote (') in a field value?

    I can successfully insert value with single quoet using
    Prepared statement with placeholder(?) construct .
    I can also successfuly use value with single quote(') in
    WHERE clause.
    My question is, is there a way to use string with single
    quote if a Statement like:
    String slqString ="INSERT INTO customers (name, address) VALUES ( 'O'Reilly Bob', 'St Mary's Street') ";
    Statement sqlStmt = con.createStatement();
    sqlStmt.executeUpdate(sqlString);
    The last statement will thow an SQLException because due to single quotes
    Any ideas?

    I think the question was regarding the ' in O'Reily. Use ' twice when using the Statement interface, i.e.
    ("O''Reilly Bob", "St Mary''s Street")
    So that's two single quotes, not a double quote, to successfully insert a single quote, if you know what I mean....
    But like you said PreparedStatement does things like this for you.

Maybe you are looking for