This is an ALV Report

If have Displayed a ALV report , i that my requirement is :
Double click on line -> navigation to MM03 (Material master material; Accounting or Costing View) andd skip selection screen.
for this i have written  a call transaction program but i dont know what i should do  for this Double click on line ->.
please help me as this is very urgent , i will reward points if helpfull.
thanks and regards,
prasadnn

hi,
check the below example.
u have to use
form val using user_command like sy-ucomm sel type slis_selfield.
report  zalvinteractive1                        .
tables : lfa1,ekko,ekpo.
select-options : vendor for lfa1-lifnr.
data : begin of itab occurs 0,
       lifnr like lfa1-lifnr,
       name1 like lfa1-name1,
       end of itab.
data : begin of jtab occurs 0,
       ebeln like ekko-ebeln,
       aedat like ekko-aedat,
       end of jtab.
data : begin of ktab occurs 0,
       ebelp like ekpo-ebelp,
       matnr like ekpo-matnr,
       end of ktab.
type-pools : slis.
data : repid like sy-repid.
data :lfa1_b type slis_t_fieldcat_alv,
      lfa1_w type slis_fieldcat_alv,
      ekko_b type slis_t_fieldcat_alv,
      ekko_w type slis_fieldcat_alv,
      ekpo_b type slis_t_fieldcat_alv,
      ekpo_w type slis_fieldcat_alv,
      events_b type slis_t_event,
      events_w type slis_alv_event.
perform get_val.
repid = sy-repid.
select lifnr name1 from lfa1 into table itab where lifnr in vendor.
*perform val USING USER_COMMAND sel.
call function 'REUSE_ALV_LIST_DISPLAY'
  exporting
    i_callback_program = repid
    it_fieldcat        = lfa1_b
    it_events          = events_b
  tables
    t_outtab           = itab.
*&      Form  GET_VAL
      text  this is to put column headings
form get_val.
  lfa1_w-fieldname = 'LIFNR'.
  lfa1_w-ref_tabname = 'LFA1'.
  lfa1_w-ref_fieldname = 'LIFNR'.
  append lfa1_w to lfa1_b.
  lfa1_w-fieldname = 'NAME1'.
  lfa1_w-ref_tabname = 'LFA1'.
  lfa1_w-ref_fieldname = 'NAME1'.
  append lfa1_w to lfa1_b.
  ekko_w-fieldname = 'EBELN'.
  ekko_w-ref_tabname = 'EKKO'.
  ekko_w-ref_fieldname = 'EBELN'.
  append ekko_w to ekko_b.
  ekko_w-fieldname = 'AEDAT'.
  ekko_w-ref_tabname = 'EKKO'.
  ekko_w-ref_fieldname = 'AEDAT'.
  append ekko_w to ekko_b.
  ekpo_w-fieldname = 'EBELP'.
  ekpo_w-ref_tabname = 'EKPO'.
  ekpo_w-ref_fieldname = 'EBELP'.
  append ekpo_w to ekpo_b.
  ekpo_w-fieldname = 'MATNR'.
  ekpo_w-ref_tabname = 'EKPO'.
  ekpo_w-ref_fieldname = 'MATNR'.
  append ekpo_w to ekpo_b.
  events_w-name = 'USER_COMMAND'.
  events_w-form = 'VAL'.
  append events_w to events_b.
endform.                    "GET_VAL
*&      Form  VAL
      text
     -->USER_COMMANtext
     -->SEL        text     for retrieving data
form val using user_command like sy-ucomm sel type slis_selfield.
  data : ven(10) type n,
         po(10) type n.
  data : mat(10) type c.
  if sel-fieldname = 'LIFNR'.
    ven = sel-value.
    select ebeln aedat from ekko into table jtab where lifnr = ven.
   call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
      i_callback_program             = repid
     I_STRUCTURE_NAME               = EKKO_B
      it_fieldcat                    = ekko_b
      it_events                      = events_b
     tables
       t_outtab                       = jtab.
  endif.
  if sel-fieldname = 'EBELN'.
    po = sel-value.
    select ebelp matnr from ekpo into table ktab where ebeln = po.
    call function 'REUSE_ALV_POPUP_TO_SELECT'
      exporting
        i_title            = 'ITEM DETAILS'
        i_tabname          = 'EKPO'
        it_fieldcat        = ekpo_b
        i_callback_program = repid
      importing
        es_selfield        = sel
      tables
        t_outtab           = ktab.
  endif.
