ALV Avoid repeated values for a field

I have developed an ALV report. In that 1 field say Company Code along with its details are getting displayed. I dont want the same Company Code to get printed repeatedly. It is sorted by Company Code.
Company code should get printed only once when it gets changed ..
eg:
Comp1 sdf ghj
Comp1 bvc asd
Comp2 qqq ert
Comp2 www rrr
Comp2 tyu iop
I want a report like this:
Comp1 sdf ghj
      bvc asd
Comp2 qqq ert
      www rrr
      tyu iop
Can anyone help me ? Its urgent ..
Thanking you in advance,
Shankar

Hi,
Check the sample code.
REPORT  Z_TEST_HERSEQ_LIST_DISPLAY.
type-pools : slis.
*--Data declaration
data : itab_ekko like standard table of ekko with header line,
       itab_ekpo like standard table of ekpo with header line.
data : it_fldcat_ekko type SLIS_T_FIELDCAT_ALV,
       it_fldcat_ekpo type slis_t_fieldcat_alv.
data : v_repid type sy-repid.
DATA : IS_KEYINFO TYPE SLIS_KEYINFO_ALV.
data : header type slis_tabname,
       item   type slis_tabname,
       layout type slis_layout_alv.
**--Table declaration
tables : ekko.
**--selection screen
select-options: s_ebeln for ekko-ebeln.
initialization.
  v_repid = sy-repid.
**--Start of selection
start-of-selection.
select * from ekko
  into table itab_ekko
  where ebeln in s_ebeln.
if not itab_ekko[] is initial.
  select * from ekpo
    into table itab_ekpo
    for all entries in itab_ekko
    where ebeln = itab_ekko-ebeln.
endif.
perform fldcat.
*perform set_layout.
perform herseq_list.
*&      Form  fldcat
*       text
* Form to populating fieldcat
form fldcat .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
   I_PROGRAM_NAME               = v_repid
   I_INTERNAL_TABNAME           = 'ITAB_EKKO'
   I_STRUCTURE_NAME             = 'EKKO'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fldcat_ekko
* EXCEPTIONS
*   INCONSISTENT_INTERFACE       = 1
*   PROGRAM_ERROR                = 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.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
   I_PROGRAM_NAME               = v_repid
   I_INTERNAL_TABNAME           = 'ITAB_EKPO'
   I_STRUCTURE_NAME             = 'EKPO'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fldcat_ekKo
* EXCEPTIONS
*   INCONSISTENT_INTERFACE       = 1
*   PROGRAM_ERROR                = 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.
endform.                    " fldcat
*&      Form  herseq_list
*       text
*her list
form herseq_list .
IS_KEYINFO-HEADER01 ='EBELN' .
IS_KEYINFO-ITEM01 = 'EBELN'.
header = 'ITAB_EKKO'.
item = 'ITAB_EKPO'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
  EXPORTING
*   I_INTERFACE_CHECK              = ' '
*   I_CALLBACK_PROGRAM             =
*   I_CALLBACK_PF_STATUS_SET       = ' '
*   I_CALLBACK_USER_COMMAND        = ' '
*   IS_LAYOUT                      = layout
   IT_FIELDCAT                    =  IT_FLDCAT_EKKO
*   IT_EXCLUDING                   =
*   IT_SPECIAL_GROUPS              =
*   IT_SORT                        =
*   IT_FILTER                      =
*   IS_SEL_HIDE                    =
*   I_SCREEN_START_COLUMN          = 0
*   I_SCREEN_START_LINE            = 0
*   I_SCREEN_END_COLUMN            = 0
*   I_SCREEN_END_LINE              = 0
*   I_DEFAULT                      = 'X'
*   I_SAVE                         = ' '
*   IS_VARIANT                     =
*   IT_EVENTS                      =
*   IT_EVENT_EXIT                  =
    i_tabname_header               = HEADER
    i_tabname_item                 = ITEM
*   I_STRUCTURE_NAME_HEADER        =
*   I_STRUCTURE_NAME_ITEM          =
    is_keyinfo                     = is_keyinfo
*   IS_PRINT                       =
*   IS_REPREP_ID                   =
*   I_BYPASSING_BUFFER             =
*   I_BUFFER_ACTIVE                =
*   IR_SALV_HIERSEQ_ADAPTER        =
*   IT_EXCEPT_QINFO                =
*   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER        =
*   ES_EXIT_CAUSED_BY_USER         =
  tables
    t_outtab_header                =   itab_ekko
    t_outtab_item                  =   itab_ekpo
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.                    " herseq_list
Regards
vijay

