Cl_gui_custom_container Problem
HI Gurus,
I have defined a variable g_custom_container as below,
g_custom_container type ref to cl_gui_custom_container,
and I am cheking in the program for its initial value as
if g_custom_container is initial.
perform create_and_init_ct1_alv changing gt_outtab[]
gt_fieldcat.
endif.
Now,
when I am executing the program, its not going inside the if condition becouse the value of the g_custom_container is not initial ,
Please tell the way to set g_custom_container to its initial value.
My code for calling the module is
*& Module ct1_PBO OUTPUT
text
module ct1_PBO output.
*call method g_custom_container->free.
if g_custom_container is initial.
perform create_and_init_ct1_alv changing gt_outtab[]
gt_fieldcat.
endif.
endmodule. " ct1_PBO OUTPUT
and the definition of perform create_and_init_ct1_alv changing gt_outtab[]
gt_fieldcat.
is
FORM create_and_init_ct1_alv CHANGING pt_outtab LIKE gt_outtab[]
pt_fieldcat TYPE lvc_t_fcat.
DATA: lt_exclude TYPE ui_functions.
g_container = 'ZEXC_REC_CT1'.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
Create Objekt to verify input values.
(This object is already needed in form SELECT_DATA).
CREATE OBJECT g_verifier.
SET HANDLER g_verifier->handle_data_changed FOR g_grid.
PERFORM select_data CHANGING pt_outtab[].
Build fieldcat and set columns LFIMG VRKME
NETPR WAERS edit enabled.
PERFORM build_fieldcat CHANGING pt_fieldcat.
PERFORM exclude_tb_functions CHANGING lt_exclude.
gs_layout-stylefname = 'CELLTAB'.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = lt_exclude
is_layout = gs_layout
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab[].
Set editable cells to ready for input initially
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ENDFORM. "CREATE_AND_INIT_ALV
when I am executing the program it is showing me the previous values because it is not going inside the if condition .
I also used the statement
call method g_custom_container->free.
but its giving runtime error.
Please suggest the solution.
Please suggest.
Similar Messages
-
Hi,
I want to reuse the same custom container screen for a different data.
First screen there will be button 1 and button 2
if I click button 1 then calculate and display data in custom container, if button 2 is clicked then calculate and display data with in the same custom container.
For this
1. Created Custom container - CONTAINER
2. In program defined and created custom container and custom alv grid
g_custom_container TYPE REF TO cl_gui_custom_container,
alv_grid TYPE REF TO cl_gui_alv_grid.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = g_custom_container.
ENDIF.
3. Display data using CALL METHOD alv_grid->set_table_for_first_display
every thing works great for button 1
4. when button 2 is clicked then calculate and display different set of data in same custom container which is used earlier.
5. here I used
call method alv_grid->free.
call method g_custom_container->free.
6. create above objects once again and tried to use
call method alv_grid->set_table_for_first_display
, to reuse the same custom container 'CONTAINER' again for a different set of data and getting ABAP dump.
In debug mode, when I used the above method FREE for both ALV_GRID and G_CUSTOM_CONTAINER objects are not clearing.
Please let me know how can I reuse the same container for a different set of data when button2 is pressed.
Thanks in advance,
Krishna
Please use code tags to format your code and post in the correct forum
Edited by: Rob Burbank on Oct 1, 2010 2:37 PMHello Krishna
I would recommend to use a different approach instead of trying to initialize your container instances:
DATA:
go_container_1 TYPE REF TO cl_gui_custom_container,
go_container_2 TYPE REF TO cl_gui_custom_container,
go_grid_1 TYPE REF TO cl_gui_alv_grid,
go_grid_2 TYPE REF TO cl_gui_alv_grid.
" NOTE: Do this coding BEFORE calling the screen
* (1) Create 2 containers
CREATE OBJECT g_container_1
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT g_container_2
EXPORTING
container_name = 'CONTAINER'.
" NOTE: If it is not possible to use the same container name then either create an additional
" dummy screen having a second CUSTOM_CONTROL element or replace
" the customer containers with docking containers -> here you do not need to give a container name
* (2) Create 2 grid instances using a different container
* (3) Link the first container to the screen using its LINK method:
CALL METHOD go_container_1
EXPORTING
repid = <...>
dynnr = <...>.
* (4) Perhaps you need to define a second dummy screen to which you link the second container
* (5) Display first grid instance (as default)
Now when the user pushes button 2 (to display the second grid) link container_1 to the dummy screen
and link container_2 to your main screen.
Regards
Uwe -
Problems using ECL Viewer to display multipage TIFF Files
Hey there!
Maybe someone here may have a good hint due to our problem?
The Situation as it is:
We are using ECL Viewer to display multipage TIFFs.
The Process looks like following:
The first step is to show a list of files situated in the user's personal folder(Network-Share).
Then the user selects one of these Files through a mouse-click -> The File is displayed via ECL Viewer.
Now the user selects the personal-Id where this file should be connected to and selects "SAVE".
The Programm closes the Viewer and saves the Data in SAP Archiv.
>> Everything works fine till here.<<
But now the last processing-step would be to delete this file from the user-folder.
(So next time the users starts it there will be only files he/she has to work on...)
Here an error message is telling us that the file can not be deleted because there s some kind of file lock set...
This problem only occurs only during processing multipage-Tiffs after paging down (swiching to page 2,3,4...) once at least.
Any Idea what's the cause here - or how to get through it?
We are using a CL_GUI_CUSTOM_CONTAINER objekt as base -> hooked on that is a CL_GUI_ECL_VIEWERBOX and the TIFF itself is displayed wit an I_OI_DOCUMENT_VIEWER objekt.
Maybe we get confused while destroying the "Connections" to the FIle oder something with Automation Queue Handling is not implemented right?
Thanx for any idea, hints, or better practices
Very kind Regards from Austria!
DanielHi MaryAbraham,
Since the issue regards ASP.NET and website deployment. I suggestion you post the question in the ASP.NET forums at
http://forums.asp.net/. It is appropriate and more experts will assist you.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hi experts,
I have created a screen with custom control( cl_gui_custom_container ) and displayed a alv using cl_gui_alv_grid in the screen. I have to enter tha values into the alv displayed on screen.The problem here is i have to make 2 fields as mandatory on the alv displayed on the screen.
Is it possible to get screen name of these fields so that i can process it in the PBO or is their some way??
Thanks in advance
regards,
AshwinAnyway the fields that are getting displayed is from the structure u have created right?
So in PBO, u can use the field names like 'MATNR'.
If u want to process after selecting u have to right in PAI like
CASE sy-ucomm.
WHEN 'MATNR'.
In oops for selected row processing
CASE e_ucomm.
WHEN 'FCODE'.
CALL METHOD o_alvgrid->get_selected_rows
IMPORTING
et_index_rows = i_selected_rows
* ET_ROW_NO =
IF i_selected_rows[] IS INITIAL.
MESSAGE i153 WITH text-009.
LEAVE LIST-PROCESSING.
ENDIF.
CLEAR: w_reviewed_mat.
* w_reviewed_mat-reviewed = c_x.
* w_reviewed_mat-reviewedby = sy-uname.
* w_reviewed_mat-reviewedon = sy-datum.
LOOP AT i_selected_rows INTO w_selected_rows.
READ TABLE i_output INTO w_output INDEX w_selected_rows-index.
IF sy-subrc EQ 0.
w_reviewed_mat-matnr = w_output-matnr.
ENDIF.
APPEND w_reviewed_mat TO i_reviewed_mat.
CLEAR: w_reviewed_mat-matnr.
ENDLOOP.
* MODIFY zzcs_mat FROM TABLE i_reviewed_mat.
WHEN OTHERS.
ENDCASE. -
ALV GRID Problem with reading contents
Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code.
1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'.
'zbc_dan_registry' has 2 columns: name, value.
zbc_dan_category' has 1 column: category.
Now I want to have an ALV Grid, that displays the contents of 'zbc_dan_registry' and one additional column with dropdown fields, where the user can select a category for each row. This is, what my code already does.
Now I want to save the contents of the whole table in a new table 'zbc_dan_registrz' (you see: 'registrz', not 'registry'!) with 3 columns:
name, category, value.
My problem is, how can I read the contents of the ALV Grid, with the user selected category for each row, and save them in an internal table? I've tried to adapt the code of "BCALV_EDIT_04", but I don't get it running.
Some detailled help would be great, you know, I'm really working hard to understand ABAP, but it's really hard for me. Thanks for your support and help!!
Here's my code so far:
*& Report ZBC400_DAN_TESTNO4
REPORT ZBC400_DAN_TESTNO4.
DATA: lt_registrz TYPE TABLE OF zbc_dan_regstrz WITH HEADER LINE,
lt_category TYPE TABLE OF zbc_dan_category WITH HEADER LINE,
ls_category TYPE zbc_dan_category, "Struktur Kategorie
ok_code LIKE sy-ucomm,
container_r TYPE REF TO cl_gui_custom_container,
grid_r TYPE REF TO cl_gui_alv_grid,
gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_REG',
fieldcat_r TYPE lvc_t_fcat,
layout_r TYPE lvc_s_layo,
lt_ddval TYPE lvc_t_drop,
ls_ddval TYPE lvc_s_drop,
c TYPE i.
CLASS lcl_event_receiver DEFINITION DEFERRED.
DATA g_verifier TYPE REF TO lcl_event_receiver.
DATA: BEGIN OF gt_outtab OCCURS 0.
INCLUDE STRUCTURE zbc_dan_regstrz.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF gt_outtab.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
TYPES: BEGIN OF lt_registrz_key. "Struktur mit den Schlüsseln der Tabelle 'Registry'
TYPES: name TYPE zbc_dan_name,
value TYPE zbc_dan_value,
category TYPE zbc_dan_cat.
TYPES: END OF lt_registrz_key.
TYPES: ls_registrz_keys TYPE STANDARD TABLE OF lt_registrz_key,
ls_registrz_table TYPE STANDARD TABLE OF zbc_dan_regstrz.
METHODS: get_inserted_rows EXPORTING inserted_rows TYPE ls_registrz_keys.
METHODS: refresh_delta_tables.
METHODS: handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
* METHODS: get_inserted_rows EXPORTING inserted_rows TYPE registrz_keys.
* METHODS: refresh_delta_tables.
PRIVATE SECTION.
DATA: inserted_rows TYPE ls_registrz_keys.
DATA: error_in_data TYPE c.
METHODS: get_cell_values IMPORTING row_id TYPE int4 pr_data_changed TYPE REF TO cl_alv_changed_data_protocol EXPORTING key TYPE lt_registrz_key.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
DATA: ls_good TYPE lvc_s_modi,
ls_new TYPE lvc_s_moce.
error_in_data = space.
IF error_in_data = 'X'.
CALL METHOD er_data_changed->display_protocol.
ENDIF.
ENDMETHOD.
METHOD get_cell_values.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'NAME'
IMPORTING e_value = key-name.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'VALUE'
IMPORTING e_value = key-value.
CALL METHOD pr_data_changed->get_cell_value
EXPORTING i_row_id = row_id i_fieldname = 'CATEGORY'
IMPORTING e_value = key-category.
ENDMETHOD.
METHOD get_inserted_rows.
inserted_rows = me->inserted_rows.
ENDMETHOD.
METHOD refresh_delta_tables.
clear me->inserted_rows[].
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
SELECT client name value
INTO CORRESPONDING FIELDS OF TABLE lt_registrz FROM zbc_dan_regstry.
SELECT category INTO CORRESPONDING FIELDS OF TABLE lt_category FROM zbc_dan_category.
CALL SCREEN 0100.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 0.
MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
WHEN 'SAVE'.
PERFORM save_data.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'DYNPRO100'.
SET TITLEBAR 'D0100'.
ENDMODULE.
MODULE display_alv OUTPUT.
PERFORM display_alv.
ENDMODULE.
FORM display_alv.
IF grid_r IS INITIAL.
*----Creating custom container instance
CREATE OBJECT container_r
EXPORTING
container_name = gc_custom_control_name
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.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT grid_r
EXPORTING
i_parent = container_r
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
CREATE OBJECT g_verifier.
SET HANDLER g_verifier->handle_data_changed FOR grid_r.
*----Preparing field catalog.
PERFORM prepare_field_catalog CHANGING fieldcat_r.
*----Preparing layout structure
PERFORM prepare_layout CHANGING layout_r.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
CALL METHOD grid_r->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
is_layout = layout_r
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
CHANGING
it_outtab = lt_registrz[]
it_fieldcatalog = fieldcat_r
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE.
CALL METHOD grid_r->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ENDIF.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid_r->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDFORM.
FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZBC_DAN_REGSTR2'
CHANGING
ct_fieldcat = pt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
LOOP AT pt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'NAME'.
ls_fcat-coltext = 'Name'.
ls_fcat-outputlen = '40'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'VALUE'.
ls_fcat-coltext = 'Wert'.
ls_fcat-outputlen = '30'.
MODIFY pt_fieldcat FROM ls_fcat.
WHEN 'CATEGORY'.
LOOP AT lt_category into ls_category.
ls_ddval-handle = 1.
ls_ddval-value = ls_category-category.
* ls_ddval-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_ddval TO lt_ddval.
ENDLOOP.
CALL METHOD grid_r->set_drop_down_table
EXPORTING it_drop_down = lt_ddval.
ls_fcat-edit = 'X'.
ls_fcat-drdn_hndl = '1'.
ls_fcat-coltext = 'Kategorie'.
MODIFY pt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM.
FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
ps_layout-zebra = 'X'.
ps_layout-grid_title = 'Kategorie zur Registry hinzufügen'.
ps_layout-smalltitle = 'X'.
ENDFORM.
FORM save_data.
DATA: ls_ins_keys TYPE g_verifier->ls_registrz_keys,
ls_ins_key TYPE g_verifier->lt_registrz_key,
ls_registrz TYPE zbc_dan_regstrz,
ls_outtab LIKE LINE OF gt_outtab,
lt_instab TYPE TABLE OF zbc_dan_regstrz.
CALL METHOD g_verifier->get_inserted_rows IMPORTING inserted_rows = ls_ins_keys.
LOOP AT ls_ins_keys INTO ls_ins_key.
READ TABLE gt_outtab INTO ls_outtab
WITH KEY name = ls_ins_key-name
value = ls_ins_key-value
category = ls_ins_key-category.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_outtab TO ls_registrz.
APPEND ls_registrz TO lt_instab.
ENDIF.
ENDLOOP.
INSERT zbc_dan_regstrz FROM TABLE lt_instab.
CALL METHOD g_verifier->refresh_delta_tables.
ENDFORM.Hi Hans,
You raised the Question in the Webdynpro ABAP forum. Here its very diffcult to get the answer from this forum. Please close it here and raise the same question in ABAP General Forum there you will get faster and so many anwsers.
Please close the question here.
Warm Regards,
Vijay -
Hi,
I'm using OO for ALV-GRID. I have problems by using TOP_OF_PAGE.
I try it like this:
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
HANDLE_TOP_OF_PAGE
FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID,
HANDLE_PRINT_TOP_OF_PAGE
FOR EVENT PRINT_TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
*--Handle Print Top of page
METHOD HANDLE_PRINT_TOP_OF_PAGE.
IF SY-PAGNO = 1.
PERFORM PRINT_TOP_OF_PAGE.
ENDIF.
ENDMETHOD. "handle_print_top_of_page
*--Handle Top of page
METHOD HANDLE_TOP_OF_PAGE.
PERFORM TOP_OF_PAGE.
ENDMETHOD. "handle_top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = GT_EXCLUDE
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_FIELDCATALOG = GT_FIELDCAT
IT_OUTTAB = ITAB.
CREATE OBJECT GR_EVENT_HANDLER.
SET HANDLER GR_EVENT_HANDLER->HANDLE_PRINT_TOP_OF_PAGE FOR GR_ALVGRID.
SET HANDLER GR_EVENT_HANDLER->HANDLE_TOP_OF_PAGE FOR GR_ALVGRID.
FORM PRINT_TOP_OF_PAGE.
WRITE: / 'Print-Header'.
ENDFORM. "print_top_of_page
FORM TOP_OF_PAGE.
WRITE: / 'Screnn-Header'.
ENDFORM. "top_of_page
Has anyone an idea what i shell do??
Thanks
regards, DieterHi Vijay,
i have tried this code (same as you but with MARA).
I created PF-Staus STATUS und screen 100 with container CONTROL
but i don't get any result (IT_MARA has 20 entries).
Which mistake have i done?
REPORT ZGRO_TEST1 MESSAGE-ID ZZ .
DATA: IT_MARA TYPE TABLE OF MARA.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM.
DATA: G_CONTAINER TYPE SCRFNAME VALUE 'CONTROL',
O_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT,
O_SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
O_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER,
O_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER,
O_HTML_CNTRL TYPE REF TO CL_GUI_HTML_VIEWER.
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
*Event Handler for Top of page
TOP_OF_PAGE FOR EVENT TOP_OF_PAGE
OF CL_GUI_ALV_GRID
IMPORTING E_DYNDOC_ID.
ENDCLASS. "lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD TOP_OF_PAGE.
Top-of-page event
PERFORM EVENT_TOP_OF_PAGE USING O_DYNDOC_ID.
ENDMETHOD. "top_of_page
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
START-OF-SELECTION.
SELECT *
FROM MARA
UP TO 20 ROWS
INTO TABLE IT_MARA.
END-OF-SELECTION.
IF NOT IT_MARA[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
IF G_CUSTOM_CONTAINER IS INITIAL.
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
FORM CREATE_AND_INIT_ALV .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER.
Create TOP-Document
CREATE OBJECT O_DYNDOC_ID
EXPORTING STYLE = 'ALV_GRID'.
Create Splitter for custom_container
CREATE OBJECT O_SPLITTER
EXPORTING PARENT = G_CUSTOM_CONTAINER
ROWS = 2
COLUMNS = 1.
CALL METHOD O_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = O_PARENT_TOP.
CALL METHOD O_SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = O_PARENT_GRID.
Set height for g_parent_html
CALL METHOD O_SPLITTER->SET_ROW_HEIGHT
EXPORTING
ID = 1
HEIGHT = 5.
CREATE OBJECT G_GRID
EXPORTING I_PARENT = O_PARENT_GRID.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
*Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
IT_OUTTAB = IT_MARA[].
CALL METHOD O_DYNDOC_ID->INITIALIZE_DOCUMENT
EXPORTING
BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.
Processing events
CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = O_DYNDOC_ID.
ENDFORM. "CREATE_AND_INIT_ALV
FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
DATA : DL_TEXT(255) TYPE C. "Text
CALL METHOD DG_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Flight Details'
SAP_STYLE = CL_DD_AREA=>HEADING
SAP_FONTSIZE = CL_DD_AREA=>LARGE
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CALL METHOD DG_DYNDOC_ID->ADD_GAP
EXPORTING
WIDTH = 200.
CALL METHOD O_DYNDOC_ID->ADD_PICTURE
EXPORTING
PICTURE_ID = 'ENJOYSAP_LOGO'.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
program ID
DL_TEXT = 'Program Name :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
DL_TEXT = SY-REPID.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
CLEAR : DL_TEXT.
program ID
DL_TEXT = 'User Name :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
DL_TEXT = SY-UNAME.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
Run Date
DL_TEXT = 'Run Date :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
Move date
WRITE SY-DATUM TO DL_TEXT.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
CLEAR : DL_TEXT.
*Time
DL_TEXT = 'Time :'.
CALL METHOD DG_DYNDOC_ID->ADD_GAP.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
CLEAR DL_TEXT.
Move time
WRITE SY-UZEIT TO DL_TEXT.
CALL METHOD O_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = DL_TEXT
SAP_EMPHASIS = CL_DD_AREA=>HEADING
SAP_COLOR = CL_DD_AREA=>LIST_NEGATIVE_INV.
Add new-line
CALL METHOD DG_DYNDOC_ID->NEW_LINE.
PERFORM DISPLAY.
ENDFORM. " EVENT_TOP_OF_PAGE
FORM DISPLAY.
Creating html control
IF O_HTML_CNTRL IS INITIAL.
CREATE OBJECT O_HTML_CNTRL
EXPORTING
PARENT = O_PARENT_TOP.
ENDIF.
CALL METHOD O_DYNDOC_ID->MERGE_DOCUMENT.
O_DYNDOC_ID->HTML_CONTROL = O_HTML_CNTRL.
Display document
CALL METHOD O_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = O_PARENT_TOP
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
ENDIF.
ENDFORM. " display
Regards, Dieter -
Hi ihave a problem in alv grid i want display the longtext which was very long in characters it contains of more than 20 lines as shown below now i want the output the <b>material number and shorttext description only one time</b> but not as many times as there are lines in the long text that is i want to delete the remaining short text and material number for a single material number.
I'm posting here my ALv grid code also pla consider it and give me solution
FORM field_catalog.
***MATERIAL NO no
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MATNR'.
int_cat-reptext_ddic = 'MATERIAL NO'.
APPEND int_cat .
*vender name
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MAKTX'.
int_cat-reptext_ddic = 'MATERIAL SHORT DESCRIPTION'.
APPEND int_cat .
PO No
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'TDLINE'.
int_cat-reptext_ddic = 'MATERIAL LONG DESCRIPTION'.
int_cat-outputlen = '100'.
APPEND int_cat .
endform.
*& Form display_data
text
FORM display_data.
DATA : X_SORT TYPE SLIS_SORTINFO_ALV.
DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV.
X_SORT-SPOS = '1'.
X_SORT-FIELDNAME = 'MATNR'.
X_SORT-TABNAME = 'INT_OUT'.
X_SORT-UP = 'X'.
APPEND X_SORT TO IT_SORT.
CLEAR X_SORT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = int_cat[]
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENT
IT_SORT = INT_OUT
TABLES
t_outtab = int_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "display_data
1000100000 Test material 1 1. DataSet vs DataReader
1000100000 Test material 1 # DataReader
1000100000 Test material 1 # Object to access data in a connected, forward-only, read-only
1000100000 Test material 1 fashion
1000100000 Test material 1
1000100000 Test material 1 # DataSet
1000100000 Test material 1 # Data structure to store schema and data in a disconnected fashion
1000100000 Test material 1 # Useful for editing data offline and later update to data source
1000100000 Test material 1
1000100000 Test material 1 2. What is Microsoft .NET?
1000100000 Test material 1 .NET represents an advanced new generation of software that will
1000100000 Test material 1 drive the Next Generation Internet. Its purpose is to make information
1000100000 Test material 1 available any time, any place, and on any device.
1000100000 Test material 1 Quick Definition
1000100000 Test material 1 .NET is an initiative to integrate all Microsoft products with
1000100000 Test material 1 the #Next Generation# web.
1000100000 Test material 1
1000100000 Test material 1 3. Recordset
1000100000 Test material 1
1000100000 Test material 1 ? Recordsets are generated one per table. This does not support
1000100000 Test material 1 hierarchical structure of data access. It will be programmer#s
1000100000 Test material 1 responsibility to define relationships among different recordsets.
1000100000 Test material 1 ? Rercordsets can not support data accessing from multiple sources.
1000100000 Test material 1
1000100000 Test material 1
1000100000 Test material 1 4. Connection-oriented Vs Connection-less
1000100000 Test material 1 ? Connection-oriented
1000100000 Test material 1 # Keeps the connection to the data base alive
1000100000 Test material 1 # Intended for applications with:
1000100000 Test material 1 ? short running transactions
1000100000 Test material 1 ? only a few parallel accesses
1000100000 Test material 1 ? up-to-date data
1000100000 Test material 1
1000100000 Test material 1 ? Connectionless*& Report ZREADTEXTTEST *
REPORT ZREADTEXTTEST .
tables: ekpo,MAKT.
TYPE-POOLS: slis.
DATA: thread LIKE thead.
data: P_MATNR1(15) type N.
DATA: BEGIN OF INT_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
WERKS LIKE EKPO-WERKS,
END OF INT_MAKT.
DATA: BEGIN OF INT_EKPO OCCURS 0,
MATNR LIKE EKPO-MATNR,
WERKS LIKE EKPO-WERKS,
END OF INT_EKPO.
DATA: BEGIN OF INT_OUT OCCURS 0,
MATNR LIKE EKPO-MATNR,
MAKTX LIKE MAKT-MAKTX,
TDLINE LIKE TLINE-TDLINE,
END OF INT_OUT.
DATA: it_tlines LIKE tline OCCURS 10 WITH HEADER LINE.
****ALV list definintion
DATA: ws_cat TYPE slis_fieldcat_alv ,
int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
g_custom_container TYPE REF TO cl_gui_custom_container.
*selection-screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 25(20) text-001.
SELECT-OPTIONS: S_MATNR FOR MAKT-MATNR obligatory.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 25(20) text-002.
*PARAMETERS:p_ebeln LIKE ekko-ebeln obligatory.
SELECT-OPTIONS: S_WERKS FOR EKPO-WERKS OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
PERFORM field_catalog.
PERFORM display_data.
END-OF-SELECTION.
FORM GET_DATA.
SELECT * FROM EKPO
INTO CORRESPONDING FIELDS OF TABLE
INT_EKPO
WHERE
EKPO~MATNR IN S_MATNR AND
EKPO~WERKS IN S_WERKS.
sort int_ekpo by werks.
delete adjacent duplicates from INT_EKPO .
SELECT MATNR MAKTX FROM MAKT
INTO CORRESPONDING FIELDS OF TABLE
INT_MAKT
FOR ALL ENTRIES IN INT_EKPO
WHERE MAKT~MATNR = INT_EKPO-MATNR.
loop at int_ekpo.
read table int_MAKT with key matnr = INT_EKPO-MATNR.
int_OUT-MATNR = INT_EKPO-MATNR.
INT_OUT-MAKTX = INT_MAKT-MAKTX.
ENDLOOP.
ENDIF.
**ENDIF.
**" Read text
*LOOP AT INT_EKPO.
thread-tdname = INT_EKPO-MATNR.
thread-tdid = 'BEST'.
thread-tdobject = 'MATERIAL'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = thread-tdid
LANGUAGE = sy-langu
NAME = thread-tdname
OBJECT = thread-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_tlines
loop at it_tlines.
IF INT_OUT-MATNR IS INITIAL.
CLEAR INT_OUT-MATNR .
ENDIF.
read table int_MAKT with key matnr = INT_EKPO-MATNR.
int_OUT-MATNR = INT_EKPO-MATNR.
INT_OUT-MAKTX = INT_MAKT-MAKTX.
int_OUT-MAKTX = int_EKPO-WERKS.
int_OUT-TDLINE = it_tlines-tdline.
APPEND INT_OUT.
endloop.
ENDFORM.
FORM field_catalog.
***MATERIAL NO no
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MATNR'.
int_cat-reptext_ddic = 'MATERIAL NO'.
APPEND int_cat .
*material Short Description
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MAKTX'.
int_cat-reptext_ddic = 'MATERIAL SHORT DESCRIPTION'.
APPEND int_cat .
Material Long Description
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'TDLINE'.
int_cat-reptext_ddic = 'MATERIAL LONG DESCRIPTION'.
int_cat-datatype = 'CHAR'.
int_cat-outputlen = '100'.
APPEND int_cat .
endform.
*& Form display_data
text
FORM display_data.
data: new(15) TYPE N.
*SORT int_out.
LOOP AT int_out.
CLEAR new.
AT NEW MATNR.
new = INT_OUT-MATNR.
ENDAT.
IF new = INT_OUT-MATNR.
CLEAR int_out-matnr.
clear int_out-maktx.
MODIFY int_out TRANSPORTING matnr maktx.
endif.
ENDLOOP.
*Loop at INT_OUT .
*if int_out-matnr = ' ' .
*data: temp like makt-matnr.
At new matnr.
*Temp = int_out-matnr.
*If int_out-matnr = temp.
clear int_out-matnr .
*Endif.
*Continue.
*Endat.
*endif.
*endloop.
*DATA : WTAB LIKE INT_OUT,
FLAG.
*LOOP AT INT_OUT.
*AT NEW MATNR.
*CLEAR FLAG .
*ENDAT.
*IF FLAG = 'X'.
*INT_OUT-MATNR = ''.
*INT_OUT-MAKTX = ''.
*clear int_out-matnr.
*MODIFY INT_OUT.
*ENDIF.
*FLAG = 'X'.
*ENDLOOP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = int_cat[]
IT_SORT = IT_SORT
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENT
IT_SORT = INT_OUT
TABLES
t_outtab = int_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "display_data -
Hi everyone. I've got a problem with ABAP charts. I need to place a simple chart in screen's container.
REPORT ZWOP_TEST4 .
Contain the constants for the graph type
TYPE-POOLS: GFW.
DATA: VALUES TYPE TABLE OF GPRVAL WITH HEADER LINE.
DATA: COLUMN_TEXTS TYPE TABLE OF GPRTXT WITH HEADER LINE.
DATA: ok_code LIKE sy-ucomm.
DATA: my_container TYPE REF TO cl_gui_custom_container.
REFRESH VALUES.
REFRESH COLUMN_TEXTS.
VALUES-ROWTXT = 'Salary'.
VALUES-VAL1 = 50000.
VALUES-VAL2 = 51000.
APPEND VALUES.
VALUES-ROWTXT = 'Life cost'.
VALUES-VAL1 = 49000.
VALUES-VAL2 = 51200.
APPEND VALUES.
COLUMN_TEXTS-COLTXT = '2003'.
APPEND COLUMN_TEXTS.
COLUMN_TEXTS-COLTXT = '2004'.
APPEND COLUMN_TEXTS.
Call a chart into a standard container, this function could be used
for many different graphic types depending on the presentation_type
field :
gfw_prestype_lines
gfw_prestype_area
gfw_prestype_horizontal_bars
gfw_prestype_pie_chart
gfw_prestype_vertical_bars
gfw_prestype_time_axis
CALL SCREEN '1000'.
CALL FUNCTION 'GFW_PRES_SHOW'
EXPORTING
CONTAINER = 'CONTAINER' "A screen with an empty
container must be defined
PRESENTATION_TYPE = GFW_PRESTYPE_LINES
TABLES
VALUES = VALUES
COLUMN_TEXTS = COLUMN_TEXTS
EXCEPTIONS
ERROR_OCCURRED = 1
OTHERS = 2.
*& Module STATUS_1000 OUTPUT
text
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'GUI_1000'.
SET TITLEBAR 'xxx'.
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING container_name = 'CONTAINER'.
ENDIF.
ENDMODULE. " STATUS_1000 OUTPUT
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
ok_code = sy-ucomm.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
I created a screen 1000 in SCREENPAINTER, named it 'CONTAINER'. Then I try to launch code above and nothing appears on the screen. Could You give me some tip?Hi,
delete this lines:
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING container_name = 'CONTAINER'.
ENDIF.
then it should work.
R -
Modify width property in CL_GUI_CUSTOM_CONTAINER
Hello,
I have created a HTML custom container (class CL_GUI_CUSTOM_CONTAINER) and then, as a child of this object, a html control (class cl_crm_cic_html_viewer). which calls a URL. I'm trying to modify the size of this container using the SET_WIDTH method, but the size does not change. The code i am using is basically the following:
CREATE OBJECT my_container
EXPORTING
container_name = 'HTML'
EXCEPTIONS
OTHERS = 1.
CALL METHOD my_container->SET_WIDTH
EXPORTING
WIDTH = 500.
CREATE OBJECT html_control
EXPORTING
parent = my_container
SHELLSTYLE = i_style.
CALL METHOD html_control->show_url
EXPORTING
url = doc_url.
Does anybody know how to change the size properties of the gui containers?
Thank you and best regards,
MarioHello Björn,
The problem is that i'm not drowing anything with the screren painter. I have a BSP view inside the html_control. The BSP has the 100% of the size, but the html_control only shows a part of it, because the resolution of my screen (1280x1024) is bigger than the standard .
I don't know how to resize the html_control to obtain all the posibilities of this resolution.
Best regards,
Mario -
Hi,
All,
I am developing time evalouation hr report for T-CODE - PA30. I want to write one record into another record.
acctually if any employee join one company for example 01-01-2006 and he is getting 1.5 earn leave per month. then at the end of year he has total earn leave 15 in one year. so in next year 31-01-2007 his earn leave will be total 16.5 . then problem is this
how i can add privious year total earn leave into next year january earn leave. Please provide me solution. how i need to perform coding.
Thanks,
Regards,
SaurabhHi,
I have been developed this report.below is coding.
REPORT ZHR_PA30_TIME.
TABLES : PA2001, PA2006, RP50G .
TYPE-POOLS : SLIS.
DATA : BEGIN OF ITAB OCCURS 0 ,
KTART LIKE PA2006-KTART,
ANZHL LIKE PA2006-ANZHL,
KVERB LIKE PA2006-KVERB,
DESTA LIKE PA2006-DESTA,
DEEND LIKE PA2006-DEEND,
AWART LIKE PA2001-AWART,
STDAZ LIKE PA2001-STDAZ,
ABWTG LIKE PA2001-ABWTG,
KALTG LIKE PA2001-KALTG,
ANZHL1 LIKE Q2000-ANZHL,
BEGDA LIKE PA2001-BEGDA,
ENDDA LIKE PA2001-ENDDA,
CHOIC LIKE RP50G-CHOIC,
END OF ITAB.
DATA : BEGIN OF ITAB1.
INCLUDE STRUCTURE Q2000.
DATA : END OF ITAB1.
DATA : BEGIN OF ITAB2.
INCLUDE STRUCTURE RP50G.
DATA : END OF ITAB2.
**--ALV DECLERATION *--
DATA : W_CONTAINER TYPE SCRFNAME VALUE 'CL_GRID',
W_CPROG TYPE LVC_S_LAYO,
G_REPID LIKE SY-REPID,
W_SAVE TYPE C,
W_EXIT TYPE C,
CL_GRID TYPE REF TO CL_GUI_ALV_GRID,
CL_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
IT_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV,
WA_FLD_CATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE ,
LAYOUT TYPE SLIS_LAYOUT_ALV,
COL_POS LIKE SY-CUCOL ,
ALVFC TYPE SLIS_T_FIELDCAT_ALV.
***-- SELECTION SCREEN--
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : PERNR FOR PA2006-PERNR NO-EXTENSION NO INTERVALS .
SELECT-OPTIONS : CHOIC FOR RP50G-CHOIC NO-EXTENSION NO INTERVALS.
SELECTION-SCREEN : END OF BLOCK B1.
PERFORM FILL_CATALOG1 USING :
'KTART' 'ITAB' 'Category',
'ANZHL' 'ITAB' 'Quata Number',
'KVERB' 'ITAB' 'Deduction',
'DESTA' 'ITAB' 'Deduction From',
'DEEND' 'ITAB' 'Deduction To',
'BEGDA' 'ITAB' 'Start',
'ENDDA' 'ITAB' 'TO',
'AWART' 'ITAB' 'Absence Type',
'STDAZ' 'ITAB' 'Absence hours',
'ABWTG' 'ITAB' 'Absence Days',
'KALTG' 'ITAB' 'Calender Days',
'ANZHL1' 'ITAB' 'Quota Used'.
SELECT M1~PERNR
M1~KTART
M1~ANZHL
M1~KVERB
M1~DESTA
M1~DEEND
M2~AWART
M2~STDAZ
M2~ABWTG
M2~KALTG
M2~BEGDA
M2~ENDDA INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA2006 AS M1 INNER JOIN PA2001 AS M2
ON M1PERNR = M2PERNR WHERE
M1~PERNR IN PERNR.
LOOP AT ITAB.
SELECT ANZHL1 INTO (ITAB-ANZHL1) FROM Q2000 WHERE M1~PERNR = PERNR.
MODIFY ITAB INDEX SY-TABIX TRANSPORTING ANZHL1.
ENDLOOP.
IF ITAB-BEGDA > ITAB-ENDDA .
APPEND ITAB-ANZHL TO ITAB-ANZHL.
ENDIF.
BREAK-POINT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'SY-REPID'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = IT_FLD_CATALOG
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = ITAB
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.
*ENDFORM.
FORM FILL_CATALOG1 USING P_FIELDNAME TYPE ANY
P_REF_TABLE TYPE ANY
P_SCRTEXT TYPE ANY.
CLEAR : WA_FLD_CATALOG.
WA_FLD_CATALOG-FIELDNAME = P_FIELDNAME.
WA_FLD_CATALOG-TABNAME = P_REF_TABLE.
WA_FLD_CATALOG-SELTEXT_S = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_M = P_SCRTEXT.
WA_FLD_CATALOG-SELTEXT_L = P_SCRTEXT.
APPEND WA_FLD_CATALOG TO IT_FLD_CATALOG.
ENDFORM. " fill_catalog1 -
Multiple ALV Grid Controls per report - problem with default displ.variant
Hi,
I have a report with few screens called sequentialy. Each one of the screens has implemented own instance of ALV Grid Control within custom container, means:
- screen 100 has container Cont100 and grid control "grid100",
- screen 110 has container Cont110 and grid control "grid110"
- screen 120 has container Cont120 and grid control "grid120"
and so on...
Each one of the grid controls is initialized with own field catalog table, with own layout and variant structure definitions. My problem occurs when the user changes the display variant for some of the grid controls and save the layout variant using "default setting" checkbox. In this case next time the program is started all other grid controls behaves like they don't have their own variant definitions, but uses the default setting of the mentioned screen. This leads (usualy) to unsuable grid controls by default, because usualy different controls have no equal field-definition tables. I have the same behaviour even when there are more than 1 ALV grids on a single screen (for example - 2).
For now I don't provide variant variables at selection screen, but it seems there is no way to provide such variables for each one of the grid-controls.
Is anyone aware how to control this? Means no matter if there is default setting in use for some of the grid-controls, how to manipulate other grid-controls not to use this default setting?
Many thanks in advance.
Regards,
Ivaylo Mutafchievcheck this sample code which displays 4 grids in 4 different tabs and with 4 different handles
PROGRAM sapmzsdpp MESSAGE-ID z1.
Table Declarations *
TABLES:
vbpa, " Sales Document: Partner
kna1, " Customer Master
vbap. " Sales Document: Item Data
Tab Strip Declarations *
CONTROLS:
tabstrip_sdpp TYPE TABSTRIP. " Tabstrip
Constants declarations *
CONSTANTS:
c_rep_zm(2) TYPE c VALUE 'ZM', " Outside Sales Representative
c_rep_ve(2) TYPE c VALUE 'VE', " Inside Sales Representative
c_rep_zi(2) TYPE c VALUE 'ZI', " Sales Manager
c_abgru_08(2) TYPE c VALUE '08', " Reason for Rej: SO Not Closed
c_stock_ind_e TYPE c VALUE 'E', " Stock Idctr : Orders on hand
c_gauge(5) TYPE c VALUE 'GAUGE', " Characteristic Name - GAUGE
c_width(5) TYPE c VALUE 'WIDTH', " Characteristic Name - WIDTH
c_gauge_metric(12) " Character Name - GAUGE_METRIC
TYPE c VALUE 'GAUGE_METRIC',
c_width_metric(12) " Character Name - WIDTH_METRIC
TYPE c VALUE 'WIDTH_METRIC',
c_eng_metric(14) " Charac Value - ENGLISH_METRIC
TYPE c VALUE 'ENGLISH_METRIC',
c_coil(4) TYPE c VALUE 'COIL', " For Value COIL
c_spec_bf(7) TYPE c VALUE 'SPEC_BF'," Charac value SPEC_BF
c_wadat_ist(8) " Actual Goods Movement Date
TYPE c VALUE '00000000',
c_mcha(4) TYPE c VALUE 'MCHA', " Database Table 'MCHA'
c_classtype_022(3)
TYPE c VALUE '022', " Class Type : BATCH
c_pipe(2) TYPE c VALUE '06', " Material Pricing Group: Pipes
c_item_ctgry_ztam(4)
TYPE c VALUE 'ZTAM', " Item Cat:Certificate Mnfctr
c_lab_result(10) " Charac Value LAB_RESULT
TYPE n VALUE '0000001392',
c_none_reqd(10) " For Value NONE REQD
TYPE c VALUE 'NONE REQD.',
c_passed(6) TYPE c VALUE 'PASSED', " For Value PASSED
c_pending(12) TYPE c " For Value TEST PENDING
VALUE 'TEST PENDING',
c_bundling(13) " For Value TEST BUNDLING
TYPE c VALUE 'TEST BUNDLING',
c_normal(2) TYPE c VALUE '01'. " Priority: Normal
Internal Table Declarations *
DATA :
Internal table to hold common data for all reports
BEGIN OF t_common_data OCCURS 0,
kunnr LIKE vbak-kunnr, " Customer Number
vbeln LIKE vbap-vbeln, " Sales Document Number
posnr LIKE vbap-posnr, " Sales Document Item Number
ihrez_e LIKE vbkd-ihrez_e, " Mill Order Number
matnr LIKE vbap-matnr, " Material Number
pstyv LIKE vbap-pstyv, " Sales Document Item Category
kwmeng LIKE vbap-kwmeng, " Cumulative Order Quantity
lprio LIKE vbap-lprio, " Delivery Priority
werks LIKE vbap-werks, " Plant
kondm LIKE vbap-kondm, " Material Pricing Group
aedat LIKE vbap-aedat, " Date of Last Change
cuobj LIKE vbap-cuobj, " Configuration
saldata LIKE vbap-zzcust_req_avail,
" Required Availability Date
END OF t_common_data,
Internal table to hold Customer Number
BEGIN OF t_cust_temp OCCURS 0,
kunnr LIKE vbak-kunnr, " Customer Number
END OF t_cust_temp,
Internal table to hold stock details
BEGIN OF t_stock OCCURS 0,
vbeln LIKE mska-vbeln, " Sales Document Number
posnr LIKE mska-posnr, " Sales Document Item Number
matnr LIKE mska-matnr, " Material Number
werks LIKE mska-werks, " Plant
charg LIKE mska-charg, " Batch Number
kalab LIKE mska-kalab, " Valuated Stock
ersda LIKE mska-ersda,
END OF t_stock,
Internal table to hold deliveries
BEGIN OF t_delivery_data OCCURS 0,
vbeln LIKE lips-vbeln, " Delivery Document Number
vgbel LIKE lips-vgbel, " Document No of Ref Document
vgpos LIKE lips-vgpos, " Item No of Ref Item
END OF t_delivery_data,
Internal table to hold released tons & released days
BEGIN OF t_released_tons_days OCCURS 0,
vbeln LIKE likp-vbeln, " Delivery Document Number
btgew LIKE likp-btgew, " Total Weight
bldat LIKE likp-bldat, " Document Date in Document
END OF t_released_tons_days,
Internal table to hold Pre-Production-Pending Orders (Report-1)
BEGIN OF t_pre_prod_ord OCCURS 0,
sortl1 LIKE zcustcode-sortl, " Customer Search Term
ihrez_e1 LIKE vbkd-ihrez_e, " Mill Order Number
salord1(17) TYPE c, " Sales Order Document & Item
descri TYPE char70, " Specification of the Item
speci TYPE char30, " Description of the Item
days_entry LIKE zlgcyinfo-days_since_entry,
" Days Since Entry
dept LIKE zlgcyinfo-bklog, " Department
notes1 LIKE zcsimemo-text, " CSI File Memo Text
*/ Request No. DV2K904687
chng_date LIKE vbap-aedat, " Date of Last Change
END OF t_pre_prod_ord,
Internal table to hold Delinquent Orders (Report-2)
BEGIN OF t_delinquent_ord OCCURS 0,
sortl2 LIKE zcustcode-sortl, " Customer Search Term
ihrez_e2 LIKE vbkd-ihrez_e, " Mill Order Number
salord2(17) TYPE c, " Sales Order Document & Item
descri TYPE char70, " Specification of the Item
speci TYPE char30, " Description of the Item
saldata LIKE vbap-zzcust_req_avail,
schdate LIKE vbep-edatu, " Schedule Line Date
days_late LIKE zlgcyinfo-dayslate,
" Days Late
unit LIKE zlgcyinfo-unit, " Status of Consolidation Units
days_at_unit LIKE zlgcyinfo-daysatunit,
notes2 LIKE zcsimemo-text, " CSI File Memo Text
END OF t_delinquent_ord,
Internal table to hold Processed Material Orders (Report-3)
BEGIN OF t_processed_ord OCCURS 0,
sortl3 LIKE zcustcode-sortl, " Customer Search Term
ihrez_e3 LIKE vbkd-ihrez_e, " Mill Order Number
salord3(17) TYPE c, " Sales Order Document & Item
descri TYPE char70, " Specification of the Item
speci TYPE char30, " Description of the Item
order_tons LIKE vbap-kwmeng, " Cumulative Order Quantity
fin_tons LIKE mska-kalab, " Val.Stock With Unres Usage
fin_days TYPE i, " Finished Days
rel_tons LIKE likp-btgew, " Total Weight
rel_days TYPE i, " No.of.Days Order is Released
status(15) TYPE c, " Status Of Stock
tb_tons LIKE zlgcyinfo-tons, " Tons
notes3 LIKE zcsimemo-text, " CSI File Memo Text
END OF t_processed_ord,
Internal table to hold Flagged Orders (Report-4)
BEGIN OF t_flagged_ord OCCURS 0,
sortl4 LIKE zcustcode-sortl, " Customer Search Term
ihrez_e4 LIKE vbkd-ihrez_e, " Mill Order Number
salord4(17) TYPE c, " Sales Order Document & Item
descri TYPE char70, " Specification of the Item
speci TYPE char30, " Description of the Item
saldata LIKE vbap-zzcust_req_avail,
unit LIKE zlgcyinfo-unit, " Status of Consolidation Units
tons LIKE zlgcyinfo-tons, " Tons
priority LIKE vbap-lprio, " Delivery Priority
notes4 LIKE zcsimemo-text, " CSI File Memo Text
END OF t_flagged_ord,
Internal table to hold CSI memo file data
BEGIN OF t_csi_memo_data OCCURS 0,
vbeln LIKE zcsimemo-vbeln, " Sales Document Number
posnr LIKE zcsimemo-posnr, " Sales Order line item
text LIKE zcsimemo-text, " CSI File Memo Text
END OF t_csi_memo_data,
Internal table to hold Customer Codes
BEGIN OF t_customer_code OCCURS 0,
sortl LIKE zcustcode-sortl, " Sort Field
kunnr LIKE zcustcode-kunnr, " Customer Number
END OF t_customer_code,
Internal table to hold schedule line dates
BEGIN OF t_schedule_line_date OCCURS 0,
vbeln LIKE vbep-vbeln, " Sales Document Number
posnr LIKE vbep-posnr, " Sales Document Item Number
edatu LIKE vbep-edatu, " Schedule line date
END OF t_schedule_line_date,
Internal table to hold Characteristic values
t_configuration
TYPE TABLE OF conf_out
WITH HEADER LINE,
Internal tables to hold legacy data
t_lgcyinfo TYPE TABLE OF zlgcyinfo
WITH HEADER LINE.
Work variables declarations *
DATA:
gv_parvw LIKE kupav-parvw, " Partner function
gv_abgru LIKE vbap-abgru, " Reason to eject sales order
gv_gauge LIKE conf_out-atwtb, " Charac Value Description
gv_width LIKE conf_out-atwtb, " Charac Value Description
gv_ok_code LIKE sy-ucomm, " Usercommand
gv_okcode LIKE sy-ucomm, " User Command
gv_number LIKE sy-dynnr
VALUE '0101', " Initial Sub Screen Number
gv_vbeln LIKE vbak-vbeln, " Sales Order
gv_posnr LIKE vbup-posnr, " Sales Item
*/ Request No. DV2K904687
gv_del_prio LIKE vbap-lprio, " Delivery Priority
gv_obj_key LIKE inob-objek, " Object Key
gv_config LIKE inob-cuobj, " Configuration
gv_lab_result LIKE ausp-atwrt, " Lab Result Value
gv_pass_stock LIKE mska-kalab, " Finished Stock
gv_fail_stock LIKE mska-kalab, " Failed Stock
gv_tp_tons LIKE mska-kalab, " Test Pending Tons
gv_csi_stock LIKE mbew-lbkum, " CSI Stock On Hand
gv_val_stock LIKE mska-kalab, " Valuated Stock
gv_fin_tons LIKE mska-kalab, " Finished Tons
gv_fin_days TYPE i, " Finished Days
gv_rel_tons LIKE likp-btgew, " Released Tons
gv_rel_days TYPE i, " Released Days
gv_no_delivery " Number of Delivery Documents
TYPE i,
gv_bund_tons LIKE zlgcyinfo-tons, " Bundling Tons
gv_net_weight LIKE mara-ntgew, " Net Weight
gv_tb_tons LIKE zlgcyinfo-tons, " Test/Bundling Tons
gv_date LIKE mska-ersda, " Date
gv_tabix LIKE sy-tabix, " Table Index
gv_flg TYPE c, " Flag Variable
gv_exit TYPE c. " For Parameter Exit
Constant declarations for ALV Grid *
CONSTANTS:
c_cont_pre_prod_ord
TYPE scrfname VALUE 'CUST_PPP',
" Custom Container for Report-1
c_cont_delinquent_ord
TYPE scrfname VALUE 'CUST_DIP',
" Custom Container for Report-2
c_cont_processed_ord
TYPE scrfname VALUE 'CUST_PMS',
" Custom Container for Report-3
c_cont_flagged_ord
TYPE scrfname VALUE 'CUST_FLGORD',
" Custom Container for Report-4
c_handle1(3) TYPE c VALUE 'G_1', " Handle for PPP rpt Grid
c_handle2(3) TYPE c VALUE 'G_2', " Handle for DIP rpt Grid
c_handle3(3) TYPE c VALUE 'G_3', " Handle for PMS rpt Grid
c_handle4(3) TYPE c VALUE 'G_4', " Handle for FLGORD rpt Grid
c_true TYPE c VALUE 'X', " For value 'X'
c_save TYPE c VALUE 'A'. " User-Defd & Global Variants
Selection Screen *
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-014.
PARAMETERS :
p_osr RADIOBUTTON GROUP g1
DEFAULT 'X', " Outside Sales Representative
p_isr RADIOBUTTON GROUP g1, " Inside Sales Representative
p_s_mgr RADIOBUTTON GROUP g1. " Sales Manager
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.
SELECT-OPTIONS:
s_pernr FOR vbpa-pernr
OBLIGATORY, " Employee Number
s_kunnr FOR kna1-kunnr, " Customer Number
s_sortl FOR kna1-sortl, " Customer Search Term
s_kondm FOR vbap-kondm. " Material Pricing Group
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-006.
PARAMETERS:
p_open RADIOBUTTON GROUP g2
DEFAULT 'X', " Open Orders
p_closed RADIOBUTTON GROUP g2. " Closed Orders
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-007.
PARAMETERS:
p_var1 LIKE disvariant-variant, " Variant For Report-1
p_var2 LIKE disvariant-variant, " Variant For Report-2
p_var3 LIKE disvariant-variant, " Variant For Report-3
p_var4 LIKE disvariant-variant. " Varinat For Report-3
SELECTION-SCREEN END OF BLOCK b4.
SELECTION-SCREEN END OF SCREEN 500.
*/ Begin of Modification - Request No. DV2K904687
Selection Screen for Changing Sales Order Priority
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-044.
PARAMETERS p_sonum LIKE vbap-vbeln." Sales Order Number
SELECT-OPTIONS s_item FOR vbap-posnr." Sales Order Item
PARAMETERS p_delpr LIKE vbap-lprio." Delivery Priority
SELECTION-SCREEN END OF BLOCK b5.
SELECTION-SCREEN END OF SCREEN 1100.
*/ End of Modification - Request No. DV2K904687
CLASS lcl_gv_event_receiveriver DEFINITION *
CLASS lcl_event_receiver DEFINITION DEFERRED.
ALV Grid - Work Variables Declarations *
DATA:
gv_cont_pre_prod_ord TYPE REF
TO cl_gui_custom_container,
" Custom Cont For Report-1
gv_cont_delinquent_ord TYPE REF
TO cl_gui_custom_container,
" Custom Cont For Report-2
gv_cont_processed_ord TYPE REF
TO cl_gui_custom_container,
" Custom Cont For Report-3
gv_cont_flagged_ord TYPE REF
TO cl_gui_custom_container,
" Custom Cont For Report-4
gv_grid_pre_prod_ord TYPE REF
TO cl_gui_alv_grid,
" Grid For Report-1
gv_grid_delinquent_ord TYPE REF
TO cl_gui_alv_grid,
" Grid For Report-2
gv_grid_processed_ord TYPE REF
TO cl_gui_alv_grid,
" Grid For Report-3
gv_grid_flagged_ord TYPE REF
TO cl_gui_alv_grid,
" Grid For Report-4
gv_event_receiver TYPE REF
TO lcl_event_receiver,
" Object For Local Class
gs_lay_pre_prod_ord TYPE lvc_s_layo,
" Work Area for Grid layout
gs_lay_delinquent_ord TYPE lvc_s_layo,
" Work Area for Grid layout
gs_lay_processed_ord TYPE lvc_s_layo,
" Work Area for Grid layout
gs_lay_flagged_ord TYPE lvc_s_layo,
" Work Area for Grid Layout
gs_var_pre_prod_ord TYPE disvariant,
" Layout Structure
gs_var_delinquent_ord TYPE disvariant,
" Layout Structure
gs_var_processed_ord TYPE disvariant,
" Layout Structure
gs_var_flagged_ord TYPE disvariant,
" Layout Structure
t_fcat_pre_prod_ord TYPE lvc_t_fcat
WITH HEADER LINE,
" Field Catalog For Report-1
t_fcat_delinquent_ord TYPE lvc_t_fcat
WITH HEADER LINE,
" Field Catalog For Report-2
t_fcat_processed_ord TYPE lvc_t_fcat
WITH HEADER LINE,
" Field Catalog For Report-3
t_fcat_flagged_ord TYPE lvc_t_fcat
WITH HEADER LINE,
" Field Catalog For Report-4
t_exclude TYPE ui_functions,
" Function Code Table
gs_exclude TYPE ui_func. " Function Code Structure
CLASS lcl_gv_event_receiver DEFINITION *
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_hotspot
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no,
handle_top_of_page
FOR EVENT print_top_of_page OF cl_gui_alv_grid,
*/ Begin of Modification - Request No. DV2K904687
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.
*/ End of Modification - Request No. DV2K904687
ENDCLASS. " LCL_EVENT_RECEIVER DEFINITION
CLASS IMPLEMENTATION *
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_hotspot.
CASE e_column_id-fieldname.
WHEN 'SALORD1'.
CLEAR t_pre_prod_ord.
READ TABLE t_pre_prod_ord
INTO t_pre_prod_ord
INDEX e_row_id-index.
Call VA03 To View Sales Order Line Item Details
PERFORM call_va03 USING t_pre_prod_ord-salord1.
WHEN 'SALORD2'.
CLEAR t_delinquent_ord.
READ TABLE t_delinquent_ord
INTO t_delinquent_ord
INDEX e_row_id-index.
Call VA03 To View Sales Order Line Item Details
PERFORM call_va03 USING t_delinquent_ord-salord2.
WHEN 'SALORD3'.
CLEAR t_processed_ord.
READ TABLE t_processed_ord
INTO t_processed_ord
INDEX e_row_id-index.
Call VA03 To View Sales Order Line Item Details
PERFORM call_va03 USING t_processed_ord-salord3.
WHEN 'SALORD4'.
CLEAR t_flagged_ord.
READ TABLE t_flagged_ord
INTO t_flagged_ord
INDEX e_row_id-index.
Call VA03 To View Sales Order Line Item Details
PERFORM call_va03 USING t_flagged_ord-salord4.
WHEN 'SORTL1'.
CLEAR t_pre_prod_ord.
READ TABLE t_pre_prod_ord
INTO t_pre_prod_ord
INDEX e_row_id-index.
Call ZSD11 for Customer Search Term
PERFORM call_zsd11_cust_code USING t_pre_prod_ord-sortl1.
WHEN 'SORTL2'.
CLEAR t_delinquent_ord.
READ TABLE t_delinquent_ord
INTO t_delinquent_ord
INDEX e_row_id-index.
Call ZSD11 for Customer Search Term
PERFORM call_zsd11_cust_code USING t_delinquent_ord-sortl2.
WHEN 'SORTL3'.
CLEAR t_processed_ord.
READ TABLE t_processed_ord
INTO t_processed_ord
INDEX e_row_id-index.
Call ZSD11 for Customer Search Term
PERFORM call_zsd11_cust_code USING t_processed_ord-sortl3.
WHEN 'SORTL4'.
CLEAR t_flagged_ord.
READ TABLE t_flagged_ord
INTO t_flagged_ord
INDEX e_row_id-index.
Call ZSD11 for Customer Search Term
PERFORM call_zsd11_cust_code USING t_flagged_ord-sortl4.
WHEN 'IHREZ_E1'.
CLEAR t_pre_prod_ord.
READ TABLE t_pre_prod_ord
INTO t_pre_prod_ord
INDEX e_row_id-index.
Call ZSD11 for Mill Order
PERFORM call_zsd11_millorder USING t_pre_prod_ord-ihrez_e1.
WHEN 'IHREZ_E2'.
CLEAR t_delinquent_ord.
READ TABLE t_delinquent_ord
INTO t_delinquent_ord
INDEX e_row_id-index.
Call ZSD11 for Mill Order
PERFORM call_zsd11_millorder USING t_delinquent_ord-ihrez_e2.
WHEN 'IHREZ_E3'.
CLEAR t_processed_ord.
READ TABLE t_processed_ord
INTO t_processed_ord
INDEX e_row_id-index.
Call ZSD11 for Mill Order
PERFORM call_zsd11_millorder USING t_processed_ord-ihrez_e3.
WHEN 'IHREZ_E4'.
CLEAR t_flagged_ord.
READ TABLE t_flagged_ord
INTO t_flagged_ord
INDEX e_row_id-index.
Call ZSD11 for Mill Order
PERFORM call_zsd11_millorder USING t_flagged_ord-ihrez_e4.
WHEN 'NOTES1'.
CLEAR t_pre_prod_ord.
READ TABLE t_pre_prod_ord
INTO t_pre_prod_ord
INDEX e_row_id-index.
Call zsd00087 program to edit CSI Memo Text
PERFORM edit_notes USING t_pre_prod_ord-salord1.
WHEN 'NOTES2'.
CLEAR t_delinquent_ord.
READ TABLE t_delinquent_ord
INTO t_delinquent_ord
INDEX e_row_id-index.
Call zsd00087 program to edit CSI Memo Text
PERFORM edit_notes USING t_delinquent_ord-salord2.
WHEN 'NOTES3'.
CLEAR t_processed_ord.
READ TABLE t_processed_ord
INTO t_processed_ord
INDEX e_row_id-index.
Call zsd00087 program to CSI Memo Text
PERFORM edit_notes USING t_processed_ord-salord3.
WHEN 'NOTES4'.
CLEAR t_flagged_ord.
READ TABLE t_flagged_ord
INTO t_flagged_ord
INDEX e_row_id-index.
Call zsd00087 program to CSI Memo Text
PERFORM edit_notes USING t_flagged_ord-salord4.
ENDCASE. " CASE E_COLUMN_ID ...
ENDMETHOD. " HANDLE_HOTSPOT
METHOD handle_top_of_page.
PERFORM write_report_header.
ENDMETHOD. " METHOD HANDLE_TOP_OF_PAGE
*/ Begin of Modification - Request No. DV2K904687
METHOD handle_toolbar.
DATA: ls_toolbar TYPE stb_button.
append a separator to normal toolbar
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
append a button for Change Delivery Priority
MOVE 'CHNG_PRIO' TO ls_toolbar-function.
MOVE 'Change SO Delivery Priority'(048)
TO ls_toolbar-quickinfo.
MOVE 'Change SO Priority'(049) TO ls_toolbar-text.
MOVE 0 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD. " handle_toolbar
METHOD handle_user_command.
DATA: t_sel_row TYPE lvc_t_roid,
gs_sel_row TYPE lvc_s_roid,
gs_flagged_ord LIKE t_flagged_ord,
lv_lines TYPE i.
CASE e_ucomm.
WHEN 'CHNG_PRIO'.
REFRESH t_sel_row.
CLEAR e_ucomm.
CALL METHOD gv_grid_flagged_ord->get_selected_rows
IMPORTING
et_row_no = t_sel_row.
CLEAR: t_flagged_ord,
gv_vbeln,
gv_posnr,
gv_del_prio.
DESCRIBE TABLE t_sel_row LINES lv_lines.
IF lv_lines GT 1.
MESSAGE i001 WITH 'Select only one row'(043).
ELSEIF lv_lines EQ 1.
READ TABLE t_sel_row INTO gs_sel_row INDEX 1.
READ TABLE t_flagged_ord INTO gs_flagged_ord
INDEX gs_sel_row-row_id.
IF sy-subrc EQ 0.
SPLIT gs_flagged_ord-salord4 AT '-' INTO gv_vbeln gv_posnr.
gv_del_prio = gs_flagged_ord-priority.
CLEAR: s_item, s_item[].
p_sonum = gv_vbeln.
p_delpr = gv_del_prio.
s_item-low = gv_posnr.
APPEND s_item TO s_item.
CLEAR s_item.
ENDIF. " IF sy-subrc EQ 0
ENDIF. " IF lv_lines GT 1
IF lv_lines LE 1.
CALL SELECTION-SCREEN '1100' STARTING AT 30 2
ENDING AT 110 7.
LEAVE TO SCREEN 100.
ENDIF.
ENDCASE. " CASE e_ucomm
ENDMETHOD. " handle_user_command
*/ End of Modification - Request No. DV2K904687
ENDCLASS. " LCL_EVENT_RECEIVER
" IMPLEMENTATION
Form WRITE_REPORT_HEADER *
This subroutine displays Report Header which includes *
Report Name, Executed by, Execution date, Execution Time *
There are no parameters to be passed to this subroutine *
FORM write_report_header.
DATA lv_rep_tit(72) TYPE c.
FORMAT COLOR COL_KEY.
MOVE sy-title TO lv_rep_tit.
CONDENSE lv_rep_tit.
SKIP 1.
WRITE: /3 sy-repid,
25 'California Steel Industries, Inc.'(040),
75 'Page'(041),
80(4) sy-pagno.
WRITE: /3 sy-uzeit,
25 lv_rep_tit,
75 sy-datum.
FORMAT RESET.
ENDFORM. " WRITE_REPORT_HEADER
At selection-output *
AT SELECTION-SCREEN OUTPUT.
CLEAR sy-ucomm.
IF sy-dynnr EQ '0500'.
Initialize layout variant for report-1
CLEAR gs_var_pre_prod_ord.
gs_var_pre_prod_ord-report = sy-cprog.
gs_var_pre_prod_ord-handle = c_handle1.
PERFORM initialize_layoutvariant CHANGING gs_var_pre_prod_ord.
p_var1 = gs_var_pre_prod_ord-variant.
Initialize layout variant for report-2
CLEAR gs_var_delinquent_ord.
gs_var_delinquent_ord-report = sy-cprog.
gs_var_delinquent_ord-handle = c_handle2.
PERFORM initialize_layoutvariant CHANGING gs_var_delinquent_ord.
p_var2 = gs_var_delinquent_ord-variant.
Initialize layout variant for report-3
CLEAR gs_var_processed_ord.
gs_var_processed_ord-report = sy-cprog.
gs_var_processed_ord-handle = c_handle3.
PERFORM initialize_layoutvariant CHANGING gs_var_processed_ord.
p_var3 = gs_var_processed_ord-variant.
Initialize layout variant for report-4
CLEAR gs_var_flagged_ord.
gs_var_flagged_ord-report = sy-cprog.
gs_var_flagged_ord-handle = c_handle4.
PERFORM initialize_layoutvariant CHANGING gs_var_flagged_ord.
p_var4 = gs_var_flagged_ord-variant.
*/ Begin of Modification - Request No. DV2K904687
ELSEIF sy-dynnr EQ '1100'.
DATA t_exclude TYPE TABLE OF sy-ucomm.
SET PF-STATUS 'MENU_1100'.
To use your own GUI status for a selection screen
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = 'MENU_1100'
TABLES
p_exclude = t_exclude.
ENDIF. " IF sy-dynnr EQ '0500'
*/ End of Modification - Request No. DV2K904687
At Selection Screen *
AT SELECTION-SCREEN.
*/ Begin of Modification - Request No. DV2K904687
CASE sy-dynnr.
WHEN '1100'.
IF sy-ucomm IS INITIAL.
CLEAR sy-ucomm.
LEAVE TO SCREEN 1100.
ENDIF. " IF sy-ucomm IS INITIAL
CASE sy-ucomm.
WHEN 'SAVE'.
CLEAR sy-ucomm.
Change Delivery Priority using BAPI method
PERFORM change_del_priority.
CLEAR: sy-ucomm,
gv_vbeln,
gv_posnr,
gv_del_prio,
p_sonum,
s_item,
s_item[],
p_delpr.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
CLEAR: sy-ucomm,
gv_vbeln,
gv_posnr,
gv_del_prio,
p_sonum,
s_item,
s_item[],
p_delpr.
LEAVE TO SCREEN 0.
ENDCASE. " CASE sy-ucomm
WHEN '0500'.
IF sy-ucomm EQ 'CRET'.
LEAVE TO SCREEN 100.
ELSEIF sy-ucomm IS INITIAL.
LEAVE TO SCREEN 500.
ENDIF. " IF SY-UCOMM EQ 'CRET'
ENDCASE. " CASE sy-dynnr
*/ End of Modification - Request No. DV2K904687
Selection Screen: Validations *
AT SELECTION-SCREEN ON s_pernr.
Validate Employee Number
PERFORM validate_employee_number.
AT SELECTION-SCREEN ON s_kunnr.
Validate Customer Number
IF NOT s_kunnr IS INITIAL.
PERFORM validate_customer_number.
ENDIF. " IF NOT S_KUNNR IS INITIAL
AT SELECTION-SCREEN ON s_sortl.
Validate Search Term
IF NOT s_sortl IS INITIAL.
PERFORM validate_search_term.
ENDIF. " IF NOT S_SORTL IS INITIAL
AT SELECTION-SCREEN ON s_kondm.
Validate Product
IF NOT s_kondm IS INITIAL.
PERFORM validate_product.
ENDIF. " IF NOT S_KONDM IS INITIAL
Validate p_var1
AT SELECTION-SCREEN ON p_var1.
CLEAR gs_var_pre_prod_ord.
gs_var_pre_prod_ord-report = sy-cprog.
gs_var_pre_prod_ord-handle = c_handle1.
gs_var_pre_prod_ord-variant = p_var1.
IF p_var1 IS NOT INITIAL.
PERFORM validate_variant CHANGING gs_var_pre_prod_ord.
ENDIF. " IF P_VAR1 IS NOT INITIAL
Validate p_var2
AT SELECTION-SCREEN ON p_var2.
CLEAR gs_var_delinquent_ord.
gs_var_delinquent_ord-report = sy-cprog.
gs_var_delinquent_ord-handle = c_handle2.
gs_var_delinquent_ord-variant = p_var2.
IF p_var2 IS NOT INITIAL.
PERFORM validate_variant CHANGING gs_var_delinquent_ord.
ENDIF. " IF P_VAR2 IS NOT INITIAL
Validate p_var3
AT SELECTION-SCREEN ON p_var3.
CLEAR gs_var_processed_ord.
gs_var_processed_ord-report = sy-cprog.
gs_var_processed_ord-handle = c_handle3.
gs_var_processed_ord-variant = p_var3.
IF p_var3 IS NOT INITIAL.
PERFORM validate_variant CHANGING gs_var_processed_ord.
ENDIF. " IF P_VAR3 IS NOT INITIAL
Validate p_var4
AT SELECTION-SCREEN ON p_var4.
CLEAR gs_var_flagged_ord.
gs_var_flagged_ord-report = sy-cprog.
gs_var_flagged_ord-handle = c_handle4.
gs_var_flagged_ord-variant = p_var4.
IF p_var4 IS NOT INITIAL.
PERFORM validate_variant CHANGING gs_var_flagged_ord.
ENDIF. " IF P_VAR4 IS NOT INITIAL
Selection Screen: Value Request for ALV GRID Variants *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var1.
CLEAR gs_var_pre_prod_ord.
gs_var_pre_prod_ord-report = sy-cprog.
gs_var_pre_prod_ord-handle = c_handle1.
PERFORM f4_variant CHANGING gs_var_pre_prod_ord
gv_exit.
IF gv_exit NE c_true.
p_var1 = gs_var_pre_prod_ord-variant.
ENDIF. " IF GV_EXIT NE c_true
F4 help for variant p_var2
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2.
CLEAR:
gs_var_delinquent_ord,
gv_exit.
gs_var_delinquent_ord-report = sy-cprog.
gs_var_delinquent_ord-handle = c_handle2.
PERFORM f4_variant CHANGING gs_var_delinquent_ord
gv_exit.
IF gv_exit NE c_true.
p_var2 = gs_var_delinquent_ord-variant.
ENDIF. " IF GV_EXIT NE c_true
F4 help for variant p_var3
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var3.
CLEAR:
gs_var_processed_ord,
gv_exit.
gs_var_processed_ord-report = sy-cprog.
gs_var_processed_ord-handle = c_handle3.
PERFORM f4_variant CHANGING gs_var_processed_ord
gv_exit.
IF gv_exit NE c_true.
p_var3 = gs_var_processed_ord-variant.
ENDIF. " IF GV_EXIT NE c_true
F4 help for variant p_var4
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var4.
CLEAR:
gs_var_flagged_ord,
gv_exit.
gs_var_flagged_ord-report = sy-cprog.
gs_var_flagged_ord-handle = c_handle4.
PERFORM f4_variant CHANGING gs_var_flagged_ord
gv_exit.
IF gv_exit NE c_true.
p_var4 = gs_var_flagged_ord-variant.
ENDIF. " IF GV_EXIT NE c_true
Form validate_employee_number *
This subroutine validates Employee Number *
There are no parameters to need be passed to this subroutine *
FORM validate_employee_number.
DATA lv_pernr LIKE vbpa-pernr.
SELECT SINGLE pernr
INTO lv_pernr
FROM vbpa
WHERE pernr IN s_pernr.
IF sy-subrc NE 0.
MESSAGE e001 WITH text-010.
ENDIF. " IF SY-SUBRC NE 0
CLEAR lv_pernr.
ENDFORM. " VALIDATE_EMPLOYEE_NUMBER
Form validate_customer_number *
This subroutine validates Customer Number *
There are no parameters need to be passed to this subroutine *
FORM validate_customer_number.
SELECT SINGLE kunnr
INTO t_common_data-kunnr
FROM kna1
WHERE kunnr IN s_kunnr.
IF sy-subrc NE 0.
MESSAGE e001 WITH text-011.
ENDIF. " IF SY-SUBRC NE 0
CLEAR t_common_data-kunnr.
ENDFORM. " VALIDATE_CUSTOMER_NUMBER
Form validate_search_term *
This subroutine validates Search Term *
There are no parameters need to be passed to this subroutine *
FORM validate_search_term.
SELECT SINGLE sortl
INTO t_customer_code-sortl
FROM kna1
WHERE sortl IN s_sortl.
IF sy-subrc NE 0.
MESSAGE e001 WITH text-012.
ENDIF. " IF SY-SUBRC NE 0
CLEAR t_customer_code-sortl.
ENDFORM. " VALIDATE_SEARCH_TERM
Form validate_product *
This subroutine validates Product *
There are no parameters need to be passed to this subroutine *
FORM validate_product.
SELECT SINGLE kondm
INTO t_ -
Printing image problem.
Hi to all.
I am new in abap programming.
I would like to ask what could be the reason in my program for not printing the image. I do not know where's my mistake is, please help. Thanks..
I got this program from internet and it's pretty displaying the image ( I uploaded the image in SE78), then I created the program below and run it, but when I happened to click the print button, it wasn't giving me anything or no action at all.
REPORT ZPICTURE04.
START-OF-SELECTION.
SET PF-STATUS 'ADJTEMP'.
CALL SCREEN 9000.
module status_9000 output.
SET PF-STATUS 'ADJTEMP'.
data: w_lines type i.
types pict_line(256) type c.
data : ok_code type c,
exit type c.
data :
container type ref to cl_gui_custom_container,
editor type ref to cl_gui_textedit,
picture type ref to cl_gui_picture,
pict_tab type table of pict_line,
url(255) type c.
data: graphic_url(255). data: begin of graphic_table occurs 0,
line(255) type x,
end of graphic_table.
data: l_graphic_conv type i.
data: l_graphic_offs type i.
data: graphic_size type i.
data: l_graphic_xstr type xstring.
call method cl_gui_cfw=>flush. create object:
container exporting container_name = 'PICTURE_CONTAINER',
picture exporting parent = container.
call method cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
exporting
p_object = 'GRAPHICS'
p_name = 'XLPE'
p_id = 'BMAP'
p_btype = 'BCOL'
receiving
p_bmp = l_graphic_xstr
graphic_size = xstrlen( l_graphic_xstr ).
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
while l_graphic_conv > 255.
graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
append graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
endwhile.
graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
append graphic_table.
call function 'DP_CREATE_URL'
exporting
type = 'IMAGE'
subtype = 'X-UNKNOWN'
size = graphic_size
lifetime = 'T'
tables
data = graphic_table
changing
url = url.
call method picture->load_picture_from_url
exporting
url = url.
call method picture->set_display_mode
exporting
display_mode = picture->display_mode_fit_center.
case sy-ucomm.
when 'EXIT'.
leave program.
WHEN '%PRI'.
NEW-PAGE PRINT ON
DESTINATION 'LP01'
IMMEDIATELY 'X'
KEEP IN SPOOL 'X'
NO DIALOG.
NEW-PAGE PRINT OFF.
endcase.
endmodule. " STATUS_9000 OUTPUT
my pf-status " SET PF-STATUS 'ADJTEMP", I set it from the / menu / extras / adjust template then List status.
Is there anything I missed for not printing it? Thanks a lot to all.
Edited by: chard_vill on Nov 27, 2011 8:59 AMHi Venkat, Thanks a lot for the very helpful reply.
I can't seem follow the contents in the link and lost it somewhere, may be I am missing something being a beginner?
I actually have that program for displaying the image, uploaded from the transaction SMW0 (Binary data for WebRFC applications.). I successfully uploaded the images (format .gif and jpeg), and it was also successful displaying on the screen container.
The problem now is also similar, print button seems not functioning, I guess I am missing something I don't know.
Your help is really appreciated, thanks a lot!
here is my executable program.
REPORT ZPICTURE02.
TYPE-POOLS: cndp.
DATA: ok_code TYPE syucomm,
container TYPE REF TO cl_gui_custom_container,
picture TYPE REF TO cl_gui_picture,
url TYPE cndp_url,
print_parameters TYPE pri_params,
valid_flag TYPE c LENGTH 1..
User can input which object name they uploaded from SMW0.
PARAMETERS: p_objid TYPE w3objid OBLIGATORY.
Here query the table and throw error message if the object is not found.
AT SELECTION-SCREEN.
SELECT COUNT(*) FROM wwwparams
WHERE objid = p_objid.
IF sy-subrc <> 0.
MESSAGE e001(00) WITH 'MIME Object not found'.
ENDIF.
START-OF-SELECTION.
Enabled the function keys from template
SET PF-STATUS 'S0100'.
IF container is INITIAL.
CREATE OBJECT container
EXPORTING
container_name = 'CONT'
repid = 'ZPICTURE02'
dynnr = '0100'
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 i001(00) WITH 'Error while creating container'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
IF picture is INITIAL.
CREATE OBJECT picture
EXPORTING
parent = container
EXCEPTIONS
error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i001(00) WITH 'Error while displaying pictures'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
IF picture IS NOT INITIAL.
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
objid = p_objid
lifetime = cndp_lifetime_transaction
IMPORTING
url = url
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
CALL METHOD picture->load_picture_from_url_async
EXPORTING
url = url.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_fit.
ELSE.
MESSAGE i001(00) WITH 'Error while loading picture222'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
call SCREEN 0100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'S0100'.
SET TITLEBAR 'XXX'.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 00.
LEAVE SCREEN.
when 'EXIT'.
LEAVE PROGRAM.
WHEN 'PRINT'.
NEW-PAGE PRINT ON
DESTINATION 'LP01'
IMMEDIATELY 'X'
KEEP IN SPOOL 'X'
NO DIALOG.
NEW-PAGE PRINT OFF.
WHEN 'PRNLOG'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING
out_parameters = print_parameters
valid = valid_flag
EXCEPTIONS
invalid_print_params = 2
OTHERS = 4.
NEW-PAGE PRINT ON PARAMETERS print_parameters
NO DIALOG.
NEW-PAGE PRINT OFF.
ENDCASE.
ENDMODULE.
In my own opinion, the function code "%PRN" and "PRINT" seems not functioning, is there anything I missed?
Thanks a lot. -
Problem activating the back and exit button with the ALV using OO
I have wrote my first alv using Methods.My problem is that i can't activete the BACK and EXIT button in the standart toolbar .
Look my code please .....
Without PF-STATUS can i do it ?
*& Report YDP_DOUBLE_ALV
REPORT YDP_DOUBLE_ALV.
TABLES : YQM_CERT , MARA , YOUTPUT_APPL.
DATA : ALV_GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
FIELD_CAT TYPE LVC_T_FCAT,
LAYOUT TYPE LVC_S_LAYO.
DATA : ALV_GRID2 TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
* FIELD_CAT TYPE LVC_T_FCAT,
* LAYOUT TYPE LVC_S_LAYO.
DATA: DYNNR TYPE SY-DYNNR,
REPID TYPE SY-REPID.
DATA: OK_CODE TYPE SY-UCOMM.
DATA : BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE YQM_CERT.
DATA END OF ITAB.
DATA : BEGIN OF ITAB1 OCCURS 0.
INCLUDE STRUCTURE YOUTPUT_APPL.
DATA END OF ITAB1.
* MODULE DISPLAY_ALV OUTPUT
MODULE DISPLAY_ALV OUTPUT.
SET PF-STATUS 'ZST9'.
PERFORM DISPLAY_ALV.
ENDMODULE. "DISPLAY_ALV OUTPUT
"DISPLAY_ALV OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
START-OF-SELECTION.
LAYOUT-ZEBRA = 'X'.
LAYOUT-GRID_TITLE = 'YQM_CERT'.
LAYOUT-CWIDTH_OPT = 'X'.
LAYOUT-SMALLTITLE = 'X'.
SELECT * FROM YQM_CERT INTO ITAB.
APPEND ITAB.
ENDSELECT.
SELECT * FROM YOUTPUT_APPL INTO ITAB1.
APPEND ITAB1.
ENDSELECT.
CALL SCREEN 100.
END-OF-SELECTION.
*& Form DISPLAY_ALV
* text
FORM DISPLAY_ALV.
IF ALV_GRID IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
* PARENT =
CONTAINER_NAME = 'CC_ALV'
* style =
* LIFETIME = lifetime_default
REPID = REPID
DYNNR = DYNNR
* NO_AUTODEF_PROGID_DYNNR =
* 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.
CREATE OBJECT ALV_GRID
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = CUSTOM_CONTAINER
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
* 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.
CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'YQM_CERT'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
IS_LAYOUT = LAYOUT
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = ITAB[]
* IT_FIELDCATALOG =
* 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.
ELSE.
CALL METHOD ALV_GRID->REFRESH_TABLE_DISPLAY
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
* EXCEPTIONS
* FINISHED = 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.
ENDIF.
ENDFORM. "DISPLAY_ALVHi
U need to active them in your status ZST9.
Max -
Module Pool Text Editor Problem
Hi
I have developed module pool program which has 3 tab strips. In the last (3rd) Tab Strip I need to input Long Text. I have the done the coding but when I go to the Last tab and then come back to any other tabs, the text editor is overwriting the other fields in the other tabs. Can any tell how to solve this problem
This is he code I have written
****90000******Screen
PROCESS BEFORE OUTPUT.
MODULE status_9000.
MODULE modify_screen9000.
module test_me.
LOOP AT t_operation INTO s_operation WITH CONTROL toperation.
MODULE move_data.
MODULE modiy_screentblctrl.
ENDLOOP.
CALL SUBSCREEN sub1 INCLUDING sy-repid '9001'.
CALL SUBSCREEN sub2 INCLUDING sy-repid '9002'.
CALL SUBSCREEN sub3 INCLUDING sy-repid '9003'.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
CHAIN.
FIELD zaodheader-heatnum MODULE check_heatnumber.
ENDCHAIN.
LOOP AT t_operation.
MODULE update_itab.
ENDLOOP.
MODULE user_command_9000.
CALL SUBSCREEN sub1.
CALL SUBSCREEN sub2.
CALL SUBSCREEN sub3.
**************9003*****
PROCESS BEFORE OUTPUT.
MODULE STATUS_9003.
MODULE display_texteditor.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
**************9003*****
DATA : ccont TYPE REF TO cl_gui_custom_container,
tedit TYPE REF TO cl_gui_textedit.
MODULE display_texteditor OUTPUT.
CREATE OBJECT ccont
EXPORTING
parent =
container_name = 'CC'
style =
lifetime = lifetime_default
repid =
dynnr =
no_autodef_progid_dynnr =
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.
ENDIF.
CREATE OBJECT tedit
EXPORTING
max_number_chars =
style = 0
wordwrap_mode = wordwrap_at_windowborder
wordwrap_position = -1
wordwrap_to_linebreak_mode = false
filedrop_mode = dropfile_event_off
parent = ccont
lifetime =
name =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 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.
ENDMODULE. " DISPLAY_TEXTEDITOR OUTPUT
Edited by: kumar1819 on Apr 7, 2010 8:05 AM
SolvedHi kumar,
**************9003*****
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
Case SY-UCOMM.
When 'TAB2'.
Call screen 9002.
**************9003*****
In 9001 and 9002 screen what code u r writing.
Regards,
Raj. -
ALV Tree - register event problem
Hi,
I'm trying to register standard events for ALV Tree. when perform register_events it raises exception 'illegal event combination'. does anybody know what is wrong it this code ?
***INCLUDE ZNT_SLORDERHIER_STATUS_0100O01 .
*& Module STATUS_0100 OUTPUT
* text
module STATUS_0100 output.
set pf-status 'MAIN100'.
if tree1 is initial.
perform f_init_tree.
endif.
call method cl_gui_cfw=>flush.
endmodule. " STATUS_0100 OUTPUT
form register_events.
* define the events which will be passed to the backend
data: lt_events type cntl_simple_events,
l_event type cntl_simple_event.
* define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
append l_event to lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
append l_event to lt_events.
call method tree1->set_registered_events
exporting
events = lt_events
exceptions
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
if sy-subrc <> 0.
call function 'POPUP_TO_DISPLAY_TEXT_LO'
exporting
titel = 'Error number:'
textline1 = sy-subrc
start_column = 1
start_row = 6. "#EC NOTEXT
endif.
endform. " register_events
form f_init_tree.
perform f_build_fieldcatalog.
* create container for alv-tree
data: l_tree_container_name(30) type c,
l_custom_container type ref to cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
if sy-batch is initial.
create object l_custom_container
exporting
container_name = l_tree_container_name
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
endif.
* create tree control
create object tree1
exporting
parent = l_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
item_selection = space
no_html_header = ''
no_toolbar = ''
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
if sy-subrc <> 0.
message x208(00) with 'ERROR'. "#EC NOTEXT
endif.
* create Hierarchy-header
data l_hierarchy_header type treev_hhdr.
perform f_build_hierarchy_header changing l_hierarchy_header.
* create info-table for html-header
data: lt_list_commentary type slis_t_listheader,
l_logo type sdydo_value.
perform f_build_comment using
lt_list_commentary
l_logo.
* repid for saving variants
data: ls_variant type disvariant.
ls_variant-report = sy-repid.
CLEAR gt_sorder[].
* create emty tree-control
call method tree1->set_table_for_first_display
exporting
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary
i_logo = l_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
changing
it_outtab = gt_sorder "table must be emty !!
it_fieldcatalog = gt_fieldcatalog.
* create hierarchy
perform f_create_hierarchy.
perform register_events.
endform. " init_tree
form f_build_fieldcatalog.
DATA gs_fieldcat LIKE LINE OF gt_fieldcatalog.
* get fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZVNT_SLALVTREE'
changing
ct_fieldcat = gt_fieldcatalog.
clear gs_fieldcat.
endform.
form f_build_hierarchy_header changing
p_hierarchy_header type treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy Header'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'This is the Hierarchy Header !'. "#EC NOTEXT
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
endform.
form f_build_comment using
pt_list_commentary type slis_t_listheader
p_logo type sdydo_value.
data: ls_line type slis_listheader.
* LIST HEADING LINE: TYPE H
clear ls_line.
ls_line-typ = 'H'.
* LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'ALV-tree: sales order-overview'. "#EC NOTEXT
append ls_line to pt_list_commentary.
* STATUS LINE: TYPE S
p_logo = 'ENJOYSAP_LOGO'.
endform. "build_comment
form f_create_hierarchy.
data: ls_sorder type ty_ZVNT_SLALVTREE,
lt_sorder type ty_ZVNT_SLALVTREE occurs 0.
* get data
select * from ZVNT_SLALVTREE into table lt_sorder up to 200 rows WHERE spras = sy-langu and matnr in s_matnr
and vbeln in s_vbeln.
sort lt_sorder by vbeln.
* add data to tree
data: l_vbeln_key type lvc_nkey,
l_posnr_key type lvc_nkey,
l_last_key type lvc_nkey.
loop at lt_sorder into ls_sorder.
on change of ls_sorder-vbeln.
perform f_add_vbeln_line using ls_sorder
changing l_vbeln_key.
endon.
on change of ls_sorder-posnr.
perform f_add_posnr_line using ls_sorder
l_vbeln_key
changing l_posnr_key.
endon.
perform f_add_complete_line using ls_sorder
l_posnr_key
changing l_last_key.
endloop.
* this method must be called to send the data to the frontend
call method tree1->frontend_update.
endform. " create_hierarchy
form f_add_vbeln_line using ps_sorder type ty_ZVNT_SLALVTREE
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value,
ls_sorder type ty_ZVNT_SLALVTREE.
* set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-style =
cl_gui_column_tree=>style_intensifd_critical.
append ls_item_layout to lt_item_layout.
* add node
l_node_text = ps_sorder-vbeln.
data: ls_node type lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sorder
is_node_layout = ls_node
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform.
form f_add_posnr_line using ps_sorder type ty_ZVNT_SLALVTREE
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value,
ls_sorder type ty_ZVNT_SLALVTREE.
* set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@3Y@'.
ls_item_layout-style =
cl_gui_column_tree=>style_intensified.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
append ls_item_layout to lt_item_layout.
* add node
l_node_text = ps_sorder-posnr.
data: relat type int4.
relat = cl_gui_column_tree=>relat_last_child.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = relat
i_node_text = l_node_text
is_outtab_line = ls_sorder
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " add_connid_line
form f_add_complete_line using ps_sorder type ty_ZVNT_SLALVTREE
p_relat_key type lvc_nkey
changing p_node_key type lvc_nkey.
data: l_node_text type lvc_value.
* set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
ls_item_layout-editable = 'X'.
append ls_item_layout to lt_item_layout.
l_node_text = ps_sorder-posnr.
data: ls_node type lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
call method tree1->add_node
exporting
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = ps_sorder
i_node_text = l_node_text
is_node_layout = ls_node
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " add_complete_line
form exit_program.
call method tree1->free.
leave program.
endform.
Code Formatted by: Alvaro Tejada Galindo on Feb 14, 2008 9:54 AM
Edited by: Lukasz Sekowski on Feb 14, 2008 4:11 PMI've finally fixed the problem:
there was:
item_selection = space
and should be:
item_selection = 'X'
Maybe you are looking for
-
Under the camera-when I select the video option-the app switches to video. I can start the video, but can not stop it by pushing the same button. After a time period-(varies) the phone freezes up and then reboots.
-
Images will not delete, or do not wind up in trash as expected
Since I upgraded to LR 3, I am not able to delete images from a library without getting an error message that says something to the effect that 'unable to delete from selected drive.' It then goes on to offer the choice 'delete anyway?' which I choos
-
Current Project Online environment is currently setup with Project Server Permissions Mode. All projects follow a customized workflow that enables Schedule PDP on Planning Phase/Stage, among other rules. For some users the workflow and expected PDPs
-
XI Adapter - Proxy - ECC user roles ?
Hi Gurus, My scenario is HTTP - XI - ECC(Proxy). We are using communication user with SAP_ALL role to login to ECC from XI(in receiver XI adapter -Communication channel). Basis do not want to give SAP_ALL role this communication user. <b>Are there an
-
Revision: 14975 Revision: 14975 Author: [email protected] Date: 2010-03-23 17:04:43 -0700 (Tue, 23 Mar 2010) Log Message: Fix for FM-447 : Adding CuePoint in TemporalFacet event listeners doesn't work Ticket Links: http://bugs.adobe.com/jir