Regarding alv creation in wd abap
Hi All,
I am a beginner in wd abap and i have to create an ALV application.If any one knows about it then please describe it in detail i.e. step by step by the help of any alv application.
Thanking you all in advance.
check this link
[Creating a WebDynpro ALV Application in 30 easy steps|http://****************/Tutorials/WebDynproABAP/ALV/page1.htm]
also check the blogs in below link
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/60ea94e5-0901-0010-c3bb-aad5ea9620d8
Thanks
Suman
Edited by: suman kumar chinnam on Sep 12, 2008 9:07 AM
Edited by: suman kumar chinnam on Sep 12, 2008 9:09 AM
Similar Messages
-
Regarding ALV Using container OO ABAP
HI ALL,
I have created an editable alv report using docking conatainer.
i am facing list of problem while need to maintain these activities.
1. I need to save the changes which are made change in the grid layout.
2. As the alv itself gives a option adding a new row and deleting a new row, while doing that i need to capture the previous record value. And assign these values to the first 2 field in the added row.
In order to do how can we deffer the original functionality.
Can any one give some suggestions in order to work.
Thanks and regards,
Nareshhi,
First you have to take your data into another internal table and then send data for display of ALV.At the time of save you can compare the old internal table with new edited data and based on which you can save the data for it.
SAP will give provision for triggering of our own subroutine before/after the user command method is called. You can call those subroutines for those adding/deleting lines.
Regards,
Veeresh -
Regarding ALV Reporting in ABAP
Hi All,
I have some clarifications related to <b>ALV Reporting</b> in ABAP.
<b>Actually i have to create ALV report with Structure Length/Each record length is around 300 characters.</b>
Is it possible to create a ALV Report with <b>300</b> length for each record!
If possible which is the best<b>[ALV]</b> method for the same!
Can anybody give me the solution!
Thanks in advance.
Thanks & Regards,
Prasad.Hai Prasad
Check with the code
*& Report ZALV_PRAKASH_SAMP *
REPORT ZALV_PRAKASH_SAMP .
TABLES: MARA.
TYPE-POOLS : SLIS.
Data declaration
DATA: BEGIN OF I_MARA OCCURS 0.
INCLUDE STRUCTURE MARA.
DATA: END OF I_MARA.
DATA: V_REPID LIKE SY-REPID.
selection-screen
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
PARAMETERS: P_MTART LIKE MARA-MTART DEFAULT 'ROH'.
SELECTION-SCREEN END OF BLOCK B1.
initialisation
INITIALIZATION.
S_MATNR-LOW = '1400'.
S_MATNR-HIGH = '1500'.
APPEND S_MATNR.
V_REPID = SY-REPID.
start-of-selection
START-OF-SELECTION.
SELECT * FROM MARA
INTO TABLE I_MARA
WHERE MATNR IN S_MATNR AND
MTART = P_MTART.
CHECK SY-SUBRC = 0.
end of selection
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'MARA'
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_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 = I_MARA
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.
loop at i_mara.
write:/ i_mara.
endloop.
Thanks & Regards
Sreenivasulu P -
ABAP ALV: Creation of Standard Layouts
Hi,
I have a requirement where in a standard layout need to be created for ALV grid, this should always be avaiable to the user and he should not be able to delete it. As far as I understand, such layouts aer named starting with a number and are transportable. However I don't know how this is achieved ? I need help with regards to creation fo such layouts.
Regards,
Shwetalayouts of ALV grid can be either user-specific either global (then it starts with "/")
in order to transport a layout, you must go to layout administration (displaying the ALV grid, go to menu Settings/Layout/Layout management) then go to menu Layout/Transport
if users are allowed to maintain/change layouts (at both levels user-specific and global) is defined in authorizations and/or inside the program itself -
ALV GRID Using oo abap example
Hi Friends,
I am new to oo abap, Can any one give me a basic example how i can create alv grid in oo abap.
regards,
DVNSHI,
Programming for ALV grid display using the classes involves creation of a screen and calling it for display.
Since there has to be a linking between the program and the screen we have created , this comes in the form of a container. We use two important classes during the programming for displaying ALV grid, CL_GUI_ALV_GRID and CL_GUI_CUSTOM_CONTAINER.
Steps To Use ALV Grid in a Program
1. Declare reference variables for,
Container (class CL_GUI_CUSTOM_CONTAINER) and
Grid (class CL_GUI_ALV_GRID)
Example
DATA: grid TYPE REF TO cl_gui_alv_grid,
custom_container TYPE REF TO cl_gui_custom_container
2. Create Standard Screen and a container on that screen and give a name to that container ( Use custom control button from tool bar) . This name will be used to link the container we have created on the screen with the object reference of class CL_GUI_CUSTOM_CONTAINER, which we have declared in the first step
3. Call the screen which has been created
4. Instantiate the container control and the ALV Grid Control in PBO of the screen.
Example
IF custom_container IS INITIAL.
CREATE OBJECT custom_container
EXPORTING
CONTAINER_NAME = MY_CONTAINER'.
CREATE OBJECT grid
EXPORTING
I_PARENT = custom_container.
ENDIF
5. For displaying the data, call the method set_table_for_first_display of object reference of CL_GUI_ALV_GRID.
Example
CALL METHOD grid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT =
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB =
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTION
INVALID_PARAMETER_COMBINATION =
PROGRAM_ERROR =
TOO_MANY_LINES =
others =
EXPLANATION OF SOME IMPORTANT PARAMETERS.
I_BYPASSING_BUFFER & I_BUFFER_ACTIVE :
When the program is run for the first time, the fields present in the output table and their positions are stored in a buffer. So the buffer is taken as reference for the successive executions. In order to bypass this buffer the above parameter values should be X and (space) respectively. If these values are not passed to the function module, the changes made in the structure of the internal table will not be reflected in the output.
I_STRUCTURE_NAME:
If the structure of your output table corresponds to a structure stored in the Data Dictionary (DDIC), the ALV Grid Control can use this information to generate the field catalog automatically. Pass the table structure as parameter. In this case, all fields of this DDIC structure are displayed in the list.
IS_VARIANT :
It allows the user to save and reuse the layout. It is a structure of type DISVARIANT and contain the display variant name. It facilitates pre-assignment for a layout, rather than displaying report and then choosing displaying variant.
I_SAVE:
This single character variable specifies whether the user specific display variants can be saved or not.
The I_SAVE "Options for saving layouts" parameter can have the following values:
U Only user specific layouts can be saved
X Only global layouts can be saved
A Both user specific and global layouts can be saved
Space Layouts can not be saved
IS_LAYOUT:
This structure of type LVC_S_LAYO
is used to control the layout of the ALV. Two important fields are:
GRID TITLE. : Title of grid
ZEBRA : Alternate lines in list are displayed in different colors.
IT_FIELDCATALOG:
This internal table of type LVC_T_FCAT
is used to specify the position of various fields in the report itab.
There are three ways we can fill the field catalog table
1. Automatically through data dictionary structure (DDIC). In this case we pass the table structure to I_STRUCTURE_NAME.
2. Manually in ABAP program. Filling the internal table of type LVC_T_FCAT
1. . With each row corresponding to each column of output table. Each row of this table will hold value like
i). TABNAME & FIELDNAME specifies the reference fields for F1 help
ii). CTABNAME & CFIELDNAME specifies the reference fields for currency formatting
iii). QTABNAME & QFIELDNAME specifies the reference fields for quantity formatting
iv). SELTEXT_L holds the long description of the field
v). SELTEXT_M holds the medium description of the field
vi). SELTEXT_S holds the small description of the field
vii). KEY specifies the Key field ( cannot be hidden )
viii). OUTPUTLEN species the output length of the field
ix). DO_SUM specifies that subtotal is required on this field
x). NO_OUT specifies a hidden field
3. Semi-Automatically by combining the above 2 procedures.
Call function Module REUSE_ALV_FIELDCATALOG_MERGE and pass DDIC
structure or the output table to generate the field catalog.
Add additional Rows or modify existing properties of the fields to be displayed.
METHODS OF IMPLEMENTING SOME EXTRA FEATURES
Set focus to the grid
After CALL METHODgrid->set_table_for_first_display insert the following stament:
CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid
Refresh grid display
Use the grid method REFRESH_TABLE_DISPLAY
Example:
CALL METHOD grid->refresh_table_display.
Set the title of the grid
Fill the grid_title field of structure lvc_s_layo.
DATA:
gs_layout TYPE lvc_s_layo.
gs_layout-grid_title = 'TITLE'.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'structure name'
is_layout = gs_layout
CHANGING it_outtab = Output table.
The structure lvc_s_layo contains fields for setting graphical properties, displaying exceptions, calculating totals and enabling specific interaction options
Event Handling
We can handle the events triggered by
1. User defined Text Output
2. Mouse-controlled Actions
3. Self-defined and Standard Functions
Steps for Event Handling
1. Define a (local) class for event handling
2. Define a method for each event you need to handle
3. Implement your event handler methods.
4. Create Object of the above class
5. Link used events and event handler methods of the receiver object and the grid
object.
Example program : Handling Double Click Event
Step1.Define a class.
class lcl_my_event_receiver definition.
public section.
methods:
handle_double_click
for event double_click of cl_gui_alv_grid.
endclass.
Step 2. Implement the class
class lcl_my_event_receiver implementation.
method handle_double_click.
message i001(zz) with ' double click event - Triggerd '.
endmethod.
endclass.
Step 3. Declare and create Object for the local class defined and implemented in steps 1 and 2 respectively
o_receiver TYPE REF TO lcl_my_event_receiver (Declaration)
create object o_receiver. (Instantiation)
Step 4. Link the method for handling the event with the grid object in the PBO of screen after instantiating the grid object
set handler o_receiver->handle_double_click for grid.
EXAMPLE PROGRAM TO CHANGE A CLASSICAL REPORT OUTPUT TO A ALV GRID
This can be used as a template program to convert a classical report layout to a ALV grid.
Report<Report name>
Grid data Declarations----------------------------------------------*
INCLUDE ZVINALVD.
Internal table for ALV grid
TYPES: BEGIN OF T_ALV,
Field1 like table-field1,
Field2 like table-field2,
END OF T_ALV.
DATA: I_ALV TYPE TABLE OF T_ALV.
DATA: WA_ALV TYPE T_ALV.
-Class declarations----
INCLUDE ZVINALVE.
Add a checkbox in selection screen for ALV grid display. If it is unchecked
output will be of classical type.
SELECTION-SCREEN BEGIN OF BLOCK box01.
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: COMMENT 4(30) To display repot output as a ALV grid.
PARAMETERS: p_alv AS CHECKBOX.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN END OF BLOCK box01.
START-OF-SELECTION.
Fill the ALV grid internal table
END-OF-SELECTION.
IF P_ALV = X.
PERFORM ALV_DISPLAY.
ELSE.
PERFORM CLASSICAL_DISPLAY.
ENDIF.
Alv Display
FORM ALV_DISPLAY.
CALL SCREEN 100.
ENDFORM.
Module STATUS_0100 OUTPUT
PBO for ALV Grid
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GRID_DISPLAY'.
DATA:
For parameter IS_VARIANT that is used to set up options for storing
the grid layout as a variant in method set_table_for_first_display
l_layout TYPE disvariant.
GS_LAYOUT-SEL_MODE = 'B'.
Optimize column width
GS_LAYOUT-CWIDTH_OPT = 'X'.
Read data and create objects
IF go_custom_container IS INITIAL.
Create objects for container and ALV grid
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING i_parent = go_custom_container.
Create object for event_receiver class
and set handlers
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
Layout (Variant) for ALV grid
l_layout-report = sy-repid. "Layout to report
To built fieldcatalog
PERFORM alv_build_fieldcatalog.
Grid setup for first display
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
CHANGING it_outtab = I_ALV
it_fieldcatalog = fieldcat.
Raise event toolbar to show the modified toolbar
CALL METHOD go_grid->set_toolbar_interactive.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
Form ALV_BUILD_FIELDCATALOG.
Store contents of selected line in a internal table
FORM alv_build_fieldcatalog.
CLEAR afield.
afield-fieldname = 'FIELD1'.
afield-tabname = 'I_ALV'.
afield-coltext = Field Name 1.
afield-lzero = ' '.
afield-key = 'X'.
afield-outputlen = XX.
APPEND afield TO fieldcat.
CLEAR afield.
afield-fieldname = 'FIELD2'.
afield-tabname = 'I_ALV'.
afield-coltext = Field Name 2.
APPEND afield TO fieldcat.
ENDFORM. " alv_build_fieldcatalog
Module USER_COMMAND_0100 INPUT
PAI for ALV Grid
MODULE USER_COMMAND_0100 INPUT.
CASE OK_100.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Form SELECT_LINE
Store contents of selected line in a internal table
FORM SELECT_LINE.
DATA:l_lines TYPE i.
REFRESH gi_index_rows.
CLEAR g_selected_row.
Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING et_index_rows = gi_index_rows.
Check if any row are selected at all. If not
table gi_index_rows will be empty
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a line'.
EXIT.
ENDIF.
Read indexes of selected rows.
LOOP AT gi_index_rows INTO g_selected_row.
IF sy-tabix = 1.
READ TABLE I_ALV INDEX g_selected_row-index INTO
WA_ALV.
ENDIF.
ENDLOOP.
ENDFORM. " SELECT_LINE
Includes:
1. ZVINALVD for data declarations
INCLUDE ZVINALVD .
Type pool for icons - used in the toolbar
TYPE-POOLS: icon.
To allow the declaration of o_event_receiver before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_receiver DEFINITION DEFERRED.
GLOBAL DATA FOR ALV GRID
DATA:
OK code for alv grid screen
OK_100(4) TYPE C,
ALV control: Layout structure
gs_layout TYPE lvc_s_layo,
Declare reference variables to the ALV grid and the container
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container,
o_event_receiver TYPE REF TO lcl_event_receiver,
Data for storing information about selected rows in the grid
Internal table
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
fieldcatalog
DATA: fieldcat TYPE LVC_T_FCAT,
afield TYPE LVC_S_FCAT.
2. ZVINALVE for Class/object declarations
INCLUDE ZVINALVE.
C L A S S E S
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Event handler method for event toolbar.
CONSTANTS:
Constants for button type
c_button_normal TYPE i VALUE 0,
c_menu_and_default_button TYPE i VALUE 1,
c_menu TYPE i VALUE 2,
c_separator TYPE i VALUE 3,
c_radio_button TYPE i VALUE 4,
c_checkbox TYPE i VALUE 5,
c_menu_entry TYPE i VALUE 6.
DATA: ls_toolbar TYPE stb_button.
Append seperator to the normal toolbar
CLEAR ls_toolbar.
MOVE c_separator TO ls_toolbar-butn_type..
APPEND ls_toolbar TO e_object->mt_toolbar.
Append a new button that to the toolbar. Use E_OBJECT of
event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
This class has one attribute MT_TOOLBAR which is of table type
TTB_BUTTON. The structure is STB_BUTTON
CLEAR ls_toolbar.
MOVE 'DISPLAY' TO ls_toolbar-function.
MOVE icon_DISPLAY TO ls_toolbar-icon.
MOVE 'Displaying customer' TO ls_toolbar-quickinfo.
MOVE 'Display' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'DISPLAY'.
PERFORM SELECT_LINE.
ENDCASE.
ENDMETHOD.
Reward if useful -
Interactive report and ALV s in HR ABAP.
hi all,
can any one tell , how to do Interactive reporting and alv's in HR ABAP. with some example reports..Hi Rao
Nothing changes for HR ABAP when it comes to ALV or Interactive Lists. Only the DATA fetching process is changed. To fetch HR data , you use Logical Database PNP or Clusters or just read a specific infotype using a method.
Here is a sample program for ALV 'BALVST02_GRID'. For interactive list , use this demo program
DEMO_LIST_INTERACTIVE_1. It is a series of Demo Programs which you can open in SE38.
Reward Points, if helpful.
Regards
Waz -
DIfference Between OOPS ALV and WEBDYNPRO FOR ABAP ALV?
Hi to All,
i want some information that What is main difference when we develop ALV Report in OOPS and WEBDYNPRO For ABAP.which is good n in what way it is good?
In the Same way I m also want know that WHICH IS BETTER AMONG WEBDYNPRO FOR JAVA/ABAP.In which way?
Regards,
Ravi KThanku for ur valuble Information.
could u give me information regarding OOPS ALV and WEBDYNPRO FOR ABAP ALV?which is better?is there differences?
Edited by: ravi k on Mar 26, 2008 12:23 PM -
Remove buttons in ALV grid display in ABAP Web Dynpro
Hi,
Sub: ALV grid-->Web Dynpro ABAP.
Request guidance to prevent display of the buttons "Microsoft Excel" and "Print Version" (which provide options to export the ALV grid output into an Excel format document).
Is there a way we could hide this from being displayed on the ALV grid in a Web dynpro ABAP component output?
Thanks very much.
Best Regards,
AdiHi Adithya,
really simple solution is to call cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs=>set_all( abap_false ). This deactivates all ALV functionality.
For individual setting cl_salv_wd_config_table if_salv_wd_standard_functions~set_<x>_allowed.
- Michelle -
hi friendz,
can any one of u give an example, how to build alv report using oops abap ?
thanks in advance.
points for sure
regards,
VijayaHi Vijaya,
I hope the following code upto your requirement.
*& Report ZMAT_ALV_GRID *
REPORT ZCL_CLASS1.
TYPES: BEGIN OF T_MARA,
MATNR TYPE MARA-MATNR,
MAKTX TYPE MAKT-MAKTX,
WERKS TYPE MARD-WERKS,
LGORT TYPE MARD-LGORT,
LABST TYPE MARD-LABST,
END OF T_MARA.
*DATA: IT_MARA TYPE STANDARD TABLE OF T_MARA.
DATA: IT_MARA TYPE T_MARA OCCURS 0.
DATA: O_CONT TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
O_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: X_FLDCAT TYPE LVC_S_FCAT.
DATA: IT_FLDCAT TYPE LVC_T_FCAT.
DATA: I_LAYOUT TYPE LVC_S_LAYO.
DATA: X_SORT TYPE LVC_S_SORT.
DATA: I_SORT TYPE LVC_T_SORT.
TABLES: MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
PARAMETERS: P_CHK AS CHECKBOX.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM GENERATE_FLDCAT.
PERFORM GENERATE_LAYOUT.
PERFORM DO_SORT.
SET SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'xxx'.
PERFORM BUILD_ALV.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_ALV
text
FORM BUILD_ALV .
CREATE OBJECT O_CONT
EXPORTING
CONTAINER_NAME = 'MAT_CONTAINER'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
CREATE OBJECT O_GRID
EXPORTING
I_PARENT = O_CONT
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = ' '
IS_LAYOUT = I_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_MARA
IT_FIELDCATALOG = IT_FLDCAT[]
IT_SORT = I_SORT
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
ENDFORM. " BUILD_ALV
*& Form GET_DATA
text
FORM GET_DATA .
SELECT A~MATNR
B~MAKTX
C~WERKS
C~LGORT
C~LABST
INTO TABLE IT_MARA
FROM MARA AS A
INNER JOIN MAKT AS B
ON BMATNR = AMATNR
INNER JOIN MARD AS C
ON CMATNR = AMATNR
WHERE A~MATNR IN S_MATNR
AND B~SPRAS = SY-LANGU.
ENDFORM. " GET_DATA
*& Form GENERATE_FLDCAT
text
FORM GENERATE_FLDCAT .
*CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'ZSMARA'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME = ' '
CHANGING
CT_FIELDCAT = IT_FLDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
X_FLDCAT-COL_POS = 1.
X_FLDCAT-FIELDNAME = 'MATNR'.
X_FLDCAT-OUTPUTLEN = '18'.
X_FLDCAT-REPTEXT = 'Material No'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 2.
X_FLDCAT-FIELDNAME = 'MAKTX'.
X_FLDCAT-OUTPUTLEN = '48'.
X_FLDCAT-REPTEXT = 'Material Desc'.
X_FLDCAT-TOOLTIP = 'Material Desc'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 3.
X_FLDCAT-FIELDNAME = 'WERKS'.
X_FLDCAT-OUTPUTLEN = '5'.
X_FLDCAT-REPTEXT = 'Plant'.
X_FLDCAT-TOOLTIP = 'Plant'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 4.
X_FLDCAT-FIELDNAME = 'LGORT'.
X_FLDCAT-OUTPUTLEN = '5'.
X_FLDCAT-REPTEXT = 'S.Loc'.
X_FLDCAT-TOOLTIP = 'S.Loc'.
APPEND X_FLDCAT TO IT_FLDCAT.
X_FLDCAT-COL_POS = 5.
X_FLDCAT-FIELDNAME = 'LABST'.
X_FLDCAT-OUTPUTLEN = '20'.
X_FLDCAT-REPTEXT = 'Quantity'.
X_FLDCAT-TOOLTIP = 'Quantity'.
X_FLDCAT-DO_SUM = 'X'.
APPEND X_FLDCAT TO IT_FLDCAT.
ENDFORM. " GENERATE_FLDCAT
*& Form GENERATE_LAYOUT
text
FORM GENERATE_LAYOUT .
I_LAYOUT-ZEBRA = 'X'.
I_LAYOUT-FRONTEND = 'X'.
I_LAYOUT-GRID_TITLE = 'ALV GRID USING OOPS'.
I_LAYOUT-NUMC_TOTAL = 'X'.
ENDFORM. " GENERATE_LAYOUT
*& Form DO_SORT
text
FORM DO_SORT .
X_SORT-FIELDNAME = 'MATNR'.
X_SORT-UP = 'X'.
X_SORT-SUBTOT = 'X'.
IF P_CHK = 'X'.
X_SORT-EXPA = SPACE.
ELSE.
X_SORT-EXPA = 'X'.
ENDIF.
APPEND X_SORT TO I_SORT.
ENDFORM. " DO_SORT
inorder to execute this code perfectly, do the following things.
1. Create a Graphical Screen 100.
2. Place a Custom Control on that screen and give name as MAT_CONTAINER.
3. activate the screen.
and execute the program.
if this suits requirement award points.
satish -
Hierarchical ALV Report in webdynpro abap
Hi Experts,
I'm facing the trouble with requirement as below. Please help me to resolve this issue.
Output as:
Material Number Description Created Date
- 10001(Header data) abc 09-09-2013
1001 (item level data) abc 10-09-2013
1002 xyz 11-09-2013
1003 xyz 11-09-2013
- 10002(Header data) abc 09-09-2013
2001 (item level data) abc 10-09-2013
2002 xyz 11-09-2013
2003 xyz 11-09-2013
- 10003(Header data) abc 09-09-2013
3001 (item level data) abc 10-09-2013
3002 xyz 11-09-2013
3003 xyz 11-09-2013
.... and so on...
- when I expand on header Materail number, it has to be display with item level data with in alv report in webdynpro abap.
Looking forward your valuable comments.
Regards,
VenkatHi Venkat,
We can achieve the HIERARCHY through the following code.In this case I have used CARRID as the drill down column.
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_flight_tree( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_flight_tree( ).
DATA lv_value TYPE ref to cl_salv_wd_config_table.
lv_value = lo_interfacecontroller->get_model(
lv_value->IF_SALV_WD_TABLE_SETTINGS~SET_DISPLAY_TYPE( IF_SALV_WD_C_TABLE_SETTINGS=>DISPLAY_TYPE_HIERARCHY ).
"Enable HIERARCHY structure
data lr_col type ref to CL_SALV_WD_COLUMN.
lr_col = lv_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'CARRID' )." Enable HIERARCHY for the col. specified
lr_col->IF_SALV_WD_COLUMN_HIERARCHY~SET_HIERARCHY_COLUMN( ABAP_TRUE ).
Regards,
Harsha -
Changing colour based on cells for ALV in Web Dynpro ABAP
Hi,
I have a requirement where I need to change the font color for some cells of ALV in Web Dynpro ABAP. I am able to change the font color for whole row or whole column but need to know how to change it based on cells.
My output should be something like the picture attached to this discussion. The coloumns/cells where I need the font colour can change for different rows, based on some internal condition.
Please let me know how to achieve this...... Thank you.
- Divya PosanpallyHi Divya,
Your requirement can be achieved as below
Create an attribute for each column of alv i.e. COLOR_F1, COLOR_F2, COLOR_F3...... COLOR_F10 of type WDY_UIE_LIBRARY_ENUM_TYPE in the context node which holds the color value
Now while configuring ALV, set the field name of semantic color for each column as below
data lv_color_fld_name type string.
data lo_text_view type ref to cl_salv_wd_uie_text_view.
loop at lt_columns into ls_column.
concatenate 'COLOR' ls_column-id into lv_color_fld_name separated by '_'.
lo_text_view ?= ls_column-r_column->get_cell_editor( ).
if lo_text_view is bound.
lo_text_view->SET_SEMANTIC_COLOR_FIELDNAME( value = lv_color_fld_name ).
endif.
endloop.
Set the color based on the condition
loop at lt_data into ls_data.
if ..... "your condition here.
ls_data-color_f1 = cl_wd_text_view=>e_semantic_color-NEGATIVE.
ls_data-color_f2 = cl_wd_text_view=>e_semantic_color-POSITIVE.
elseif...... " another condition
endif.
endloop.
Note: You can optimize the code as per your requirement
Hope this helps you.
Regards,
Rama -
Hi Abapers,
I am having one Problem regarding ALV Header on the report. Requirement is to get the data it into this order on ALV Header using Simple ABAP.
Summary
"Building No Room No Comments
111 AA Over Allocated.
545 XX Space Free
787 YY No Space
I have Tried to enter it into the header table but the data is not coming correctly.
Problem is It is coming in this way which is wrong..
Summary
"Building No Room No Comments
111 AA Over Allocated.
545 XX Space Free
787 YY No Space
Can Any body solve my Problem to get the header information it into the below .
Summary
"Building No Room No Comments
111 AA Over Allocated.
545 XX Space Free
787 YY No SpaceHi ,
I have tried but couldn't succeded. Can you Please provide me the solution. -
Problem regarding the creation of Table using CSS.
Hi ,
Here I have a Problem regarding the creation of Table using CSS.
In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
width:900px;
height : auto,
Overflow : visible,
Max-height: : 200px.
If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
Thanks & Regards
MadhaviHey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?
-
Help needed regarding ALV report
Hi,
I have a query regarding ALV report.
The requirement is as follows:-
When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
First of all i wanna know is it possible to do r not. If yes then how
Hope u have got what i want.
eagerly waiting for ur reply.
regards,
maqsoodHi
Yes you can! You have to manage the layout variant.
So when you call your ALV you have to set the parameter I_SAVE = 'A'.
In this way you'll allow the user to save the variants for layout.
After you has to have a chance to choose the variant in selection-screen.
See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
Max -
How to make cell editable alv in WebDynpro for ABAP?
I make Column editable ALV.(See under source code)
But I can't make Cell editable ALV.
How to make Cell editable ALV in WebDynpro for ABAP?
and..how to get changed data?
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model( ).
* { EDITABLE
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
lr_column TYPE REF TO cl_salv_wd_column.
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'TOTAL_COUNT' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'TOTAL_COUNT'.
lr_column->set_cell_editor( lr_input_field ).
DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false ).the code seems to be correct....but where are you writing it?
put the code in the wddoinit method and it should work.
have a look at this article..
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1
Maybe you are looking for
-
Hi guys.. How can i create an DVS Document (CV01N) and keep the Filename after checking the document in alive? The Doc Name is only visible before Chekcing in!
-
Plugging an external hard drive into my 500gb Time Capsule.
I'm looking to buy a new external hard drive, this one in particular: http://www.currys.co.uk/gbuk/wd-my-book-essential-external-hard-drive-2tb-037011 39-pdt.html I was wondering if I plugged it into my time capsule it would be recognised on my macbo
-
Howdy - I've recently purchased an IPOD 20GB Colour and becoming very frustrated with continual crashes while transferring. I've tried both iTunes and Winamp with no success. I'm transfer about 10GB of music when I get a crash on the transfer and the
-
I have a iMac mid 2007 model. I was running os x 10.10.2 with no problems. I update to os x 10.10.3 for the security issue. Now my bluetooth pane has gone missing from system preferences. I have tried everything suggested in suggested in support as i
-
ExFAT formated harddrive won't mount on Macbook Pro
My job recently gave me a 4tb G-Tech G-Drive to access video and audio files to edit. The drive works fines on my bosses Windows computer and the drive is formatted for exFAT but it won't mount on my Macbook Pro. My OSX is 10.8.4 and the drive appear