1 Introduction
The ALV provides Events, which allows users to add information to the List at different rendering time points.
Goals of the ALV Form:
• UI independent information for rendering
• The information is displayed in agreement with the SAP agronomical guideline
The base Element of the ALV Form is the abstract class CL_SALV_FORM_ELEMENT.
This base Element (CL_SALV_FORM_ELEMENT) describes the information to be displayed. There are two major Element types:
• Layout Element (CL_SALV_FORM_ELEMENT_LAYOUT): the base layout element for describing a table or a flow of information
• Textual Element (CL_SALV_FORM_ELEMENT_TEXTUAL): the base element for text elements. Text Elements supported are:
o Label (CL_SALV_FORM_LABEL)
o Text (CL_SALV_FORM_TEXT)
o Header information (CL_SALV_FORM_HEADER_INFO)
o Action information (CL_SALV_FORM_ACTION_INFO)
2 Step-by-Step Description how to Replace
1) Have a look at the original output and ensure you that the converted output has the same lines and texts arrangements
2) Identify used ‘REUSE_ALV_COMMENTARY_WRITE’ calls within your programs, especially in the subroutines TOP_OF_PAGE (Grid) and TOP_OF_LIST (Simple List)
3) Comment the ‘REUSE_ALV_COMMENTARY_WRITE’
4) Search and comment all the used variables, subroutine / function module calls, text-elements and internal tables, which are used exclusively for the ‘REUSE_ALV_COMMENTARY_WRITE’ output.
5) Please insert the necessary coding and data-elements for “ALV Form”. This is done within the TOP_OF_PAGE subroutine for ALV GRID and in the TOP_OF_LIST subroutine for Simple List
6) Delete all unused (commented) variables, calls and tables (step 3&4).
7) ! Ensure that you have inserted all newly created text-elements for this process in your report documentation
8) Test the output and compare with the original one
3 Coding and Functionality of “ALV Form” (easy)
CREATE OBJECT lr_grid.
lr_label = lr_grid->create_label(
row = 1
column = 1
text = constant1).
lr_text = lr_grid->create_text(
row = 1
column = 2
text = variable1).
*... set label for text
lr_label->set_label_for( lr_text ).
lr_label = lr_grid->create_label(
row = 2
column = 1
text = text-003).
lr_text = lr_grid->create_text(
row = 2
column = 2
text = variable2).
*... set label for text
lr_label->set_label_for( lr_text ).
CALL METHOD cl_salv_form_content=>set
EXPORTING
value = lr_grid.
To 1: Declare the necessary type with reference to the used class locally (within FORM top_of_page or top_of_list).
To 2: Create the object which will be filled in part 3.
To 3: In this section, you need to define the exact data to be displayed and the layout / formatting of the same. The coding in BLACK is fixed – do not alter this code. The code in BLUE is variable and your action is needed here.
The „ lr_grid->create_label“ statement creates the label – usually at the beginning left of each line
The „lr_grid->create_text“ statement creates the text, which usually stand right to the label and specifies the label by a value
You can combine both as it is needed and as it’s making sense.
In „row“ and „column“ you enter the exact position of label or text. Attention: Elements will automatically aligned!
Example, 1st line: Label row 1, column 1 / Text row 1, column 2
Label and text will be automatically aligned by system. Please see label „abc“ and text „21“.
For „text“ please insert the formerly used data elements. They could be
- text element
- variable/constant
- internal table value ...
Do not use hard coded statements!
To 4: If your row contains label and text data, which belong together, please add this statement to link them.
To 5: If all your formatting is done, call the necessary method (cl_salv_form_content=>set ) with exactly the same coding as in the section 4.
Addition to 3: If an empty line is needed please use following statement:
*... create empty line.
lr_grid->add_row( ).
4 Coding and Functionality of “ALV Form” with header line / action item
If you need a header line and/or an action item, please cf. the example coding below:
DATA: lr_content TYPE REF TO cl_salv_form_element,
lr_outer_grid TYPE REF TO cl_salv_form_layout_grid,
lr_inner_grid TYPE REF TO cl_salv_form_layout_grid,
lr_flow TYPE REF TO cl_salv_form_layout_flow,
lr_label TYPE REF TO cl_salv_form_label,
lr_text TYPE REF TO cl_salv_form_text,
lr_header TYPE REF TO cl_salv_form_header_info,
lr_action TYPE REF TO cl_salv_form_action_info.
*********************************************************************
* create OUTER_GRID as top_of_page object
*********************************************************************
CREATE OBJECT lr_outer_grid.
*********************************************************************
**... in the cell [1,1] of outer_grid a flow information is set
*********************************************************************
lr_flow = lr_outer_grid->create_flow(
row = 1
column = 1 ).
*.. create header information
lr_header = lr_flow->create_header_information(
text ='This a a long header line as flow information').
*********************************************************************
*... in the cell [2,1] of outer_grid grid information is set
*********************************************************************
lr_inner_grid = lr_outer_grid->create_grid(
row = 2
column = 1 ).
*... create empty line in inner_grid_
lr_inner_grid->add_row( ).
*... create lable information in inner_grid
lr_label = lr_inner_grid->create_label(
row = 2
column = 1
text = 'LABLE' ).
*... create text information in inner_grid
lr_text = lr_inner_grid->create_text(
row = 2
column = 2
text = 'Herr Mayer' ).
*... set label for text
lr_label->set_label_for( lr_text ).
*... create empty line in innner_grid
lr_inner_grid->add_row( ).
*********************************************************************
*... in the cell [3,1] of outer_grid low information is set
*********************************************************************
lr_flow = lr_outer_grid->create_flow(
row = 3
column = 1 ).
*... create action information
lr_action = lr_flow->create_action_information(
text ='Action in cell [3,1]').
*********************************************************************
*.. set content
*********************************************************************
lr_content = lr_outer_grid.
cl_salv_form_content=>set( lr_content ).
ENDFORM. "TOP_OF_PAGE
Wednesday, October 1, 2008
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(167)
-
▼
October
(145)
- SAP ALE ABAP DETIAL
- SAP ABAP ALE IDOC'S
- SAP - DIFFERENCE BETWEEN CONVERSION AND INTERFACE
- BAPI AND IDOC ALE
- SAP ABAP MESSAGE CONTORL
- SAP IDOC'S IN ABAP INTRODUCTION
- SAP ABAP IDOC'S OUTLOOK
- SAP ABAP IDOC PROCESSING
- SAP ABAP IDOC'S BASIC TOOLS I
- SAP ABAP IDOC'S BASIC TOOLS II
- SAP ABAP IDOC'S INBOUND BASIC TOOLS III
- SAP IDOC OUT BOUND TRIGGERS II
- SAP IDOCS OUTBOUND TRIGGER II
- SAP IDOC'S OUTBOUND TRIGGER III
- SAP Work flow based outbound Idoc's
- SAP ALE Change Pointers
- SAP Dispatching ALE IDocs for Change Pointers
- SAP IDOC design and Processing
- SAP Creation of the IDoc Data
- SAP Developing an Outbound IDoc Function
- SAP Converting Data into IDoc Segment Format
- SAP Partner Profiles and Ports
- SAP Defining the partner profile for ALE IDOC
- SAP Data Ports ( WE21 ) in idoc
- SAP RFC in R/3
- SAP Workflow from Change Documents
- SAP ALE Distribution Scenario
- SAP Useful ALE Transaction Codes
- BAPI Creating IDocs and ALE Interface
- R/3 RFC from MS Office Via Visual Basic
- SD WORK FLOW SCENARIOS I
- SD WORK FLOW SCENARIOS II
- SD WORK FLOW SCENARIOS III
- SD WORK FLOW SCENARIOS IV
- SD WORK FLOW SCENARIOS V
- SD WORK FLOW SCENARIOS VI
- SD WORK FLOW SCENARIOS VII
- MM WORK FLOW SCENORIOS I
- MM WORK FLOW SCENORIOS II
- MM WORK FLOW SCENORIOS III
- MM WORK FLOW SCENORIOS IV
- MM WORK FLOW SCENORIOS V
- MM WORK FLOW SCENORIOS VI
- MM WORK FLOW SCENARIOS VII
- MM WORK FLOW SCENARIOS VIII
- MM WORK FLOW SCENARIOS IX
- MM WORK FLOW SCENARIOS X
- MM WORK FLOW SCENARIOS XI
- WORK FLOW SCENARIOS in SAP ABAP
- SAP ABAP WORK FLOW I
- SAP ABAP WORK FLOW II
- SAP ABAP WORK FLOW III
- SAP ABAP Work Flow IV
- SAP ABAP Workflow Technology
- SAP OPTIMIZATION
- abap type key ward
- PERFORMENCE TIPS
- SAP ABAP INTERNAL TABLES IN BRIEF
- SAP ABAP RUN TIME ANALASIS
- MEMORY In SAP ABAP
- NAVIGATION In SAP ABAP
- WORK BENCH AND TOOLS In SAP ABAP
- DATA OBJECTS AND STATEMENTS In SAP ABAP
- INTERNAL PROGRAM MODULARIZATION In SAP ABAP
- SAP ABAP CONSITENCEY THROUGH INPUT CHECKS
- RUN TIME ENVIRONMENT In SAP ABAP
- SAP ABAP INTER TABLE OPERATIONS
- STATEMENTS In SAP ABAP
- SAP ABAP INTERNAL TABLES
- SAP ABAP SUB ROUTIENS
- SAP ABAP FUNCTION MODULES AND GROUPS
- SAP ABAP QUARY ADMINSTRATION
- SAP ABAP SAVING LISTS AND BACK GROUND PROCESSING
- SAP ABAP PROGRAM INTERFACE
- SAP ABAP LOCK CONCEPT
- SAP ABAP AUTHORISATION CHECKS
- SAP ABAP PERFORMENCE TIPS
- In SAP SYSTEM FIELDS
- SAP ABAP CONTROL BLOCKS
- SAP ABAP BUFFERING
- SAP ABAP MATCH CODE OBJECTS
- SAP ABAP LOCKS
- SAP SAMPLE CODE FOR OUTPUT TO EXCEL AND IN PUT FIL...
- SAP MULTIPLE INTERACTIVE REPORT SAMPLE CODE
- MULTIPLE INTERACTIVE REPORT SAMPLE CODE II
- CALLING PROGRAM AND PASSING DATA
- SAP TECHNIQUES FOR LIST CREATION AND SAP QUARY
- SAP SELECTION SCREENS ABAP REPORT
- SAP ABAP FAQ ON SCRIPTS I
- SAP ABAP FAQ ON SCRIPTS II
- SAP ABAP FAQ ON SCRIPTS III
- IN SAP ABAP TABLE TYPES
- SAP ABAP TYPES OF VIEWS
- SAP ABAP DATA BASE UPDATES COMPLETE
- SAP ABAP LOCK CONCEPT
- SAP ORGANIZING DATABASE UPDATES
- SAP ENHANCEMENTS TO DICTIONERY ELEMENTS
- DATA BASE DIALOG IN ABAP
- ABAP DICTIONARY I
- PERFORMANCE DURING TABLE ACCESS
-
▼
October
(145)
No comments:
Post a Comment