Length problem on a grid.
Hello,
I have a problem with grids in my add-on.
I have to generate 2 grids where the datas are exactly the same (so the associated XML definitions are the same too) but come from 2 different user-defined tables (1 grid for each table).
On both of these tables, the datas that I have to display in my grids have the same type and size, but in one of my 2 grids the fields max length is not correct (multiply by 2) whereas the other is fine.
I populate these 2 grids exactly the same way, by generating a query with the function ExecuteQuery.
After several tests, i can say that the problem is not in my XML file or in one of my Grid object. It seems to come from B1 not retrieving or modifying the size of the fields in one of my table.
Can somebody help me, please ?
Thanks.
Hi Helen,
here is my code.
'Declarations and initialisations
Private muc_grOperationsSO As SAPbouiCOM.Grid
Private muc_grOperationsTL As SAPbouiCOM.Grid
muc_grOperationsSO = CType(FormItem("grOPSO").Specific, SAPbouiCOM.Grid)
muc_grOperationsTL = CType(FormItem("grOPTL").Specific, SAPbouiCOM.Grid)
muc_grOperationsSO.DataTable.Clear()
muc_grOperationsTL.DataTable.Clear()
'Grid generation
Dim dst_CodeSQL As String = ""
' Request SO
dst_CodeSQL = "SELECT TOP 2 OP.Code"
dst_CodeSQL &= ", OP.U_CodeOP"
dst_CodeSQL &= " FROM [@MRO_SEO2] OP "
dst_CodeSQL &= " ORDER BY OP.Code"
muc_grOperationsSO.DataTable.ExecuteQuery(dst_CodeSQL)
'Request TL
dst_CodeSQL = "SELECT TOP 1 OP.Code"
dst_CodeSQL &= ", OP.U_CodeOP"
dst_CodeSQL &= " FROM [@MRO_TAL2] OP "
dst_CodeSQL &= " ORDER BY OP.U_CodeOP"
muc_grOperationsTL.DataTable.ExecuteQuery(dst_CodeSQL)
In this case, I have 2 grids and both display 2 columns : "Code" and "U_CodeOP". "Code" is defined on 8 characters and "U_CodeOP" on 4 characters on my 2 table MRO_SEO2 and MRO_TAL2.
In my grid TL, "Code" is displayed on 8 characters and "U_CodeOP" on 4 characters (Normal behavior)
In my grid SO, "Code" is displayed on 8 characters and "U_CodeOP" on 8 characters instead of 4.
I don't understand why B1 doesn't retrieve the max length for this field in my grid because when I go to Tools > Customization tools > User defined fields management my "U_CodeOP" field is well defined (on 4 characters).
Let me know if you want to see the XML code associated, I don't want to "flood" the post, but the XML code for both grids is exactly the same (copy/paste).
Thanks for your answer.
Charly
Similar Messages
-
I have a problem with ALV Grid User Command?
Hi Experts,
I have a problem with ALV GRID User Command.
I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
Here is my code.
FORM user_command_alv USING u_ucomm TYPE sy-ucomm
us_self_field TYPE slis_selfield.
CASE u_ucomm.
WHEN '&IC1'.
READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
WHEN 'ORDER'.
IF NOT wa_final-order IS INITIAL.
SET PARAMETER ID 'COK' FIELD wa_final-order.
CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
ENDIF.
endform.
PARAMETER ID 'COK' also the standard one.
Could you please help me out, Where I did wrong?
If I select any order, that order only should display.
Thanks in advance.
Regards,
Sarayu.
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PMhi,
Please check it once the Paramater ID is 'ANR' for IW33 order number.
Hope this may help.
Regards,
Sravanthi -
Problem with ALV grid in edit mode
Hello, gurus!
I have a problem with ALV-grid. Sometimes when I call F4 help for a cell, data is inserted in a different cell. And when I call check_changed_data method, my internal table (passed to ALV-control in set_table_for_first_display) does not updates properly. In what can be a problem?
Thanks,
MikhailHi Prabhu,
MODULE pbo_100 OUTPUT.
SET PF-STATUS 'MAIN100'.
title_of_report = text-010.
SET TITLEBAR '0100' WITH title_of_report.
DATA: g_event_receiver TYPE REF TO lcl_event_handler.
IF z_custom_container IS INITIAL .
CREATE OBJECT z_custom_container
EXPORTING
container_name = 'ALV_ZAC'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = z_custom_container.
g_repid = sy-repid.
gs_variant-report = g_repid.
x_save = 'A'.
PERFORM check_alv_grid_fields.
ps_layout-cwidth_opt = 'X'.
ps_layout-edit = 'X'.
CALL METHOD alv_grid->set_ready_for_input
EXPORTING
i_ready_for_input = '1'.
* CALL METHOD alv_grid->register_edit_event
* EXPORTING
* i_event_id = cl_gui_alv_grid=>mc_evt_enter.
APPEND s_list_rec to it_list_rec.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
is_variant = gs_variant
i_save = x_save
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = it_list_rec[].
CALL METHOD alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
ENDIF.
FORM check_alv_grid_fields .
DATA: ls_fcat LIKE LINE OF pt_fieldcat.
REFRESH pt_fieldcat .
CLEAR: ps_layout, ls_fcat.
ls_fcat-fieldname = 'VBELN'.
ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table = 'LIPS'. " .
ls_fcat-outputlen = 9.
* ls_fcat-datatype = 'CHAR'.
* ls_fcat-inttype = 'C'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR: ls_fcat.
ls_fcat-fieldname = 'ERDAT'.
ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'LIPS'.
ls_fcat-outputlen = 9.
* ls_fcat-f4availabl = 'X' .
* ls_fcat-datatype = 'DATS'.
* ls_fcat-inttype = 'D'.
APPEND ls_fcat TO pt_fieldcat.
CLEAR: ls_fcat.
ENDFORM. " check_alv_grid_fields
FORM save_p .
CLEAR l_valid.
CALL METHOD alv_grid->check_changed_data
IMPORTING
e_valid = l_valid.
IF l_valid IS INITIAL.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-i01
txt1 = text-i02
txt2 = text-i03
txt3 = text-i04.
ELSE.
i_dat_reg = zrumm_prr-cdprr.
CLEAR is_temp_otc.
freshit i_prrpus_fax.
freshit i_list2_ot.
LOOP AT it_list_rec INTO s_list_rec.
MOVE-CORRESPONDING s_list_rec TO i_list2_ot.
i_list2_ot-fgrup = 'RECE'.
i_list2_ot-prrnu = i_num_prr.
APPEND i_list2_ot.
MOVE-CORRESPONDING s_list_rec TO i_prrpus_fax.
APPEND i_prrpus_fax.
ENDLOOP.
ENDIF.
Edited by: Mikhail Sarychev on Mar 16, 2011 6:41 AM
Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM
Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM -
Problem while alv grid display exporting to excel sheet
Hi,
I have done an ALV report using reuse_alv_grid _display , out put is fine , but when i click on excel view icon i could only see an excel sheet without any data ., but when i use export to local file and choose spread sheet its giving the data in excel, but the user wants to click only the excel view icon.
Best RegardsHi,
Check this link
[Problem with Excel button in ALV Grid...URGENT;
Regards,
Sathish Reddy. -
Problems with fluid grid layout live site only showing phone view in Chrome and Firefox Feb 2015
Hi all,
I have done a complex fluid grid layout using DW 2014 CC. The site has now gone live on the web masters server setup.
Up until now the layout of the site has been working fine and responding to screen size.
Early this morning in the USA the site stopped working. The layout for some users, not all, is only showing the phone view, and takes a long time to load.
This is happening in Chrome and Firefox, but IE is displaying the site properly.
So it looks like the CSS media queries are not working on all browsers.
I am using BC for the test site, and one user having this problem can see that version of the site OK.
I noticed that Chrome has done some updates recently Chrome Releases
Has anyone else come across this problem with Chrome and Firefox with their responsive layouts?
Thanks for any help given.Hi Ben,
Yes, thanks for this link. The Travel Health Website is one of ours, hosted on BC, and no reported problems so far. We also have another large BC website with ga code in it and users are not reporting problems with it. The Headless Way
However the problem website is hosted elsewhere on a different platform to BC. We have been developing it for three months now, and no problems so far until yesterday. The problem of the site taking ages to load, and timing out seems to be happening with about 10% of users in the USA. http://www.harrisonassessments.com/
The web developer found a user in NZ who was experiencing the slow display problem. They looked at the site with Chrome, Firefox and IE. The site would only display on IE. When the developer removed the google analytics code, the site displayed fine on all browsers for the NZ user. We are waiting for users in the USA to wake up and test the site.
So the problem definitely is related to the ga code and the responsive layout that was done by me in DW2014.1 fluid grid layout. So the related problem of DW2014.1 not being able to load htm files with ga code in them looks to be a good clue to what is going on here.
As there was a bug report for DW2014.1 and google analytics code made in the other thread, I would be interested to know if that was ever solved.
It is interesting that you are pushing Bootstrap and Foundation on me. (Big square websites here I come! lol)
I wonder if DW is going to persist with fluid grid layout then? I certainly hope so, as I have spent 12 months blood sweat and tears learning how to do it in DW. -
Hies
Guys I've a problem in oracle report calling from Oracle FORMS. I am using reports and forms 6i. When the report name length is more than 30 characters the report engine runs first time correctly but on the second call of report the system gives an error :
" RWRBE60.exe has generated errors and will be closed by windows.You will need to restart the program ".
After this error the report engine closes and i have to call the report again.
Is there a length fixed for reports name in Oracle 6i.
Is any possible solution available.
Remember i dont want to shorten my report names.
Kindly help me with this.
Thanx.There may be a limit, but I'm not aware of any. I never ran accross a limit. You may try the latest patch to see if it helps. What is your exact Developer version?
But I really have never seen report names of more than 10 characters or so. Almost every application has some short program coding, like xyz_0010.rep, r_emp.rep etc.
Do you mean the the name including the full path is more than 30 characters? If you put the path in the REPORTS60_PATH variable, your report names don't have to include the path. -
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 friends
really need yours help
I have to show an ALV grid with checkbox as first column.
This checkbox is based on internal table condition may be enabled or disabled, other columns are disabled.
I used the structure 'ZMESD' where i decleared that checkbox field.
I called function module:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZMESD'
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = it_fieldcat[].
x_fieldcat-seltext_s = 'CheckBox'.
x_fieldcat-checkbox = 'X'. " Display this field as a
x_fieldcat-edit = 'X'. " You can specify the width of a
MODIFY it_fieldcat FROM x_fieldcat TRANSPORTING seltext_s checkbox
edit WHERE fieldname = 'CHK' .
Now the problem is, I want to use
"REUSE_ALV_GRID_DISPLAY", where I am using
is_layout = x_layout
and value of x_layout is filled based on condition as follows
LOOP AT gt_grid INTO ls_outtab.
DATA l_tabix TYPE i.
IF ls_outtab-status = 'Reserved'. "This is the condition for which checkbox is disabled
l_tabix = sy-tabix.
REFRESH lt_edit.
ls_edit-fieldname = 'CHK'.
ls_edit-style = cl_gui_alv_grid=>mc_style_disabled.
ls_edit-style2 = space.
ls_edit-style3 = space.
ls_edit-style4 = space.
ls_edit-maxlen = 10.
APPEND ls_edit TO lt_edit.
APPEND LINES OF lt_edit TO ls_outtab-handle_style.
MODIFY gt_grid INDEX l_tabix FROM ls_outtab TRANSPORTING
handle_style .
ENDIF.
ENDLOOP.
Now I finally i m using:
<b>x_layout-lights_tabname = 'handle_style'.</b>
but its giving dump.
I am sure its only because i havent found the corrosponding X_layout field for 'handle_event'.
Please help me, as its urgent.
Points ll be awarded for sure.Thank you friends
I got the answer.
I used function module
CALL FUNCTION <b>'LVC_FIELDCATALOG_MERGE</b>'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'ZMESD'
I_CLIENT_NEVER_DISPLAY = 'X'
i_bypassing_buffer = 'X'
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = it_fieldcat[].
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
Its solved the problem -
Background task problem with alv grid display
Hello !
I have a problem when executing my program in background.
In foreground I have no problem, my ALV appears. In the background I have a dump.
The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.
I use the function module 'REUSE_ALV_GRID_DISPLAY'
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'F533_USER_COMMAND'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = i_fgroup[]
i_save = 'X'
it_sort = gd_sort
i_buffer_active = ' '
i_callback_pf_status_set = 'F534_SET_PF_STATUS'
TABLES
t_outtab = mytab
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.
I don't understand where the problem is. Please help me.
Thank you.I love replying to old threads:
Try this link
http://scn.sap.com/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job -
Hi,
I have developed ALV Grid Report. It is working fine.
But while i am coming from alv grid display to program
by pressing BACK button it is showing one more screen
which is empty. Again I press back button it is coming to
selection screen. I don't want that empty screen.What is
the problem. Can u help me in this regard.?
Thanks
Narasimhahi
under the usercommand of back button use Exit Statement
like
At user-comand
IF sy-ucom = 'Back'
EXIT
ENdif.
Cheers
Snehi -
Problem with ALV Grid Display screen Back Button
Dear Friends ,
I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
Please Suggest if i have to take care of something else.
I want my Selection Screen when i press Back on my Display Screen.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
Thanks and Regards,
AshwiniHi Vijay ,
No i dont have any write statement in my proggram.
Here it is
REPORT ZRMMPD01A NO STANDARD PAGE HEADING.
TABLES : EQUI,SER03,MKPF,OBJK.
TYPE-POOLS : SLIS.
DATA IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
DATA IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
DATA IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
DATA : BEGIN OF IT_DISPLAY OCCURS 0,
MATNR LIKE EQUI-MATNR,
SERNR LIKE EQUI-SERNR,
BWART LIKE SER03-BWART,
WERK LIKE SER03-WERK,
CHARGE LIKE SER03-CHARGE,
LAGERORT LIKE SER03-LAGERORT,
MBLNR LIKE SER03-MBLNR,
MJAHR LIKE SER03-MJAHR,
ZEILE LIKE SER03-ZEILE,
BUDAT LIKE MKPF-BUDAT,
BKTXT LIKE MKPF-BKTXT,
USNAM LIKE MKPF-USNAM,
XBLNR LIKE MKPF-XBLNR,
END OF IT_DISPLAY.
DATA : WA_DISPLAY LIKE IT_DISPLAY.
DATA IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
START-OF-SELECTION.
*Fetch Data.
PERFORM GET_DATA.
*Fill Display Fields.
PERFORM FILL_TABLE.
*Segregate data according to radio button selection.
PERFORM SELECT_CONDITION.
*Fill The Feild catalog.
PERFORM FIELD_CATALOG.
*Display Output.
PERFORM OUTPUT_DISPLAY..
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA.
SELECT * FROM EQUI INTO TABLE IT_EQUI
WHERE MATNR IN S_MATNR
AND SERNR IN S_SERNR.
SELECT * FROM OBJK INTO TABLE IT_OBJK
FOR ALL ENTRIES IN IT_EQUI
WHERE EQUNR = IT_EQUI-EQUNR.
SELECT * FROM SER03 INTO TABLE IT_SER03
FOR ALL ENTRIES IN IT_OBJK
WHERE OBKNR = IT_OBJK-OBKNR
AND MBLNR IN S_MBLNR
AND BWART IN S_BWART
AND WERK IN S_WERK
AND LAGERORT IN S_LAGET.
SELECT * FROM MKPF INTO TABLE IT_MKPF
FOR ALL ENTRIES IN IT_SER03
WHERE MBLNR = IT_SER03-MBLNR
AND BUDAT IN S_BUDAT
AND XBLNR IN S_XBLNR.
ENDFORM. " GET_DATA
*& Form FILL_TABLE
text
--> p1 text
<-- p2 text
FORM FILL_TABLE.
LOOP AT IT_EQUI.
LOOP AT IT_OBJK.
IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
SKIP.
ELSE.
READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
IF SY-SUBRC = 0.
WA_DISPLAY-MATNR = IT_EQUI-MATNR.
WA_DISPLAY-SERNR = IT_EQUI-SERNR.
WA_DISPLAY-BWART = IT_SER03-BWART.
WA_DISPLAY-WERK = IT_SER03-WERK.
WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
IF SY-SUBRC = 0.
WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
WA_DISPLAY-USNAM = IT_MKPF-USNAM.
WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
ENDIF.
ENDIF.
ENDIF.
IF NOT WA_DISPLAY IS INITIAL.
APPEND WA_DISPLAY TO IT_DISPLAY.
CLEAR WA_DISPLAY.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. " FILL_TABLE
*& Form FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM FIELD_CATALOG.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MATNR'.
FIELDCAT-SELTEXT_M = 'Material Number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'SERNR'.
FIELDCAT-SELTEXT_M = 'Serial number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MBLNR'.
FIELDCAT-SELTEXT_L = 'Number of material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BWART'.
FIELDCAT-SELTEXT_M = 'Movement type'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'WERK'.
FIELDCAT-SELTEXT_M = 'Plant'.
FIELDCAT-OUTPUTLEN = 5.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'CHARGE'.
FIELDCAT-SELTEXT_M = 'Batch number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'LAGERORT'.
FIELDCAT-SELTEXT_M = 'Storage Location'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MJAHR'.
FIELDCAT-SELTEXT_M = 'Material doc. year'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'ZEILE'.
FIELDCAT-SELTEXT_L = 'Item in material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BUDAT'.
FIELDCAT-SELTEXT_L = 'Posting date in the document'.
FIELDCAT-OUTPUTLEN = 10.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BKTXT'.
FIELDCAT-SELTEXT_L = 'Document header text'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'USNAM'.
FIELDCAT-SELTEXT_M = 'User name'.
FIELDCAT-OUTPUTLEN = 15.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'XBLNR'.
FIELDCAT-SELTEXT_L = 'Reference document number'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. " FIELD_CATALOG
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT_DISPLAY.
IF R1 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_DISPLAY
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ELSEIF R2 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_FINAL
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ENDIF.
ENDFORM. " DISPLAY_OUTPUT
*& Form SELECT_CONDITION
text
--> p1 text
<-- p2 text
FORM SELECT_CONDITION.
IF R2 = 'X'.
CLEAR WA_DISPLAY.
SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
IF SY-SUBRC = 0.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY.
IF WA_DISPLAY IS INITIAL.
WA_DISPLAY = IT_DISPLAY.
ENDIF.
LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
AND SERNR = WA_DISPLAY-SERNR.
IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
WA_DISPLAY = IT_DISPLAY.
ELSE.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
APPEND WA_DISPLAY TO IT_TEMP.
CLEAR WA_DISPLAY.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM IT_TEMP.
IF NOT IT_TEMP[] IS INITIAL.
IT_FINAL[] = IT_TEMP[].
ENDIF.
ENDIF.
ENDFORM. " SELECT_CONDITION
Regards,
Ashwini -
Hi Team,
We r tring to create table with field length 250 and 'CHAR' type and one more field 'STRING 'for unlimited length.While creating table entries ,it is tsking only 130 length for all fields.it is not taking 250 characters for 250 length field.and it is not taking unlimited length for String field.Plz let me know.Hello Mohan,
CHAR 250 is right. i am not facing any problem.
can you please explain in detail what you have done and what error you are getting.
Regards,
Sujeet
Edited by: Sujeet Mishra on Dec 2, 2009 4:42 AM -
Error Message through Dynamic Configuration length problem
HI All,
We are trying to raise an error message with the help of Dynamic configuration in the Message mapping.
The need is to populate the message with certain variables.
However we are facing the problem that the message is getting truncated beyond a certain length.(Around 60 characters)
Similar custom messages in other interfaces are working fine for messages up to 100 characters.
Question:
1. What could be the maximum length for an error message in case of mapping failure?
2. What could be limiting the length of the message in our case?
Thank you for looking into this.
Regards,
Ankeshhi Ankesh,
yes, there is limit length, see this oss [Note 974481 - XI Adapter Framework DynamicConfiguration Module|https://service.sap.com/sap/support/notes/974481]
regards.
Mickale -
Hi,
I am working an ALV grid in my report. after executing my report ALV grid is displaying all columns with all records. But if i am trying to see print priview or if i am trying to do export to spreadsheet, many columns are missing & records also jumbling from their exact places.
Why it is coming like this? can u help me. .
Thanks
vishnuHi,
if i am trying to do export to spreadsheet, many columns are missing & records also jumbling from their exact places.
Regarding on your query, You will write a query as select query
I.e.., select a query corresponding coloumns and reterive the data
Then check through an select corresponding coloums
Then solved your problem.
Regards,
Sekhar -
Hi,
I'm trying to print a 1mm X 1mm grid in a paper.
I'm using Java2D to print the lines. This is the code snippet which draws the lines:
/** Pixels/millimeter ratio */
public final static double PRINT_PIXELS_PER_MILLIMETER = (72.00 / 25.40);
g2d.setStroke(new BasicStroke(0.3f));
int counter = 0;
for (double x=bounds.x;x<=bounds.x + bounds.width;x+=PRINT_PIXELS_PER_MILLIMETER) {
g2d.setColor(((counter % 5 == 0) ? Color.GRAY : Color.LIGHT_GRAY));
g2d.draw(new Line2D.Double(x,bounds.y,x,bounds.y + bounds.height));
counter++;
counter = 0;
for (double y=bounds.y;y<=bounds.y + bounds.height;y+=PRINT_PIXELS_PER_MILLIMETER) {
g2d.setColor(((counter % 5 == 0) ? Color.GRAY : Color.LIGHT_GRAY));
g2d.draw(new Line2D.Double(bounds.x,y,bounds.x + bounds.width,y));
counter++;
}The grid prints OK into ink printers, but when I try to print the grid in laser printers, some lines appear greater than others and the grid appears visually antiesthetic.
I've tried to do it with a background image. The problem I have is if I create the image at 72dpi, the grid paints ok but the lines are too thick. Then I created a 300dpi image and draw it, but then the grid lines were drawn too separated the ones from the others (a lot more than 1mm). If I re-scale the 300dpi image in the paint routine, then I have the same problems than when I was drawing the lines.
By the way, the laser printer has more than enough resolution to paint the 300dpi grid correctly. If I print the image directly from photoshop, it is printed perfectly with 1mm separation b/w lines.
Anyone knows how can I solve that?Hi, make sure you are using the latest release of PDF program.
Please mark the post that solves your issue as "Accept as Solution".
If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
I am not a HP employee.
Maybe you are looking for
-
HIAll I waited so long not to update of my iphone4 to 7.x.x because of bugs and not much stable for iPhone4 and many reviews from friends saying phone is very slow and many bugs but after release of iOS 7.1.1 of many improvements for iphone4. I tried
-
(SAP BW 3.5) Navigate attributes did not display value in BEx
Dear SAP BW Expert, I created simple queries using BEx to display data in an InfoObject. This InfoObject composed of many attributes which were set to navigate attributes. I already loaded data into this infoobject as well. After I check data in RSA1
-
Hi to all I have problem with loading report. i have connection to oracle database by third party driver(i made odbc by this driver). when i design my report is not problem and even see preview report by live informations. but when i want to test my
-
Epson Stylus Photo R800 issues
I have just installed Mac OSX 10.5, Leopard on a G5 2.7Ghz DP tower (OSX 10.4.11, Tiger still on an alternate drive in the computer). I installed on a new drive and used Migration Assistant to move all my personal data and settings. I use an Epson St
-
Elements 9 can't save edited image
When I try to do a save of an edited image on Vista in Photoshop Elements 9 I get the following popup: Could not complete your request because of a program error. I have also noticed it will not create a panoramic composite image. It only generates