How to get the fields in a display variant

Hello gurus,
I have created variants for an ALV display that I can select on my selection. This works fine.
Now I need to know during the execution of the program what are the fields that have been selected in the display variant so that I can export the selected fields in an excel sheet that I send by mail. The file is currently being sent with all the possible fields .
Is there a module function that allows the program to know which field is present in the display variant?
Thanks,
Parvez

Hi,
Try these:     REUSE_ALV_VARIANT_DEFAULT_GET.
     REUSE_ALV_VARIANT_F4.
.also see the link for more Details:
http://www.abapcode.info/2008/09/selecting-variants-for-initial-alv-list.html.
Hope it helps.
Regards,
Rahul

Similar Messages

  • How to get the field COMPLETION in extract layout

    Hi,
    Does anyone knows How to get the field COMPLETION in extract layout? i have not been able to find it and it is imperative to have it for implementing a new evaluation.
    Thanks a lot for your help.
    CAMILO URIBE

    Hi Neil,
    The following steps describe what we did to get the new evaluation:
    1. Define Attributes and Object Types for Evaluations: here we added a new field for evaluation. The field was COMPLETION (degree of processing in percent), with relevant object "TASK". "No Summarization" was configurated as Rule for Summarization
    2. Define Extract Layouts: here we created a new extract layout for evaluation. The objects and attributes to be used were defined (the field COMPLETION  was defined as attribute).
    3. Assign Extract Layouts to Project Types.
    4. Define Evaluations: the new layout for evaluation were created using the attributes.
    5. Define Severity.
    6. Define Threshold Values. In the new evaluation the field COMPLETION was used in the formula.
    After configurating and testing, we have noticed that the values of field COMPLETION are not taking into account. It does not matter which value it has, evaluation always take 0.
    Thanks for your help,
    CAMILO URIBE

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to get which fields are currently displayed by ALV?

    Hi ,
    I have a program which displays list in the form of ALV . I have a parameter on the screen which takes the layout name from the user. At the same time I have the parameter which takes the filename from the user.
    Now the program should write only those fields to the file which are displayed on the screen depending on the layout.
    How can I get the names of the fields which are displayed on the ALV layout so that I can write only those fields to the file ?
    [Here the requirement is such that we have to provide seperate download to file option even if we have the same functionality provided by the ALV]
    Please suggest.
    Naina

    YOu can use one these FMs before filling up your download table:
    REUSE_ALV_GRID_LAYOUT_INFO_GET
    REUSE_ALV_LIST_LAYOUT_INFO_GET
      IF g_grid IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
             IMPORTING
                  es_layout      = g_layout
                  et_fieldcat    = g_fieldcat_tab[]
                  et_sort        = g_sortfields_tab[]
                  et_filter      = g_filter_tab[]
    *           ES_LIST_SCROLL = G_SCROLL
                  es_variant     = g_variant
             EXCEPTIONS
                  no_infos       = 1
                  program_error  = 2
                  OTHERS         = 3.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
          IMPORTING
            es_layout      = g_layout
            et_fieldcat    = g_fieldcat_tab[]
            et_sort        = g_sortfields_tab[]
            et_filter      = g_filter_tab[]
            es_list_scroll = g_scroll
            es_variant     = g_variant
          EXCEPTIONS
            no_infos       = 1
            program_error  = 2
            OTHERS         = 3.
      ENDIF.
    Regards,
    Naimesh Patel

  • How to get the field's type in the database with jdbc?

    How to get the one filed's type(varchar,int,long...etc) with jdbc??
    Can u help me??
    It's best that giving a sample code..

    Thx for your reply,BheegaChicken! But i use it with
    oracle9i jdbc..It doesn't return to my the fields
    type correctly..
    This is problem is caused by oracle jdbc??
    Can u tell me??It depends on the driver classes you are using... some of them don't have an implementation for those methods and you won''t get anything useful. Check the driver documentation.
    ***Annie***

  • How to get the field of customer PO no

    I cannot get the field of customer PO no in 2LIS_11_VAHDR and 2LIS_11_VAITM , please give me a hand to tell me where to get it or how to do can get the customer PO no which in sales order overview,thanks

    Hi Jeff
    please refer SAP approved doc for data source enhancement..
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/302d4b15-5847-2a10-93bb-9c45d9f06b16
    hope this works and if still issue persists try searching in SDN for documents relating to datasource enhancement , sure u will get a lot of it.
    Thanks
    Manesh

  • How to get the field type from the database dictionary in screen painter

    hi,
    I wanted to create a new input field that input field should have the data element from the structure that i have created. How to get the data field type from the database dictionary in the screen painter

    hi
    good
    there is two kinds of evernt
    PROCESS ON HELP-REQUEST
    PROCESS ON VALUE-REQUEST.
    which ll help you to give two types of help one is f1 help and another one is f4 help
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/47/e07f622b9911d2954f0000e8353423/content.htm
    thanks
    mrutyun

  • How to get the field texts from abap dictionary into screen Text fields

    Hi SapAll.
    here i have got to modify one zscreen by adding 1 more field,when i added one field in teh screen by just writng the code in program as SELECT-OPTIONS ilart FOR CAUFVD-ILART.
    but iam unable to get the field text for the text field from teh table CAUFVD.
    CAN ANY BODY HELP ME IN THIS.
    regards.
    varma

    Hi Varma,
    Even if you want to personalise the Text also you can do without checking the DICTREF checkbox. Dirctly you can give the text in the Text elements by using the Menu GOTO -> Text Elemetns -> Selection Texts.
    Regards
    Thiru

  • How to get the field in table.

    hi Guru,
    My Requirment is I hava table ZSample.
    Field:
    1.Name
    2.Age
    3.Class
    4.Country.
    Is it possible to get the field . Bye Coding.
    And i want store it in a StringTable.
    Regards
    Vivekananthan.S

    Hello,
    You can use ABAP RTTS for that.
    Follow the examplo below:
    DATA: itab TYPE TABLE OF sflight.
    DATA: ref_table        TYPE REF TO cl_abap_tabledescr,
          ref_struct        TYPE REF TO cl_abap_structdescr,
          fields_table     TYPE abap_compdescr_tab.
    FIELD-SYMBOLS: <field> LIKE LINE OF fields_table.
    ref_table  ?= cl_abap_tabledescr=>describe_by_data( itab ).
    ref_struct ?= ref_tb->get_table_line_type( ).
    fields_table[] = ref_struct->components.
    LOOP AT fields_table ASSIGNING <field>.
      WRITE: / <field>-name.
    ENDLOOP.
    The reference variable to CL_ABAP_TABLEDESCR describes the table . You have to cast from CL_ABAP_TYPEDESCR in order to have the reference variable ref_tb accessing both CL_ABAP_TABLEDESCR and CL_ABAP_TYPEDESCR.
    After this, you need to identify the line of this table, you do so using a reference for CL_ABAP_STRUCTDESCR. Again, cast is needed here CL_ABAPTYPEDESCR reference is
    returned from GET_TABLE_LINE_TYPE( ) method. By this way you will have access to the
    table where the fieldnames you need are described.
    After that, you can use as a common internal table.
    I've done this on WebAS 6.20, maybe in SAP 4.6 (and below) these classes won't be available.
    Also, there's an eLearning on SDN about generic programming.
    Regards,
    Eduardo

  • How to get the Number of lines displayed in  table control in bdc

    Hi,
    when we write a  bdc for a standard transaction, if we encounter a table control, we fill the values for each record like field(01), and the second record field(02) .......and so on..
    if only 3 records are displayed in the screen and if we have 5 records to be filled in the table control, how to write the logic for that?
    how to track of how many lines are getting displayed in the table control .. again it depends on the screen resolution i think..
    useful answers will be rewarded
    shekhar

    Hi,
    Here is the solution code for this :-
    data for controlling paging on screen 0102 
    DATA: W_MAXLINES(2) TYPE N, 
    W_NEXT_LINE(3) TYPE N, 
    W_PAGE(1), "y = page forward, n otherwise 
    W_SCRLEN(2) TYPE I, 
    W_SCRLINE(2) TYPE I. 
    DATA: BEGIN OF W_HDR. 
    INCLUDE STRUCTURE D020S. 
    DATA: END OF W_HDR. 
    DATA: BEGIN OF W_FLD OCCURS 100. 
    INCLUDE STRUCTURE D021S. 
    DATA: END OF W_FLD. 
    DATA: BEGIN OF W_LOG OCCURS 20. 
    INCLUDE STRUCTURE D022S. 
    DATA: END OF W_LOG. 
    DATA: BEGIN OF W_MC OCCURS 20. 
    INCLUDE STRUCTURE D023S. 
    DATA: END OF W_MC. 
    DATA: BEGIN OF W_DYNPRONAME, 
    PROGRAM(8) VALUE 'SAPMM60X', 
    DYNPRO(4) VALUE '0102', 
    END OF W_DYNPRONAME. 
    FORM GET_MAX_LINES. 
    set w_maxlines to the number of var-loop occurrences on the screen so 
    that we know when to page forward on screen 0102 
    also initialise w_next_line to zero for GET_NEXT_LINE 
    this subroutine caters for all cases - including screens without loops 
    CLEAR: W_MAXLINES, 
    W_NEXT_LINE. 
    IMPORT DYNPRO W_HDR 
    W_FLD 
    W_LOG 
    W_MC 
    ID W_DYNPRONAME. 
    LOOP AT W_FLD WHERE LTYP EQ 'L'. 
    MOVE W_FLD-LINE TO W_SCRLINE. "first var-loop line 
    MOVE W_FLD-LBLK TO W_SCRLEN. "depth of loop block 
    EXIT. 
    ENDLOOP. 
    IF SY-SUBRC EQ 0 
    AND W_SCRLEN NE 0. 
    sy-srows = total no of lines on screen 
    w_scrline = actual first line of loop so that 
    w_scrline - 1 = number of heading lines (before loop) 
    4 = no of lines at top of screen - command line, pushbuttons, 2 ulines 
    3 = no of lines after loop - uline & Page count 
    w_scrlen = no of lines in loop block 
    w_maxlines = sy-srows - ( wscrline - 1 ) - 4 - 3 
    and then 1 less but not sure why! 
    W_MAXLINES = SY-SROWS - W_SCRLINE - 1 - 4 - 3. 
    W_MAXLINES = W_MAXLINES - 1.
    W_MAXLINES = W_MAXLINES DIV W_SCRLEN. 
    ELSE. 
    MOVE 99 TO W_MAXLINES. "this required if no screen loop 
    ENDIF. 
    ENDFORM. 
    FORM GET_NEXT_LINE. 
    set w_page if page forward is required 
    W_NEXT_LINE = W_NEXT_LINE + 1. 
    IF W_NEXT_LINE GT W_MAXLINES. 
    W_NEXT_LINE = 1. 
    W_PAGE = 'Y'. 
    ELSE. 
    W_PAGE = 'N'. 
    ENDIF. 
    ENDFORM. 
    Hope it helps.
    reward if helpful.
    Regards,
    Sipra

  • How to get the field names of a table

    hi all,
    i need to get all field names of a table. here i dont need any data. i need only field names.
    initially i used this query, select * from tname;
    the problem is if table have 1000 records, all records will be in memory.
    how to get this one.
    regards
    pavan.

    hi all,
    thanks a lot. the query is working.
    initially i given this query
    select column_name from user_tab_columns where table_name='mytable';
    but no rows selected.
    and i tried with this,
    select column_name from user_tab_columns where table_name='MYTABLE';
    this is working fine.
    thanks
    pavan.

  • How to get the field row name of database from a form?

    Hello experts,
    I am newer in OIM and developments with the API's.
    I have this environment,
    one resource that have the attribute department
    relationship with the database row
    UD_RESOURCE1_DEPARTMENT and other resource with the same attribute in, UD_RESOURCE2_DEPARTMENT
    I am programing one java class that put values in the
    form field through the table name, sample,
    UD_RESOURCE_DEPARTMENT.
    I let some code:
    # Hash table with the value of Department
    myMap.put("UD_RESOURCE_DEPARTMENT", value);
    # and save in the resource form
    tcFormInstanceOperationsIntf tcform = (tcFormInstanceOperationsIntf)tcUtilityFactory.getUtility(dataProvider,"Thor.API.Operations.tcFormInstanceOperationsIntf");
    tcform.setProcessFormData(Long.parseLong(formKey), myMap);
    But this solution implies know the name of the field in the database and not is a global solution.
    I am interesting in know how I can obtain the name of the
    row field of the database for the atribute. Does anybody know how to obtain the row field name of database from an IT Resource or through the field name of the form?
    Is this the correct way to store data in a form?
    Thanks in advanced.

    Hi,
    Thank you.
    I have seen this function in the OTN help, but how can i get the index number. My requirment is when saving the data, I need to save both the value and the element name into the database,
    Also it is tabular block, more than one rows
    Thanks again

  • How to get the field

    Hi SAP GURUS,
    I m working in SAP  CRM5.0. when i m going to t code BUSB I m seeing the screen field and data base field. In field name (DATA BASE) I m getting 302 fields those r available in BP Screen. But in BP screen their r 2 fields (NAME_FIRST AND MC_NAME1). I m nt able to see  the NAME_FIRST field in BUSB t code but MC_NAME1 is available  How they r related.
    Thnx
    Chinu

    answeded

  • How to get the field id of an UserField

    Hello,
    in my AddOn i add an UserField to the table "OCRD". Later i have to change this field. I tried to initiate the UserField object with the method "GetByKey". This method needs two parameters:
    - TableName as string : "OCRD"
    - FieldID as integer : ???
    How can i get the FieldID of my created UserField?
    King regards
    Christian Niehaves

    Hello Christian,
    you can either use a recordset, to query the table CUFD, where all the userfields are stored. Using the table name (tableID), and the filed name (AliasID), you can have the FieldID
    an other solution is going thru the collection of userfield of your table
    dim i as integer
    For i=0 to MyUserTable.UserFields.fields.count-1
        if MyUserTable.UserFields.fields.tem(i).Name = YourFieldName then
          'i has the value you need
        end if
    next
    HTH
    Sebastien

  • How to get the field name in the PAI

    Hello All.
    I have to run a FM on one of two fields in the screen.
    I don't want to write two different moudles to these fields like this:
      FIELD scr100-lenum1   MODULE check_lenum1   ON REQUEST.
      FIELD scr100-lenum2   MODULE check_lenum2   ON REQUEST.
    I want write one moudle that i could ask there - > from which field did i came, like this:
      FIELD scr100-lenum1   MODULE check_lenum   ON REQUEST.
      FIELD scr100-lenum2   MODULE check_lenum   ON REQUEST.
    please advice..
    thanks, Barak.

    Use get cursor statement.
    Ex:
    GET CURSOR FIELD wa_field1.
    u will get the filed name in wa_field1.
    Reward points if helpfull.
    Regards,
    Gopi

Maybe you are looking for

  • DW CS5 with PHP - page 247

    Why not include the email address in the $data array that gets inserted into the database? Is that covered later in the book?

  • SetRollbackOnly doesn't work on Container Managed MDB

    I have a Container Managed Message Driven Bean + an AQ Queue. In my onMessage, I call the messageContext.setRollbackOnly() but my message is removed from the queue! Is it the expected behavior??? It seems that there is a problem with the transactions

  • How can you view/work on image in CC while still viewing thumbnails in Bridge?

    Just switched to CC from CS5. Cannot open an image from Bridge into Photoshop while still viewing thumbnails in Bridge. Killing my workflow by having to reopen Bridge after processing every image in Photoshop. Using two monitors. Another huge frustra

  • Photoshop CS5 Master Collection

    When trying to open PS this morning I am receiving the following error: Could not initialize Photohop because the preferences file was invalid (it has been deleted). Any ideas on how to correct?

  • User Exit in VF01 for Tax Conditions

    Hello, Please inform if any user exit is available for processing Conditions (Tax) in a Sales Order. I'm facing a problem that while Invoicing, a certain Tax condition is not being executed. Thanks, Shalabh Jain