logic to select a record
  if sel-fieldname = 'MATNR'.
    mat = sel-value.
    set parameter id 'MAT' field mat.
    call transaction 'MM02' and skip first screen.
  endif.
endform.                    "VAL

Similar Messages

  • Display only first value of the repeated values  in ALV report

    Hi,
    Test Data
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    In this type of ALV Report in which only the First field value of the repeated value  should be displayed.
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    I can display document value as like expected result in SORT ORDER in LAYOUT but the Quantity value,Net value  which cannot be done in SORT ORDER in LAYOUT.
    Please tell me the suitable solution.

    For a Sales Order there are two Invoice.
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith  material no
    5000              900             234774.00    456.00000                 65             123
                                             234774.00    456.00000                 25             456
                                             234774.00    456.00000                 35             898
                                             234774.00    456.00000                 20             496
                          901            634774.00    256.00000                 50               746
                                            634774.00    256.00000                 10               456
                                            634774.00    256.00000                 20               545
                                            634774.00    256.00000                 30               869
    I  need to print this billed Qty and Net value  only once in first line and it should not be deleted.
    I need the result like this
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith          material no
    5000              900             234774.00    456.00000                 65                     123
                                                                                    25                     456
                                                                                    35                     898
                                                                                    20                     496
    5001              901            634774.00    256.00000                 50                       746
                                                                                    10                       456
                                                                                    20                       545
                                                                                    30                       869               
    The same value should not be repeated for Billed Qty and Net Value.
    I can do that for Sales doc in sort order in layout but i couldn't do for Billed qty and Net Value.
    Please  help.

  • Logo is not printing in ALV report

    Hi all,
             I have to print logo in the O/P list of an ALV report. for this i have written the code like......
    FORM TOP-OF-PAGE.
      wa_listheader-typ  = 'H'.
      wa_listheader-info = 'This is an ALV report'.
      append wa_listheader to it_listheader.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary       = it_listheader
           I_LOGO                   =  'ENJOY'.
    endform.
    and i have passed this TOP-OF-PAGE to I_CALLBACK_TOP_OF_PAGE .Here my problem is the logo and list heading also not getting printed in the o/p, but list is coming...pls help me out...
    Thanks & Regards.
    Laxman.P
    B'lore.
        ENDFORM.

    Hi,
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = i_repid
    i_callback_user_command = 'USER_COMMAND_PERNR'
    it_fieldcat = header
    is_layout = gt_layout
    i_callback_top_of_page = 'TOP-OF-PAGE1'
    i_grid_title = xyz
    it_sort = gt_sort[]
    i_default = 'X'
    i_save = 'U'
    is_variant = gt_variant
    it_events = gt_events
    tables
    t_outtab = t_output.
    clear t_output.
    Form TOP-OF-PAGE1
    form top-of-page1.
    data: header type slis_t_listheader,
    wa type slis_listheader. "infield like wa-info, nline type n.
    TITLE AREA
    wa-typ = 'S'.
    wa-info = text-h04.
    append wa to header.
    wa-typ = 'S'.
    write sy-datum to wa-info mm/dd/yyyy.
    concatenate text-h03 wa-info into wa-info separated by space.
    append wa to header.
    wa-typ = 'S'.
    concatenate text-h02 sy-uname into wa-info separated by space.
    append wa to header.
    wa-typ = 'S'.
    concatenate text-h01 sy-repid into wa-info separated by space.
    append wa to header.
    ********" LOGO
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = header
    i_logo = 'ENJOYSAP_LOGO'.
    *********" LOGO
    endform.
    refer this report
    <b>
    BALVST03_GRID</b>
    <b>Reward points</b>
    Regards

  • Delte coulmn in alv report

    i have an alv report , after or before he get's out
    i need to delete the column that have '0' zero how i can do it.

    i forgot this rich program i use it an d i need to delete the zero column
    this is dynamic alv
    report zrich_0002 .
    type-pools: slis.
    tables: mard, t023t, marc,makt, mara, t001l,mdbs, vbup,vbfa,mvke,
    vbep, vbap, vbak.
    field-symbols: <dyn_table> type standard table,
    <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
    it_fldcat type lvc_t_fcat,
    wa_it_fldcat type lvc_s_fcat.
    *data: imard type table of mard with header line.
    data: begin of imard occurs 0,
    werks like marc-werks,
    matkl like t023t-matkl,
    matnr like ekpo-matnr,
    lgort like mard-lgort,
    labst like mard-labst,
    diskz like mard-diskz,
    insme like mard-insme,
    wgbez like t023t-wgbez,
    meins like mara-meins,
    speme like mard-speme,
    retme like mard-retme,
    umlme like mard-umlme,
    werks LIKE mard-werks,
    maktx like makt-maktx,
    eislo like marc-eislo,
    end of imard.
    select-options: matnr for mara-matnr matchcode object mat1,
    werks for mard-werks, " MATCHCODE OBJECT t001w,
    lgort for mard-lgort, " MATCHCODE OBJECT tl001,
    mtart for mara-mtart, "MATCHCODE OBJECT mara,
    matkl for mara-matkl." MATCHCODE OBJECT mara.
    start-of-selection.
      select mardeinme mardinsme mardlabst mardmatnr mard~retme
      mardspeme mardumlme mardwerks maramatnr mara~meins
      maktmaktx maktmatnr marceislo marcmatnr mard~lgort
      mard~werks
      into (mard-einme , mard-insme , mard-labst , mard-matnr , mard-retme
      , mard-speme , mard-umlme , mard-werks , mara-matnr , mara-meins
      , makt-maktx , makt-matnr , marc-eislo , marc-matnr , mard-lgort
      , mard-werks
      from ( mard
      inner join mara
      on maramatnr = mardmatnr
      inner join makt
      on maktmatnr = maramatnr
      inner join marc
      on marcmatnr = maktmatnr )
      where mara~matnr in matnr
      and mard~werks in werks
      and mard~lgort in lgort
      and mara~mtart in mtart
      and mara~matkl in matkl
      and makt~spras = 'B'.
        if sy-subrc = 0.
          move mard-einme to imard-insme.
          move mard-insme to imard-insme.
          move mard-labst to imard-labst.
          shift mard-matnr left deleting leading '0'.
          move mard-matnr to imard-matnr.
          move mard-retme to imard-retme.
          move mard-speme to imard-speme.
          move mard-umlme to imard-umlme.
          move mard-werks to imard-werks.
          move mara-matnr to imard-matnr.
          move mara-meins to imard-meins.
          move makt-maktx to imard-maktx.
          move makt-matnr to imard-matnr.
          move marc-eislo to imard-eislo.
          move marc-matnr to imard-matnr.
          move mard-lgort to imard-lgort.
          append imard.
        endif.
      endselect.
    <b>  delete adjacent duplicates from imard.</b>
    select * into table imard from mard
    where matnr = p_matnr
    and werks = p_werks.
    build the dynamic internal table
      perform build_dyn_itab.
      perform build_report.
    call the alv grid.
      perform call_alv.
    Build_dyn_itab
    form build_dyn_itab.
      data: new_table type ref to data,
      new_line type ref to data,
      tot_lines type i.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'MATNR'.
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-seltext = 'Material Number'.
      wa_it_fldcat-intlen = 25.
      append wa_it_fldcat to it_fldcat .
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'WERKS'.
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-seltext = 'Plant'.
      wa_it_fldcat-intlen = 4.
      append wa_it_fldcat to it_fldcat .
      loop at imard.
    <b>* Check that the field hasn't been already addd to the fieldcat.
        concatenate 'LABST' imard-lgort into  wa_it_fldcat-fieldname.
        read table it_fldcat into wa_it_fldcat
               with key fieldname = wa_it_fldcat-fieldname.
        check sy-subrc <> 0.</b>
        clear wa_it_fldcat.
    concatenate 'LGORT' imard-lgort into
    wa_it_fldcat-fieldname.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
    wa_it_fldcat-intlen = 4.
    append wa_it_fldcat to it_fldcat .
        clear wa_it_fldcat.
        concatenate 'LABST' imard-lgort into
        wa_it_fldcat-fieldname.
        wa_it_fldcat-datatype = 'QUAN'.
        wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
        wa_it_fldcat-intlen = 15.
        append wa_it_fldcat to it_fldcat .
        clear wa_it_fldcat.
        concatenate 'INSME' imard-lgort into
        wa_it_fldcat-fieldname.
        wa_it_fldcat-datatype = 'QUAN'.
        wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
        wa_it_fldcat-intlen = 15.
        append wa_it_fldcat to it_fldcat .
        clear wa_it_fldcat.
        concatenate 'RETME' imard-lgort into
        wa_it_fldcat-fieldname.
        wa_it_fldcat-datatype = 'QUAN'.
        wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
        wa_it_fldcat-intlen = 15.
        append wa_it_fldcat to it_fldcat .
        clear wa_it_fldcat.
        concatenate 'UMLME' imard-lgort into
        wa_it_fldcat-fieldname.
        wa_it_fldcat-datatype = 'QUAN'.
        wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
        wa_it_fldcat-intlen = 15.
        append wa_it_fldcat to it_fldcat .
        clear wa_it_fldcat.
        concatenate 'SPEME' imard-lgort into
        wa_it_fldcat-fieldname.
        wa_it_fldcat-datatype = 'QUAN'.
        wa_it_fldcat-seltext = wa_it_fldcat-fieldname.
        wa_it_fldcat-intlen = 15.
        append wa_it_fldcat to it_fldcat .
      endloop.
    Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
      exporting
      it_fieldcatalog = it_fldcat
      importing
      ep_table = new_table.
      assign new_table->* to <dyn_table>.
    Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Form build_report
    form build_report.
      data: fieldname(20) type c.
      data: fieldvalue(5) type c.
      data: index(3) type c.
      field-symbols: <fs1>.
    <b>*  assign component 'MATNR' of structure <dyn_wa> to <fs1>.
    call function 'CONVERSION_EXIT_MATN1_OUTPUT'
          exporting
               input  = matnr
          importing
               output = matnr.
    shift matnr-low left deleting leading '0'.
    <fs1> = matnr-low.
    assign component 'WERKS' of structure <dyn_wa> to <fs1>.
    <fs1> = werks.</b>
      loop at imard.
        index = sy-index.
    <b>    assign component 'MATNR' of structure <dyn_wa> to <fs1>.
        <fs1> = imard-matnr.
        call function 'CONVERSION_EXIT_MATN1_OUTPUT'
             exporting
                  input  = <fs1>
             importing
                  output = <fs1>.
        assign component 'WERKS' of structure <dyn_wa> to <fs1>.
        <fs1> = imard-werks.</b>
    Set the LGORT
    concatenate 'LGORT' imard-lgort into
    fieldname.
    condense fieldname no-gaps.
    assign component fieldname of structure <dyn_wa> to <fs1>.
    <fs1> = imard-lgort.
    Set the LABST
        concatenate 'LABST' imard-lgort into
        fieldname.
        condense fieldname no-gaps.
        assign component fieldname of structure <dyn_wa> to <fs1>.
        <fs1> = imard-labst.
    INSME
        concatenate 'INSME' imard-lgort into
        fieldname.
        condense fieldname no-gaps.
        assign component fieldname of structure <dyn_wa> to <fs1>.
        <fs1> = imard-insme .
    *******RETEME
        concatenate 'RETME' imard-lgort into
        fieldname.
        condense fieldname no-gaps.
        assign component fieldname of structure <dyn_wa> to <fs1>.
        <fs1> = imard-retme.
    ******UMLME
        concatenate 'UMLME' imard-lgort into
        fieldname.
        condense fieldname no-gaps.
        assign component fieldname of structure <dyn_wa> to <fs1>.
        <fs1> = imard-umlme.
    ****SPEME
        concatenate 'SPEME' imard-lgort into
        fieldname.
        condense fieldname no-gaps.
        assign component fieldname of structure <dyn_wa> to <fs1>.
        <fs1> = imard-speme.
        at end of matnr.
    Append to the dynamic internal table
          append <dyn_wa> to <dyn_table>.
          clear <dyn_wa>.
        endat.
      endloop.
    endform.
    CALL_ALV
    form call_alv.
      data: wa_cat like line of alv_fldcat.
      loop at it_fldcat into wa_it_fldcat.
        wa_cat-fieldname = wa_it_fldcat-fieldname.
        wa_cat-seltext_s = wa_it_fldcat-seltext.
        wa_cat-outputlen = wa_it_fldcat-outputlen.
        append wa_cat to alv_fldcat.
      endloop.
    Call ABAP List Viewer (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = alv_fldcat
           tables
                t_outtab    = <dyn_table>.
    endform.

  • In ALV report how to do this..

    Hi,
         I worte one zreport,  it displays the output in the Grid format.
         Goto tr code : coois-> give some material number u will get output in the grid format..->above the grid u will look the bar on that u will see  ENDUSER DOC, DISPLAY GRAPHIC, LAYOUT SETTINGS....
    My requirement is :  I have to add this bar to my grid report, please explain to me.
    Thanks and Regards,
    Surya

    Hi Jai.
    We can not display barcode in ALV but in Smartform  and Script is possible becuase we can set font "BARCODE" or any fonts to our variable.
    What you should do is create general ALV report ,Smatform for printing barcode and botton for call
    Smartform  in ALV program.When a line is selected and click botton then take data in that line and call
    Smartform for printing barcode that what I have done.
    Hope it help .
    SayC.

  • How to get this output format in ALV report

    Hi.
    Can any one pls let me know how to get the following output format in ALV report.Following are the outputfields
    companycode   location     position     approver
    300    800       01    watson
    null   null        03     candy
    null   null        04     smith
    null   null        05     michael
    one empty line after this again
    300     800     01     ryant
    null      null    02     gyan
    null      null    03     fermi
    null      null    04     ogata
    *Note: Null     indicates  empty space .( i.e I need to get empty space in  output where ever null is there.)
            Thanks in advance.
    Kind Regards,
    samiulla.

    hi,
    u can use 'REUSE_ALV_LIST_DISPLAY'
                           or
    'REUSE_ALV_GRID_DISPLAY'  function modules.
    SAMPLE CODE :
    *& Report  Y101982CHD
    *                         TABLES
    TABLES: vbak.    " standard table
    *                           Type Pools                                 *
    TYPE-POOLS: slis.
    *                     Global Structure Definitions                     *
    *-- Structure to hold data from table CE1MCK2
    TYPES: BEGIN OF tp_itab1,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           werks LIKE vbap-werks,
           lgort LIKE vbap-lgort,
           END OF tp_itab1.
    *-- Data Declaration
    DATA: t_itab1 TYPE TABLE OF tp_itab1.
    DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
    *                    Selection  Screen                                 *
    *--Sales document-block
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    SELECTION-SCREEN END OF  BLOCK b1.
    *--Display option - block
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
    PARAMETERS: alv_list RADIOBUTTON GROUP g1,
                alv_grid RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF  BLOCK b2.
    *file download - block
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
    PARAMETERS: topc AS CHECKBOX,
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF  BLOCK b3.
    *                      Initialization.                                *
    *                      At Selection Screen                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
        EXPORTING
          dynpfield_filename = 'P_FILE'
          dyname             = sy-cprog
          dynumb             = sy-dynnr
          filetype           = 'P'      "P-->Physical
          location           = 'P'     "P Presentation Srever
          server             = space.
    AT SELECTION-SCREEN ON s_vbeln.
      PERFORM vbeln_validate.
    *                           Start Of Selection                         *
    START-OF-SELECTION.
    *-- Fetching all the required data into the internal table
      PERFORM select_data.
    *                           End Of Selection                           *
    END-OF-SELECTION.
      IF t_itab1[] IS NOT INITIAL.
        IF topc IS NOT INITIAL.
          PERFORM download.
          MESSAGE 'Data Download Completed' TYPE 'S'.
        ENDIF.
        PERFORM display.
      ELSE.
        MESSAGE 'No Records Found' TYPE 'I'.
      ENDIF.
    *                           Top Of Page Event                          *
    TOP-OF-PAGE.
    *& Form           :      select_data
    * Description     : Fetching all the data into the internal tables
    *  parameters    :  none
    FORM select_data .
      SELECT vbeln
         posnr
         werks
         lgort
         INTO CORRESPONDING  FIELDS OF TABLE t_itab1
         FROM vbap
         WHERE  vbeln IN s_vbeln.
      IF sy-subrc <> 0.
        MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " select_data
    *& Form        : display
    *  decription  : to display data in given format
    * parameters   :  none
    FORM display .
      IF alv_list = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                               USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
    **        it_events                = t_alv_events[]*
            *it_fieldcat              = i_fieldcat[]*
          *TABLES*
            *t_outtab                 = t_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.*
      ENDIF.
      IF alv_grid = 'X'.
        PERFORM build_fieldcat TABLES i_fieldcat[]
                                 USING :
    *-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
         'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
         'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
         'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
         'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
        *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
          *EXPORTING*
            *i_callback_program       = sy-repid*
    **        i_callback_pf_status_set = c_pf_status*
            *i_callback_user_command  = 'USER_COMMAND '*
            *it_fieldcat              = i_fieldcat*
          *TABLES*
            *t_outtab                 = t_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.*
      *ENDIF.*
    ENDFORM.                    " display
    *& Form        : vbeln_validate
    *  description : to validate sales document number
    * parameters   :  none
    FORM vbeln_validate .
      DATA: l_vbeln TYPE vbak-vbeln.
      SELECT SINGLE vbeln
        FROM vbak
        INTO l_vbeln
        WHERE vbeln IN s_vbeln.
      IF sy-subrc NE 0.
        MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
        EXIT.
      ENDIF.
    ENDFORM.                    " vbeln_validate
    *& Form       :build_fieldcat
    * Description : This routine fills field-catalogue
    *  Prameters  : none
    FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                        USING   fp_field     TYPE slis_fieldname
                                fp_table     TYPE slis_tabname
                                fp_length    TYPE dd03p-outputlen
                                fp_ref_tab   TYPE dd03p-tabname
                                fp_ref_fld   TYPE dd03p-fieldname
                                fp_seltext   TYPE dd03p-scrtext_l
                                fp_col_pos   TYPE sy-cucol.
    *-- Local data declaration
      DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
    *-- Clear WorkArea
      wl_fieldcat-fieldname       = fp_field.
      wl_fieldcat-tabname         = fp_table.
      wl_fieldcat-outputlen       = fp_length.
      wl_fieldcat-ref_tabname     = fp_ref_tab.
      wl_fieldcat-ref_fieldname   = fp_ref_fld.
      wl_fieldcat-seltext_l       = fp_seltext.
      wl_fieldcat-col_pos         = fp_col_pos.
    *-- Update Field Catalog Table
      APPEND wl_fieldcat  TO  fpt_fieldcat.
    ENDFORM.                    "build_fieldcat
    *& Form        : download
    *  description : To Download The Data
    *  Parameters  :  none
    FORM download .
      DATA: l_file TYPE string.
      l_file = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
        TABLES
          data_tab                = t_itab1
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6.
      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.                    " download
    HOPE IT WILL HELP YOU
    REGARDS
    RAHUL SHARMA

  • '@' not getting displayed in the ALV report

    Hello,
    I am facing  a strange issue in the ALV report display. A string starting with '@' is not getting displayed and says "default icon " on the report. and this is varying from system to system for the same user.
    can anyone please help me in resolving the issue.
    Thanks in advance.
    Thanks and Regards,
    Santhosh Guptha N.

    @ is a default value as per ALV internal process. This is used in icons .
    I think this is causing the confusion.
    Check in the fieldcat if there is any adjsutment to be made to handle this.
    Br,
    Vijay

  • PF STATUS IN ALV REPORT

    hi,
    How to use PF STATUS IN ALV REPORT?

    HI,
    see this code.
    TABLES:MARA.
    SELECT-OPTIONS: MATNR FOR MARA-MATNR.
    DATA:BEGIN OF ITAB OCCURS 0,
         MATNR LIKE MARA-MATNR,
         ERSDA LIKE MARA-ERSDA,
         MTART LIKE MARA-MTART,
         MBRSH LIKE MARA-MBRSH,
    END OF ITAB.
    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR
    IN MATNR.
    TYPE-POOLS SLIS.
    DATA:FCAT TYPE slis_t_fieldcat_alv.
    DATA:LAYOUT TYPE slis_layout_alv.
    DATA:EVE TYPE slis_t_event WITH HEADER LINE.
    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    SORT-UP = 'X'.
    SORT-SPOS = 1.
    SORT-FIELDNAME = 'ERSDA'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    SORT-SPOS = 2.
    SORT-FIELDNAME = 'MTART'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    EVE-NAME = 'TOP_OF_PAGE'.
    EVE-FORM = 'TOPOFPAGE'.
    APPEND EVE.
    EVE-NAME = 'TOP_OF_LIST'.
    EVE-FORM = 'TOPOFLIST'.
    APPEND EVE.
    EVE-NAME = 'END_OF_LIST'.
    EVE-FORM = 'ENDOFLIST'.
    APPEND EVE.
    LAYOUT-ZEBRA = 'X'.
    LAYOUT-no_hline = 'X'.
    LAYOUT-NO_VLINE = 'X'.
    LAYOUT-window_titlebar = 'MATERIAL DETAILS'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = SY-REPID
       I_INTERNAL_TABNAME           = 'ITAB'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = FCAT
    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_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = SY-REPID
    <b>   I_CALLBACK_PF_STATUS_SET       = 'STATUS'
       I_CALLBACK_USER_COMMAND        = 'UCOMM'</b>
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = LAYOUT
       IT_FIELDCAT                    = FCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       IT_SORT                        = SORT[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = EVE[]
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 5
      I_SCREEN_START_LINE            = 5
      I_SCREEN_END_COLUMN            = 120
      I_SCREEN_END_LINE              = 25
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = ITAB
    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.
    FORM TOPOFPAGE.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    FORM TOPOFLIST.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS-LISTTOP'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    FORM ENDOFLIST.
    REFRESH HEAD.
        HEAD-TYP = 'H'.
        HEAD-INFO = 'MATERIALS-LISTEND'.
        APPEND HEAD.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = HEAD[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
    ENDFORM.
    <b>FORM STATUS USING MYMENU.
        SET PF-STATUS 'MENU' excluding MYMENU.
    ENDFORM.
    FORM UCOMM USING CODE STEXT.
        CASE CODE.
            WHEN 'ABC'.
            WRITE:/ 'YOU HAVE CLICKED ON ABC'.
            WHEN 'XYZ'.
            WRITE:/ 'YOU HAVE CLICKED ON XYZ'.
        ENDCASE.
    ENDFORM.</b>
    rgds,
    bharat.

  • Menu options in ALV report

    Hi,
    Im not getting Menu options in ALV report output. Not even default menu options SYSTEM, HELP Its dispalying as <b>????????????????????????????????</b>. Can someone help me regarding this?
    Regards,
    amal

    Hi Amal,
                Check the screen number if you are using a seperate screen and Menu painter.
    Thanks and Regards,
    Sampath

  • Double click in alv report

    Hi all,
    I have below output in alv report.
    matnr 101_102 121_122 123_124
    10000   23          34              45
    10001   34          34              456
    if i m clicking on 23 in combination of 121_122 and 10000 then i want to see detail for 121_122 and if i m clicking on 34 combination of 101_102 then i want to see detail according to it.
    plz help me. its urgent.
    thanks in advance.

    Check the below report and do compare and modify the report as per your req.
    REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838                      .
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
          Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
       LIST_TYPE_WRONG       = 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.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
         Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
      retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
          text
         -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
          text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = ALV_LAYOUT
         IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
        i_default                         = 'ZLAY1'
         I_SAVE                            = 'A'
        is_variant                        = i_variant
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "display_alv_report
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
          text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
           Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
          text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKPO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         =
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_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.
    Thanks
    Seshu

  • Icon display in alv report

    Hi all,
           I have a problem in alv report ,there are 5 fields to display and in 6th position i have to display an icon as red or green light according to data. How can i do that ? please help me .
    Thanks and regards
    Goutam

    Hi goutam,
    1. Simple
    2. we have to use the layout for this purpose.
    3. like this :
      alvly-lights_fieldname = 'LT'.
      alvly-lights_tabname = 'ITAB'.
    4. Just copy paste to get a taste of it.
      (important code has been highlighted)
    REPORT abc.
    TYPE-POOLS : slis.
    DATA : alvly TYPE slis_layout_alv.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : BEGIN OF itab OCCURS 0,
    <b>       lt TYPE i,</b>
           matnr LIKE mara-matnr,
           END OF itab.
    END-OF-SELECTION.
    <b>  itab-lt = 1.
      APPEND itab.
      itab-lt = 2.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 1.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.</b>
    <b>  alvly-lights_fieldname = 'LT'.
      alvly-lights_tabname = 'ITAB'.</b>
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = sy-repid
          i_internal_tabname = 'ITAB'
          i_inclname         = sy-repid
        CHANGING
          ct_fieldcat        = alvfc.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = alvfc
          is_layout          = alvly
          i_save             = 'A'
        TABLES
          t_outtab           = itab.
    regards,
    amit m.

  • Display Icons in ALV report

    Hi all Good Morning.
    In ALV report am inserted my own icons. But the problem is at output screen am getting only those icons which i created, remaining are not displaying in standard tool bar .
    Please tell me how to solve this. I want to display all default icons with my own created icons in standard tool bar .
    Regards,
    Prajwal K.
    Edited by: prajwal k on Jan 24, 2008 4:39 AM

    Hi Prajwal, this code will solve ur problem.
    go to SE41.
    Give SAPLKKBL as program name and STANDARD_FULLSCREEN as status....
    now click on Copy Status and in that give ur program and status name into To.....
    now in REUSE_ALV_GRID_DISPLAY
    FORM display_list.
    g_f_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = g_f_repid
    i_callback_user_command = 'USER_COMMAND'
    i_callback_pf_status_set = 'SET_STAT'
    it_fieldcat = g_t_fieldcat[]
    it_events = g_t_events[]
    TABLES
    t_outtab = g_t_itab
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " display_list
    FORM set_stat USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM. "set_stat
    here my status name is ZSTAT which i gave in SE41...
    and in user_command form...
    FORM user_command USING u_comm LIKE sy-ucomm selfield TYPE slis_selfield.
    CASE u_comm.
    WHEN 'DET'.
    ........ur logic.........
    ENDCASE.
    ENDFORM. "user_command
    kindly reward if found helpful.
    cheers,
    Hema.

  • Hiding fields in ALV report

    Hi all
    In ALV Report .The user must be able to adapt the result list (add hidden fields, remove columns) and save the layout as layout. The user must be able to select this layout when executing the selection.
      the user must hide the fields and can diplay when ever he needs in ALV report

    U have to use no_out = 'X'.
    fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-no_out   = 'X'.
      fieldcatalog-key         = 'X'.
    gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
                it_events               = gt_events 
                is_print                = gd_prntparams
    <b>            i_save                  = 'X'</b>
                is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

  • Some doubts in alv report

    how can i page breakin alv report ?
    what are the types of variants and events in alv report?
    how to hide field in alv?
    how to change standard pf status in alv reports?
    plz give me sample program for how to use variants in alv?
    <THREAD LOCKED. Please stop asking interview questions. There is already a lot of information out there, refer to the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to ask a good question and learn to search>
    Edited by: Mike Pokraka on Oct 15, 2008 4:52 PM

    how can i page breakin alv report ?
    - Yes... using NEW-PAGE
    what are the types of variants and events in alv report?
    - DATA: g_variant LIKE disvariant.
    - DATA: gt_eventos          TYPE slis_t_event.
    how to hide field in alv?
    - When you define the field catalog mark this field ls_fieldcat-no_out = 'X'.
    how to change standard pf status in alv reports?
    CLEAR ls_extab.
    ls_extab-fcode = 'ZASSIG'.
    APPEND ls_extab TO extab.
    SET PF-STATUS 'Z09_STATUS' EXCLUDING extab.

  • Warning message in ALV report

    Hi Experts,
    In ALV report i am getting warning like
    " Field string LS_HEADER is not referenced statically"
    Actually i declared this field as "DATA: ls_header TYPE slis_listheader.".
    How to correct this warning message.
    Thanks in advance.
    Thanks,
    Madhu.

    Dear Madhu,
    You are not using LS_HEADER statically that you have defined in the program. You will get a warning message since you have defined a field that you have not referenced statically.
    Are you using this field dynamically? You can delete/comment the code if you are not using it statically and dynamically.
    Moved the thread ABAP forum. Post your queries in relevant forums to get efficient answers.
    Regards,
    Naveen

Maybe you are looking for

  • Computer turns on but screen doesn't work

    I turn the computer on and it sounds like it comes on but the screen doesn't come on...?

  • SetBindValue

    Is it posible to bind one value to multiple variables with DBMS_XMLQuery.setBindValue with out having to name all the variables differently In the case where I am using the same named variable twice. i.e. select role, granted_role from role_role_priv

  • Will AirPlay use Battery when not in use?

    Hi everyone, i'm pretty new in the Apple Universe (Aug 2012) and...well enjoying it :-) One thing i was not able to find an answer to is if AirPlay will drain more Battery from iPad and iPhone when activated even if nothing ist streamed or mirrored?!

  • Rounding ist wrong for float value (MS SQL 2005)

    Hello I have a simple report with a command: select num = convert(float, 4.145) Field round over "Format Field" or ToText( num, 2) the result is 4.14  -> Wrong if  i use Round(num, 2)  result is 4.15 --> OK In CR 8.5 result is always correct Thx

  • ISynk doesn't transfer my phone calendar items

    Had some kind of breakdown in iCal. That is fixed. Now when I'm synking my calendar, the phone says that it sends items, iSynk says that it has received items, but no items gets visible in iCal. The other way around - from Mac to phone is no problem.