Custom control alv
Dear friends ,
I want to make 'HYPERLINK' action in custom control alv , in my alv one icon is there , when ever I click into that icon ,action will generate in PAI , m nt able to generate this action . please help me out .
Thanks ,
Joy .
Hi,
Go trough the [LINK|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=55249] which has sample example for hyperlink in ALV custom contianer.
Regards,
Shanmugavel Chandrasekaran
Similar Messages
-
IN CUSTOMER CONTROL- ALV GRID ,
IN CUSTOMER CONTROL -ALV GRID,
It is possible to have both the hotspot and f4 help.I WANT TO USE BOTH OF THEM AT A TIME. PLZ GIVE ME SOLUTION.
THANKS,
RANI.hey rani,
ya it is possible just define f4 help and hotspot independently in program itself, in program define search help for which field you want to make searh help and also provide hotspot condition with that field itself ok, if it is helpfull reward. -
Changing Custom Control / ALV size in program
Hello,
Everytime I need a screen with more than 1 ALV, I do as follows:
1 - I define one custom container for each ALV;
2 - In my program, I create one object of class CL_GUI_CUSTOM_CONTAINER for each ALV;
3 - For each ALV, I create one object of class CL_GUI_ALV_GRID. For each of these objects, I assign one of the parents created in 2;
So far so good - with this technique I can easily have multiple ALV screens, make ALV's dependent on each other, etc.
My problem is as follows:
- I need to change the screen appearence in my program (typically size and position of the ALV's);
- I tried to use the methods of class CL_GUI_CUSTOM_CONTAINER that seem to be appropriate (SET_HEIGHT, SET_LEFT, etc), but nothing seems to happen:
Example:
CALL METHOD gr_ccontainer1->set_height EXPORTING height = 200.
I would appreciate any help,
Regards,
JoaoHi Sandra,
Thank you for the tip about the poins, I'll try to correct that, if it is still possible. About the question, I confess that I didn't test the solution with the splitter. Nevertheless, I decided to close the question - I believe that following the tips I'll get somewhere:-)
In fact, trying to resize the ALVs was just a first step towards the final result that I want: to resize the objects in a (ABAP) screen according to the screen resolution. Because time is short I decided not to continue for now, and I used my normal approach:
- Defining a screen for the worst resolution in the project;
- Designing custom containers (that now I know cannot change in size in runtime);
- Attacching my ALVs to these custom containers;
Regards,
Joã -
HOW CAN WE USE ALV-CUSTOM CONTROL
Dear Friends,
How can we use the custom control ALV.please provide the sample PPT or material to learn the container ALV.
Thanks &Regards,
Rajkumar.ASAP released document on ALV custom control. Pretty cool stuff..
http://www.saphelpbykevin.com/saphelpbykevin/modules.php?name=Downloads&d_op=getit&lid=10#dl
Edited by: Kevin Nguyen-Tu on May 14, 2008 7:44 PM -
OOP ALV report custom control performance problem
HI
how to write OOP ALV report without custom control.. Actually with custom control which taking long time... and time out happens for huge selection of data..
Regards
Roops.timeout is not an alv problem. If you try to display a "huge" amount of data, any display technology will fail. Even sap programs fail, their wise solution is to ask user to restrict data to be displayed. Or reduce database selection time, or display amount. Or propose the user to download data as a spool, or output to a file on server.
Otherwise, read some advices about how to handle timeout in [Note 25528 - Parameter rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528].
About your question, if you still want to try, look at [example code with alv class cl_salv_table for simple display|http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm] -
ALV Display on the Custom Control
Hi Friends,
Iam developing a Module Pool program where I call a ALV grid on a custom control.
I have only one screen in which i have a input field and a custom control.
when I enter a material number in the input field and press ENTER the custom control should be populated with some of the material details. I have written all the logic. But the problem is when i press enter the custom control is not filled but after I press the REFRESH button present by default on the grid, the details are displayed.
What is the problem??
Regards,
Raju...HI,
Use the method <b>REFRESH_TABLE_DISPLAY</b> after filling the new values into <b>it_outtab</b> table. in the PBO flow logic of your Module pool program.
<b>CALL METHOD grid1->refresh_table_display.</b>
Regards, -
Hi,
I have created on one Dynpro 3 Custom Controls, which are
responsible for Three ALV Grid Reports.
I have named CC1 for ALV1 CC2 for ALV2 and CC3 for ALV3.
I can put the Data for each ALVs.
So far so good, but if I save the Layout global for one ALV and start the Program again, disappears me some Elements on other ALVs like Columns , Buttons etc...
I have used Method set_for_first_display.
Thanks for your Replies.
Best Regards
Beserithan MalabakanWha tis happening is the VARIANT parameter values that you are passing are the same for all the three grids. So, once you alter the layout of one its changing all the grids. What you need to do is to specify a unique name in the field HANDLE of the parameter VARIANT for each grid, say the grid name.
Then this problem will not occur and you will have variants specific to the grid.
It has nothing to do with the global / user defined layouts.
Regards,
Ravi
Note: Please mark the helpful answers -
In custom control , I wnt to save the layout with variant -
Hi,
In custom control , I want to save the layout using variant and i want to choose the layout from the variant
Plz give me the details.
Rerards,
RaniHello Rani
I assume you have an ALV grid displayed within a custom control. For this ALV grid you want to be able to save layouts.
Assuming that you are using class CL_GUI_ALV_GRID you have set the following IMPORTING parameters when calling method go_grid->set_table_for_first_display:
" Fill variant parameter with following values:
gs_variant-report = syst-repid.
gs_variant-handle = 'GRID'. " 4-digit handle; required if you have multiple ALV grids
- I_SAVE = 'A' " allows saving of user-specific and global layouts
- IS_VARIANT = gs_variant
Regards,
Uwe -
TOP of PAGE using ABAP oo with single CUSTOM CONTROL
Can anybody please tell me how to handle TOP_OF_PAGE using ABAP OBJECTS with a SINGLE CUSTOM CONTROL and not with SPLIT CONTAINER(i.e. using single CL_GUI_CUSTOM_CONTAINER and single grid CL_GUI_ALV_GRID ). Is it possible if so Please help me out?
Hi Ravi,
Here is my code. i didn't handle the top_of_page event yet but created a method to handle.
REPORT ZSATEESH_ALV_CONTAINER MESSAGE-ID ZZ
LINE-SIZE 150 NO STANDARD PAGE HEADING.
PROGRAM id : ZSATEESH_ALV_CONTAINER *
Title : Sales document report *
Author : Sateesh *
Date : *
CR# : *
Dev Initiative :
Description :ALV GRID/LIST Report which displays the sales
document header data using ABAP Objects.
Modification Log
Corr. no date programmer description
TYPES Declaration
*--Type for the Header Sales data
TYPES: BEGIN OF TY_VBAK ,
INDICAT LIKE ICON-ID, " Icon
VBELN LIKE VBAK-VBELN, " Sales Document
AUDAT LIKE VBAK-AUDAT, " Document date
VBTYP LIKE VBAK-VBTYP, " SD document category
AUART LIKE VBAK-AUART, " Sales Document Type
AUGRU LIKE VBAK-AUGRU, " Order reason
NETWR LIKE VBAK-NETWR, " Net Value
WAERK LIKE VBAK-WAERK, " SD document currency
END OF TY_VBAK.
DATA Declaration
*--Tableto hold the header sales data
DATA: TB_VBAK TYPE STANDARD TABLE OF TY_VBAK.
*--Table to hold the Icons
DATA: BEGIN OF TB_ICON OCCURS 0,
ID TYPE ICON-ID, " Icon
NAME TYPE ICON-NAME, " Name of an Icon
END OF TB_ICON.
*--Declaration of ALV Grid Tables
DATA: TB_FDCAT TYPE LVC_T_FCAT, " Fieldcatalog
TB_SORT TYPE LVC_T_SORT. " Sorting
DATA: OK_CODE LIKE SY-UCOMM. " sy-ucomm
*--Reference variables for container and grid control.
DATA: CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
" Container reference
OBJ_ALV_GRID TYPE REF TO CL_GUI_ALV_GRID.
" Alv Grid reference
S T R U C T U R E S
DATA: X_FDCAT TYPE LVC_S_FCAT, " Fieldcatalog
X_LAYOUT TYPE LVC_S_LAYO, " layout
X_SORT TYPE LVC_S_SORT, " Sorting
X_VBAK TYPE TY_VBAK, " sales header stucture
X_ICON LIKE TB_ICON. " icons structure
C O N S T A N T S
*--Declaration of Constants
CONSTANTS :
C_GREEN(40) TYPE C VALUE 'ICON_GREEN_LIGHT',
C_RED(40) TYPE C VALUE 'ICON_RED_LIGHT',
C_YELLOW(40) TYPE C VALUE 'ICON_YELLOW_LIGHT',
C_X TYPE C VALUE 'X'. " Flag
SELECTION SCREEN
*--Block 1.
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: P_AUDAT LIKE VBAK-AUDAT
DEFAULT '20050101'(003). " doc date.
SELECTION-SCREEN: END OF BLOCK B1.
*--bLOCK 2.
SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETER :P_ALVDIS AS CHECKBOX. " For List/Grid
SELECTION-SCREEN : END OF BLOCK B2.
Class LC_VBAK definition
CLASS LC_VBAK DEFINITION.
PUBLIC SECTION.
METHODS: VBAK_POPULATE, " sales header population
ICON_POPULATE, " Icons population
FINAL_POPULATE, " Final ALV population
DISPLAY, " Displaying ALV
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "LC_VBAK DEFINITION
Class LC_VBAK IMPLEMENTATION
CLASS LC_VBAK IMPLEMENTATION.
METHOD VBAK_POPULATE.
*-- selecting from VBAK
SELECT VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
INTO CORRESPONDING FIELDS OF TABLE TB_VBAK
FROM VBAK
WHERE AUDAT > P_AUDAT AND
NETWR > 0.
IF SY-SUBRC <> 0.
SORT TB_VBAK BY AUART VBTYP WAERK .
ENDIF.
ENDMETHOD . "VBAK_POPULATE
METHOD ICON_POPULATE.
*--selecting from ICON table
SELECT ID
NAME
INTO TABLE TB_ICON
FROM ICON.
IF SY-SUBRC = 0.
SORT TB_ICON BY NAME .
ENDIF.
ENDMETHOD . "ICON_POPULATE
METHOD FINAL_POPULATE.
*--looping through VBAK table into the work area
LOOP AT TB_VBAK INTO X_VBAK .
IF X_VBAK-NETWR <= 10.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_GREEN
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR > 10 AND X_VBAK-NETWR < 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_YELLOW
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ELSEIF X_VBAK-NETWR >= 100.
*--Reading the ICON table into work area comparing field NAME
READ TABLE TB_ICON INTO X_ICON WITH KEY NAME = C_RED
BINARY SEARCH.
IF SY-SUBRC = 0.
X_VBAK-INDICAT = X_ICON-ID.
*--modifying the TB_VBAK table
MODIFY TB_VBAK FROM X_VBAK.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD. "FINAL_POPULATE
METHOD top_of_page *
METHOD TOP_OF_PAGE.
PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID.
ENDMETHOD. "top_of_page
METHOD DISPLAY.
*--Building fieldcatalog table
PERFORM FIELDCATLOG.
*--FOr making the Layout settings
PERFORM LAYOUT.
*--For sorting the fields
PERFORM SORTING.
*--perform for displaying the ALV
PERFORM ALV_GRID_DISPLAY.
ENDMETHOD. "DISPLAY
ENDCLASS. "LC_VBAK IMPLEMENTATION
*& Form FIELDCATLOG
Building the FIELDCATALOG
FORM FIELDCATLOG .
CLEAR: X_FDCAT,TB_FDCAT[].
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 1.
X_FDCAT-FIELDNAME = 'INDICAT'(004) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'STATUS_INDICATOR'(006).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 2.
X_FDCAT-FIELDNAME = 'VBELN'(007) .
X_FDCAT-TABNAME = 'TB_VBAK'(005).
X_FDCAT-SCRTEXT_L = 'SALES DOC'(008).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 3.
X_FDCAT-FIELDNAME = 'AUDAT'(009) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC DATE'(010).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 4.
X_FDCAT-FIELDNAME = 'VBTYP'(011) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'SALES CATEGORY'(012).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 5.
X_FDCAT-FIELDNAME = 'AUART'(013) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'DOC TYPE'(014).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 6.
X_FDCAT-FIELDNAME = 'AUGRU'(015) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'REASON'(016).
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 7.
X_FDCAT-FIELDNAME = 'NETWR'(017) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'NET VALUE'(018).
X_FDCAT-DO_SUM = C_X.
APPEND X_FDCAT TO TB_FDCAT.
X_FDCAT-ROW_POS = 1.
X_FDCAT-COL_POS = 8.
X_FDCAT-FIELDNAME = 'WAERK'(019) .
X_FDCAT-TABNAME = 'TB_VBAK'.
X_FDCAT-SCRTEXT_L = 'UNIT'(020).
APPEND X_FDCAT TO TB_FDCAT.
ENDFORM. " FIELDCATLOG
*& Module STATUS_0007 OUTPUT
module for setting the pf status
MODULE STATUS_0007 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0007 OUTPUT
*& Module USER_COMMAND_0007 INPUT
module for handling the user commands
MODULE USER_COMMAND_0007 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0007 INPUT
*& Form LAYOUT
ALV Layout settings
FORM LAYOUT .
CLEAR X_LAYOUT.
*-- making Layout settings
X_LAYOUT-GRID_TITLE = 'Sales Header Document'(021).
X_LAYOUT-ZEBRA = C_X.
IF P_ALVDIS = C_X.
X_LAYOUT-NO_HGRIDLN = C_X.
X_LAYOUT-NO_VGRIDLN = C_X.
ENDIF.
ENDFORM. " LAYOUT
*& Form SORTING
sub routine for sorting criteria
FORM SORTING .
CLEAR X_SORT.
X_SORT-SPOS = '1'(022).
X_SORT-FIELDNAME = 'AUART'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '2'(023).
X_SORT-FIELDNAME = 'VBTYP'.
X_SORT-UP = C_X.
APPEND X_SORT TO TB_SORT.
CLEAR X_SORT.
X_SORT-SPOS = '3'(024).
X_SORT-FIELDNAME = 'WAERK'.
X_SORT-UP = C_X.
X_SORT-SUBTOT = C_X.
APPEND X_SORT TO TB_SORT.
ENDFORM. " SORTING
*& Form CREATE_CONTAINER_OBJECT
subroutine to create object of container
FORM CREATE_CONTAINER_OBJECT .
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'CUST_CONTROL'(025)
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
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. " CREATE_CONTAINER_OBJECT
*& Form CREATE_ALV_GRID_OBJECT
subroutine to create object of ALV GRID
FORM CREATE_ALV_GRID_OBJECT .
CREATE OBJECT OBJ_ALV_GRID
EXPORTING
I_PARENT = CUSTOM_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
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. " CREATE_ALV_GRID_OBJECT
*& Form ALV_GRID_DISPLAY
subroutine to call method for displaying the ALV GRID
FORM ALV_GRID_DISPLAY .
CALL METHOD OBJ_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = X_LAYOUT
CHANGING
IT_OUTTAB = TB_VBAK
IT_FIELDCATALOG = TB_FDCAT
IT_SORT = TB_SORT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 0007.
ENDFORM. " ALV_GRID_DISPLAY
START OF SELECTION
START-OF-SELECTION.
*--Creating a reference variable for the class LC_VBAK
DATA : OBJ1 TYPE REF TO LC_VBAK.
*--Creating a container object
PERFORM CREATE_CONTAINER_OBJECT.
*--Creating a ALV GRID control object
PERFORM CREATE_ALV_GRID_OBJECT.
*--Creating a object of class LC_VBAK
CREATE OBJECT OBJ1.
*--calling vbak population method
CALL METHOD OBJ1->VBAK_POPULATE.
*--calling icon population method
CALL METHOD OBJ1->ICON_POPULATE.
*--calling fianl table population method
CALL METHOD OBJ1->FINAL_POPULATE.
*--calling final method for display
CALL METHOD OBJ1->DISPLAY.
*& Form EVENT_TOP_OF_PAGE
text
-->P_E_DYNDOC_ID text
FORM EVENT_TOP_OF_PAGE USING P_E_DYNDOC_ID TYPE REF TO
CL_DD_DOCUMENT.
ENDFORM. " EVENT_TOP_OF_PAGE -
Customer Control in screen painter in Module pool - work like container?
Customer Control option in screen painter in Module pool - work like container?
is it true? How?
Is like any work area or what?
what is the excat use of that option?
regards.Hello,
In screen painter ,custom control is used to define the control area on the screen.Just click on that and make your own container area.When you create an ALV grid or TEXT EDITOR or any other control,it will get attached to the screen in that area through the custom container.
Name the container area as say '<b>CONTAINER</b>'.(in capitals.)
When you actually create the custom conatiner programatically,you should give the container area name.ie.
Data : cont type ref to cl_gui_custom_container.
Create object cont
exporting
parent = '<b>CONTAINER</b>'.
Now,this container that you created-cont is attached to the screen in the area defined by CONTAINER.
Regards,
Beejal
**Reward if this helps -
Hide the custom control while changing the tab
Hello Experts,
I am using many screens & subscreens in my application. In a tabstrip control, I am calling one subscreen which has Custom Control to display the text editor.
When I change the tab say for ex from TAB1 to TAB2, the custom control with text editor remains at the same place. In TAB2 I dont want custom control of TAB1.
Thank you to go through my query.
Regards,
Bhavina
Edited by: Rob Burbank on Aug 23, 2010 5:12 PMHello Alej,
I have created one subscreen which i need in a tabstrip control. Now this subscreen has one Editor Control (CL_GUI_TEXTEDIT->TEXT_EDITOR) which I put on Custom Control. Custom Control is placed in the subscreen with SE51.
to put the editor control of CL_GUI_TEXTEDIT, I need Custom Control on screen. And I didnt find any property using which we can hide custom control.
Is there any way using classes or methods, can we put Editor Control without using the custom control of screen.
I think in your prob, you had ALV, that we can put on another subscreen, but in my prob how can we remove custom control Please Explain.
Thanks & Regards,
Bhavina -
Hi all, I am developing ALV using OO concept in which custom container is placed on custom control, i have kept that custom control of full screen size but my requirement is to make custom control flexible dynamically while we are adjusting the size of main window.
I used Resizing option while designing the layout, but still its not properly serving my purpose. Is there any other way to work with it?There is no direct option which will resize custom control/container when resizing window. The one you already set will prevent from making it too small. You may however, set custom control large enought (i.e fullscreen) but resize container inside it by using methods SET_HEIGHT and SET_WIDTH of cl_gui_custom_container .
Regards
Marcin -
Dynamic screen and custom control
Hi,
I have to create a screen and custom control dynamically within a method and display alv grid. Is this possible?
regards,
Madhuhi,
this is a smple program just try in this way.plz do reward points if it is of some use
data:obj type ref to zcl_test_alv.
parameter:p_mblnr type zbshd-mblnr.
start-of-selection.
set screen 100.
*& Module STATUS_0100 OUTPUT
text
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
if obj is initial.
create object obj
exporting p_con = 'MATERIAL_DOC'.
endif.
CALL METHOD obj->get_data
exporting p_mat = p_mblnr.
endmodule. " STATUS_0100 OUTPUT
The above is an executable program.
zcl_test_alv is a class which u need to create in se24 according to ur requirement
u need to define methods and attributes.
for example there are 3 methods
constructor
get_data
put_data
method GET_DATA.
SELECT mblnr
mblpo
matnr
maktx
meins
menge
waers
dmbtr
INTO corresponding fields of TABLE it_mm
FROM zbsit
WHERE mblnr = p_mat.
if sy-subrc = 0.
call method put_data.
endif.
endmethod.
method PUT_DATA.
DATA : it_fldcat TYPE lvc_t_fcat.
DATA : wa_fldcat LIKE LINE OF it_fldcat.
DATA : it_sort TYPE lvc_t_sort,
wa_sort LIKE LINE OF it_sort.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'ZBMDC'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME = 'ZBSIT'
CHANGING
ct_fieldcat = it_fldcat[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
EXIT.
ELSE.
LOOP AT it_fldcat INTO wa_fldcat.
CASE wa_fldcat-fieldname.
WHEN 'MBLNR'.
wa_fldcat-reptext = 'Material Doc no'.
WHEN 'MBLPO'.
wa_fldcat-reptext = 'Item Material Doc'.
wa_fldcat-ref_table = 'X'.
WHEN 'MATNR'.
wa_fldcat-reptext = 'Material No'.
wa_fldcat-ref_table = 'X'.
WHEN 'MAKTX'.
wa_fldcat-reptext = 'Description'.
wa_fldcat-do_sum = 'X'.
WHEN 'MEINS'.
wa_fldcat-reptext = 'UOM'.
wa_fldcat-do_sum = 'X'.
WHEN 'MENGE'.
wa_fldcat-reptext = 'QUAN'.
wa_fldcat-do_sum = 'X'.
WHEN 'WAERS'.
wa_fldcat-reptext = 'CurrKey'.
wa_fldcat-do_sum = 'X'.
WHEN 'DMBTR'.
wa_fldcat-reptext = 'curr'.
wa_fldcat-do_sum = 'X'.
ENDCASE.
MODIFY it_fldcat FROM wa_fldcat INDEX sy-tabix.
ENDLOOP.
wa_sort-fieldname = 'MBLNR'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
ENDIF.
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 = 'x'
is_layout =
is_print =
it_special_groups =
it_toolbar_excluding =
it_hyperlink =
it_alv_graphics =
it_except_qinfo =
ir_salv_adapter =
CHANGING
it_outtab = it_mm[]
it_fieldcatalog = it_fldcat[]
it_sort = it_sort
it_filter =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endmethod.
method CONSTRUCTOR.
CREATE OBJECT o_con
EXPORTING
container_name = p_con .
IF sy-subrc = 0.
CREATE OBJECT o_grid
EXPORTING
i_parent = o_con .
ENDIF.
endmethod.
Attributes are
o_con type ref to CL_GUI_CUSTOM_CONTAINER
o_grid type ref to CL_GUI_ALV_GRID
it_mm type zmdoc
to get alv grid ,in layout editor u need to create custom control
for constructor method u should have a parameter p_con with default value as 'MATERIAL_DOC'
Im just explaining the above program use this as reference and try. -
Size dinamically a Custom Control
Hi all,
in a dynpro I have two section:
- one with some parameters
- one with alv (using cl_gui_alv_grid).
I build the first section with a sub area and with a button to collapse and expand the sub area. All works fine.
The problem is that when I collapse the subarea I want to expand the custom control where the alv is.
I want to do something like the trx ME23N.
Any one can help me?
Bye
enzoHi,
I just wanna know how you did the collapse / expand for a sub area like tcode me23n do ???
Any help would be appreciated !
Max
>
Enzo Porcasi wrote:
> Hi all,
> in a dynpro I have two section:
> - one with some parameters
> - one with alv (using cl_gui_alv_grid).
>
> I build the first section with a sub area and with a button to collapse and expand the sub area. All works fine.
> The problem is that when I collapse the subarea I want to expand the custom control where the alv is.
>
> I want to do something like the trx ME23N.
> Any one can help me?
>
> Bye
> enzo -
Issue in Custom Control UI element
Hi there,
I have created 2 custom controls(SAP mobile 7.1), one for rendering images(actually map images) and another for capturing user's signature. Both are integrated into the main application and works fine when alone. But when present together, certainly on different screens in the main app, still it works but with rendering problems. Say when navigating from the screen that displays the map custom control to the screen that has the signature capuring custom control, the map image is still getting displayed over the signature custom control view.
I wonder , if the problem is with disposing of the custom control. Can anyone suggest how to do that. Or something else has to be done?
Regards,
AravindHopefully someone more knowledgeable about custom controls \ SWT can add some input
I do know disposing the SWT controls is important but not sure if it would solve your problem
from our application that uses a few simple custom controls together, we definitely needed to use dispose or it would cause memory consumption issues and slow performance
within the constructor
[Text object].addDisposeListener(this);
method to dispose color and fonts used
public void widgetDisposed(DisposeEvent event)
font.dispose();
amber.dispose();
Maybe you are looking for
-
kindly advise how do i install Bonjour to my MacBook Pro. i have quite a fewApps that won't work and have troubleshot them and can not find this application anywhere.
-
Display two characteristics in the same column
Hi everyone, I have two cubes that store key figures in two different ways. In the first cube I have several key figures like "Amount in Local Currency", "Amount in Document Currency" etc. these have the currency characteristics "Local currency"(0LO
-
Best Practice: Team Management
Hi together, I have to reconfigure a server (now 10.4.8) which has been running unattended for quite some time. I've been reading a lot but still didn't find the information I need. When I took it over all users have been working with local accounts
-
NiIviDmmComponent.h not found?
I'm finally getting closer on this conversion from a big Visual Studio C++ 6.0 project to Visual Studio .Net 2005. Now in my NIIncludes.h file, it is unable to find NiIviDmmComponent.h. I have freshly installed Ni-Dmm 2.9 and it shows in the last scr
-
I've accidentally deleted purchases from appearing in iCloud, and iTunes will not even let me re-purchase them, let alone make them appear in "previous purchases" to download.