Anda di halaman 1dari 5

0

More

Next Blog

Create Blog Sign In

Sap Abap

SATURDAY, JUNE 16

TOTAL PAGEVIEWS

OOP ALV REPORT


SAP ABAP4

27090

A Simple OOP ALV Report ( with Custom Container component in screen ) Steps to code an OOP ALV: 1) Populate an internal table with data to be displayed in the ALV report. 2) SE51 in the screen paint a Custom Container component. 3) In the report program PBO module: a) Create an object of CL_GUI_CUSTOM_CONTAINER and associate it with the Custom Contianer component in the screen. b) Create an obejct of CL_GUI_ALV_GRID by setting the object of CL_GUI_CUSTOM_CONTAINER as its parent. c) Populate layout properties using the structure LVC_S_LAYO. d) Populate fieldcatalog properties using the table type LVC_T_FCAT. e) Invoke the method SET_TABLE_FOR_FIRST_DISPLAY on the obejct of CL_GUI_ALV_GRID and pass the layout, fieldcatalog and the internal table with data. OOP ALV With Custom Container As part of screen design: 1) Create a screen with screen-number 0100. Also create a menu named MYMENU with Functional Keys BACK, CANCEL, and EXIT with respective function codes. See MODULE user_command_0100 INPUT in the code below. 2) To the layout of this screen add a customer control and name it CUST_CONT. 3) In a PBO module set the title in the title bar of the report screen, using the command SET TITLEBAR <Title Name>. Flow logic of screen 0100: PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100. Element List of screen 0100:

NAVIGATOR 2013 (346) 2012 (165) July (1) June (19)

Different methods of converting dates Direct table update Interview Questions OOP ALV SPLITTER OOP ALV INTERACTIVE OOP ALV REPORT OOP_EVENTS OOPS Upgrade from LSMW 1.5 to LSMW 1.6 Transfer of LSMW Data from Version 1.0 to Version ... Upgrade from LSMW 1.0 to LSMW 1.6 LSMW Tips and Tricks Transport LSMW Projects Detailed Description of the Process IN LSMW LSMW General Tips for the Procedure LSMW Startup and Preparations LSMW Preconditions LMSW INTRODUCTION Sample ALV Grid program using the function module ...
May (16) April (40) March (2) February (58) January (29) 2011 (12)

*********** REPORT zoop_alv_variants.


TYPES: BEGIN OF ty_output, kunnr TYPE kna1-kunnr, name1 TYPE kna1-name1, vbeln TYPE vbak-vbeln, erdat TYPE vbak-erdat, netwr TYPE vbak-netwr, END OF ty_output.

THUNDER SPOTS

converted by Web2PDFConvert.com

DATA: t_output TYPE TABLE OF ty_output, r_cust_cont TYPE REF TO cl_gui_custom_container, r_grid TYPE REF TO cl_gui_alv_grid, s_layout TYPE lvc_s_layo, t_fcat TYPE lvc_t_fcat, ok_code type sy-ucomm. DATA: g_kunnr TYPE kna1-kunnr. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME. SELECT-OPTIONS: s_kunnr FOR g_kunnr DEFAULT 1000 TO 2000. SELECTION-SCREEN END OF BLOCK b1. START-OF-SELECTION. SELECT a~kunnr a~name1 b~vbeln b~erdat b~netwr FROM kna1 AS a INNER JOIN vbak AS b ON a~kunnr = b~kunnr INTO TABLE t_output WHERE a~kunnr IN s_kunnr. SORT t_output BY kunnr. CALL SCREEN '100'. MODULE status_0100 OUTPUT. SET PF-STATUS 'MYMENU'. PERFORM populate_layout. PERFORM populate_fcat. PERFORM display_alv. ENDMODULE. " STATUS_0100 OUTPUT MODULE user_command_0100 INPUT. IF ok_code = 'BACK'. LEAVE TO SCREEN 0. ELSEIF ok_code = 'CANCEL' OR ok_code = 'EXIT'. LEAVE PROGRAM. ENDIF. ENDMODULE. " USER_COMMAND_0100 INPUT FORM populate_layout . s_layout-zebra = 'X'. s_layout-cwidth_opt = 'X'. ENDFORM. "populate_layout FORM populate_fcat . DATA: ls_fcat TYPE lvc_s_fcat. ls_fcat-fieldname = 'KUNNR'. APPEND ls_fcat TO t_fcat. ls_fcat-fieldname = 'NAME1'. APPEND ls_fcat TO t_fcat. ls_fcat-fieldname = 'VBELN'. APPEND ls_fcat TO t_fcat. ls_fcat-fieldname = 'ERDAT'. APPEND ls_fcat TO t_fcat. ls_fcat-coltext = 'Customer'. CLEAR ls_fcat. ls_fcat-coltext = 'Customer Name'. CLEAR ls_fcat. ls_fcat-coltext = 'SO Num.'. CLEAR ls_fcat. ls_fcat-coltext = 'Created on'. CLEAR ls_fcat.

LABELS

