Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV

Former Member
0 Kudos
81

hi guru's,

how can i provide column editor for perticular colomn in my ALV report.

thanks in advance.

4 REPLIES 4

Former Member
0 Kudos
61

Hi,

Check out the ALV Report Program Links. Hope that this will help all your problems.

Go through this link. This will help you to code multiple ALVs in the same page.

http://help.sap.com/saphelp_47x200/helpdata/en/c5/3bd1369f2d280ee10000009b38f889/frameset.htm

Reprots

http://www.sapgenie.com/abap/reports.htm

http://www.allsaplinks.com/material.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

ALV

1. Please give me general info on ALV.

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

2. How do I program double click in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

3. How do I add subtotals (I have problem to add them)...

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

4. How to add list heading like top-of-page in ABAP lists?

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this. http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107

8. How do I print a logo/graphics in ALV? http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

9. How do I create and use input-enabled fields in ALV? http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

10. How can I use ALV for reports that are going to be run in background?

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

11. How can I display an icon in ALV? (Common requirement is traffic light icon).

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

Thanks,

Samantak.

<b>Rewards points for useful answers.</b>

Former Member
0 Kudos
61

hi,

Simple chk this link. code is there.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm

Rgds

Reshma

Former Member
0 Kudos
61

hi



*&---------------------------------------------------------------------*
*& Report  ZTESTDEMO_INTERACTIVE_LIST_2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZTESTDEMO_INTERACTIVE_LIST_2.

TABLES: MARA,MARC,MARD.


* internal table itab_mara 3 fields matnr, ernam,mtart
DATA: BEGIN OF ITAB_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,  " material number
ERNAM LIKE MARA-ERNAM,  " name of person who create
MTART LIKE MARA-MTART,  " Material Type
END OF ITAB_MARA.

* internal table itab_marc 3 fields matnr, werks,lvorm

DATA: BEGIN OF ITAB_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,  " Plant
LVORM LIKE MARC-LVORM,  " Flag Material for Deletion at Plant Level
END OF ITAB_MARC.

* internal table itab_mard 2 fields

DATA: BEGIN OF ITAB_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,  " Storage Location
END OF ITAB_MARD.

SELECT-OPTIONS: S_MTART FOR MARA-MTART.

INITIALIZATION.

S_MTART-LOW = 'HALB'.
S_MTART-HIGH = 'HAWA'.
S_MTART-OPTION = 'BT'.
APPEND S_MTART.

START-OF-SELECTION.

SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
S_MTART.

PERFORM DISPLAY.


TOP-OF-PAGE.
WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.


FORM DISPLAY.

LOOP AT ITAB_MARA.
WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
HIDE: ITAB_MARA-MATNR.
ENDLOOP.

ENDFORM.

AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.

SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
ITAB_MARA-MATNR.
PERFORM DISPLAY1.

WHEN 2.

SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
ITAB_MARC-MATNR.
PERFORM DISPLAY2.

when 3.
sy-lsind = 0.
ENDCASE.

FORM DISPLAY1.
LOOP AT ITAB_MARC.
WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
HIDE: ITAB_MARC-MATNR.
ENDLOOP.

WRITE:/ SY-LSIND.
ENDFORM.

FORM DISPLAY2.
LOOP AT ITAB_MARD.
WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
ENDLOOP.
WRITE:/ SY-LSIND.

ENDFORM.

regards

ravish

<b>plz dont forget to reward points if useful</b>

Former Member
0 Kudos
61

Check this sample code

DATA: ok_code LIKE sy-ucomm,

save_ok like sy-ucomm,

g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',

g_grid TYPE REF TO cl_gui_alv_grid,

g_custom_container TYPE REF TO cl_gui_custom_container,

gs_layout TYPE lvc_s_layo,

g_max type i value 100.

DATA: gt_outtab type table of sflight.

*----


*

  • MAIN *

*----


*

CALL SCREEN 100 starting at 1 1..

*----


*

  • MODULE PBO OUTPUT *

*----


*

MODULE pbo OUTPUT.

SET PF-STATUS 'MAIN100'.

set TITLEBAR 'MAIN100'.

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT g_grid

