[Help]Grid
Hello experts, I have a question regarding in Grid. I created a grid in Screen painter and now I want to get the first row value of the grid. I already populate the grid with JDT1 in journal voucher.
Thank you,
Hi,
As per my opinion do the following code
Dim o_Matrix As SAPbouiCOM.Matrix
Set o_Matrix = oForm.Items.Item("54").Specific
If oMatrix.RowCount >= 1 Then
While (i <= oMatrix.RowCount)
value = oMatrix.Columns.Item("ColumnID").Cells.Item(i).Specific.value) ('value of first row and column mention as columnID)
i = i + 1
End While
End If
Reply me
Similar Messages
-
Hi experts. Having problem with Grid column. Here's my code.
For oRow As Integer = 0 To oDT.Rows.Count - 1
oQuery &= "INSERT INTO [" & oCompany.CompanyDB & "]..[" & txt_AppD.Value & "]" & _
"(AppNo, AppType, ItemCode, Description, Price, CompanyId)" & _
"VALUES (@txtRM, @txt_AppT, '" & oDT.GetValue("ItemCode", oRow) & "'," & _
"'" & oDT.GetValue("Description", oRow) & "', '" & oDT.GetValue("Rate", oRow) & "', '" & oCompany.CompanyDB & "')"
Next
I want to get the Col as integer. As you can see in oDT.GetValue("ItemCode", oRow) ItemCode is a column. Instead of manually input can I change it as integer? Like this *oDT.GetValue(1, oRow) Please help.
Thanks,In the sdk help, it says you can do this.
Did you try this? -
[Help]Grid (Add row - Delete row)
Hi experts. Just want to ask how can I add row and delete row in Grid?
And how can I get the data from the specific row so I can Save the data in my table.
Please help.Hi hikaru1207 ,
this code for delete row from Matrix :
Matrix oMatrix_cat = (Matrix)form.Items.Item("mtx_cat").Specific;
Delete Row -
for (int i = 2; i <= oMatrix_cat .rowcount; i++)
oEditText = (EditText)oMatrix.Columns.Item(colname).Cells.Item(i).Specific;
oMatrix.DeleteRow(i);
if (form.Mode == BoFormMode.fm_ADD_MODE)
if (oMatrix.RowCount == 0)
DBDataSource oDBDataSource = form.DataSources.DBDataSources.Item(table name);
oDBDataSource.Clear();
oMatrix_cat .FlushToDataSource();
Add row----
if (oMatrix_cat.RowCount == 0)
oMatrix_cat.AddRow(1, 1);
oDBDataSource_cat.InsertRecord(oDBDataSource_cat.Size);
else
oDBDataSource_cat.InsertRecord(oDBDataSource_cat.Size - 1);
oDBDataSource_cat.SetValue("LineId", oDBDataSource_cat.Size - 1, "");
oDBDataSource_cat.SetValue("U_SKU", oDBDataSource_cat.Size - 1, "");
oDBDataSource_cat.SetValue("U_CatId", oDBDataSource_cat.Size - 1, "");
oMatrix_cat.LoadFromDataSource();
oDBDataSource_cat = null;
please reply ......
yhanks
surajit -
when i install grid,the program stop at "loading setup dirver",this 's the log file.
sorry about my poor english.
Using paramFile: /u02/grid/install/oraparam.ini
Checking Temp space: must be greater than 120 MB. Actual 3431 MB Passed
Checking swap space: must be greater than 150 MB. Actual 20479 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
The commandline for unzip:
/u02/grid/install/unzip -qqqo ../stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/\*.jar -d /tmp/OraInstall2013-05-30_07-35-51PM
Using the umask value '022' available from oraparam.ini
Execvp of the child jre : the cmdline is /tmp/OraInstall2013-05-30_07-35-51PM/jdk/jre/bin/java, and the argv is
/tmp/OraInstall2013-05-30_07-35-51PM/jdk/jre/bin/java
-Doracle.installer.library_loc=/tmp/OraInstall2013-05-30_07-35-51PM/oui/lib/linux64
-Doracle.installer.oui_loc=/tmp/OraInstall2013-05-30_07-35-51PM/oui
-Doracle.installer.bootstrap=TRUE
-Doracle.installer.startup_location=/u02/grid/install
-Doracle.installer.jre_loc=/tmp/OraInstall2013-05-30_07-35-51PM/jdk/jre
-Doracle.installer.nlsEnabled="TRUE"
-Doracle.installer.prereqConfigLoc=
-Doracle.installer.unixVersion=2.6.18-348.el5
-mx150m
-cp
/tmp/OraInstall2013-05-30_07-35-51PM::/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/jsch.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/OraPrereq.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/instcrs.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/orai18n-mapping.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/ojdbc5.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/orai18n-utility.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/cvu.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/installcommons_1.0.0b.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/ssh.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/OraPrereqChecks.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/instcommon.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/prov_fixup.jar:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/remoteinterfaces.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/OraInstaller.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/oneclick.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/xmlparserv2.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/share.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/OraInstallerNet.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/emCfg.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/emocmutl.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/OraPrereq.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/jsch.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/ssh.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/remoteinterfaces.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/http_client.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/OraSuiteInstaller.jar:../stage/Components/oracle.swd.opatch/11.2.0.3.0/1/DataFiles/jlib/opatch.jar:../stage/Components/oracle.swd.opatch/11.2.0.3.0/1/DataFiles/jlib/opatchactions.jar:../stage/Components/oracle.swd.opatch/11.2.0.3.0/1/DataFiles/jlib/opatchprereq.jar:../stage/Components/oracle.swd.opatch/11.2.0.3.0/1/DataFiles/jlib/opatchutil.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/OraCheckPoint.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstImages.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_de.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_es.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_fr.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_it.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_ja.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_ko.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_pt_BR.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_zh_CN.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/InstHelp_zh_TW.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/oracle_ice.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/help4.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/help4-nls.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/ewt3.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/ewt3-swingaccess.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/ewt3-nls.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/swingaccess.jar::/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/jewt4.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/jewt4-nls.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/orai18n-collation.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/orai18n-mapping.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/ojmisc.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/xml.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/srvm.jar:/tmp/OraInstall2013-05-30_07-35-51PM/oui/jlib/srvmasm.jar
oracle.install.ivw.crs.driver.CRSInstaller
-scratchPath
/tmp/OraInstall2013-05-30_07-35-51PM
-sourceLoc
/u02/grid/install/../stage/products.xml
-sourceType
network
-timestamp
2013-05-30_07-35-51PM
-formCluster
INFO: Loading data from: jar:file:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Loading beanstore from jar:file:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Restoring class oracle.install.driver.oui.ConfigCmdMappings from jar:file:/tmp/OraInstall2013-05-30_07-35-51PM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Loading beans from Xml Bean Store. [BeanStoreName:config-data]
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:id in the bean:configcmd
INFO: Setting value for the property:platformcmdmap in the bean:configcmd
INFO: Setting value for the property:configcmds in the bean:configcmdmappings
SEVERE: [FATAL] monidb: monidb.
Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:37
INFO: Advice is ABORT
SEVERE: Unconditional Exit
INFO: Adding ExitStatus FAILURE to the exit status set
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is -1
INFO: Shutdown Oracle Grid InfrastructureIs your hostname defined in /etc/hosts?
During 11.2.0.3 Install Get Pop-Up Error - <Hostname>:<Hostname> [ID 1396516.1] -
Synchronizing Page between grids in HFR
This is not only a question, but also a bit of an explanation - it might save someone decent amount of time. It is about behaviour in HFR 11.1.2.2 when it comes to using "Merge similar prompts" option in Workspace when running the report with multiple grids using the same Page/prompt.
I wanted to create report that has (let's say) 2 grids - one main, and one hidden "helper" grid that calculates some total to be displayed in the main grid (e.g., if you want to show some benchmark value against your own ones). I set both grids to use the same dimension in their Page sections. Other properties of those Page dimensions were also set to be the same - both were driven by Prompt, and were limited to the Lvl 0 members of that dimension. Based on documentation, I was expecting that if I opened report in Workspace, with "Merge similar Prompts" option checked on, that I would have report with my main grid displayed with the Page combo box showing all the members I previously allowed to be selected, and that as I change my choice in Page (e.g., picking different Payees), that the hidden "helper" grid would simultaneously change its Page member to the same one, thus displaying benchmark amounts appropriate for each Payee.
Well, yes and no. If I open the report in PDF mode, and enter multiple members for Payee dimension in its prompt (or a parent member), I get wanted results: report has a separate page for each selected Payee in the prompt, and the hidden grid produces proper benchmark number for each. But if I open the report in HTML mode, initial amounts are fine, until I change Page member in my main grid - instead that the Page member in the hidden grid changes too (as I would expect), nothing happens. Result is that my main grid now shows results for another Payee, while the benchmark number, that is coming from the hidden grid, stays the same. Not what I would expect.
So, I am either doing something wrong here, or it's just another quirk of this tool (and there are many). I hope it's the former, so if it is me missing something, please share here what it is, and how to make it work. If not, at least this post could same someone from hours of futile trying and experimenting, until they realize the same.
Regards,
MilosThis was pretty much the first hit I got when researching this topic.
http://www.macworld.com/article/133881/2008/07/syncitunes.html
But I'd go straight to:
https://www.socketheadstudios.com/mytunesync/ -
I have a grid what is binded to a query. I want to see the grid group by itemcode (that is why I set the CollapseLevel = 1, where 1 is the column item code). But, in the grid id' like to set in the column quatity and the row on which it collapse the grid (the row with the itemcode) the sum of quatities in the expanded list. How can I do that? (just like in Reporting, Inventory, Inventory Posting List where i have the name of the item above the detailed list of documents).
And also I'd like to know if I can get the position of a column of a grid in a form and it's properties (like width).The details you would like to set on the 'collapsed row' is unfortunately not possible as far as i know... This row is maintained by SBO and functions only as a group header and cannot be modified. (if someone knows how anyway, please report!)
I think that if you have the grid, you can ask for its 'columns' list and then find the column you will need. You will get a 'gridcolumn' object or so. Check the SDK help: 'grid/gridcolumn/edittextcolumn/etc' -
Kindly help to develop alv grid display
Hi ,
I have a requirement in which I need to display ALV GRID display and in its tool bar 4 butons are required. In the same view down to alv display i want to develop a tabstrip and its functionalities.I have designed classic alv using SALV_WD_TABLE component. I want a good GRID Display, not like flat field names that comes in list display, looking for bulged fields(like what comes for ALV GRID in normal abap) display with print version etc hidden and buttons at the top of ALV. Kindly help
Highly rewarded
Kindly help
Regards,
Lakshmi
Edited by: Lakshmi Menon on Nov 27, 2008 4:49 PMWell Web Dynpro is generally output in HTML so the output formatting is never going to quite look like a desktop application (which is the case with the ALV Grid). You have very little control over the look of the column headers. In fact you can only manipulate what is available via the Portal Theme.
There is a new Tradeshow Plus theme available in NetWeaver 7.01 which uses a gradiant background for the column headers. This gives them a little more depth:
http://www.flickr.com/photos/tjung/3068850120/
The other option is next year when NetWeaver Business Client version 3.0 comes out, you will be able to render Web Dynpro applications using the NWBC Smart Client Rendering. This will render Web Dynpro applications using desktop libraries instead of HTML/Browser. This gives Web Dynpro a more SAPGUI/Desktop appears of course.
http://www.flickr.com/photos/tjung/2685619882/in/set-72157606418550143/ -
Search help (PREM) for personal no. is not coming in ALV grid table control
hi experts,
Search help (PREM) for personal no. is not coming in ALV grid table control.
i have assigned the srch help (prem) to my 'ZFIEXP_PROJALLOC' table for the emp_id.
but in output it is now showing the help.
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'ZFIEXP_PROJALLOC'.
ls_fcat-ref_field = 'EMP_ID'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
Then i tried to solve it using the PA0002 . ie.,
ls_fcat-fieldname = 'EMPLOYEE CODE'.
ls_fcat-ref_table = 'PA0002'.
ls_fcat-ref_field = 'PERNR'.
ls_fcat-outputlen = '10'.
ls_fcat-key = 'X'.
ls_fcat-edit = 'X'.
ls_fcat-coltext = 'EMPLOYEE CODE'.
ls_fcat-seltext = 'EMPLOYEE CODE'.
append ls_fcat to pt_fieldcat.
clear ls_fcat.
with this it is showing the help in employee code, but, when i click on an empl number, it is not added to my table control and allowing me to add the number by typing them.
plz help me.
thanks.Hi
In the layout give layout-sel_mode = 'A'. and
pass 'A' to i_save exporting parameter to method set_table_for_first_display.
The same thing if you are working with function module
reuse_alv_grid_display.
Reward points for useful answer.
Venkat -
F4 help for a field in alv grid
hello friends,
i want to make one of the fields of my alv grid as editable and i want f4 help option also available for it, can v do it, if yes how??? pls explain through code
thankscheck this example
REPORT ztest440.
TABLES : mara.
TYPES: BEGIN OF t_mara,
matnr TYPE mara-matnr,
lvorm TYPE mara-lvorm,
mtart TYPE mara-mtart,
mbrsh TYPE mara-mbrsh,
matkl TYPE mara-matkl,
meins TYPE mara-meins,
brgew TYPE mara-brgew,
ntgew TYPE mara-ntgew,
gewei TYPE mara-gewei,
END OF t_mara.
TYPES: BEGIN OF t_equk,
matnr TYPE equk-matnr,
werks TYPE equk-werks,
bdatu TYPE equk-bdatu,
vdatu TYPE equk-vdatu,
qunum TYPE equk-qunum,
END OF t_equk.
CLASS : lcl_alv_grid DEFINITION DEFERRED.
DATA : gi_mara TYPE STANDARD TABLE OF t_mara,
gi_equk TYPE STANDARD TABLE OF t_equk,
gs_mara TYPE t_mara,
gs_equk TYPE t_equk.
*-- Global data definitions for ALV
*--- ALV Grid instance reference
DATA : gw_alvgrid TYPE REF TO cl_gui_alv_grid,
gw_alvgrid1 TYPE REF TO cl_gui_alv_grid .
*--- Custom container instance reference
DATA gw_container TYPE REF TO cl_gui_custom_container.
DATA gw_event_handler TYPE REF TO lcl_alv_grid.
DATA gw_event_handler1 TYPE REF TO lcl_alv_grid.
DATA gw_container1 TYPE REF TO cl_gui_custom_container.
*--- Field catalog table
DATA : gi_fieldcat TYPE lvc_t_fcat,
gi_fieldcat1 TYPE lvc_t_fcat,
gs_fieldcat TYPE lvc_s_fcat,
gs_fieldcat1 TYPE lvc_s_fcat.
*--- Layout structure
DATA : gs_layout TYPE lvc_s_layo,
gs_layout1 TYPE lvc_s_layo.
CLASS lcl_alv_grid DEFINITION
CLASS lcl_alv_grid DEFINITION.
PUBLIC SECTION.
METHODS :
Handle_double_click
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column,
Handle_double_click
handle_onf4
FOR EVENT onf4 OF cl_gui_alv_grid
IMPORTING e_fieldname,
Handle_double_click
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id.
PRIVATE SECTION.
ENDCLASS. " lcl_alv_grid DEFINITION
CLASS LCL_ALV_GRID IMPLEMENTATION *
CLASS lcl_alv_grid IMPLEMENTATION.
METHOD handle_double_click *
METHOD handle_double_click.
READ TABLE gi_mara INTO gs_mara INDEX e_row.
IF sy-subrc = 0.
SELECT matnr
werks
bdatu
vdatu
qunum
FROM equk
INTO TABLE gi_equk
WHERE matnr = gs_mara-matnr.
IF sy-dbcnt NE 0.
SORT gi_equk BY matnr werks bdatu.
ENDIF.
CALL SCREEN 0002.
ENDIF.
ENDMETHOD. "handle_double_click
METHOD handle_onf4 *
METHOD handle_onf4.
PERFORM f4_help USING e_fieldname.
ENDMETHOD. "handle_double_click
METHOD handle_double_click *
METHOD handle_hotspot_click.
READ TABLE gi_mara INTO gs_mara INDEX e_row_id.
IF sy-subrc = 0.
SELECT matnr
werks
bdatu
vdatu
qunum
FROM equk
INTO TABLE gi_equk
WHERE matnr = gs_mara-matnr.
IF sy-dbcnt NE 0.
SORT gi_equk BY matnr werks bdatu.
ENDIF.
CALL SCREEN 0002.
ENDIF.
ENDMETHOD. "handle_hotspot_click
ENDCLASS. " lcl_alv_grid IMPLEMENTATION
SELECTION SCREEN DEFINITION *
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS,
s_mtart FOR mara-mtart NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION *
START-OF-SELECTION.
SELECT matnr
lvorm
mtart
mbrsh
matkl
meins
brgew
ntgew
gewei
FROM mara
INTO TABLE gi_mara
WHERE matnr IN s_matnr
AND mtart IN s_mtart.
IF sy-dbcnt NE 0.
SORT gi_mara BY matnr.
ENDIF.
CALL SCREEN 0001.
*& Module STATUS_0001 OUTPUT
text
MODULE status_0001 OUTPUT.
SET PF-STATUS '0001'.
SET TITLEBAR '001'.
PERFORM build_alv_display.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module USER_COMMAND_0001 INPUT
text
MODULE user_command_0001 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'SAVE'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
*& Form build_alv_display
text
--> p1 text
<-- p2 text
FORM build_alv_display .
PERFORM build_fieldcat.
PERFORM build_layout.
PERFORM create_alv_grid.
PERFORM display_alv_grid.
ENDFORM. " build_alv_display
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
FORM build_fieldcat .
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material Number'.
gs_fieldcat-outputlen = '18'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '1'.
gs_fieldcat-hotspot = 'X'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'LVORM'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Deletion'.
gs_fieldcat-outputlen = '8'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '2'.
gs_fieldcat-checkbox = 'X'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MTART'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material Type'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '3'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MBRSH'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Industry sector'.
gs_fieldcat-outputlen = '15'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '4'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATKL'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Material group'.
gs_fieldcat-outputlen = '14'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '5'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MEINS'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Base Unit of Measure'.
gs_fieldcat-outputlen = '20'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '6'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'BRGEW'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Gross weight'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '7'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'NTGEW'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Net weight'.
gs_fieldcat-outputlen = '13'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '8'.
APPEND gs_fieldcat TO gi_fieldcat.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'GEWEI'.
gs_fieldcat-tabname = 'MARA'.
gs_fieldcat-coltext = 'Weight Unit'.
gs_fieldcat-outputlen = '11'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '9'.
APPEND gs_fieldcat TO gi_fieldcat.
ENDFORM. " build_fieldcat
*& Form build_layout
text
--> p1 text
<-- p2 text
FORM build_layout .
gs_layout-sel_mode = 'A'.
gs_layout-edit = ' '.
gs_layout-no_toolbar = ' '.
gs_layout-grid_title = 'Material Data'.
gs_layout-no_headers = ' '.
gs_layout-weblook = 'X'.
ENDFORM. " build_layout
*& Form create_alv_grid
text
--> p1 text
<-- p2 text
FORM create_alv_grid .
IF gw_container IS INITIAL.
CREATE OBJECT gw_container
EXPORTING
container_name = 'CC_ALV'.
Display ALV grid
IF gw_alvgrid IS INITIAL.
CREATE OBJECT gw_alvgrid
EXPORTING
i_parent = gw_container.
ENDIF.
ENDIF.
IF gw_event_handler IS INITIAL.
CREATE OBJECT gw_event_handler.
SET HANDLER gw_event_handler->handle_double_click
FOR gw_alvgrid.
SET HANDLER gw_event_handler->handle_onf4
FOR gw_alvgrid.
SET HANDLER gw_event_handler->handle_hotspot_click
FOR gw_alvgrid.
ENDIF.
ENDFORM. " create_alv_grid
*& Form display_alv_grid
text
--> p1 text
<-- p2 text
FORM display_alv_grid .
CALL METHOD gw_alvgrid->set_table_for_first_display
EXPORTING
i_buffer_active = ' '
i_bypassing_buffer = ' '
i_structure_name = 'T_MARA'
is_layout = gs_layout
CHANGING
it_outtab = gi_mara[]
it_fieldcatalog = gi_fieldcat[]
EXCEPTIONS
OTHERS = 0.
ENDFORM. " display_alv_grid
*& Module STATUS_0002 OUTPUT
text
MODULE status_0002 OUTPUT.
SET PF-STATUS '0002'.
SET TITLEBAR '002'.
PERFORM build_alv_display1.
ENDMODULE. " STATUS_0002 OUTPUT
*& Module USER_COMMAND_0002 INPUT
text
MODULE user_command_0002 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0002 INPUT
*& Form build_alv_display1
text
--> p1 text
<-- p2 text
FORM build_alv_display1 .
PERFORM build_fieldcat1.
PERFORM build_layout1.
PERFORM create_alv_grid1.
PERFORM display_alv_grid1.
ENDFORM. " build_alv_display1
*& Form build_fieldcat2
text
--> p1 text
<-- p2 text
FORM build_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'MATNR'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Material Number'.
gs_fieldcat-outputlen = '18'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '1'.
gs_fieldcat-f4availabl = 'X'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'WERKS'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Plant'.
gs_fieldcat-outputlen = '4'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '2'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'BDATU'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Valid Untill'.
gs_fieldcat-outputlen = '12'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '3'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'VDATU'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Valid From'.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '4'.
APPEND gs_fieldcat TO gi_fieldcat1.
CLEAR gs_fieldcat.
gs_fieldcat-fieldname = 'QUNUM'.
gs_fieldcat-tabname = 'EQUK'.
gs_fieldcat-coltext = 'Quota'.
gs_fieldcat-outputlen = '10'.
gs_fieldcat-edit = ' '.
gs_fieldcat-just = 'C'.
gs_fieldcat-col_pos = '5'.
APPEND gs_fieldcat TO gi_fieldcat1.
ENDFORM. " build_fieldcat2
*& Form build_layout2
text
--> p1 text
<-- p2 text
FORM build_layout1.
gs_layout1-sel_mode = 'A'.
gs_layout1-edit = ' '.
gs_layout1-no_toolbar = ' '.
gs_layout1-grid_title = 'Quota Header Data'.
gs_layout1-no_headers = ' '.
ENDFORM. " build_layout1
*& Form create_alv_grid2
text
--> p1 text
<-- p2 text
FORM create_alv_grid1.
IF gw_container1 IS INITIAL.
CREATE OBJECT gw_container1
EXPORTING
container_name = 'CC_ALV1'.
Display ALV grid
IF gw_alvgrid1 IS INITIAL.
CREATE OBJECT gw_alvgrid1
EXPORTING
i_parent = gw_container1.
ENDIF.
ENDIF.
IF gw_event_handler1 IS INITIAL.
CREATE OBJECT gw_event_handler1.
SET HANDLER gw_event_handler1->handle_onf4
FOR gw_alvgrid1.
ENDIF.
ENDFORM. " create_alv_grid1
*& Form display_alv_grid2
text
--> p1 text
<-- p2 text
FORM display_alv_grid1 .
DATA : li_f4 TYPE lvc_t_f4,
ls_f4 TYPE lvc_s_f4.
CALL METHOD gw_alvgrid1->set_table_for_first_display
EXPORTING
i_buffer_active = ' '
i_bypassing_buffer = ' '
i_structure_name = 'T_EQUK'
is_layout = gs_layout1
CHANGING
it_outtab = gi_equk[]
it_fieldcatalog = gi_fieldcat1[]
EXCEPTIONS
OTHERS = 0.
IF li_f4[] IS INITIAL.
MOVE 'MATNR' TO ls_f4-fieldname.
MOVE 'X' TO ls_f4-register.
MOVE 'X' TO ls_f4-getbefore.
APPEND ls_f4 TO li_f4.
CLEAR ls_f4.
CALL METHOD gw_alvgrid1->register_f4_for_fields
EXPORTING
it_f4 = li_f4.
ENDIF.
ENDFORM. " display_alv_grid1
*& Form f4_help
text
-->P_FIELDNAME text
FORM f4_help USING p_fieldname.
TYPES : BEGIN OF t_values,
matnr TYPE mara-matnr,
END OF t_values.
DATA : li_fields TYPE TABLE OF dfies,
li_select_values TYPE TABLE OF ddshretval,
li_values TYPE TABLE OF t_values,
ls_fields TYPE dfies,
ls_values TYPE t_values.
REFRESH : li_fields,
li_select_values.
SELECT matnr
FROM equk
INTO TABLE li_values.
CASE p_fieldname.
WHEN 'MATNR'.
ls_fields-tabname = 'EQUK'.
ls_fields-fieldname = 'MATNR'.
APPEND ls_fields TO li_fields.
CLEAR ls_fields.
SORT li_values BY matnr.
DELETE ADJACENT DUPLICATES FROM li_values COMPARING matnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
TABLES
value_tab = li_values
field_tab = li_fields
return_tab = li_select_values.
IF sy-subrc = 0.
LOOP AT li_select_values WHERE fieldname = 'MATNR'.
clear gs_mara.
gs_mara in
ENDIF.
ENDCASE.
ENDFORM. " f4_help -
One example for edit the grid in oops and provide f4 help for particular field in Grid
Hi all
Here is the code for that editable Grid
*& Report YVAMC_EDIT_GRID
REPORT YVAMC_EDIT_GRID.
DATA GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID .
*--- Name of the custom control added on the screen
DATA GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC1_ALV' .
*--- Custom container instance reference
DATA GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER .
*--- Field catalog table
DATA GT_FIELDCAT TYPE LVC_T_FCAT .
TYPES: BEGIN OF IT_LIST,
BANFN TYPE EBAN-BANFN,
BNFPO TYPE EBAN-BNFPO,
BSART TYPE EBAN-BSART,
BSTYP TYPE EBAN-BSTYP,
BSAKZ TYPE EBAN-BSAKZ,
LOEKZ TYPE EBAN-LOEKZ,
STATU TYPE EBAN-STATU,
ESTKZ TYPE EBAN-ESTKZ,
FRGKZ TYPE EBAN-FRGKZ,
FRGZU TYPE EBAN-FRGZU,
END OF IT_LIST.
DATA: GT_LIST TYPE STANDARD TABLE OF IT_LIST,
WA_LIST TYPE IT_LIST.
DATA GS_LAYOUT TYPE LVC_S_LAYO .
DATA OK_CODE TYPE SY-UCOMM.
DATA ZFLAG.
** data for event handling
DATA: GS_F4 TYPE LVC_S_F4,
GT_F4 TYPE LVC_T_F4.
START-OF-SELECTION.
SELECT BANFN
BNFPO
BSART
BSTYP
BSAKZ
LOEKZ
STATU
ESTKZ
FRGKZ
FRGZU
FROM EBAN INTO TABLE GT_LIST.
CALL SCREEN 9000.
*& Module DISPLAY_ALV OUTPUT
* text
MODULE STATUS_9000 OUTPUT.
set pf-status 'ZNEW_STS'.
PERFORM DISPLAY_ALV.
ENDMODULE. " DISPLAY_ALV OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE USER_COMMAND_9000 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'EDIT'.
ZFLAG = '1'.
PERFORM UPDATE_FIELD_CATALOG CHANGING GT_FIELDCAT.
PERFORM REGISTER_EDIT.
WHEN 'DISPLAY'.
ZFLAG = '0'.
PERFORM UPDATE_FIELD_CATALOG CHANGING GT_FIELDCAT.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Form DISPLAY_ALV
* text
FORM DISPLAY_ALV.
IF GR_ALVGRID IS INITIAL.
CREATE OBJECT GR_CCONTAINER
EXPORTING
* parent =
CONTAINER_NAME = GC_CUSTOM_CONTROL_NAME .
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 GR_ALVGRID
EXPORTING
I_PARENT = GR_CCONTAINER.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*----Preparing field catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING GT_FIELDCAT .
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = GT_LIST[]
IT_FIELDCATALOG = GT_FIELDCAT
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 GR_ALVGRID->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_ALV
*& Form prepare_field_catalog
* text
* -->PT_FIELDCAT text
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT .
LS_FCAT-FIELDNAME = 'BANFN' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '10' .
LS_FCAT-COLTEXT = 'Requisition no' .
* LS_FCAT-SELTEXT = 'Requisition no' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BNFPO' .
LS_FCAT-INTTYPE = 'N' .
*ls_fcat-outputlen = '5' .
LS_FCAT-COLTEXT = 'Item no' .
LS_FCAT-SELTEXT = 'Item no' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '5' .
LS_FCAT-COLTEXT = 'Doc Type' .
LS_FCAT-SELTEXT = 'Doc Type' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Doc Category' .
LS_FCAT-SELTEXT = 'Doc Category' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Control Indicator' .
LS_FCAT-SELTEXT = 'Control Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Deletion Indicator' .
LS_FCAT-SELTEXT = 'Deletion Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-INTTYPE = 'C' .
LS_FCAT-F4AVAILABL = 'X'.
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Processing status' .
LS_FCAT-SELTEXT = 'Processing Status' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Creation Indicator' .
LS_FCAT-SELTEXT = 'Creation Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-INTTYPE = 'C' .
* ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Release Indicator' .
LS_FCAT-SELTEXT = 'Release Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '8' .
LS_FCAT-COLTEXT = 'Release Status' .
LS_FCAT-SELTEXT = 'Release Status' .
APPEND LS_FCAT TO PT_FIELDCAT .
ENDFORM. "prepare_field_catalog
*& Form update_field_catalog
* text
* -->PT_FIELDCAT text
FORM UPDATE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT.
DATA LS_FCAT TYPE LVC_S_FCAT .
CALL METHOD GR_ALVGRID->GET_FRONTEND_FIELDCATALOG
IMPORTING
ET_FIELDCATALOG = PT_FIELDCAT[].
LOOP AT PT_FIELDCAT INTO LS_FCAT .
IF ZFLAG = '1'.
IF LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-EDIT = 'X' .
LS_FCAT-F4AVAILABL = 'X'.
LS_FCAT-REF_TABLE = 'T161T'.
LS_FCAT-REF_FIELD = 'BSART'.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-EDIT = 'X' .
LS_FCAT-F4AVAILABL = 'X'.
* ls_fcat-drdn_hndl = '1'.
* ls_fcat-outputlen = 15.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-EDIT = 'X' .
* for laready attcahed search help
LS_FCAT-F4AVAILABL = 'X'.
LS_FCAT-REF_TABLE = 'T161U'.
LS_FCAT-REF_FIELD = 'FRGKZ'.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF.
IF LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
* add customise f4 help on feild STATU
CLEAR GT_F4.
GS_F4-FIELDNAME = 'STATU'.
GS_F4-REGISTER = 'X'.
* gs_f4-getbefore = check_be. "§7a
* gs_f4-chngeafter = chn_aft. "§7b
APPEND GS_F4 TO GT_F4.
CALL METHOD GR_ALVGRID->REGISTER_F4_FOR_FIELDS
EXPORTING
IT_F4 = GT_F4.
ELSEIF ZFLAG = '2'.
IF LS_FCAT-FIELDNAME = 'BANFN' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BNFPO' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
ELSE.
IF LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-EDIT = SPACE.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
ENDIF.
ENDLOOP .
CALL METHOD GR_ALVGRID->SET_FRONTEND_FIELDCATALOG
EXPORTING
IT_FIELDCATALOG = PT_FIELDCAT[].
ENDFORM. "update_field_catalog
*& Form register_edit
* text
FORM REGISTER_EDIT .
CALL METHOD GR_ALVGRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
ENDFORM. "register_editHi all
Here is the code for that editable Grid
*& Report YVAMC_EDIT_GRID
REPORT YVAMC_EDIT_GRID.
DATA GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID .
*--- Name of the custom control added on the screen
DATA GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC1_ALV' .
*--- Custom container instance reference
DATA GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER .
*--- Field catalog table
DATA GT_FIELDCAT TYPE LVC_T_FCAT .
TYPES: BEGIN OF IT_LIST,
BANFN TYPE EBAN-BANFN,
BNFPO TYPE EBAN-BNFPO,
BSART TYPE EBAN-BSART,
BSTYP TYPE EBAN-BSTYP,
BSAKZ TYPE EBAN-BSAKZ,
LOEKZ TYPE EBAN-LOEKZ,
STATU TYPE EBAN-STATU,
ESTKZ TYPE EBAN-ESTKZ,
FRGKZ TYPE EBAN-FRGKZ,
FRGZU TYPE EBAN-FRGZU,
END OF IT_LIST.
DATA: GT_LIST TYPE STANDARD TABLE OF IT_LIST,
WA_LIST TYPE IT_LIST.
DATA GS_LAYOUT TYPE LVC_S_LAYO .
DATA OK_CODE TYPE SY-UCOMM.
DATA ZFLAG.
** data for event handling
DATA: GS_F4 TYPE LVC_S_F4,
GT_F4 TYPE LVC_T_F4.
START-OF-SELECTION.
SELECT BANFN
BNFPO
BSART
BSTYP
BSAKZ
LOEKZ
STATU
ESTKZ
FRGKZ
FRGZU
FROM EBAN INTO TABLE GT_LIST.
CALL SCREEN 9000.
*& Module DISPLAY_ALV OUTPUT
* text
MODULE STATUS_9000 OUTPUT.
set pf-status 'ZNEW_STS'.
PERFORM DISPLAY_ALV.
ENDMODULE. " DISPLAY_ALV OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE USER_COMMAND_9000 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'EDIT'.
ZFLAG = '1'.
PERFORM UPDATE_FIELD_CATALOG CHANGING GT_FIELDCAT.
PERFORM REGISTER_EDIT.
WHEN 'DISPLAY'.
ZFLAG = '0'.
PERFORM UPDATE_FIELD_CATALOG CHANGING GT_FIELDCAT.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Form DISPLAY_ALV
* text
FORM DISPLAY_ALV.
IF GR_ALVGRID IS INITIAL.
CREATE OBJECT GR_CCONTAINER
EXPORTING
* parent =
CONTAINER_NAME = GC_CUSTOM_CONTROL_NAME .
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 GR_ALVGRID
EXPORTING
I_PARENT = GR_CCONTAINER.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*----Preparing field catalog.
PERFORM PREPARE_FIELD_CATALOG CHANGING GT_FIELDCAT .
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = GT_LIST[]
IT_FIELDCATALOG = GT_FIELDCAT
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 GR_ALVGRID->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_ALV
*& Form prepare_field_catalog
* text
* -->PT_FIELDCAT text
FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
DATA LS_FCAT TYPE LVC_S_FCAT .
LS_FCAT-FIELDNAME = 'BANFN' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '10' .
LS_FCAT-COLTEXT = 'Requisition no' .
* LS_FCAT-SELTEXT = 'Requisition no' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BNFPO' .
LS_FCAT-INTTYPE = 'N' .
*ls_fcat-outputlen = '5' .
LS_FCAT-COLTEXT = 'Item no' .
LS_FCAT-SELTEXT = 'Item no' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '5' .
LS_FCAT-COLTEXT = 'Doc Type' .
LS_FCAT-SELTEXT = 'Doc Type' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Doc Category' .
LS_FCAT-SELTEXT = 'Doc Category' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Control Indicator' .
LS_FCAT-SELTEXT = 'Control Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Deletion Indicator' .
LS_FCAT-SELTEXT = 'Deletion Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-INTTYPE = 'C' .
LS_FCAT-F4AVAILABL = 'X'.
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Processing status' .
LS_FCAT-SELTEXT = 'Processing Status' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Creation Indicator' .
LS_FCAT-SELTEXT = 'Creation Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-INTTYPE = 'C' .
* ls_fcat-outputlen = '1' .
LS_FCAT-COLTEXT = 'Release Indicator' .
LS_FCAT-SELTEXT = 'Release Indicator' .
APPEND LS_FCAT TO PT_FIELDCAT .
LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-INTTYPE = 'C' .
*ls_fcat-outputlen = '8' .
LS_FCAT-COLTEXT = 'Release Status' .
LS_FCAT-SELTEXT = 'Release Status' .
APPEND LS_FCAT TO PT_FIELDCAT .
ENDFORM. "prepare_field_catalog
*& Form update_field_catalog
* text
* -->PT_FIELDCAT text
FORM UPDATE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT.
DATA LS_FCAT TYPE LVC_S_FCAT .
CALL METHOD GR_ALVGRID->GET_FRONTEND_FIELDCATALOG
IMPORTING
ET_FIELDCATALOG = PT_FIELDCAT[].
LOOP AT PT_FIELDCAT INTO LS_FCAT .
IF ZFLAG = '1'.
IF LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-EDIT = 'X' .
LS_FCAT-F4AVAILABL = 'X'.
LS_FCAT-REF_TABLE = 'T161T'.
LS_FCAT-REF_FIELD = 'BSART'.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-EDIT = 'X' .
LS_FCAT-F4AVAILABL = 'X'.
* ls_fcat-drdn_hndl = '1'.
* ls_fcat-outputlen = 15.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-EDIT = 'X' .
* for laready attcahed search help
LS_FCAT-F4AVAILABL = 'X'.
LS_FCAT-REF_TABLE = 'T161U'.
LS_FCAT-REF_FIELD = 'FRGKZ'.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF.
IF LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
* add customise f4 help on feild STATU
CLEAR GT_F4.
GS_F4-FIELDNAME = 'STATU'.
GS_F4-REGISTER = 'X'.
* gs_f4-getbefore = check_be. "§7a
* gs_f4-chngeafter = chn_aft. "§7b
APPEND GS_F4 TO GT_F4.
CALL METHOD GR_ALVGRID->REGISTER_F4_FOR_FIELDS
EXPORTING
IT_F4 = GT_F4.
ELSEIF ZFLAG = '2'.
IF LS_FCAT-FIELDNAME = 'BANFN' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BNFPO' .
LS_FCAT-EDIT = 'X' .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
ELSE.
IF LS_FCAT-FIELDNAME = 'BSART' .
LS_FCAT-EDIT = SPACE.
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSTYP' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'BSAKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'LOEKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'STATU' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'ESTKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGKZ' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
IF LS_FCAT-FIELDNAME = 'FRGZU' .
LS_FCAT-EDIT = SPACE .
MODIFY PT_FIELDCAT FROM LS_FCAT .
ENDIF .
ENDIF.
ENDLOOP .
CALL METHOD GR_ALVGRID->SET_FRONTEND_FIELDCATALOG
EXPORTING
IT_FIELDCATALOG = PT_FIELDCAT[].
ENDFORM. "update_field_catalog
*& Form register_edit
* text
FORM REGISTER_EDIT .
CALL METHOD GR_ALVGRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
ENDFORM. "register_edit -
F4 - Help for field in ALV Grid Output
Hi,
I generated a report which gives output in ALV Grid output.
In the output, 1 of the field is editable.Here, for this field I need to have my own F4-Help.
I think the procedure to be followed is:--
Create a Search Help in SE11.
Link the Search Help to the editable field.
Please let me know if its the correct procedure.
I f yes, how can I link user defined Search Help to the editable field?
Thanks,
Shivaa........Hi siva,
you can also do that way.
while filling the fieldcatalog use the parameter F4AVAILABL
for more info check
F4 help in ALV Grid...
f4 help for a field in alv grid
hope it helps you
Thanks!
Edited by: Prasanth on Mar 6, 2009 3:59 PM -
F4 help for field in ALV grid control (using ABAP objects)
Hi All,
I have created a z table ZTAB which is a master table( with single column X). field X should be a input field in ALV Grid through F4 key. I have created searchelp and assigned it to data element of X feild, and in domain level I have assigned ZTAB as value table.
And in ALV field catalog wrote ls_fcat-ref_tab = 'ZTAB'. But still I'm not getting list of values when I press F4.
Can anyone help me to understand what is missing here? How to call standardard F4 help?
This is very urgent..
Regards
Jaker.u can refer to this standard program :BCALV_EDIT_08
also u wont get the list of values automatically..
declare a class :
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS :
handle_on_f4 for event onf4 of cl_gui_alv_grid
importing e_fieldname es_row_no er_event_data,
ENDCLASS. "LCL_EVENT_HANDLER
implementation of class
here u pass ur internal table what u want to display as pop up for f4 help.
*& Class (Implementation) LCL_EVENT_HANDLER
Text
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Method to handle F4 click.
Method handle_on_f4.
Function to create a popup and passing the values of internal table in it.
CALL FUNCTION 'POPUP_WITH_TABLE'
EXPORTING
ENDPOS_COL = 60
ENDPOS_ROW = 60
STARTPOS_COL = 5
STARTPOS_ROW = 5
TITLETEXT = 'pop up'
IMPORTING
CHOICE = wa_grid-zfield
TABLES
VALUETAB = ITAB
EXCEPTIONS
BREAK_OFF = 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.
RETURN.
ENDIF.
endmethod. "handle_on_f4
ENDCLASS. "LCL_EVENT_HANDLER
hope this gives u some idea. -
Need to help in alv grid graph
Hi All,
I made alv grid report.I put graph button in screen using pf status(&graph).
Now when I execute the report output come and my graph button is also working fine.But when I click
the graph button, the graph shows defalut column wise.Now I right click on graph and select chart type and then select LINES wise then graph shows LINES wise. Can we do default LINES wise so that
when I click on graph button then it should come LINES wise default.
Thanks,
RakeshHI,
You can do this using the FM GFW_PRES_SHOW
Check the sample program : DEMO_GFW_PRES_SHOW.
For more infomation:
refer to links:
Re: How to plot graph in ALV?
http://help.sap.com/saphelp_erp2005/helpdata/en/7e/daf830b46411d2961200a0c9308b1f/frameset.htm
hope this infromation helps you.
Thanks! -
For the last 2 (maybe 3) updates iTunes has been showing my MUSIC LIBARY in a GRID of IMAGES with small caption below each image (usually an empty grey box, but occasionally tje front cover of album). It is a BIG waste of time to look at, go through and find any of my many hundreds of items.
I want / NEED "LIST VIEW" (or whatever it is called) back.
I have looked in SUPPORT / iTunes HELP / Preferences / ALL my menus - for ANY info on getting my LIST VIEW back.
Somebody PLEASE share with me HOW to get a LIST VIEW in the iTunes MAIN WINDOW (NOT the sidebar ...which is in a nice LIST foerm still thank God).
Going out of my mind on this one - and wasting LOTS of time, going through it.
Sure it's ALPHABETICAL (in an arbitrary fashion), but do they REALLY expect me to "REMEMBER" - or already know my choice - of what I am" looking for"?? Come on! I open iTunes, SEARCH through my (where'd it GO?) list and choose something that feels right for the moment. Most people do.
This IMAGE GRID just throws unnecessary obstruction into the experience and takes massive amounts of time to arrive at a selection (especially if it is not one of my first 40 albums (less than 10% of my libary). I want it gone - and a simple LIST VIEW back. ANY help VASTLY appreciated. -
Help! Where is the button to toggle Grid-View in Dreamweaver CC 2014.1?
Just downloaded the latest version last night, and now the grid-view button is gone, so if I want to re-size a fluid-element, I can't.
Help!See changes in latest update
Dreamweaver Help | New features summary
Nancy O.
Maybe you are looking for
-
I have three tabs in my application. What i want is to display a warning message when the user tries to go from one tab to another with Yes and No options. If Yes clicked then navigate to the new tab if No is clicked then remain on the same tab. Can
-
How to edit the core.css file
Hello, All the fonts in my Apex app are too small, and I mean all the fonts, for the interface too. So, I did a bit of research and found it is probably the core.css file that has been adjusted, trouble is I do not know how to change it. Even install
-
Hi, I'm using XMLSpy to access the queryview web service. When I send my SOAP message to the server I get an authentication error. (almost there!) Any idea how I can log into this web service properly? The WSDL doesn't generate and fields for login
-
Excel error - linking between tabs?
We recently upgraded to Essbase 6.2.2 on AIX (from 5.0.2 patch 10). All usershave the Excel Add-in on their desktops. We have a couple users who are having problems linking cells in Excel. When they hit = and then flip to another tab, Excel is highli
-
Universal adapters for europe/zen to
I'm leaving in a couple of weeks for a trip to Italy and I need to know if there is a preferred/best Uni'versal AC adapter for my power charger? I have a zen touch 20gb and I don't want to get over there and find I have 3 weeks of inability to rechar