ABAP DICTIONARY badi BAPI bdc CLASICAL ABAP Code Reviews CROSS APP DB Updates EDI EXITS FAQ FUNCTION MODULES FUNCTIONAL SPECIFICATIONS SAP ABAP IDOC INTERNAL TABLE OPERATIONS Interview Questions LSMW MODULE POOL OOPS OPEN SQL REAL TIME EXAMPLE CODES SAP Script and SmartForms SD AND MM WEBDYNPRO workflow
POPULAR POSTS

what is a process code in ale idoc the process code is having the function module attachment ...here you will get the logic for the data population in the idocs....simply ... WHAT IS IDOC? What is IDOC IDOC = Intermediate Document IDOC is simply a data container used to exchange information between any two processe... EXPLAIN SD AND MM FLOW? MM flow: purchase Requestion (ME51) Request for Quatation (ME41) Quatation from different vendors (ME47)... SAP ABAP 3+ INTERVIEW QUESTIONS ABAP Interview Questions What is the typical structure of an ABAP TM program? What are field symbols and field groups.? Have you used &... idoc *&--------------------------------------------------------------------* *& Report ZIDOC_PROG_B41 *& *&-------...
converted by Web2PDFConvert.com

ls_fcat-fieldname = 'NETWR'. ls_fcat-coltext = 'Net Value'. APPEND ls_fcat TO t_fcat. CLEAR ls_fcat. ENDFORM. "populate_fcat

FORM display_alv . CREATE OBJECT r_cust_cont EXPORTING container_name = 'CUST_CONT'. CREATE OBJECT r_grid EXPORTING i_parent = r_cust_cont. CALL METHOD r_grid->set_table_for_first_display EXPORTING is_layout = s_layout CHANGING it_outtab = t_output it_fieldcatalog = t_fcat. ENDFORM. "display_alv

USER EXITS User exits : 1. Introduction 2. How to find user exits 3. Using Project management of SAP Enhancements 1. Introduction: User exits (... SD Flow Cycle with T Codes and Tables SD Flow Cycle with T Codes and Tables: ________________T Code______________Tables________ Doc Type___________ INQUIRY V... Customer exits (CMOD transaction) Enhancement code Description SDAPO001 Activating Sourcing Subitem Quantity Propagation SDTRM001 Reschedule schedule lines without a n... Difference between refresh and clear[] . Just Consider all below cases for internal table CLEAR : It will clear only Header of the internal Table. Refresh : It will cl... BDC using CALL TRANSACTION method BDC using CALL TRANSACTION method By Kumar Saurabh, Yash Technologies Objective: - Steps For implementing BDC using call transaction Metho...
SCRAPER

Allowing the user to create report variants: In other words we are allowing the user to save and reuse the layout. A button can be shown on the grid toolbar, allowing the user to save and reuse a layout. The button looks like this: .
See also example in SAP standard program BCALV_GRID_09.

To do this, use the parameters IS_VARIANT and I_SAVE of the set_table_for_first_display method. The IS_VARIANT parameter must have the structure DISVARIANT. The I_SAVE parameter indicates the options for saving layouts. This 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 cannot be saved In the above code modify the subroutine display_alv as highlighted below: FORM display_alv. DATA: ls_variant TYPE disvariant. CREATE OBJECT r_cust_cont EXPORTING container_name = 'CUST_CONT'. CREATE OBJECT r_grid EXPORTING i_parent = r_cust_cont. ls_variant-report = sy-repid. CALL METHOD r_grid->set_table_for_first_display EXPORTING is_variant = ls_variant i_save = 'A' * I_DEFAULT = 'X' is_layout = s_layout CHANGING it_outtab = t_output it_fieldcatalog = t_fcat. ENDFORM. About the parameter I_DEFAULT: The purpose of the parameter I_DEFAULT is to either allow or disallow the end-user of the report to select a layout (variant) as the default layout, whenever the report is executed. If a value of X is passed to this parameter (the default value for this parameter is X) the user will be allowed to choose a particular layout as the default layout. The user can do this in the Manage Layout option. On the other hand, if a space is passed; then the user will not have the option to select a layout as default.
converted by Web2PDFConvert.com

If the parameter I_DEFAULT is assigned a value of X (or if the parameter is not at all used in the call to the method set_table_for_first_display, the Manage Layouts screen would look as below, where the user can choose a default layout: [First create two or more layout variants for the report] i_default = X, or Do not mention this parameter in the method call. The default value for this parameter is X.

If the parameter I_DEFAULT is assigned a value of space, the Manage Layouts screen would look as below, where the user has no option choose a default layout: i_default = space (or) i_default =

Setting the Grid Title: Modify the subroutine populate_layout as highlighted below: FORM populate_layout . s_layout-zebra = 'X'. s_layout-cwidth_opt = 'X'. s_layout-grid_title = 'Grid title text comes here.'. ENDFORM.

Posted by G M KRISHNA REDDI at 23:25:00


Recommend this on Google

Labels: OOPS Reactions:

No comments yet

Add a comment

converted by Web2PDFConvert.com

Newer Post
Subscribe to: Post Comments (Atom)
HIT ME

Home

Older Post

Krishna. Picture Window template. Powered by Blogger.

converted by Web2PDFConvert.com

Anda mungkin juga menyukai