Add fields in abap  query

Hi,
  Please let me know , how to add two fields in ABAP Query.  Please it  showing  two fields in list fileds  but i want to add two into one.
thanks,
Sonar

Thanks  for  Inf
Here I want  to  print total  of two fields  into  one  field,  where  concatenate  should  be there
mv_abrmenge, mn_abrmenge  
select ebelnr, htariftyp, csparte, cvertrag, cvkont, mbelzart, cbegabrpe, cendabrpe, mv_abrmenge, mn_abrmenge, e~budat
from erchc as e
join dberchz1 as m
on ebelnr = mbelnr
join erch as c
on mbelnr = cbelnr
join ever as r
on cvertrag = rvertrag
join eanlh as h
on hanlage = ranlage
where h~tariftyp in @p1@
and c~erchc_v = 'X'
and c~simulation = space
and c~tobreleasd = space
and e~budat in @p2@
and e~simulated = space
Thanks,
Sonar

Similar Messages

  • Creation of local field in ABAP Query

    Hi
    Please let me know how to create a local field in ABAP query. I am finding the option inactive in SQ01.
    Regards
    Priyadarshini

    hi priya,
         *__Adding u201CLocal Fieldu201D (user defined field) in SAP Query_ :
    There is also facility to add the user defined fields in SAP query output. Also we can provide calculation formula for calculating values for this user defined field.
    Calculation formula consists of standard fields from standard SAP tables. So the values fetched for particular standard SAP fields from standard SAP tables get calculated as per the calculation formula defined for the user defined field and displays the value accordingly.
    To do this first go to change mode for Query which automatically takes you to screen shown below and click on icon   , as below :
    Then further screen will appears. So select the Field group and again click on the same icon button   .
    Then switch on the Short names for the fields and give the short names to fields which we need to use in Calculation formula.
    Give the short names and then created u201CLocal Fieldu201D, as shown in below screen shot. Also Short names are given to fields, which can be used further for calculation.
    Defining Local Field u201CREM_QTYu201D along with its field type and Calculation formula.
      In this case we have 
      defined field type for new  
      field as similar to
      ORD_QTY and
      Calculation formula is  
      defined.
    Also its possible to have Conditional logic for Local field by putting Condition in u201CConditionu201D line.
    Now activate this newly added Local field for coming it in output screen. To do the same again go to u201CBasic Listu201D and activate the Local Field as shown below :
    i think this will help u
    regards,
    sindhu.

  • Addition of checkbox and 2 fields in ABap query selection screen

    Hi
    I need to add chack boxes and 2 fields in ABAP query which is using LDB QMI. can u pls let me know how to do that.

    Hi Tarun,
    I am still not clear with the problem..I guess you require plant in your selection screen which you have.
    i guess if you go to sq01tcode there is a option infoset query from where you can give your selection options and value.
    have you selected all the fields in infoset and made a selection screen?
    When you have done with your infoset you just need to diplay the fields and there is a automatic program generated.
    Let me know...
    Regards,
    Nihkil.

  • Query: How to add new fields in ABAP query?

    Hi All,
    Can any one tell me how to add new fields in the ABAP query output?
    We have to add the new fields using query design or we have
    to add those in the background program(automatically generated behind query) by selecting new fields in the code?

    What kind of report? Usually, you have to add the field in the table declaration and then also in the SQL query. After that, include the field in what kind of report you are using.

  • Problem in Currency field in Abap Query

    hi.
         I have created an additional field for storing the currency type.
         Based on some calculations i want to store the currency type into this additonal field.But the problem is that the currency field is not getting displayed in the report though i am getting the currency type in the additional field when i check it while debugging. Can anyone help me out...

    Vimal,
      Is it ABAP Query problem(SQ01).If yes, then
      In tcode SQ02(Infotype)>press extras button(F5)>In right side you will find 4 tabstrip buttons.Press on Extras--> create variable with same type of currency.
    goto Field group button--> add this field to field groups.
    In record processing event after your calculations assign your value of cuurncy to this new variable.
    In tcode SQ01-->enter query name >F6>F6>F6>select your new varaible
    >Press on basic list button(shift+F4)>left side you will find additional fields Node From there select your new field-->Save come back and execute the query.Now  you will find your variable.
    Don't forget ot reward if useful....

  • How to hide some fields in ABAP Query

    Hi,
    My ABAP Query has a long list of extracted fields. I wanted to set some of these output to "HIDE".
    This allow User the flexibility to decide what fields to show.
    How can I set the field to "HIDE" in my query?
    Thanks
    bye

    Hi Tim,
    You can do this by setting the Report layout variant in following steps:
    1. First define the parameter on selection screent for report variant.
    2. Data decelaration for variant.
    3. Value request to get already present variants on report:
    4. If doesn't choose the layout take out the default report layout.
    5. Initialize the report variant.
    6. Apply the variant to the REUSE_ALV_GRID_DISPLAY funtion module.
             Here to generate report variant first to open report output and then as per according to user set the layout of report using the layout icon of ALV with summation on value fields (as required) and create layout name.
    *Data Deceleration as below:
    Data :g_save(1) TYPE c,
    **      g_default(1) TYPE c,
    g_exit(1) TYPE c,
    gx_variant TYPE disvariant,
    g_variant TYPE disvariant.
    *First Define the parameter to give layout of Report variant.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
    PARAMETERS: p_vari TYPE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK 3.
    * Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    * Selection-Screen Checking
    AT SELECTION-SCREEN.
    PERFORM pai_of_selection_screen.
    INITIALIZATION.
    w_repid = sy-repid.
    PERFORM variant_init.
    * Get default variant
    gx_variant = g_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 0.
    p_vari = gx_variant-variant.
    ENDIF.
    FORM f4_for_variant .
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
    is_variant = g_variant
    i_save     = g_save
    IMPORTING
    e_exit     = g_exit
    es_variant = gx_variant
    EXCEPTIONS
    not_found  = 2.
    IF sy-subrc = 2.
    MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    **  ELSE.
    **    IF g_exit = space.
    **    ENDIF.
    ENDIF.
    ENDFORM.                    " f4_for_variant
    FORM pai_of_selection_screen .
    IF NOT p_vari IS INITIAL.
    MOVE g_variant TO gx_variant.
    MOVE p_vari TO gx_variant-variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
    i_save     = g_save
    CHANGING
    cs_variant = gx_variant.
    g_variant = gx_variant.
    ELSE.
    PERFORM variant_init.
    ENDIF.
    ENDFORM.                    " pai_of_selection_screen
    FORM variant_init .
    CLEAR g_variant.
    g_variant-report = w_repid.
    ENDFORM.                    " variant_init
    **While Showing report pass the variant :::
    g_save = 'A'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = w_repid
    i_structure_name   = 'IT_MAIN'
    is_layout          = i_layout
    is_print           = i_print
    it_fieldcat        = i_fieldcat[]
    it_events          = i_events[]
    i_save             = g_save
    is_variant         = g_variant
    TABLES
    t_outtab           = it_main
    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.
    Many Thanks / Himanshu Gupta

  • Add field in a query (logical data base)

    Hi,
    I want to add a field in a query .
    The data source of  its infoset is logical database .
    When i tried to drag and drop the field, the alv grid turned to alv list.
    Can you help me.
    thanks,
    Meriem.

    Hi Merim,
    As KAMESH mention,
    you can add  additional fields in your infoset and put the logic for that field in your infoset program and assign the same field in your existing group within infoset.
    once you assign the infoset and generate the infoset then your field will be reflected  in sap Query .
    you can add additional field in your output.
    Regards,
    Prasenjit Mishra

  • How to control attributes in 'Add Fields' in af:query Advance mode

    Hi,
    The VO attributes those set Queriable=false doesn't appear in the Add Fields dropdown in ad:query advance mode.
    But I have few attributes in a VO those required to use in VO query so I cannot set those attrbutes Queriable as false.
    Also observed that QBE doesn't work for the attributes whose Queriable set as false.
    So can someone please suggest me how to achieve below,
    VO attribute which having Queriable=true but doesn't appear in 'Add Fields' dropdown in af:query advance mode.
    JDeveloper version 11.1.1.7.0
    Edited by: user12820425 on Mar 21, 2013 10:16 AM

    Hi Naresh
    Thanks for your reply.
    In ViewCriteria -> UI Hints we can set attribute Rendered Mode as never, but that perticular attribute still appear in 'Add Fields' section.
    I think renderedMode=never means that attribute doesn't appear in Advance or Basic mode user need to manually select that attribute.
    So please suggest me how to achive my requirement.

  • How to make fields in field group as text fields in ABAP query

    Hi friends,
    I a have a ABAP query 85 corresponding to infoset A205,
    there is a field group in the infoset A205 and it contains some fields
    but some of the fields are made as text fields ................i want to know how to make these fields in
    the field group as text fields.
    there is a small icon  " T " on the field when it is made as a text field .
    Please help me
    Thanks & Regards

    Hi,
    IF you can specify which Field Catalog then it will be useful for us to provide appropriate answer.
    1. For Customer Master
    IMG> Financial Accounting New> Acs Recev and Acs Payable --> Customer Accounts --> Master Data --> Preperation of creating customer master Data --> Define Account Groups with screen layout (customers)
    In that you can create your own account group, and click Details Screen.
    There will Field Status header within that are listed three main areas
    General data
    Company code data
    Sales data
    When you double click these lines it will take you into "Status Group" Overview. Wherein under "Select Group" are listed fields Address, communiucation.... Double click on one group , you will bet aken into the group field wherein you will find 4 colums with indicators assigned to it. ( Suppress, Req. Entry, Opt Entry, Display) you can choose the required option. "Req. Entry" against the field. Click save after you complete your selections.
    2. Similarly you can do for Material Master in
    IMG --> Logistics General --> Material Master --> Field Selection --> Maintain Field Selection for Data Screens
    But be careful when you do it for material master as it is cuts across all the modules...
    Regards
    Sathya

  • Including MANDT field in ABAP Query Report as output field

    Hi All,
    I need to display the client(MANDT) field in the ABAP Query Report as an output field.
    But in SQ01 where we select the fields to be displayed as output in query , this field is not visible.
    I later checked in the Infoset. Even in the infoset the field MANDT is greyed out and all other fields are active.
    Can someone tell me how to include the field MANDT in the output of the ABAP Query Report.

    self resolved

  • Search help for field in ABAP Query

    Hi Experts,
    For a particular field in standard table the search help(F4) is not maintained in the table level, which is used in a ABAP query.
    Is there any possibilities for user-defined Search help using InfoSet or Query?
    Please help me in this regard.
    Thanks in advance,
    Balaganesh.

    Hi Bala,
    I understand your question better now.  Since you mention standard selections I assume that your InfoSet is based on a logical database instead of a table join, direct read, or custom data retrieval program.  You are correct that the AT SELECTION-SCREEN ON VALUE REQUEST logic I mentioned earlier will not work for the standard selections of a logical database.  The system gives you an error when generating your InfoSet if you try to use the standard selection name (in ECC 5.0 at least).  I've tried various tricks to attempt to get it to work, but so far no luck. 
    You could, of course, use a different logical database as your InfoSet basis (e.g. VAV has a matchcode on VBAK-VBELN) or create your own data retrieval program and change your InfoSet to use the custom program instead of a logical database.  In the second case you wouldn't need to deal with standard selections at all.  I understand that these solutions are probably not what you need and, in the case of the custom data retrieval program, would be more complex (it may not be worth it to write a custom program just to allow F4 help... or maybe it would be... just depends). 
    Please keep us updated if you find a way to do it.  I'll also report back if I happen to discover a way.
    Best Regards,
    Jamie

  • Increase length of output field in ABAP Query

    Hello All,
    I have one ABAP Query in which inside the  system  generated program for the Query, there is a write statement -
    write 030(020) anlav-invnr
    Because of this statement,  the field invnr is displaying in only 20 chars & the last two chars of the field invnr are not getting displayed.
    I want to display all 22 chars for field invnr.
    How can I increase the output length for this field.
    Please help.
    <vague subject corrected by moderator, please choose a meaningful one next time>
    Edited by: Thomas Zloch on Mar 3, 2010 2:34 PM

    >
    Jain Arpita wrote:
    > write 030(020) anlav-invnr
    Means displaying INVNR field at 030th position with 20 chars width. To increase the width you just give 022 instead of 020 like below.
    write 030(022) anlav-invnr
    Thanks
    Venkat.O
    Edited by: Venkat.O on Mar 3, 2010 11:28 AM

  • Hide 'Add Fields' in af:query

    Hi guys,
    I just want to hide 'Add Fields' alone in advanced section of af:query.
    Is it possible?
    Thanks in advance
    Dev

    There are two possible solutions:
    1. you can add a skin selector and hide hte footer component, which holds the button to add fields.
    in your skin.css file add
    .AFMyQuery af|query::footer-facet-content-style
      display: none;
    }and put this as AFMyQuery as styleClass onto the af:query
    ... styleClass="AFMyQuery"...2. you add a af:spacer into the footer facet of the af:query and set it's height and width to 1px. This will hide the button too. From the doc
    . If a footer is not specified then an 'Add Fields' dropdown is automatically added to the facet. If a footer facet is specified, (that includes custom buttons for example) the default 'Add Fields' dropdown will not appear and users are required to specify it explicitly in the footer facet along with the other content if this functionality is desired.add this to the af:query
                                           <f:facet name="footer">
                                                <af:spacer width="1" height="1" id="s1"/>
                                            </f:facet>
                                        </af:query>Timo

  • How to sort the fields in ABAP query.

    Hi all
    I am not able to drag the fields in Sort tool box.
    Please help me how to add the fields in Sort tool bar.
    Regards
    Gangi

    In SQ01, when we are creating a query, we can define the default sort sequence & Totals also.
    This can be done when defining the basic list.

  • Inserting addition field in ABAP query (SQ01) while generating reports.

    Please let me know the procedure of adding field and applying mathematical  formula in the query.

    Hi,
    have a look at the help <a href="http://help.sap.com/saphelp_erp2005/helpdata/EN/d2/cb4138455611d189710000e8322d00/frameset.htm">Creating and Changing Queries</a>. I doubt that you can add real formulas besides the predefined statistics.
    Regards,
    Christian

Maybe you are looking for