Similar Messages

  • Avoid repeating values in details section

    Hi,
    I have a report with a lot of formulas - depending on certain values in a certain Oracle database table values are summed up.
    The fields are therefore placed in the report footer.
    As I now have to insert a grouping I need to move the fields into the details section. However, I don't want to display each value there but only the sum - I would like to avoid repeating values in the details section.
    A formula looks like this:
    stringvar A1;
    if {OUR_TABLE_FIELD} = 1 then A1 := {OTHER_TABLE.OTHER_FIELD}
    Else A1:=A1;
    A1;
    Thanks!

    Add a suitable group and then display data in this group footer, suppress detail section. It will effectively show the last detail line and thus eliminate duplicates from view. However, data is still there so if you want to use summaries you will need to use Running totals to ensure duplicates are not counted/summed
    Ian

  • How can i avoid leading zeros for a field in smartform?

    how can i avoid leading zeros for a field in smartform?

    Hi,
    Using the Symbols.
    &symbol(Z)&  Omit Leading Zeros  &symbol(S)&  Omit Leading Sign 
    &symbol(<)&  Display Leading Sign to the Left 
    &symbol(>)&  Display Leading Sign to the Right 
    &symbol(C)&  Compress Spaces 
    &symbol(.N)&  Display upto N decimal places 
    &symbol(T)&  Omit thousands separator 
    &symbol(R)&  Right justified 
    &symbol(I)&  Suppress output of the initial value 
    Regards,
    Shiva Kumar

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • Default value for a field in Purchase order

    I want that while creating purchase order system should suggest one value for the field ' prior vendor ' in retail tab. I don't want to use user exit. Can anybody help?

    Hi,
    if that button is clicked then give the values in the work area of  table control and then append it to the table control
      in pai of the screen.
      if r_rad eq 'X'.
        fs_tab = ur value.
    append fs_tab to it_tab.
    endif.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:39 PM

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • HOW TO  SET A DEAFULT  VALUE  FOR A FIELD?

    hi friends
      i have doubt..how to  set a default  value for a field..say  like in  local printer field i always want  lp01 to  be displayed defaultly..when i  click  F1  in that  field i  get the parameter id ..i  know there is something  dealt with that  parameter id..how can i  set that  default value ..in the case of the default  printer value i made in  own data settings as lp01 but  how to  do it  normally  for other  field which has parameter id ??????
    thanks and regards
    prince

    Hi Prince,
    u can set the default value in abap as given below
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : S_BUKRS TYPE BSID-BUKRS OBLIGATORY DEFAULT '1000'.
    PARAMETERS : S_BELNR TYPE BELNR_D OBLIGATORY DEFAULT '1600000070'.
    PARAMETERS : S_GJAHR TYPE GJAHR OBLIGATORY DEFAULT '2008'.
    PARAMETERS : ASON TYPE BUDAT OBLIGATORY DEFAULT SY-DATUM.
    PARAMETERS : S_KUNNR TYPE KUNNR MODIF ID GP1.
    PARAMETERS : S_LIFNR TYPE LIFNR MODIF ID GP2.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : END OF BLOCK B1.
    or
    u can give the default value in INITIALIZATION also.
    vlue = '1000'.

  • Value for mandatory field is missing

    Hello again,
    I created an application how descripted in 95 Implementing Remote Persistency with CAF and RFCs (Service).
    The problem occurred when I try to search for an entry. I get the following error:
    german: "ERROR. Wert für Pflichtattribut ... fehlt:"
    english: "Value for mandatory field ... is missing"
    The option mandatory=true seems to be the problem. But I need this option to make these fields available for the mapping with the create method. After I while of tinkling I find out that the errormessage appears when I set more than to fields to mandatory.
    Do anybody know how to resolve this error?
    Thanks!

    Hi Martin,
    I reported this issue to development and they said that this is "by design".  Here is the recommendation.
    1.  set the "Mandatory" flag to false for each attribute that is not required by your external interface.
    2.  perform mappings for only the mandatory attributes in the create method.
    3.  perform mappings for mandatory and optional attributes in the update method.  The update method allows you to map optional attributes.
    4.  At runtime, first call the create method with only the required attributes, then call the update method to fill any optional attributes. 
    This should eliminate the error that you get in the Service Browser.
    Best Regards,
    Austin.

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • How to display texts automatic. besides entered value for a field in Trans.

    How to display texts automatically besides the entered value for a field in a standard transaction screen. For example you have a value table and a text table associated to it. Then on entering the value field and pressing enter the text associated should get displayed immediately besides the value. Like if you have 'LOC' as the value and 'Location' as the text associated to it, on entering this value 'LOC', you automatically get the text 'Location' printed besides it automatically in a transaction screen ?
    Message was edited by: Sarika Kedia

    Hi sarika,
    Welcome to SDN.
    1. first of all, such display of text,
       is not automatic.
       (it appears to be automatic)
    2. At design time,
       a) take one extra field for text
         and mark it as OUTPUT ONLY
    3. Then in PBO coding,
        call some module, and in that module
        write code
    4. The code should be to
       select from TEXT Table
       into the work area.
    EG. THE SCREEN TEXT FIELD NAME IS
    T510A-FIELDNAME.
    CLEAR t510a.
      SELECT SINGLE * FROM t510a INTO t510a
      WHERE trfar = FIELVALUE.
    5. This will take care of
       displaying the text value of that field.
    regards,
    amit m.

  • Value for customized fields didn't get copied to back end system

    Hi,
    We are in SRM 4.0 and using extended classic scenario.
    We have defined two customized fields in account assignment tab in shopping cart and SRM Po and also in back end PO.
    SRM POs are having values for the field but while transferring the Po details to back end system, for some of the line items of the Po the entries are missing in back end system.
    Problem is only with few line items of the PO.
    Have tried with FM like BBP_PD_PO_TRANSFER_EXEC  and BBP_PD_SC_RESUBMIT, but it is not transfering the values to back end.
    Is there any other way to push the missing values to back end system.
    Please advise.
    Thanks.

    Sk,
    Table adjustment has to be done accordingly. Get in touch with your Basis team.
    Thanks.

  • Values for a field in table

    Hi Experts
             Can you explain me that, in table some of the fields has predefined values, whether its a value table or what.
           Pls explain, how to set predefined values for particular fields to our own tables.
    Thank in advance.
    Regards
    Rajaram

    Hi,
    you can explicitly mention domain range as value table for the fields in the database table.
    Also the search help can be maintained for the fields in SE11 transcation where the value table can be specified.
    Reward appropriate points.
    Regards,
    Mansi.

  • Enter multiple values for a field in dialog programming

    I need to enter multiple values for some of the fields in screen , which screen element do i use for this or is there any other way of doing it?

    That would be a table control. In this you can enter multiple values for multiple fields.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm
    Thanks,
    SKJ

  • Pass in values for form fields

    Is it possible to pass in values for form
    fields like an ticket id or something?

    Sorry, we currently do not support that.
    Randy

  • AUFGR (Order Group)- Which table has values for this field

    Hi Gurus,
    I am working on a report, which uses Key field- Order number AUFNR from table AUFK, and is similar to standard transaction KOK5 and S_ALR_87013019.
    havent been able to find where we get values for the field AUFGR from,
    If you have any table where this field gets values from/how to find that, Please do mail and help for this problem..
    Thanks,
    Regards,
    Krishna

    Hi Raman,
    Try this function module, when i execute it in transaction SE37, it show me the Order Group list, it can be helpful:
    CALL FUNCTION 'G_SET_SELECT'
    EXPORTING
       CLASS                   = '103'
       CRUSER                  = '*'
       DISPLAY_ONLY            = ' '
       DYNP_TITLE              = ' '
       ECCS_DIMEN              = '*'
       ECCS_ITCLG              = '*'
       ECCS_SITYP              = '*'
       FIELD_ENTRY             = '*'
       FIELD_NAME              = 'AUFNR'
       KOKRS                   = 'FSCO'
       KTOPL                   = '*'
       FIKRS                   = '*'
       LIB                     = ' '
       MULTIPLE_CHOICE         = ' '
       NO_CLASS_DISPLAY        = 'X'
       NO_DYNAMIC_SETS         = 'X'
       NO_MAINTENANCE          = 'X'
       NO_SUBSET_EXPAND        = 'X'
       NO_TABLE_DISPLAY        = ' '
       RNAME                   =
       SEARCHFLD               = '*'
       SET                     = '*'
       SET_USAGE               = '*'
       SET_WILDCARD_ONLY       = 'X'
       START_COLUMN            = 0
       START_ROW               = 0
       SUBCLASS                = '*'
       TABLE                   = 'CCSS'
       TITLE_STRING            = '*'
       TOP_NODES_ONLY          = ' '
       TYPELIST                = 'BSMD'
       UPDUSER                 = '*'
       VARIABLE                = '*'
    regards,
    Alejandro.

