Display of check box as the output in the ALV

Hi Experts,
Please guide me with the steps of displaying the check box as the output of an ALV report
thanks

Hi,
Check this program: BALVSD01.
Check this code:
*& Report ZAK_ALV
REPORT ZAK_ALV line-count 10.
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ck type c,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'CK'.
fieldcatalog-seltext_m = 'CHECKM BOX'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-CHECKBOX = 'X'.
fieldcatalog-EDIT = 'X'.
fieldcatalog-key = ''.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
fieldcatalog-checkbox = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
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
i_save = 'X'
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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 100 rows
from ekpo
into CORRESPONDING FIELDS OF table it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.

Similar Messages

  • Display of check box on the o/p list

    Hi,
            I need to display 3 check boxes on the final output display.
    Can you pls guide me to do this?

    Hi Nagalakshmi,
    Please check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e6435c111d1829f0000e829fbfe/content.htm
    You can output the first character of a field as a checkbox on the output screen by using the following syntax:
    Syntax
    WRITE <f> AS CHECKBOX.
    If the first character of field <f> is an "X", the checkbox is displayed filled. If the first character is SPACE, the checkbox is displayed blank.
    In other words, the user can fill or clear them with a mouse click. For information on how you can check if output fields are ready for input or not, see Enabling Fields for Input. Fields that are ready for input are an essential component of interactive lists that allow a dialog with the user (see Interactive Lists.
    DATA: flag1(1) TYPE c    VALUE ' ',
          flag2(1) TYPE c    VALUE 'X',
          flag3(5) TYPE c    VALUE 'Xenon'.
    WRITE: / 'Flag 1 ', flag1  AS CHECKBOX,
           / 'Flag 2 ', flag2  AS CHECKBOX,
           / 'Flag 3 ', flag3  AS CHECKBOX.
    Best regards,
    raam

  • Complete filter cannot be displayed by check box item - How to solve

    Hi,
    I have created a web template which has a table, chart and the navigational block.
    When i execute the report and further when i want to drill down i use navigational block.
    When i filter the value suppose country in the navigational block by clicking on it, i should be able to see the county values, but i get the error "Complete filter cannot be displayed by check box item".
    How can i solve the problem by getting the filter values, when i further drill down
    Thanks
    rani

    it is a awfull conundrum/and is why I began ONLY using optimum as a web mail/ But  Now yes Now even this is becomming a nasty little night mare'   I see 2 email windows,simotaniously'
    and  Then I se FLASHES of words,stuck in address bar..
    weeks Later I see LAZSLO '
    This lead me to a Univeristy'IMAGINE THIS'
    but is it also a company and Optimum has the web mail as well as tec support OUTSOURCED
    "THEY CAN N OT HELP YOU PAST dinner time,save your breath! 
    BUT WHAT IS HAPPENING WITH ALL THESE points for answers APPLE BOYS AND GRILS?
    HOW do you all get points to the  Happyness to then say TOUCH DOWN?
    remarkably fantastic!'for you not me
    linda really would LIKE TO KNOW WHos doing your mail latley'
    peace

  • Is it Possible to display the output of the ALV list as POP-UP

    Hi Experts,
                     Is it Possible to display the output of the ALV list as POP-UP, if yes then provide some ideas on it.
    thanking in advance,
    Samad.

    Hi samad, it is possible to display alv list as pop-up by using the FM " REUSE_ALV_POPUP_TO_SELECT"
    try this sample code
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
          EXPORTING
       I_TITLE                       =  P1_TITLE
           I_SELECTION                   = 'X'
           I_ZEBRA                       = 'X'
      I_CHECKBOX_FIELDNAME          =
      I_LINEMARK_FIELDNAME          =
      I_SCROLL_TO_SEL_LINE          = 'X'
            I_TABNAME                     = 'T_VBAP'
           I_STRUCTURE_NAME              =  'T_VBAP'
           IT_FIELDCAT                   =  T_FCAT2
           I_CALLBACK_PROGRAM            = 'ZTEST_ALV_POPUP'
       IMPORTING
           ES_SELFIELD                   = I_SELFIELD
           E_EXIT                        = W_EXIT
          TABLES
            T_OUTTAB                      = T_VBAP.
    i think it will solve your problem
    Regards,
    Vijay

  • Is there a way to automatically align and make same size of check boxes/ radio-buttons like in the image below?

    I create PDF forms on daily basis for multiple people around but still, I create a table in Word and then manually convert it to PDF. I'm using Acrobat X and then I manually create radio buttons or check boxes in each cell of the table so aligning those buttons or check-boxes in the same line is a problem. I know there would be some solution to this but can anyone guide me to that? Also, making the same size of the radio-buttons of check boxes likewise ? ? ?
    Please see the image above and advise how to align them in the same line and how to make them same size using Acrobat X?
    Your help appreciated.

    You should create these fields using the Place Multiple Fields command, so that they are aligned properly and all the same size. Read about it here:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS8C2DDC1C-C174-4ad1-893F-B14A1C0289B4.htm l
    Read how to align and distribute fields here:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS6D2D2BFC-6F69-4a8b-BDE6-8043D7EE240D.htm l

  • Since updating to Firefox 3.6.15, I can no longer print coupons from SmartSource. The error message is that Java is not detected. The check box is longer showing in the Options/Content of this version of Firefox, so I can not enable it.

    # Question
    Since updating to Firefox 3.6.15, I can no longer print coupons from SmartSource. The error message is that Java is not detected. The check box is longer showing in the Options/Content of this version of Firefox, so I can not enable it.

    Same PC as I used to post the question. When I go to the "plug in check" page, it shows I am up to date and it is not disabled.
    Java(TM) Platform SE 6 U24
    Next Generation Java Plug-in 1.6.0_24 for Mozilla browsers 1.6.0.24

  • Problem displaying the output in the same view

    hi Gurus,
    I have developed an web dynrpo application and have three views, in the first view I am having an input field from which I am calling a BAPI by giving that input field value as input to the BAPI.
    Now is it possible to display the output also retrived from the BAPI on the same view.
    Thanks and regards
    kris

    hi LM,
    Thanks for your fast response.
    I think I was not clear in explaining my problem.
    I have a view in which I have an input field which is the input to the BAPI, now on entering the value in the input field I have a submit button, on clicking the BAPI should be executed and also the the output should be displayed on the same view.
    Now regarding the mapping both the input and output are in the same context, would that a problem.
    And also after getting the output from the BAPI I have to do some validations based on the output from the BAPI and get some message printed on the view.
    Please help me in this issue.
    Thanks and regards
    kris

  • How can I take check box in particular cell of the table in smartforms??

    Hi experts,
       pls tell me how can I take check box in particular cell of the table in smartforms??
    It is not interactive form.
    I hv taken small windows as check boxes.but i think it is not a proper solution....give me another solution...

    Hi,
    first create text for a particular cell.
    In that we have a  text editor  in that text editor we have symbols in include menu.
    whatever the symboll u want to put to ur cell . just assign it.
    please check it. if it helpful reward points.
    regards,
    satish.

  • [OLAP DML] display on screen the output while the program is running

    Hi,
    I'm running a script in AWM that is quite long, and I've placed some few 'show' so that I know what the program is doing, but it won't show on the screen the outputs until the program ends. I guess it writes all the outputs in a kind of buffer and release the content of the buffer at the end of the program.
    How could I have it to release this buffer continuously?
    Thanks

    i think the relational analogy would be an anonymous pl/sql block executing a list of commands while outputting a list of useful dbms_output.put_line log statements:
    Just as with SHOW and olap worksheet cmd line, you cant see the running dbms_output log while the pl/sql program is running... you need to wait for it to complete before you can see the log.
    You can write to a file and close/exit the file each time or you can write to log table and commit each time but i guess, some such heavy lifting is needed if you want to track the long running process mid-way.
    NOTE: For regular operations like dbms_cube.build load/forecast/allocate process/steps, you can always run queries against CUBE_BUILD_LOG etc mid-way. But if it's pure olap dml actions being performed then no neat pre-built handle to check things mid-way exists.

  • When i try to use my apple acocunt for the first time i get a prompt to put in my CC info but after i agree to the TOS the ipad only displays a black box no text, ive erased the ipad and still the same thing

    When i try to use my apple acocunt for the first time i get a prompt to put in my CC info but after i agree to the TOS the ipad only displays a black box no text, ive erased the ipad and still the same thing

    1. Turn router off for 30 seconds and on again
    2. Settings>General>Reset>Reset Network Settings

  • How to display that Check Box In Down of Tabular Rows .

    Dear Friends,
    i have created tabular form and one check box Item in that region.
    i want to display that checkbox Item after tabular form Rows .
    How to display that Check Box In Down of Tabular Rows .
    Thanks

    Hi,
    From report attributes, you can change column order
    http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21674/bldapp_rpt.htm#sthref1348
    Regards,
    Jari

  • To get the output  in the chart for a single selection

    Hi all,
    I used a query to get the output of the table, and for the same query i have  created a view to get the result in the chart.
    to get the output of the table for  a particular region i have created an input field and added value help to it. When i selected one particular region, i will be getting the data, in the table. But when i select a particular row in the table i need to get the data of that particular row only in the chart. (which i am getting)
    But when i select multiple regions at a time, then i am facing the issue. I get result of multiple regions data(at a time two rows are displayed in the chart) in the chart. where in i want to get data only for one region (only one row needs to get selected at a time) to get the result.
    Can any one throw a light of what needs to be done here.
    Thanks,
    Rani

    Hi Rani,
    I am not sure if I understand your question exactly, but it sounds like you need to set the selection mode for your table to "Single". If you do that the user will only have the possibility of selecting one row at a time in the table; they will not be able to select multiple rows.
    You make that setting in the Configure Element panel for the table.
    I hope this suggestions helps.
    Margaret

  • How to hide the specified rows in the output of the report?

    Hello all,
        I have a requirement where i have to hide some of the lines (<b>initial 6 lines</b> that is <b>6 rows</b>) in the output of the report.
    How would I go about doing this?
    Thanks for you time.

    Hello Sai,
    I believe this is query output ( e.g., )
    Country   Sales
    India        $100
    USA        $200
    Germany  $300
    You want to hide the line Germany  $300
    Case 1:
        If you can change the query, Filter on Country and exclude Germany
    Case 2:
        If you can not change the query, use url appending and filter out Germany
    Check webapi reference for the exact commands
    Case 3:
        Only if you are using the NW2004s front-end, Report designer will be available for you. In this, you can delete the rows that you do not want and publish in web.
    Case 1 and 2 solutions are available in older versions of front-end as well.
    Regards,
    Sheik Bilal

  • How to control the output fields in ALV

    Hi Pals,
    I have a Z program which outputs around 400 characters length. It is working fine when we run in foreground(online).. But i have the problem with the length of the output of the report when i run in BACKGROUND mode. That is, only 255 characters are being displayed.
    So, i have decided to supress some of the unwanted output fields being diplayed, so that the total output length becomes 255 characters.
    How can i handle this situation in the ALV's?
    Someone please send me some sample code.
    Thanks in advance,
    Ram.

    Hi
       Better create the Layout Variants with the desired columns.
    ALV is providing that functionality.
    Use
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = alv_variant
          i_save     = 'A'
        IMPORTING
          es_variant = alv_variant
        EXCEPTIONS
          not_found  = 2.
    Regards,
    Kumar

  • To store the output of the OutputStream in the String

    I can get the output of the transformer.transform("","") to be printed on the screen, but the aim is to store the output in the String.
    I checked out the API, one way to get the data would be to store the output in the file using.....
    new StreamResult(new File("x.html")) and then get the data. But I am not suppose to use a temporary storage in the form of a file. Is there any other way I can get the data in the form of a String.
    The code is :
    File file = new File("table.xsl");
    StreamSource xslSource = new StreamSource(file);
    File file1 = new File("test.xml");
    StreamSource xmlSource = new StreamSource(file1);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(xslSource);
    target = new StreamResult(System.out);
    transformer.transform(xmlSource,target);
    Thanks in advance.
    manibhat

    Hi ecbouma,
    Thanks for the solution.
    I came across another approach..
    StringWriter sw = new StringWriter();
    PrintStream ps = new PrintStream(sw);
    sw.toString();
    It works fine...
    I have a question over here...
    PrintStream takes an argument that extends OutputStream, but looks like StringWriter does not extend OutputStream...
    I am not sure why does the above code works.
    manibhat

Maybe you are looking for