Alv field no display

Hi All,
I am displaying a list using alv hierarchy report and I dont want the fields at the item level to diplay. I am using the fieldcat-tech = 'X' for this. Its working butthe allignment of the fields is getting disturbed. How can it be displayed properly. One more issue is how can i display a value in the list as a delete icon if the value of the field is 'X'. I know there is a icon field in field cat ..I dont know how to get that particular icon in place. Could somebody please help.
Thanks,
Kiran.

HI.
Pls use ALV grid if you dont want item level.
alv hierarchy report  for when we need header and line item .
refer this porg
BCALV_TEST_HIERSEQ_LIST
BCALV_TEST_HIERSEQ_LIST_EVENTS
Reward all helpfull answers.
Regards.
Jay

Similar Messages

  • 1000 CHARACTER TEXT IN ALV FIELD

    Hi Experts,
    I have a String type variable containing 1000 character text that I am passing in a field on ALV. But ALV field can display on 132 characters. So now my requirement is that when a user double clicks on that field... then a popup or a screen appears where the user can read the entire text of that field.
    I have tried some FMs (like POPUP_TO_CONFIRM, POPUP_TO_INFORM, POPUP_DISPLAY_TEXT etc...), but all have length restriction.
    Please suggest if there is any FM to get the entire 1000 character text on a popup....  OR if there is any other way to do this...
    Thanks in advance
    Regards,
    Ashish Goyal

    I am using this code provided by you, facing error : Field "OB_GUI_DIALOGBOX_CONTAINER" is unknown. It is neither in one of   the specified tables nor defined by a "DATA" statement. 
    Please take a look and suggest.
    Using REUSE ALV GRID to display ALV.
       TYPES: BEGIN OF tp_text_x .
    TYPES: tdname      TYPE thead-tdname ,
           tdobject    TYPE thead-tdobject ,
           tdid        TYPE thead-tdid ,
           tdspras     TYPE thead-tdspras ,
           tdtxtlines  TYPE thead-tdtxtlines .
    TYPES: tdline      TYPE tline-tdline ,
           it_tline    TYPE tline_tab .
    TYPES: END OF tp_text_x .
    CLASS cl_event_reciever DEFINITION DEFERRED.
    DATA v_event_reciever TYPE REF TO cl_event_reciever.
    CLASS cl_event_receiver DEFINITION .
      PRIVATE SECTION.
        METHODS: close
                 FOR EVENT close OF cl_gui_dialogbox_container
                 IMPORTING sender.
        METHODS: init_container .
        METHODS: display_textedit
                 IMPORTING value(st_text_x) TYPE tp_text_x .
    ENDCLASS .                    "cl_event_receiver DEFINITION
    CLASS cl_event_receiver IMPLEMENTATION.
      METHOD close .
        CALL METHOD sender->set_visible
          EXPORTING
            visible = abap_false.
      ENDMETHOD .                    "handle_close
      METHOD init_container .
    *    DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
        IF ob_gui_dialogbox_container IS NOT INITIAL .
    *    IF EDITOR_CONTAINER IS NOT INITIAL .
          me->close( EXPORTING sender =  ob_gui_dialogbox_container ) .   " EDITOR_CONTAINER ).
        ENDIF .
        CREATE OBJECT ob_gui_dialogbox_container
          EXPORTING
            parent   = cl_gui_container=>screen0
            top      = 40
            left     = 200
            lifetime = cntl_lifetime_dynpro
            width    = 600
            height   = 100.
      ENDMETHOD.                    "init_container
      METHOD display_textedit .
        me->init_container( ) .
        DATA: ob_gui_textedit TYPE REF TO cl_gui_textedit .
    *    DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
        CREATE OBJECT ob_gui_textedit
          EXPORTING
            parent = ob_gui_dialogbox_container.
        CALL METHOD ob_gui_textedit->set_readonly_mode
          EXPORTING
            readonly_mode = cl_gui_textedit=>true.
        DATA: it_tdline TYPE TABLE OF tdline .
        DATA: st_tdline LIKE LINE OF it_tdline .
        FIELD-SYMBOLS: <st_tline> LIKE LINE OF st_text_x-it_tline .
        LOOP AT st_text_x-it_tline ASSIGNING <st_tline> .
          APPEND <st_tline>-tdline TO it_tdline .
        ENDLOOP .
        CALL METHOD ob_gui_textedit->set_text_as_stream
          EXPORTING
            text = it_tdline.
      ENDMETHOD.                    "display_textedit
    ENDCLASS .                    "cl_event_receiver IMPLEMENTATION
    INITIALIZATION.
    CREATE OBJECT v_event_reciever.
    DATA: ob_gui_dialogbox_container TYPE REF TO cl_gui_dialogbox_container.
    CREATE OBJECT ob_gui_dialogbox_container.
    START-OF-SELECTION.
    v_event_reciever->display_textedit( EXPORTING st_text_x = <st_alv_data_1>-text_1 ) .

  • Regarding Selection Screen field making display field  in ALV report

    Hi All,
               In ALV Report,  at runtime how can i make the field as Display Field in selection screen .
    Thks & Regds
    Shailesh

    hii,
    Go to se38 and give the below progra name execute.... check the source code it is very easy to understand.
    1.demo_dynpro_modify_simple
    2.demo_dynpro_modify_screen
    if tou are using grid,u can refer to foll link
    sequencing / choosing fields in report screen at runtime,
    Display the Columns in the grid at run time
    rgrds,
    Shweta

  • Need to remove space for a field when displayed in ALV Report

    Hi,
    I have material field of length 18, but the content is only 10 char. I need to remove the extra space when it is displayed on ALV Report.
    Is there any option in ALV field catalogue

    use statement condense.
    condense zmatnr.
    also giv output lenth of alv column as 10.

  • Field not displaying in ALV??

    Hi Experts,
    I am enhancing(just addition of one field to the existing alv display) the existing ALV report i.e. exisiting_alv
    So, first, I copied the code by giving the target prog. name i.e. new_alv.
    So, I started the follwoing changes in new_alv code,
    I added one filed in the itab,
    I added this filed in SELECT statement (its a  JOIN SELECT),
    I added it in the field catalog.
    It worked well.
    So, I want to do the same in existing_alv code, so, I did the same i.e.
    I added one filed in the itab,
    I added this filed in SELECT statement (its a  JOIN SELECT),
    I added it in the field catalog.
    (In debug mode, I checked that, Weather the data is coming into ITAB or not? Its coming from DB into ITAB!)
    But, here its not working, even though I tried with itab, alv field catalog order i.e. keeping my field in the first, in the last, in the middle of itab and alv filed catalog?
    So,
    1- What culd b the reason ie. Its working well in copied code new_alv and not working in the original existing_alv code?
    2- Is it overlapping some where?
    3-Bcoz of join conditions in the select statemtnt?
    4-How to fix it?
    If any of the reason, then Why its displaying/working well in copied prog. i.e. new_alv?
    ThanQ.
    Message was edited by:
            Sridhar
    Message was edited by:
            Sridhar
    Message was edited by:
            Sridhar

    Hello Sridhar
    If the new field is added to the fieldcatalog and the itab then it should be displayed as additional column on the ALV list. If not then mostly likely there is a <b>layout </b>defined for the ALV list where this field is simply missing. Change the layout and add the missing column.
    Regards
      Uwe

  • Decimal Value display in ALV Field display

    Hi Expert,
    I need to dispaly one ALV Field "Routine Work Hour" value up to 2 decimal place in ALV output i.e if value is 2.5 then it should display as 2.50.The field which refers to this is ISMNW and the database table is AFRU.Now if this value is maintained in MINUTE unit, then code converts into HOUR unit and correctly outputs to ALV output up to 2 decimal after i changed the field decimal lenght.But for the value which is mainatined in HOUR unit, it correctlty populated into the final internal table upto 2 decimal and this table data while passing into FM " REUSE_GRID_DISPLAY" it only outputs upto 2 deciamal value for the value which is maintained as MINUTE unit in database table AFRU in ALV output, but for other value(Which are maintained in HOUR unit in table AFRU)  it still shows 1 decimal length.But the internal table correctly populates these values up to 2 decimal for all unit of work(MINUTE/HOUR) while passing though this above FM.
    Please advise where i need to look into.
    Thanks

    hi,
    pass these parameters to fieldcatlog.
    e.g.
    Fcat-ref_fieldname = 'ISMNW'.
    fcat-ref_tabname  = 'AFRU'.
    fcat-decimalsout = 2.
    Hope this will help you.
    Regards,
    Vijay

  • At run time,ALV table is displaying all fields of database table

    Hi all
    I done one application using ALv I am displaying the ALV Table.my problem is at run time it was fetching and displaying all the fields in the data base table but i need only the fields which are defined in node.
    Please help me.
    Thanks and Regards
    Tulasi Palnati

    Hi,
    May be you have specified the database table as the Dicitonary structure property of the node.
    Check the same and if its there clear the Dictionary structure property of the node.
    Hope this solves your isse!
    Regards,
    Srilatha

  • Field doesnu0092t display in alv  , why  ?

    WHEN 'NETPR' .
          LS_FCAT-COLTEXT = TEXT-031 .
          LS_FCAT-COL_POS =  29.
          LS_FCAT-OUTPUTLEN = 15 .
        LS_FCAT-DATATYPE   = 'CURR' . "'QUAN'.
        LS_FCAT-rollname = 'NETPR'.
    when the report is display  , the field doesn't show up ?
    also if i reduce the number of Columns ( in the field catalog )
    for display there is no change
    all the other fields are display except the "NETPR"
    when i check the "layout change" he is there   ,
    also he is display if i reduce the number of columne for display ( by layout change)

    hi,
    see this.
    did u append the data to field catlog internal table also please check .
    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.
    Regards
    Anver

  • Values from alv hierarchical list display

    hi all,
    i need to display sme values from vbak and vbap tables in ALV hierarchical list display.if i click on the sales order of the header, it should directly go to the second screen of transaction VA03 with the sales details displayed..
       i got the parameter id, how can i assign the selected sales order value to this parameter id?...
    regards,
    Hamsa Priya

    Hi,
    Check this example..Marked in bold..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab
           WHERE vbeln > '0060000040'.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program      = v_repid
    <b>          i_callback_user_command = 'USER_COMMAND'</b>
              is_layout               = s_layout
              it_fieldcat             = t_fieldcatalog
              i_tabname_header        = 'ITAB'
              i_tabname_item          = 'ITAB1'
              is_keyinfo              = s_keyinfo
         TABLES
              t_outtab_header         = itab
              t_outtab_item           = itab1
         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.
    <b>FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      IF ucomm = '&IC1' AND selfield-fieldname = 'VBELN'.
        READ TABLE itab INDEX selfield-tabindex.
        IF sy-subrc = 0.
    document
          SET PARAMETER ID 'AUN' FIELD itab-vbeln.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDIF.
    ENDFORM.</b>
    Thanks,
    Naren

  • ALV how to display page no in every page - Page break

    Hi All
    I would like to know how can i write an ALV page no in each of the page.
    Currently i manage to write the page no in the top , but only show "Page No : 1 "
    but when i send to spool the All the page no will break into "Page No : 1 , Page No :2 and up to end page .
    thank you

    Hi Check this program.
    A Simple ABAP ALV LIST VIEWER Example
    This ALV program have all the basic report requirements such as page heading, page no, sub-total and a grand total.
    This is a basic ALV with the followings:-
    - Page Heading
    - Page No
    - Sub-Total
    - Grand Total
    REPORT ZALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GS_PRINT            TYPE SLIS_PRINT_ALV,
    GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    GT_EVENTS           TYPE SLIS_T_EVENT,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    Print Parameters
    PARAMETERS:
                P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
                P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
                P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
                P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
                P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
                P_RESERV TYPE I.                  "NO OF FOOTER LINE
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
    START-OF-SELECTION.
    TEST DATA
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    DO 50 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
    PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
    PERFORM CALL_ALV.
    FORM BUILD.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-NO_OUT    = 'X'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
    FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    FORM CALL_ALV.
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    HEADER FORM
    FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = LT_EVENTS.
      READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO LT_EVENTS.
      ENDIF.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                             INTO LS_EVENT.
    IF SY-SUBRC = 0.
      MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
      APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    ENDFORM.
    FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: GS_LINE TYPE SLIS_LISTHEADER.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'H'.
      GS_LINE-INFO = 'HEADER 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'S'.
      GS_LINE-KEY  = 'STATUS 1'.
      GS_LINE-INFO = 'INFO 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      GS_LINE-KEY  = 'STATUS 2'.
      GS_LINE-INFO = 'INFO 2'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
    CLEAR GS_LINE.
    GS_LINE-TYP  = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO  GT_TOP_OF_PAGE.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
      WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
    ENDFORM.
    FORM END_OF_PAGE.
      WRITE at (sy-linsz) sy-pagno CENTERED.
    ENDFORM.
    PRINT SETTINGS
    FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
      LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
      LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
      LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
      LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
      LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
      LS_PRINT-RESERVE_LINES      = P_RESERV.
    ENDFORM.
    *END OF ZALV PROGRAM
    Reward if it helps you.

  • ALV: How to display amount respective to currency format in ALV?

    Hi All,
    Normally in ALV, to display the amount respective to its currency, we just simply pass the currency field(coming from the t_outtab  of FM REUSE_ALV_GRID_DISPLAY) to CFIELDNAMEof ALV field catalog.
    For ordinary currencies with 2 decimal places, like USD, etc, it will work fine.
    But for currencies like KWD and IDR, their decimal place is always 3 via SAP standard definition in transaction OY04.
    Given this, ALV field catalog CFIELDNAME cannot handle as such automatic formatting.
    Is there any other way without using the code below?
    WRITE <amount_field_name> CURRENCY <currency_field_name>.
    Thanks.

    Answer:
    'WAERK' to w_alv_fcat-cfieldname,

  • Regarding ALV ( To be displayed in Tree Format)

    Hi all,
    I am working on a ALV report which is to be displayed in Tree Structure . I found some demo programs within SAP .. but do we have an Alternative .. all those Demos use  OOPS concept .. Can this Report be done without using OOPS in ALV.
    Please Suggest.
    Thanks & Regards
    Srinivas

    Hi,
    This is a ALV Report with tree structure.
    report  zwmr_pick_status_report no standard page heading
                                    message-id zw.
    Type Pools                                                           *
    type-pools: icon, slis.
    Tables                                                               *
    tables: tvst,
            likp,
            t30b,
            vekp,
            zpallettr,
            zvantr.
    Types                                                                *
    types:
      begin of ty_data,
         lgtor       like likp-lgtor,             " door
         vbeln       like likp-vbeln,             " delivery
         wbstk       like vbuk-wbstk,             " Goods movement status
         kostk       like vbuk-kostk,             " Picking status
         posnr       like lips-posnr,             " item
         route       like likp-route,             " route
         wadat       like likp-wadat,             " goods issue date
         lvsta       like vbup-lvsta,             " warehouse status
         packvorschr like vekp-packvorschr,       " pack mnemonic
         exidv       like vekp-exidv,             " handling unit
         zpallet_no(10),  "like zpallettr-zpallet_no,   " pallet no
         zcount_check like zpallettr-zcount_check," count check flag
         zvan_no(10),     "like zvantr-zvan_no,         " van no
         zvan_print  like zvantr-zvan_print,      " van manifest print
         zeod_print  like zvantr-zeod_print,      " eod manifest print
         zzpackclass like vekp-zzpackclass,       " package class
         zzti        like vekp-zzti,              " T.I. value
      end of ty_data.
    Data                                                                 *
    ranges: r_del   for likp-vbeln,
            r_lgtor for likp-lgtor.
    ranges: r_vanno for zvantr-zvan_no,
            r_palno for zpallettr-zpallet_no.
    data: begin of number_range occurs 0,
             mark(1),
             id(3),
             num(10) type n,
             desc like zpalletmd-zdesc,
          end of number_range.
    data: t_disp_tab  type standard table of zpickdisp,
          t_data_tab  type ty_data  occurs 0 with header line,
          t_disp_head type standard table of zpickhead.
    data: w_numrnge like number_range,
          w_number(10) type n.
    data: t_likp     like likp      occurs 0 with header line,
          t_lips     like lips      occurs 0 with header line,
          t_vbuk     like vbuk      occurs 0 with header line,
          t_vbup     like vbup      occurs 0 with header line,
          t_vepo     like vepo      occurs 0 with header line,
          t_vekp     like vekp      occurs 0 with header line,
          t_vantr    like zvantr    occurs 0 with header line,
          t_pallettr like zpallettr occurs 0 with header line,
          w_likp     like likp,
          w_lips     like lips,
          w_vbuk     like vbuk,
          w_vbup     like vbup,
          w_vepo     like vepo,
          w_vekp     like vekp.
    ALV DATA *****
    data:
         g_grid             type ref to cl_gui_alv_grid,
         g_sort             type slis_t_sortinfo_alv,
         g_custom_container type ref to cl_gui_custom_container,
         g_layout           type slis_layout_alv,
         gt_fieldcat        type slis_t_fieldcat_alv,
         t_fldcat           like line of gt_fieldcat,
         g_keyinfo          type slis_keyinfo_alv,
         gt_events          type slis_t_event,
         gs_event           type slis_alv_event,
         w_sy_repid         like sy-repid.
    data: begin of seltab occurs 0.
            include structure rsparams.
    data: end of seltab.
    SYSTEM GENERATED TABLE CONTROL DATA ********
    DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
    controls: tc_tabcon type tableview using screen 0100.
    LINES OF TABLECONTROL 'TC_TABCON'
    data:     g_tc_tabcon_lines  like sy-loopc.
    data:     ok_code like sy-ucomm.
    Constants                                                            *
    constants: c_data_class like klah-class value 'DG_DATA',
               c_mat_class  like rmclf-klart value '001',
               c_pack       like lips-mtart value 'VERP',
               c_a(1)            value 'A',
               c_b(1)            value 'B',
               c_c(1)            value 'C',
               c_yes(1)          value 'X',
               c_no(1)           value ' '.
    Selection screen                                                     *
    standard report select options block
    selection-screen begin of block a with frame title text-002.
    select-options:
      s_wadat for likp-wadat no-extension obligatory.  " Goods Issue Date
    *parameters:                                           "TR01-
    p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
    select-options:                                             "TR01+
      p_vstel for tvst-vstel.            " Shipping Point  "TR01+
    select-options:
      s_lfart for likp-lfart,            " Delivery type
      s_lgtor for t30b-lgtor,            " Door selection
      s_exidv for vekp-exidv,            " Handling Unit
      s_vbeln for likp-vbeln.            " Delivery
    parameters:
      p_exdata as checkbox.              " Show extra columns flag
    selection-screen end of block a.
    van/pallet specific select options block
    selection-screen begin of block b with frame title text-001.
    select-options:
      s_palno for zpallettr-zpallet_no, " no-extension,
      s_vanno for zvantr-zvan_no.       " no-extension.
    selection-screen end of block b.
    Value Request Events                                                 *
    at selection-screen on value-request for s_palno-low.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_pal_nos.
      s_palno-low = w_number.
    at selection-screen on value-request for s_palno-high.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_pal_nos.
      s_palno-high = w_number.
    at selection-screen on value-request for s_vanno-low.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_van_nos.
      s_vanno-low = w_number.
    at selection-screen on value-request for s_vanno-high.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_van_nos.
      s_vanno-high = w_number.
    At Selection Screen                                                  *
    at selection-screen.
      perform validate_selections.
    Initialization                                                       *
    initialization.
    Start of selection                                                   *
    start-of-selection.
    clear all data tables
      clear: t_likp,
             t_lips,
             t_vbuk,
             t_vbup,
             t_vepo,
             t_vantr,
             t_pallettr,
             w_likp,
             w_lips,
             w_vbuk,
             w_vbup,
             w_vepo,
             w_vekp.
      refresh: t_likp,
               t_lips,
               t_vbuk,
               t_vbup,
               t_vepo,
               t_vantr,
               t_pallettr.
    select data for ALV
    due to different input parameters being used, to streamline the data
    selection process, different selection methods are required
      if not s_vanno is initial
      or not s_palno is initial.
      if selecting by van/pallet number, need to select the data from the
      handling unit upwards to delivery
        perform select_data_up.
      else.
      otherwise the data can be selected from the delivery downwards
        perform select_data_down.
      endif.
    End of selection                                                     *
    end-of-selection.
    call hierarchical ALV display function module
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           exporting
                i_callback_program       = 'ZWMR_PICK_STATUS_REPORT'
                i_callback_pf_status_set = 'SET_STATUS'
                i_callback_user_command =
                   'USER_COMMAND' "custom gui status form
                is_layout                = g_layout  "user command form
                it_fieldcat              = gt_fieldcat
                it_sort                  = g_sort
                it_events                = gt_events
                i_tabname_header         = 't_disp_head'
                i_tabname_item           = 't_disp_tab'
                i_structure_name_header  = 'ZPICKHEAD'
                i_structure_name_item    = 'ZPICKDISP'
                is_keyinfo               = g_keyinfo
           tables
                t_outtab_header          = t_disp_head
                t_outtab_item            = t_disp_tab.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
                                FORMS                                    *
    Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
      include zwmr_pick_status_reporto01 .
      include zwmr_pick_status_reporti01 .
      include zwmr_pick_status_reportf01 .
    *&      Form  select_pal_nos
          select pallet numbers for search help
    form select_pal_nos.
      data: begin of t_palno occurs 0,
              zpallet_no like zpallettr-zpallet_no,
            end of t_palno.
    select all available pallet numbers
      select distinct zpallet_no from zpallettr
                      into corresponding fields of table t_palno.
      loop at t_palno.
      get pallet id
        select single zpallet_id from zpallettr
                      into number_range-id
                      where zpallet_no = t_palno-zpallet_no.
      get pallet description
        select single zdesc from zpalletmd
                      into number_range-desc
                      where zpallet_id = number_range-id.
        number_range-num = t_palno-zpallet_no.
      append to search help table
        append number_range.
      endloop.
    call pop up dialog box
      call screen 0100 starting at 5 5.
    endform.                    " select_pal_nos
    *&      Form  select_van_nos
          select van numbers for search help
    form select_van_nos.
      data: begin of t_vanno occurs 0,
              zvan_no like zvantr-zvan_no,
            end of t_vanno.
    select available van numbers
      select distinct zvan_no from zvantr
                      into corresponding fields of table t_vanno.
      loop at t_vanno.
      select van id
        select single zvan_id from zvantr
                      into number_range-id
                      where zvan_no = t_vanno-zvan_no.
      select van description (maintained in pallet tables)
        select single zdesc from zpalletmd
                      into number_range-desc
                      where zpallet_id = number_range-id.
        number_range-num = t_vanno-zvan_no.
      append to search help table
        append number_range.
      endloop.
    call pop up dialog box
      call screen 0100 starting at 5 5.
    endform.                    " select_van_nos
    *&      Form  select_data_down
          select data if selecting from delivery down
    form select_data_down.
    select all deliveries from LIKP that fulfill selection criteria
      select * from likp into table t_likp
                         where vbeln in s_vbeln
                       and   vstel eq p_vstel                 "TR01-
                         and   vstel in p_vstel
                         and   lgtor in s_lgtor
                         and   wadat in s_wadat
                         and   lfart in s_lfart.
      if sy-subrc ne 0.
      no data found
        message i007.
        exit.
      endif.
      if not t_likp[] is initial.
      select sales document headers from VBUK
        select * from vbuk into table t_vbuk
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln.
      select all relevant delivery items from LIPS
        select * from lips into table t_lips
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln
                      and   pstyv ne 'ZPAC'
                      and   pstyv ne 'ZGDP'                     "TR02+
                      and   lfimg gt 0.                         "TR01+
      endif.
      if not t_lips[] is initial.
      select all sales document line items from VBUP
        select * from vbup into table t_vbup
                      for all entries in t_lips
                      where vbeln eq t_lips-vbeln
                      and   posnr = t_lips-posnr.
      select corresponding handling unit ID's (venum)
    TR03 Replace start
       select * from vepo appending corresponding fields of table t_vepo
                     for all entries in t_lips
                     where vbeln = t_lips-vbeln
                     and   posnr = t_lips-posnr
                     and   matnr = t_lips-matnr
                     and   charg = t_lips-charg.
        select * from vepo
                      inner join vekp on vepovenum = vekpvenum
                      appending corresponding fields of table t_vepo
                      for all entries in t_lips
                      where vepo~vbeln = t_lips-vbeln
                      and   vepo~posnr = t_lips-posnr
                      and   vepo~matnr = t_lips-matnr
                      and   vepo~charg = t_lips-charg
                      and   vekp~exidv in s_exidv.
    TR03 Replace end
      endif.
    build process table
      perform move_to_table.
    endform.   "select_data_down
    *&      Form  select_data_up
          select data if selecting from van/pallet up
    form select_data_up.
      if not s_vanno is initial.
      if van then select van numbers and hence pallet numbers
        select * from zvantr into table t_vantr
                              where zvan_no in s_vanno.
                            and   vstel   eq p_vstel."TR01-
        if not t_vantr[] is initial.
          select * from zpallettr into table t_pallettr
                                  for all entries in t_vantr
                                  where zpallet_no eq t_vantr-zpallet_no.
                                and   vstel      eq p_vstel."TR01-
        endif.
      else.
      otherwise can get pallet numbers directly
        select * from zpallettr into table t_pallettr
                                where zpallet_no in s_palno.
                              and   vstel      eq p_vstel."TR01-
      endif.
      if not t_pallettr[] is initial.
      from the pallet nos. we can select the handling units
        select * from vekp into table t_vekp
                           for all entries in t_pallettr
                           where exidv eq t_pallettr-exidv
                           and   exidv ne space
                           and   exidv in s_exidv               "TR03+
                           and ( exida = 'E'                    "TR01+
                           or    exida = 'F' ).                 "TR01+
      endif.
      if not t_vekp[] is initial.
      build vbeln range from t_vekp.
        loop at t_vekp.
          r_del-sign = 'I'.
          r_del-option = 'EQ'.
          r_del-low = t_vekp-vpobjkey.
          append r_del.
        endloop.
      select all deliveries from LIKP that correspond to HU's
        select * from likp into table t_likp
                           where vbeln in r_del
                           and   wadat in s_wadat
                           and   lfart in s_lfart.
      endif.
      if not t_likp[] is initial.
      select sales document headers from VBUK
        select * from vbuk into table t_vbuk
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln.
      select all relevant delivery items from LIPS
        select * from lips into table t_lips
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln
                      and   pstyv ne 'ZPAC'
                      and   pstyv ne 'ZGDP'                     "TR02+
                      and   lfimg gt 0.                         "TR01+
      endif.
      if not t_lips[] is initial.
      select all sales document line items from VBUP
        select * from vbup into table t_vbup
                      for all entries in t_lips
                      where vbeln eq t_lips-vbeln
                      and   posnr = t_lips-posnr.
      select corresponding handling unit ID's (venum)
        select * from vepo appending corresponding fields of table t_vepo
                      for all entries in t_lips
                      where vbeln = t_lips-vbeln
                      and   posnr = t_lips-posnr
                      and   matnr = t_lips-matnr
                      and   charg = t_lips-charg.
      endif.
    build process table
      perform move_to_table.
    endform.   "select_data_up
    *&      Form  move_to_table
          move data to processing table
    form move_to_table.
      loop at t_vepo.
        clear t_data_tab.
      delivery lines.
        clear w_lips.
        read table t_lips with key vbeln = t_vepo-vbeln
                                   posnr = t_vepo-posnr
                                   into w_lips.
        move-corresponding w_lips to t_data_tab.
      sales document line items
        clear w_vbup.
        read table t_vbup with key vbeln = t_vepo-vbeln
                                   posnr = t_vepo-posnr
                                   into w_vbup.
      if w_vbup-kosta = space.                   "TR01-
        not relevant for picking
        delete t_vepo.                           "TR01-
        continue.                                "TR01-
      else.                                      "TR01-
        move-corresponding w_vbup to t_data_tab.
      endif.                                     "TR01-
      sales doc header
        clear w_vbuk.
        read table t_vbuk with key vbeln = t_vepo-vbeln
                               into w_vbuk.
        move-corresponding w_vbuk to t_data_tab.
      delivery header
        clear w_likp.
        read table t_likp with key vbeln = t_vepo-vbeln
                               into w_likp.
        move-corresponding w_likp to t_data_tab.
      select handling unit info using vepo entry
        clear w_vekp.
        if t_vekp[] is initial.
          select single * from vekp into w_vekp
                                    where venum = t_vepo-venum.
        else.
          read table t_vekp with key venum = t_vepo-venum
                                     into w_vekp.
          if sy-subrc ne 0.
            select single * from vekp into w_vekp
                            where venum = t_vepo-venum.
          endif.
        endif.
        move-corresponding w_vekp to t_data_tab.
      select pallet / van load information
        select single zpallet_no zcount_check from zpallettr
                                 into (t_data_tab-zpallet_no,
                                       t_data_tab-zcount_check)
                                 where exidv eq w_vekp-exidv.
        if not t_data_tab-zpallet_no in s_palno.                "TR01+
          continue.                                             "TR01+
        endif.                                                  "TR01+
        if sy-subrc = 0.
          select single zvan_no zvan_print zeod_print from zvantr
                        into (t_data_tab-zvan_no,
                              t_data_tab-zvan_print,
                              t_data_tab-zeod_print)
                        where zpallet_no eq t_data_tab-zpallet_no.
          if not t_data_tab-zvan_no in s_vanno.                 "TR01+
            continue.                                           "TR01+
          endif.                                                "TR01+
        endif.
        append t_data_tab.
      endloop.
    *-----> TR01+ start
    If the delivery has yet to be packed, then need to include in report
    Thus delete t_lips here and if any entries left after looping through
    t_vepo, these will also need to be added to t_data_tab
    if the selection is by handling unit though we do not want these"TR03+
      if s_exidv is initial.                                          "TR03+
        loop at t_vepo.
          read table t_lips with key vbeln = t_vepo-vbeln
                                     posnr = t_vepo-posnr.
          if sy-subrc = 0.
            delete t_lips index sy-tabix.
          endif.
        endloop.
        if not t_lips[] is initial.
      move any unpacked items to the data table
          perform move_lips_to_table.
        endif.
      endif.                                                          "TR03+
    *<---- TR01+ End
    get relevant status icons
      perform select_icons.
    prepare ALV data
      perform prepare_alv.
    endform.                    " select_data
    *&      Form  select_icons
          select icons for display and move data to display table
    form select_icons.
      data: w_disp_tab like zpickdisp,
            w_disp_head like zpickhead,
            w_color like zpickdisp-color,
            ov_icon like zpickdisp-ov_icon,
            gi_icon like zpickdisp-gi_icon,
            to_icon like zpickdisp-to_icon,
            lp_icon like zpickdisp-lp_icon,
            pc_icon like zpickdisp-pc_icon,
            lv_icon like zpickdisp-lv_icon,
            vm_icon like zpickdisp-vm_icon,
            em_icon like zpickdisp-em_icon,
            t_ovst_tab like t_disp_tab with header line.
      constants: c_col1(3) value 'C10',
                 c_col2(3) value 'C20'.
      sort t_data_tab by lgtor vbeln.
      w_color = c_col2.
      loop at t_data_tab.
        at new lgtor.
        fill ALV header table
          clear w_disp_head.
          w_disp_head-lgtor = t_data_tab-lgtor.
          append w_disp_head to t_disp_head.
        endat.
      goods issue status & overall amber/green only
        case t_data_tab-wbstk.
          when c_c.
            move icon_green_light to gi_icon.
            move icon_green_light to ov_icon.
          when others.
            move icon_red_light to gi_icon.
            move icon_yellow_light to ov_icon.
        endcase.
      transfer order status
        case t_data_tab-lvsta.
          when c_a.
            move icon_red_light to to_icon.
          when c_b.
            move icon_yellow_light to to_icon.
          when c_c.
            move icon_green_light to to_icon.
          when space.
          write N/A
            to_icon = 'N/A'.
        endcase.
      loaded to pallet status
        if not t_data_tab-zpallet_no is initial.
          move icon_green_light to lp_icon.
        else.
          move icon_red_light to lp_icon.
        endif.
      pallet count status
        if not t_data_tab-zcount_check is initial.
          move icon_green_light to pc_icon.
        else.
          move icon_red_light to pc_icon.
        endif.
      loaded to van status
        if not t_data_tab-zvan_no is initial.
          move icon_green_light to lv_icon.
        else.
          move icon_red_light to lv_icon.
        endif.
      van manifest status
        if not t_data_tab-zvan_print is initial.
          move icon_green_light to vm_icon.
        else.
          move icon_red_light to vm_icon.
        endif.
      end of day manifest status
        if not t_data_tab-zeod_print is initial.
          move icon_green_light to em_icon.
        else.
          move icon_red_light to em_icon.
        endif.
      move working data table to display table
        move-corresponding t_data_tab to w_disp_tab.
        w_disp_tab-ov_icon = ov_icon.
        w_disp_tab-gi_icon = gi_icon.
        w_disp_tab-to_icon = to_icon.
        w_disp_tab-lp_icon = lp_icon.
        w_disp_tab-pc_icon = pc_icon.
        w_disp_tab-lv_icon = lv_icon.
        w_disp_tab-vm_icon = vm_icon.
        w_disp_tab-em_icon = em_icon.
        w_disp_tab-color = w_color.
      fill N/A values for initial fields for display
        if w_disp_tab-packvorschr is initial.
          w_disp_tab-packvorschr = 'N/A'.
        endif.
        if w_disp_tab-exidv is initial.
          w_disp_tab-exidv = 'N/A'.
        endif.
        if w_disp_tab-zpallet_no is initial.
          write 'N/A' to w_disp_tab-zpallet_no.
        endif.
        if w_disp_tab-zvan_no is initial.
          write 'N/A' to w_disp_tab-zvan_no.
        endif.
      display different color for new doc number
        at end of vbeln.
          if w_color = c_col1.
            w_color = c_col2.
          elseif w_color = c_col2.
            w_color = c_col1.
          endif.
        endat.
        append w_disp_tab to t_disp_tab.
        clear w_disp_tab.
      endloop.
    we have all the icons in display but need to check the overall status
    as this refers to the line items
    green and amber statuses already set and use the same criteria as the
    goods issue status unless detected as red here
      data: ov_stat_red(1).
      clear w_disp_tab.
      sort t_disp_tab by vbeln.
      loop at t_disp_tab into w_disp_tab.
        at new vbeln.
        check all line items for delivery
          loop at t_data_tab where vbeln = w_disp_tab-vbeln.
            if t_data_tab-lvsta = c_a.
            set overall status to red
              ov_stat_red = c_yes.
              exit.
            else.
            leave green/amber status icon as previosly determined
            endif.
          endloop.
          if ov_stat_red = c_yes.
          set overall status to red for all items in that delivery
            clear ov_stat_red.
            move icon_red_light to w_disp_tab-ov_icon.
            modify t_disp_tab from w_disp_tab transporting ov_icon
                              where vbeln = w_disp_tab-vbeln.
          endif.
        endat.
      endloop.
    endform.                    " select_icons
    *&      Form  fill_layout
          fill ALV layout parameters
    form fill_layout.
      clear g_layout.
      g_layout-colwidth_optimize = c_yes.   " column width optimisation
      g_layout-zebra = space.               " alternate line colors
      g_layout-box_fieldname = 'MARK'.      " checkbox fieldname
      g_layout-info_fieldname = 'COLOR'.    " highlight row indicator
      g_layout-no_vline = space.            " vertical line
      g_layout-key_hotspot = space.         " hotspot field
      g_layout-f2code = 'PICK'.             " F2 ok_code
      g_layout-numc_sum = c_yes.            " sum numc fields
      g_layout-box_tabname = 't_disp_head'. " checkbox table name
      g_layout-expand_fieldname = 'EXPAND'. " expand field name
    endform.                    " fill_layout
    *&      Form  fill_sort
          fill ALV sort table
    form fill_sort.
      data: w_g_sort type slis_sortinfo_alv.
      w_g_sort-spos      = 1.
      w_g_sort-fieldname = 'LGTOR'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 2.
      w_g_sort-fieldname = 'VBELN'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 3.
      w_g_sort-fieldname = 'POSNR'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 4.
      w_g_sort-fieldname = 'WADAT'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
    endform.                    " fill_sort
    *&      Form  fill_fieldcat
          Fill field category structure for ALV
    form fill_fieldcat.
      clear t_fldcat.
    create field catalogue for header table
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name         = 'ZWMR_PICK_STATUS_REPORT'
                i_internal_tabname     = 't_disp_head'
                i_structure_name       = 'ZPICKHEAD'
                i_client_never_display = c_yes
           changing
                ct_fieldcat            = gt_fieldcat[].
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    ceate field catalogue for items table
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name         = 'ZWMR_PICK_STATUS_REPORT'
                i_internal_tabname     = 't_disp_tab'
                i_structure_name       = 'ZPICKDISP'
                i_client_never_display = c_yes
           changing
                ct_fieldcat            = gt_fieldcat[].
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    modify field catalogue for this report
    set no display flag if not requested on selection screen
      if p_exdata ne c_yes.
        t_fldcat-no_out    =  c_yes.
        modify gt_fieldcat from t_fldcat transporting no_out
                           where fieldname eq 'PACKVORSCHR'
                           or    fieldname eq 'EXIDV'
                           or    fieldname eq 'ZPALLET_NO'
                           or    fieldname eq 'ZVAN_NO'
                           or    fieldname eq 'ZZPACKCLASS'
                           or    fieldname eq 'ZZTI'.
      endif.
    set no display flag for item level LGTOR field
      t_fldcat-no_out    =  c_yes.
      modify gt_fieldcat from t_fldcat transporting no_out
                         where fieldname eq 'LGTOR'
                         and   tabname   eq 't_disp_tab'.
    prevent display of technical fields
      t_fldcat-tech = c_yes.
      modify gt_fieldcat from t_fldcat transporting tech
                         where fieldname eq 'EXPAND'
                         or    fieldname eq 'SELKZ'.
    set vbeln as key
      t_fldcat-key = c_yes.
      modify gt_fieldcat from t_fldcat transporting key
                         where fieldname eq 'VBELN'.
    prevent scrolling for info fields
      t_fldcat-fix_column = c_yes.
      modify gt_fieldcat from t_fldcat transporting fix_column
                         where fieldname eq 'VBELN'.
    endform.                    " fill_fieldcat
    *&      Form  prepare_ALV
          Fill ALV parameters
    form prepare_alv.
    fill ALV key info
      g_keyinfo-header01 = 'LGTOR'.
      g_keyinfo-item01   = 'LGTOR'.
    fill ALV events
      gs_event-name = 'TOP_OF_PAGE'.
      gs_event-form = 'TOP_OF_PAGE'.
      append gs_event to gt_events.
    fill ALV sort table
      perform fill_sort.
    fill ALV layout structure
      perform fill_layout.
    fill ALV field category
      perform fill_fieldcat.
    endform.                    " prepare_ALV
    *&      Form  user_command
          form called on user command from ALV list
    form user_command using r_ucomm     like sy-ucomm
                            rs_selfield type slis_selfield.
      data: index type i,
            w_disp_head like line of t_disp_head,
            w_door like likp-lgtor.
      clear r_lgtor. refresh r_lgtor.
      case r_ucomm.
        when 'PICK'. " Double click line
        when 'VANM'. " Van Manifest button
        read the header table where has been selected
          loop at t_disp_head into w_disp_head where mark = c_yes.
            r_lgtor-sign   = 'I'.
            r_lgtor-option = 'EQ'.
            r_lgtor-low    = w_disp_head-lgtor.
            append r_lgtor.
          endloop.
        print the van manifest
          perform print_van_manifest tables r_lgtor.
        when 'EODM'. " EOD Manifest button
        read the header table where has been selected
          loop at t_disp_head into w_disp_head where mark = c_yes.
            r_lgtor-sign   = 'I'.
            r_lgtor-option = 'EQ'.
            r_lgtor-low    = w_disp_head-lgtor.
            append r_lgtor.
          endloop.
        print the end of day manifest
          perform print_eod_manifest tables r_lgtor.
        when 'REFR'. "Refresh
        refresh display
          w_sy_repid = sy-repid.
          call function 'RS_REFRESH_FROM_SELECTOPTIONS'
               exporting
                    curr_report     = w_sy_repid
               tables
                    selection_table = seltab.
              exceptions
                  not_found       = 1
                  no_report       = 2
                  others          = 3.
          if sy-

  • ALV LIST/GRID DISPLAY

    Hi,
    My program output is in ALV format either LIST or GRID based on Sy-batch.
    In that program they are using table Z1021.
    They are retreiving data from Z1021 table based on selection screen parameters like werks, bukrs, vkorg,
    auart and date and passing that data to one internal table.
    SELECT * FROM Z1021 INTO TABLE i_z1021
    WHERE werks in s_werks
    AND       bukrs in s_bukrs
    AND       vkorg in s_vkorg
    AND       auart in s_auart
    AND       pgi_date in s_date.
    SORT i_z1021 BY werks bukrs vkorg auart pgi_date.
    For fieldcatlog they used function module REUSE_ALV_FIELDCATALOG_MERGE'.
    passing only i_structure_name  = c_struct_name in Exporting parameters
    retreive to i_fieldcat from Changing parameters.
    from above both they are passing i_z1021 table data and i_fieldcat to function module
    'REUSE_ALV_GRID_DISPLAY' OR 'REUSE_ALV_LIST_DISPLAY' based on sy-batch.
    That is my current program.
    My new requirement is given below.
    Additional and change to fields:
    1) Add Intercompany purchase order number
        From the document flow table VBFA.
        The field name is VBFA-VBELN when Subs.doc.categ (VBFA-VBTYP_N) equal to "V" after sales order line item.
    2) Change field name u2018Customeru2019 to u2018Ship-tou2019
    From VBFA table need to retrieve VBELN value based on VBELN_VA and POSNR_VA from Z1021 table
    where VBFA-VBELV = Z1021-VBELN_VA and VBFA-POSNV = Z1021-POSNR_VA.
    This is the condition to fetch that data.
    And I want to change the description of Field 'CUSTOMER'( Z1021-KUNNR) to' Ship-to'.
    Is it possible to do without changing the original logic.
    IF it is possible what is the solution ?
    If it is not possible without changing the original code then what is the solution for that also.
    Current Code:
    Some code i am giving here.
    TABLES: Z1021.
    DATA: i_z1021 LIKE z1021 OCCURS 0.
    CONSTANTS: c_struct_name LIKE dd02l-tabname VALUE 'Z1021'.
    START-OF-SELECTION.
    PERFORM get_data.
    END-OF-SELECTION.
    PERFORM list_display.
    FORM get_data.
    SELECT * FROM Z1021 INTO TABLE i_z1021
    WHERE werks in s_werks
    AND       bukrs in s_bukrs
    AND       vkorg in s_vkorg
    AND       auart in s_auart
    AND       pgi_date in s_date.
    SORT i_z1021 BY werks bukrs vkorg auart pgi_date.
    ENDFORM.
    FORM list_display.
    PERFORM create_fieldcatalog.
    < another performs>
    PERFORM display_list.
    ENDOFRM.
    FORM create_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
           i_structure_name    = c_struct_name
        CHANGING    
           ct_fieldcat               = i_fieldcat.
    ENDFORM.
    FORM display_list.
    CASE sy-batch.
      WHEN 'X'.
    CALL FUNCTION ;REUSE_ALV_LIST_DISPLAY'
      WHEN ' '.
    CALL FUNCTION ;REUSE_ALV_GRID_DISPLAY'
    ENDCASE
    ENDFORM.
    Could you please suggest on this.
    Thanks & Regards.
    VSR

    Hi
    After fill the field catalog table by function module MERGE, u can modify the value before moving it to ALV LIST/GRID display fm:
    FORM create_fieldcatalog.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          i_structure_name = c_struct_name
       CHANGING
         ct_fieldcat = i_fieldcat.
    LOOP AT I_FIELDCAT INTO LS_FIELDCAT.
        CASE LS_FIELDCAT-FIELDNAME.
           WHEN 'KUNNR'.
            LS_FIELDCAT-SELTEXT_L = <new descrip.>.
            LS_FIELDCAT-SELTEXT_M = <new descrip.>.
            LS_FIELDCAT-SELTEXT_S = <new descrip.>.
            MODIFY I_FIELDCAT FROM LS_FIELDCAT.
        ENDCASE.
    ENDLOOP.
    ENDFORM.
    Max
    Edited by: max bianchi on Jan 29, 2009 8:15 PM

  • ALV Report to display the status of the requests raised through ESS

    Hi All,
    We have to develop a ALV report to display the status of the requests raised through ESS
    for Leave, Travel & Event Management, Travel and Appraisal workflows.
    ESS Travel, ESS TEM, ESS Apraisal workflows are associted with SAP Business Objects.
    we are using the function module SWI_WORKITEMS_OF_OBJTYPE_GET to get
    the top level work item id's by passing the object type like PDRELA_025, BUS2089.
    By using SWP_WORKFLOW_LOG_READ function we are getting the workflow log
    by passing top level work item id's as imort parameter. 
    The report output should have the following fields
    Initiator, Initiator Personal No, Request Type( Leave, Travel etc.. )
    Date of application of the request, Status ( Approved by RM, Rejected etc )
    Name of the Approver, Approved / Rejected Date.
    The logic should be work for all the above ESS workflows and should be generalized.
    Can any one please let me know the procedure to get the required information from the workflow log.
    It would be great if any one suggest on the same how to proceed further to get the information as mentioned above.
    Thanks & Regards,
    Jagadeeswara Rao Balla.

    Hello,
    You can get most of that information from fm SAP_WAPI_GET_HEADER, input is workitem_id.
    regards
    Rick Bakker
    Hanabi Technology

  • How to devolped an Interactive ALV Report to display sales orders

    hi,
             how to devolped an Interactive ALV Report to display sales orders pertaining to the selected Customers and item details in the secondary list.For this report what are the tables and fields wehave to used give with example.
    thank you
    radhakrishna

    Hi,
    look via se38 for BCALV* and SALV*.
    Try ABAPDOCU.
    Regards, Dieter

Maybe you are looking for

  • How to handle HTTP Message Format

    Hi All, i have the interface like XML File(Supplier)--XI--HTTP Message Post(SRM Server) How to handle this case and how to handle the HTTP Message formats, what Adapters and all i need to use here Regards Vamsi

  • How to get app to read my kindle books

    I need assistance and getting my Adobe Reader to read books that I have downloaded and they are you books fromso how do you do this thank you

  • Structure of the sender Data Type

    hi; i have two tables and want to fetch data from both in one go using sender JDBC adapter. Can any one tell me the structure of the sender Data Type if Table1 has A1,A2,A3 as fields and Table2 has B1,B2,B3 as fields. i want to fetch only A1,A2 field

  • Thunderbolt-email not deleting from server

    I checked my settings and the box is checked to delete messages from the server once they are deleted off of my phone.  This problem is just in the past week or so.  I delete them and as soon as email refreshes again they are back.  HELP!

  • Vector mask missing

    The "Auto Vector Mask" in Fireworks comes up totally blank when I try and apply it to one of my projects. Has anyone else experienced this, and if so can you please help? I do not receive any error message just an empty pop up window. I have uninstal