Maybe you are looking for

  • Consignment process - change of delivering plant (consignor)

    Hi Gurus, Our organisation has decided to change the Plant from PL01 to PL02 for the consignment process hence needs all the consignment stock move to PL02 and the future processing of consignment fill ups, issues , returns and pick up should be done

  • InDesign crashes in SnapshotUtils

    I am using SnapshotUtils::ExportImageToJPEG to create images of document pages. Everything works normally fine, but InDesign (CS2) crashes somewhere deep in SnapshotUtils, if the document contains transparent elements and if I try to scale the image

  • Oracle Content Management

    Hi, After installaing oracle 10gR3 content server on Linux redhat 4, can not get to admin server page: THis is the error meesage when typing in the URL: http://hostname:4440/idc Network message format error. Unable to parse browser environment or con

  • Privilege levels on switch

    I am trying to lock down my switches for my junior network engineers and have run into a problem for my sites without Radius/Tacacs. I would like to set a privilege level that only allows admins to configure interfaces, ip access list, and show comma

  • Airport Extreme and Dlink dwl-2000AP+ as wireless client

    Hi, i'm trying to let an old iMac G3 without any airport card, join an existing lan using an Airport Extreme as router, connecting an old D-Link access point configured as wireless client and connected via ethernet to the iMac G3. All my setup works