EXPORTING i_parent = g_custom_container.

*§1.Set status of all cells to editable using the layout structure.

gs_layout-edit = 'X'.

select * from sflight into table gt_outtab up to g_max rows.

CALL METHOD g_grid->set_table_for_first_display

EXPORTING i_structure_name = 'SFLIGHT'

is_layout = gs_layout

CHANGING it_outtab = gt_outtab.

*§2.Use SET_READY_FOR_INPUT to allow editing initially.

  • (state "editable and ready for input").

CALL METHOD g_grid->set_ready_for_input

EXPORTING i_ready_for_input = 1.

ENDIF.

ENDMODULE.

*----


*

  • MODULE PAI INPUT *

*----


*

MODULE pai INPUT.

save_ok = ok_code.

clear ok_code.

CASE save_ok.

WHEN 'EXIT'.

PERFORM exit_program.

WHEN 'SWITCH'.

PERFORM switch_edit_mode.

WHEN OTHERS.

  • do nothing

ENDCASE.

ENDMODULE.

*----


*

  • FORM EXIT_PROGRAM *

*----


*

FORM exit_program.

LEAVE PROGRAM.

ENDFORM.

*&----


*

*& Form SWITCH_EDIT_MODE

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM switch_edit_mode.

*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.

IF g_grid->is_ready_for_input( ) EQ 0.

*§4.Use SET_READY_FOR_INPUT to switch between the substates.

CALL METHOD g_grid->set_ready_for_input

EXPORTING i_ready_for_input = 1.

ELSE.

CALL METHOD g_grid->set_ready_for_input

EXPORTING i_ready_for_input = 0.

ENDIF.

ENDFORM. " SWITCH_EDIT_MODE

-

-


Check out these sample programs

BCALV_GRID_01

This program illustrates how the events for print processing PRINT_TOP_OF_PAGE,

PRINT_END_OF_PAGE, PRINT_TOP_OF_LIST,PRINT_END_OF_LIST are handled. The

corresponding handler methods control the appearance of the list printed.

BCALV_GRID_02

Show a detail list in an amodal window. There is no second dynro needed in contrast to

BCALV_GRID_03.

BCALV_GRID_03

This program implements a function on event DOUBLE_CLICK. According to the selected line data

from table SBOOK is selected and displayed by a second ALV Control in a dialog dynpro.

BCALV_GRID_04

Illustrates the use of exceptions (lights or leds). According to the values of SFLIGHT-SEATSOCC, the

lights are set to 1 (red), 2 (yellow) or 3 (green).

BCALV_GRID_05

Demonstrate the creation of an own toolbar button.

BCALV_GRID_06

Demonstrate the creation of an own context menu.

BCALV_GRID_07

Append a menu button to the standard toolbar.

BCALV_GRID_08

Append a menu with default button to the standard toolbar. It is exactly the same as

BCALVC_TB_WITH_MENU except for methods HANDLE_MENU_BUTTON and HANDLE_TOOLBAR.

Editable ALV grids

BCALV_EDIT_01

This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.

BCALV_EDIT_02

This report illustrates how to set chosen cells of an ALV Grid Control editable.

BCALV_EDIT_03

In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.

The report checks the input value(s) semantically and provides protocol messages in case of error

BCALV_EDIT_04

This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to

implement the saving of the new data.

BCALV_EDIT_05

This example shows how to use checkboxes within an ALV Grid Control. You learn:

(1) how to define a column for editable checkboxes for an attribute of your list

(2) how to evaluate the checked checkboxes

(3) how to switch between editable and non-editable checkboxes

BCALV_EDIT_06

This example shows how to define a dropdown listbox for all cells of one column in an editable ALV

Grid Control.

BCALV_EDIT_07

This example shows how to define dropdown listboxes for particular cells of your output table.

BCALV_EDIT_08

This report implements an ALV Grid Control with an application specific F4 help. The following aspects

are dealt with:

(1) how to replace the standard f4 help

(2) how to pass the selected value to the ALV Grid Control

(3) how to build an f4 help, whose value range depend on a value of another cell.

Regards,

Pavan