EDIT THE FIELV VALUE IN ALV GRID DISPLAY
Hi Guru ,
How can I edit the value of a particular one or two fields in ALV GRID DISPLAY .
Please reply me
hi,
1.Set status of all cells to editable using the layout structure.
2.Use SET_READY_FOR_INPUT to activate the edit feature initially.
(state "editable activated").
3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
4.Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING it_outtab = gt_outtab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
* (state "editable and ready for input").
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 1.
*Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
IF g_grid->is_ready_for_input( ) EQ 0.
*Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 1.
ELSE.
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 0.
ENDIF.
Similar Messages
-
How to Edit the CheckBox in Classic ALV GRID Display
Hi,
I want to Edit the checkbox in Grid Display.
I have one checkbox field in my internal Table,
Code Of the Program,
Data :
Begin of itab occurs 0,
CHK type C,
MATNR like MARA-MATNR,
end of itab.
Iam building the fieldcatelog using Merge Funcion module.
After that I am chaning the properties of the field
catelog like below,
loop at I_FCAT assigning <FCAT>.
Case <FCAT>-Fieldname
When 'CHK'.
<FCAT>-Checkbox = 'X'.
<FCAT>-INPUT = 'X'.
I dont have edit option in fieldcatelog.
modify I_FCAT from <FCAT>.
endcase.
endloop.
In the Layout,
I_LAYOUT-box_fieldname = 'CHK'.
I_LAYOUT-box_tabname = 'ITAB'.
It is displaying the Checkbox field.but I couldnt edit the checkBox.
I can able to edit in REUSE_ALV_LIST_DISPLAY.
But I have to use REUSE_ALV_GRID_DISPLAY.How to edit the checkbox.
Thanks in Advance,
SumithraHi vasu,
The below procedure explains you to create a checkbox cloumn in the grid and allows you to edit i hope this will helps u.
The ALV Grid Control displays the cells of a column as checkboxes if the column is marked as a checkbox column in the field catalog.
Add another field to the output table in which you want to display checkboxes
OR
Define an existing field as a checkbox.
Procedure
1. Add a field to your output table:
Data: gt_fieldcat type lvc_t_fcat.
Types: begin of gs_outtab.
Types: checkbox type c. "field for checkbox
Include structure <ABAP Dictionary structure> .
Types: end of gs_outtab.
Data: gt_outtab type gs_outtab occurs 0 with header line.
2 * Add an entry for the checkbox to the field catalog
clear ls_fcat.
ls_fcat-fieldname = 'CHECKBOX'.
* Essential: declare field as checkbox and
* mark it as editable field:
ls_fcat-checkbox = 'X'.
ls_fcat-edit = 'X'.
* do not forget to provide texts for this extra field
ls_fcat-coltext = text-f01.
ls_fcat-tooltip = text-f02.
ls_fcat-seltext = text-f03.
append ls_fcat to gt_fieldcat.
regards,
venu. -
How to merge rows with similar values in alv grid display in webdynpro
Hi experts,
i want to know about how to merge rows with similar values in alv grid display of webdynpro.grouping rows is possible in table display in webdynpro but i am not able to do row grouping in the alv grid display in webdynpro.
kindly suggest.
thanks ,
Anita.Hi Anita,
did you find a solution for this? I have opened a Thread, if you know the answer maybe you could help me out:
Is there an ALV function similar to the TABLE Row grouping?
Thanx in advanced!!!
Kind Regards,
Gerardo J -
Update values in AlV grid display after entering value
Hi,
I have an issue in ALV grid display.
Let me explain.
i have 8 fields to display in which one is editiable.
Fields are: date
material,
material Description,
Opening Stock,
Closing stock- ( this field is editiable)
Closing stock,
Received Stock,
Actual production.
Actual production = Closing stock + removal stock
- receipt stock - opening stock.
when i change the value of closing stock and press enter, actual production should get update, the new values should display.
Thany you in advance.Hi,
Please refer the code below:
REPORT z_demo_alv_jg.*******************************************************************
* TYPE-POOLS *
TYPE-POOLS: slis. *******************************************************************
* INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.*******************************************************************
* FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.*******************************************************************
* SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c,
lines(5) TYPE n.*******************************************************************
* START-OF-SELECTION *
START-OF-SELECTION.* Storing table name
p_table = tabname.* Create internal table dynamically with the stucture of table name
* entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'. LEAVE TO LIST-PROCESSING.
ENDIF.
* Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.* Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>. SORT i_fieldcat BY col_pos.* Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS. REFRESH <dyn_tab_temp>.* Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2. IF sy-subrc <> 0. ENDIF.*&-----------------------------------------------------------------*
*& Form SET_PF_STATUS
* Setting custom PF-Status
* -->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab. SET PF-STATUS 'Z_STANDARD'.ENDFORM. "SET_PF_STATUS*&----------------------------------------------------------------*
*& Form user_command
* Handling custom function codes
* -->R_UCOMM Function code value
* -->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.* Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.* Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.* Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.* Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>. CASE r_ucomm.* When a record is selected
WHEN '&IC1'.* Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex. IF sy-subrc = 0.* Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.* Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'Z_DEMO_PDF_JG'
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.* Make all the fields input enabled except key fields
w_field-input = 'X'. MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL. ENDIF.* Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2. IF sy-subrc = 0.* Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.* If the record is changed then track its index no.
* and populate it in an internal table for future
* action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF. ENDIF.* When save button is pressed
WHEN 'SAVE'.* Sort the index table
SORT i_index.* Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index. LOOP AT i_index.* Find out the changes in the internal table
* and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF. ENDLOOP.* Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3. IF sy-subrc = 0.* Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>. REFRESH <dyn_tab_temp>.* Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table. ENDIF.
ENDCASE. rs_selfield-refresh = 'X'.ENDFORM. "user_command
Thanks,
Sriram Ponna. -
How to capture the checkbox status in ALV Grid display
I need some immediate help regarding Grid ALV.
My Requirement: I need to display an ALV grid report along with checkboxes. Further, I need to provide an option wherein the user can checkboxes and select the records that I need to process further (by clicking the process button on the ALV Report).
My Query: The problem here is that I am not able to capture the status of the checkboxes. This means that I am not able to capture which of the records have been selected by checking their resp checkboxes.
Solutions that I have tried: I have tried capturing the same at user command by checking the value in slis_selfield. But all the records show the value as 1 for the checkbox field.
Kinldy suggest how to go about it.
I am not using Object Oriented ALV. Please suggest something to be used in ALV Grid display in 4.6C version.
Regards,
NamrataHere is a Sample code , it might help you
TABLES : sflight.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA: BEGIN OF it_sflight OCCURS 0,
checkbox(1),
carrid LIKE sflight-carrid,
END OF it_sflight.
*layout
DATA: wa_layout TYPE slis_layout_alv.
*field catalog
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
wa_fieldcatalog TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT carrid FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_sflight.
END-OF-SELECTION.
CLEAR it_fieldcatalog.
REFRESH it_fieldcatalog.
wa_fieldcatalog-fieldname = 'CHECKBOX'.
wa_fieldcatalog-outputlen = '3'.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-seltext_m = 'Chk'.
wa_fieldcatalog-checkbox = 'X'.
wa_fieldcatalog-edit = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'CARRID'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-seltext_m = 'Carrid'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = wa_layout
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcatalog
TABLES
t_outtab = it_sflight
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form USER_COMMAND
FORM user_command USING p_ucomm TYPE sy-ucomm
p_selfld TYPE slis_selfield.
CASE p_ucomm.
WHEN '&DATA_SAVE'.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
LOOP AT it_sflight WHERE checkbox = 'X'.
DELETE it_sflight INDEX sy-tabix.
ENDLOOP.
p_selfld-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command -
TO enable the menu button in ALV Grid Display
Hi Mates,
I have a peculiar problem while doing ALV Grid display for screens.
In the main Screen i have Three coloumns.The 1st coloum will interacted
next screen 101 and 2nd coloum will interacted to screen 102.
Now the problem is in the menu of ALV Grid display,the Total button was enabled for screen
101 and same button is disabled in screen 102.
But the code semms to be fine .
Below i have pasted the code and please have a look and help to come out of this cris.
My Code :
FORM CREATE_ALV_GRID USING R_SCREEN.
DATA: LS_LAYOUT TYPE LVC_S_LAYO,
ITAB_FUNCTIONS TYPE UI_FUNCTIONS. "MHTK903257(+)(add)
CASE R_SCREEN.
*--> SCREEN 9000
WHEN C_SCREEN_9000.
*-- Build the field catalog for the ALV grid.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_OVERVIEW' 'WADAT' 'Due date'(004) 'X' 'D' ' ' ' ' ' ' 'C100',
*'ITAB_OVERVIEW' 'HU_UNLOAD' 'Unloaded HU'(005) 'X' 'I' '15' ' ' ' ' 'C500', "MHTK903257(-)
'ITAB_OVERVIEW' 'TOT_TO' 'Total TO'(006) 'X' 'I' ' ' ' ' ' ' 'C30',
GMTK901103: REMOVE HOTSPOT ON ESTIMATED TO:
'ITAB_OVERVIEW' 'EST_TO' 'Estim TO'(030) ' ' 'I' ' ' ' ' ' ' 'C500'.
LOOP AT ITAB_INB_LOC WHERE OUTPUT = 'X'.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
USING:
ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_OVERVIEW' ITAB_INB_LOC-FIELDNAME
ITAB_INB_LOC-Z_INBND_LOC 'X' '' ' ' ' ' 'R' 'C500'. "MHTK903418
ENDLOOP.
LOOP AT ITAB_STORAGE_TYPE WHERE OUTPUT = 'X'.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_OVERVIEW' ITAB_STORAGE_TYPE-FIELDNAME
ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
ENDLOOP.
*-- Create the ALV grid object.
CREATE OBJECT PT_ALV_1000
EXPORTING
I_PARENT = PT_DOCK_1000.
PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS "MHTK903257(+)(add)
USING R_SCREEN.
*-- Get the title of the ALV grid.
PERFORM GET_ALV_GRID_TITLE USING C_SCREEN_1000
CHANGING LS_LAYOUT-GRID_TITLE.
*-- Display the ALV grid.
CALL METHOD PT_ALV_1000->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LS_LAYOUT
IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
CHANGING
IT_OUTTAB = ITAB_OVERVIEW
IT_FIELDCATALOG = ITAB_FIELDCAT_9000.
*--> SCREEN 9100
WHEN C_SCREEN_1100.
*-- Build the field catalog for the ALV grid.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_DETIAL' 'WAUHR' 'Due time'(007) ' ' 'T' ' ' 'X' ' ' 'C100',
'ITAB_DETAIL' 'TOT_TO' 'Total TO'(006) 'X' 'I' ' ' ' ' ' ' 'C30',
'ITAB_DETAIL' 'EST_TO' 'Estim TO'(030) ' ' 'I' ' ' ' ' ' ' 'C500'.
CLEAR ITAB_INB_LOC.
LOOP AT ITAB_INB_LOC WHERE SELECTED = 'X'.
CHECK SY-SUBRC EQ 0.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
USING:
ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_DETAIL' ITAB_INB_LOC-FIELDNAME
ITAB_INB_LOC-Z_INBND_LOC '' '' ' ' ' ' 'R' 'C500'.
ENDLOOP.
CLEAR: ITAB_STORAGE_TYPE.
LOOP AT ITAB_STORAGE_TYPE WHERE SELECTED = 'X'.
CHECK SY-SUBRC EQ 0.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_DETAIL' ITAB_STORAGE_TYPE-FIELDNAME
ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
ENDLOOP.
*-- Create the ALV grid object.
CREATE OBJECT PT_ALV_1100
EXPORTING
I_PARENT = PT_DOCK_1100.
PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS "MHTK903257(+)(add)
USING R_SCREEN.
*-- Get the title of the ALV grid.
PERFORM GET_ALV_GRID_TITLE USING C_SCREEN_1100
CHANGING LS_LAYOUT-GRID_TITLE.
*-- Display the ALV grid.
CALL METHOD PT_ALV_1100->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LS_LAYOUT
IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
CHANGING
IT_OUTTAB = ITAB_DETAIL
IT_FIELDCATALOG = ITAB_FIELDCAT_1100.
screen 1300 TO detail.
*--> SCREEN 9300
WHEN C_SCREEN_1300.
*-- Build the field catalog for the ALV grid.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1300
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_TO2' 'TANUM' 'TO'(020) ' ' 'C' ' ' ' ' ' ' 'C100',
'ITAB_TO2' 'NLPLA' 'Location'(021) ' ' 'C' ' ' ' ' ' ' 'C500',
'ITAB_TO2' 'LETY1' 'SUT'(013) ' ' 'C' ' ' ' ' ' ' 'C500',
'ITAB_TO2' 'MATNR' 'Material'(016) ' ' 'C' ' ' ' ' ' ' 'C500',
'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' ' ' ' ' ' 'C500',
'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' ' ' ' ' ' 'C500'. "MHTK903257(-)
*'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'. "MHTK903257(-)
*-- Create the ALV grid object.
CREATE OBJECT PT_ALV_1300
EXPORTING
I_PARENT = PT_DOCK_1300.
*-- Exclude the non-applicable functions from the ALV grid.
PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
USING R_SCREEN.
*-- Get the title of the ALV grid.
PERFORM GET_ALV_GRID_TITLE USING C_SCREEN_1300
CHANGING LS_LAYOUT-GRID_TITLE.
SORT ITAB_TO2 BY TANUM VBELN POSNR.
*-- Display the ALV grid.
CALL METHOD PT_ALV_1300->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LS_LAYOUT
IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
CHANGING
IT_OUTTAB = ITAB_TO2
IT_FIELDCATALOG = ITAB_FIELDCAT_1300.
screen 9400 Pre Processing detail.
*--> SCREEN 9400
WHEN C_SCREEN_9400. "MHTK903418(BEgin Of change)
*-- Build the field catalog for the ALV grid.
PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1400
USING:
*ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
'ITAB_PRE_PROC2' 'Z_PRE_PROC' 'Pre Processing Number'(030) ' ' 'C' ' ' ' ' ' ' 'C100',
'ITAB_PRE_PROC2' 'Z_PRE_PROC_LN' 'Pre Processing Number'(035) ' ' 'C' ' ' ' ' ' ' 'C100',
'ITAB_PRE_PROC2' 'MATNR' 'Material'(035) ' ' 'C' ' ' ' ' ' ' 'C500',
'ITAB_PRE_PROC2' 'Z_PSH_QTY' 'Quantity'(035) ' ' 'C' ' ' ' ' ' ' 'C500'.
*'ITAB_TO2' 'MATNR' 'Material'(016) ' ' 'C' ' ' ' ' ' ' 'C500',
*'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' ' ' ' ' ' 'C500',
*'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' ' ' ' ' ' 'C500'. "MHTK903257(-)
**'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'. "MHTK903257(-)
*-- Create the ALV grid object.
CREATE OBJECT PT_ALV_1400
EXPORTING
I_PARENT = PT_DOCK_1400.
*-- Exclude the non-applicable functions from the ALV grid.
PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
USING R_SCREEN.
*-- Get the title of the ALV grid.
PERFORM GET_ALV_GRID_TITLE USING C_SCREEN_1400
CHANGING LS_LAYOUT-GRID_TITLE.
SORT ITAB_PRE_PROC2 BY Z_PRE_PROC.
*-- Display the ALV grid.
CALL METHOD PT_ALV_1400->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LS_LAYOUT
IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
CHANGING
IT_OUTTAB = ITAB_PRE_PROC2
IT_FIELDCATALOG = ITAB_FIELDCAT_1400. "MHTK903418(End of change)
ENDCASE.Hi
U copy from standard program and paste ur report ...It will work..'
Regards:
Prabu -
How to merge the 2 field in alv gride display
Tables for ALV display
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
wa_layout TYPE slis_layout_alv,
it_exclude TYPE slis_t_extab,
wa_exclude TYPE slis_extab,
it_header TYPE STANDARD TABLE OF zqm_imir_hdr,
wa_header LIKE LINE OF it_header,
it_final TYPE STANDARD TABLE OF zqm_imir_itm,
wa_final LIKE LINE OF it_final,
it_vcode TYPE RANGE OF zqm_wtr_itm-vcode,
wa_vcode LIKE LINE OF it_vcode.
DEFINE m_fieldcat.
wa_fieldcat-fieldname = &1.
wa_fieldcat-tabname = &2.
wa_fieldcat-seltext_m = &3.
wa_fieldcat-outputlen = &4.
wa_fieldcat-col_pos = &5.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
END-OF-DEFINITION.
DEFINE m_vcode.
wa_vcode-option = &1.
wa_vcode-sign = &2.
wa_vcode-low = &3.
wa_vcode-high = ''.
append wa_vcode to it_vcode.
clear wa_vcode.
END-OF-DEFINITION.
START-OF-SELECTION.
PERFORM data_retrival.
PERFORM lead_time_calculation.
IF it_final[] IS NOT INITIAL.
PERFORM alv_display.
ENDIF.
Display ALV
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = wa_layout
it_fieldcat = it_fieldcat
i_save = c_x
it_excluding = it_exclude
TABLES
t_outtab = IT_OUTPUT[]
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.
m_fieldcat: 'ZIMIRNO' 'IT_OUTPUT' text-003 21 0,
'PRUEFLOS' 'IT_OUTPUT' text-004 21 1,
'ZCRDAT' 'IT_OUTPUT' text-030 9 2,
'INITS' 'IT_OUTPUT' text-031 6 3,
'SPLIT' 'IT_OUTPUT' text-005 12 4,
'WERK' 'IT_OUTPUT' text-006 5 5,
'LOSMENGE' 'IT_OUTPUT' text-007 24 6,
'MENGENEINH' 'IT_OUTPUT' text-008 15 7,
'NAMEVEND' 'IT_OUTPUT' text-009 11 8,
*& Hypercare - 721600 - IMIR Changes - Start
'KONT_PSPNR' 'IT_OUTPUT' text-023 15 7,
'POSID' 'IT_OUTPUT' text-023 15 9,
*& Hypercare - 721600 - IMIR Changes - End
'LTEX1' 'IT_OUTPUT' text-024 24 10,
'EBELN' 'IT_OUTPUT' text-010 26 11,
'MBLNR' 'IT_OUTPUT' text-011 24 12,
'ANZGEB' 'IT_OUTPUT' text-012 17 13,
'GEBEH' 'IT_OUTPUT' text-013 4 14,
'MATNR' 'IT_OUTPUT' text-014 18 15,
'TXZ01' 'IT_OUTPUT' text-015 128 16,
'SPECE' 'IT_OUTPUT' text-016 23 17,
'VCODE' 'IT_OUTPUT' text-017 24 18,
'TAGNO' 'IT_OUTPUT' text-018 10 19,
'HEATNO' 'IT_OUTPUT' text-019 11 20,
'IDCODE' 'IT_OUTPUT' text-020 7 21,
'TCNO' 'IT_OUTPUT' text-021 9 22,
'REMARKS' 'IT_OUTPUT' text-022 30 23,
'BUDAT' 'IT_OUTPUT' text-025 30 24,
'CPUTM' 'IT_OUTPUT' text-026 30 25,
'VDATUM' 'IT_OUTPUT' text-027 30 26,
'VEZEITERF' 'IT_OUTPUT' text-028 30 27,
'ZLTIME' 'IT_OUTPUT' text-029 30 26,
'LEADTIME' 'IT_OUTPUT' text-029 30 28.
DATA : v_unit like T006-MSEHI VALUE 'HR',
v_FCALID like SCAL-FCALID,
v_zltim TYPE f,
v_zltime TYPE p LENGTH 8 DECIMALS 2.
SELECT SINGLE FABKL INTO v_FCALID FROM T001W WHERE WERKS = s_werks.
SELECT zcrdat INTO TABLE it_zqm_imir_hdr
from zqm_imir_hdr
FOR ALL ENTRIES IN it_final
where zcrdat EQ it_final-zcrdat.
SELECT mblnr mjahr budat cputm
INTO TABLE it_mkpf
from mkpf
FOR ALL ENTRIES IN it_final
where mblnr EQ it_final-mblnr
AND mjahr EQ it_final-mjahr.
SELECT prueflos vdatum vezeiterf
INTO TABLE it_qave
from qave
FOR ALL ENTRIES IN it_final
where prueflos EQ it_final-prueflos.
SORT it_mkpf BY mblnr mjahr.
SORT it_qave by prueflos.
SORT it_zqm_imir_hdr BY zcrdat.
LOOP AT it_final into wa_final.
CLEAR: wa_output,wa_mkpf,wa_qave,wa_zqm_imir_hdr.
MOVE-CORRESPONDING wa_final to wa_output.
READ TABLE it_zqm_imir_hdr INTO wa_zqm_imir_hdr WITH KEY zcrdat = wa_final-zcrdat
BINARY SEARCH.
READ TABLE it_mkpf INTO wa_mkpf WITH KEY mblnr = wa_final-mblnr
mjahr = wa_final-mjahr
BINARY SEARCH.
MOVE wa_zqm_imir_hdr-zcrdat TO wa_output-zcrdat.
MOVE wa_mkpf-budat TO wa_output-budat.
MOVE wa_mkpf-cputm TO wa_output-cputm.
READ TABLE it_qave INTO wa_qave WITH KEY prueflos = wa_final-PRUEFLOS
BINARY SEARCH.
MOVE wa_qave-vdatum TO wa_output-vdatum.
MOVE wa_qave-vezeiterf TO wa_output-vezeiterf.
LV_START_DATE = wa_zqm_imir_hdr-zcrdat.
LV_START_DATE = wa_mkpf-budat.
LV_START_TIME = wa_mkpf-cputm.
LV_END_TIME = wa_qave-vezeiterf.
LV_END_DATE = wa_qave-vdatum.
IF LV_START_DATE IS NOT INITIAL.
IF LV_END_DATE IS NOT INITIAL.
CALL FUNCTION 'SD_CALC_DURATION_FROM_DATETIME'
EXPORTING
i_date1 = LV_START_DATE
i_time1 = LV_START_TIME
i_date2 = LV_END_DATE
i_time2 = LV_END_TIME
IMPORTING
E_TDIFF = LV_DIFF
E_DATE2_EARLY = E_DATE2_EARLY
EXCEPTIONS
INVALID_DATETIME = 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.
eNDFORM.}
This is my code unable to merge the to tabs position is on 3rd and 4th.
need help ......
thanks,Hi,
From Your code I saw that you called Macro of fieldcat after Calling the ALV Function Did You Check That One.
Following links may be useful for you ,
ALV report: How to merge 2 columns into 1 column?
Hope this information helps You
Regards,
Raghava Channooru -
Increase the field width in ALV grid display
hi
My problem is that when i am trying to print data through REUSE_ALV_GRID_DISPLAY, a particular field which contain message is being truncated, i used ls_layout-colwidth_optimiser as 'X' and also t_fieldcat-outputlen = 1000, but still i am having this prblm, but i checked in the internal table that is passed in ALV, the entire data is stored there, but while printing its getting truncated for a particular field, please suggest me a solution to my problem.
Regards
SwarnaliHey Neelam
this is a very old thread, so I don t remember the exact solution which I implemented,
however can you use the i_tab name in the field TABNAME of the field catalog.
Regarding breaking the message, you can use a STRLEN if you are aware at the no. of chars where it should break always or split at space the string in 4 strings.
Inside the field catalog you have to take an internal table with 4 different fields and show it.
Hopefully it should resolve your problem.
Regards
SB -
How to capture the event in ALV grid display?
Hi experts,
How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
regards,
Arul Jothi.Hi Arul,
Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
Two ALV Grid Display format on the Single page
Hi guru's
I have two plant details. I want to be display these two plant details in the single page with ALV Grid display format.. like
plant no 1(Details):
xxxx xxxx xxxx xxxx with ALV Grid Display format
plant no 2 (Details):
xxx xxxx xxxx xxxx ALV Grid Display format
Can any body help on the .. if you have sample code pls paste.
Thanks in Advance
Surendrahi,
Grid display is not possible but u can display two list on same page by Block ALV....
TYPE-POOLS : slis.
TABLES : mara,
makt.
SELECT-OPTIONS : mat FOR mara-matnr.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
matkl LIKE mara-matkl,
mtart LIKE mara-mtart,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
mtart LIKE mara-mtart,
count TYPE i,
END OF itab1.
DATA : BEGIN OF itab1_col OCCURS 0,
mtart LIKE mara-mtart,
count TYPE i,
END OF itab1_col.
DATA : t_fcat1 TYPE slis_t_fieldcat_alv,
t_fcat2 TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv,
t_eve TYPE slis_t_event,
wa_eve TYPE slis_alv_event,
t_layout TYPE slis_layout_alv.
DATA : v_repid LIKE sy-repid,
t_mat LIKE mara-matnr.
DEFINE create_fcat.
clear wa_fcat.
wa_fcat-fieldname = &1.
wa_fcat-seltext_l = &2.
wa_fcat-outputlen = &3.
append wa_fcat to t_fcat1.
END-OF-DEFINITION.
START-OF-SELECTION.
PERFORM get_data.
PERFORM dis_data.
*& Form get_data
text
FORM get_data.
SELECT amatnr bmaktx amtart amatkl INTO CORRESPONDING FIELDS OF TABLE itab
FROM mara AS a INNER JOIN makt AS b ON
amatnr = bmatnr
WHERE a~matnr IN mat.
LOOP AT itab.
itab1-mtart = itab-mtart.
itab1-count = 1.
APPEND itab1.
ENDLOOP.
SORT itab1 BY mtart.
LOOP AT itab1.
MOVE-CORRESPONDING itab1 TO itab1_col.
COLLECT itab1_col.
ENDLOOP.
ENDFORM. "get_data
*& Form dis_data
text
FORM dis_data.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
REFRESH t_fcat1.
CLEAR t_fcat1.
REFRESH t_eve.
wa_eve-name = 'TOP_OF_PAGE'.
wa_eve-form = 'TOP_OF_PAGE1'.
APPEND wa_eve TO t_eve.
create_fcat:
'MATNR' 'Material' '10',
'MAKTX' 'Material Description' '40',
'MTART' 'Type' '10',
'MATKL' 'Group' '10'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = t_layout
it_fieldcat = t_fcat1
i_tabname = 'ITAB'
it_events = t_eve
TABLES
t_outtab = itab.
REFRESH t_fcat1.
CLEAR t_fcat1.
REFRESH t_eve.
wa_eve-name = 'TOP_OF_PAGE'.
wa_eve-form = 'TOP_OF_PAGE2'.
APPEND wa_eve TO t_eve.
create_fcat:
'MTART' 'Type' '10',
'COUNT' 'Total' '5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = t_layout
it_fieldcat = t_fcat1
i_tabname = 'ITAB1_COL'
it_events = t_eve
TABLES
t_outtab = itab1_col.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
ENDFORM. "dis_data
*& Form top_of_page1
text
FORM top_of_page1.
FORMAT COLOR COL_POSITIVE.
WRITE:/ 'First Block'.
FORMAT COLOR OFF.
ENDFORM. "top_of_page
*& Form top_of_page2
text
FORM top_of_page2.
FORMAT COLOR COL_NEGATIVE.
WRITE /5 'Second Block'.
FORMAT COLOR OFF.
ENDFORM. "top_of_page
reward if usefull.... -
Regarding output using alv grid display
Hi experts,
i have a program
FS_TAB1-A = P_T1.
IF P_T1 = 0.
TEMP1 = 1.
DO TEMP1 TIMES.
FS_TAB1-A = P_T1 * DUMMY1.
APPEND FS_TAB1 TO T_TAB1.
DUMMY1 = DUMMY1 + 1.
ENDDO.
now i have to diplay the p_t1*dummy1 using alv grid display like it goes into thew loop for ten times then i have to show it 10 times like
10 1 102 103 104 111 112 like that can u help mehi,
you have to get the result of the multiplication at each row and then concatenate the result and the factor to show the final result in multiples value and multiplication factor... -
How to change sub total value in ALV Grid.
Hi All,
Can u please explain how to change SUBTOTAL Value in ALV Grid display based on another field value.
EX; F1 subtotal is initial then we have to modify the F2 sub total to 9999.9.
Thanks
Radha.Hi Radha,
I doubt if that can be changed....because the event that i was referring to in my previous post works with ALV List display...But in any case you can try that.....
There is an event in SLIS....(As i told you, i dont remember the name and currently i dont have access to SAP system, so i am not able to verify and let you know that event name).....
Other thatn TOP and END of PAGE events, there is an event for sub-total text......i think it would start with "SUBTOTAL"...
you need to use that event in your events table and pass it to ALV Grid display.
Then create a sub-routine with that name (As you do for TOP-OF-PAGE event)....and in this event you can change the values in runtime (PROVIDED, this event gets triggered for ALV GRID).....
If this does not work, i think calculating sub-totals while you build the internal table would be a better option....(If you have time constraint....else you can do some more research on the same)........
Best Regards,
Ram. -
Hi all,
Please help regardin the LOOPing Procedure on ALV-GRID Display.
For tracking the chnaged data in display mode, I need it into my Progarm Internal Table.
Thanks
Rajeev.Hi Ashis,
Add no_zero in the Field catalog.
no_zero(1) type c, " write no-zero
CLEAR wa_fieldcat. " Employee Number
wa_fieldcat-fieldname = text-f02. " EMP_NUM
wa_fieldcat-tabname = text-t99.
wa_fieldcat-seltext_m = text-t02.
wa_fieldcat-just = c_right.
wa_fieldcat-key = 'X'.
wa_fieldcat-no_zero = 'X'
APPEND wa_fieldcat TO itab_fieldcat.
Thanks,
Nelson -
Not able to download all the rows to excel sheet from alv grid display
Hi experts,
I am not able to download all the rows which are displayed in alv grid display for some material numbers.
for some materials i am able to download, i used two ways to download 1) from icon(local file) on grid 2) menu list->export.
i checked in debugging till selecting the spread sheet pop up window, i am able to see all the data in internal table.
Can you suggest me what will be the problem....
thanks in advance,hi sandeep,
sorry for didnt specify clearly.
note: EX: "asaasdada in this sentence i said " this symbol is special character not the text.
building final internal table code
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = p_capid
datuv = sy-datum
ehndl = '1'
mktls = 'X'
mehrs = 'X'
mmory = '1'
mtnrv = p_matnr
stlal = '1'
stpst = 0
svwvo = 'X'
werks = p_werks
vrsvo = 'X'
TABLES
stb = i_stb
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
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_stb1[] = i_stb[].
IF NOT i_stb1[] IS INITIAL.
SORT i_stb1 BY idnrk.
DELETE ADJACENT DUPLICATES FROM i_stb1 COMPARING idnrk.
SELECT bmatn ematn FROM ampl INTO TABLE i_ampl
FOR ALL ENTRIES IN i_stb1
WHERE bmatn = i_stb1-idnrk AND
datuv LE sy-datum AND
datub GE sy-datum.
SELECT
matnr
bwkey
verpr
stprs
bwprh
FROM mbew
INTO TABLE i_mbew
FOR ALL ENTRIES IN i_stb1
WHERE
matnr EQ i_stb1-idnrk AND
bwkey EQ i_stb1-werks.
IF NOT i_stb1[] IS INITIAL.
SELECT matnr werks beskz
dzeit webaz plifz
ekgrp
INTO TABLE i_marc
FROM marc
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_marc BY matnr werks.
ENDIF.
CLEAR i_ekpo.
CLEAR i_vend.
IF NOT i_stb1[] IS INITIAL.
SELECT ebeln ebelp matnr werks loekz aedat
netpr peinh
INTO TABLE i_ekpo
FROM ekpo
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_ekpo BY matnr ASCENDING
aedat DESCENDING
ebeln DESCENDING
ebelp DESCENDING.
IF NOT i_ekpo IS INITIAL.
SELECT k~ebeln k~lifnr l~name1
INTO TABLE i_vend
FROM ekko AS k INNER JOIN lfa1 AS l
ON k~lifnr EQ l~lifnr
FOR ALL ENTRIES IN i_ekpo
WHERE ebeln = i_ekpo-ebeln.
SORT i_vend BY ebeln.
ENDIF.
ENDIF.
ENDIF.
i_ampl1[] = i_ampl[].
IF NOT i_ampl1[] IS INITIAL.
SORT i_ampl1 BY ematn.
DELETE ADJACENT DUPLICATES FROM i_ampl1 COMPARING ematn.
SELECT matnr mfrpn mfrnr FROM mara INTO TABLE i_mara
FOR ALL ENTRIES IN i_ampl1
WHERE matnr = i_ampl1-ematn.
ENDIF.
SORT i_ampl BY bmatn.
IF NOT i_stb[] IS INITIAL.
SELECT stlty stlnr stlkn stpoz idnrk potx1 potx2
INTO TABLE i_stpo
FROM stpo
FOR ALL ENTRIES IN i_stb
WHERE stlty = i_stb-stlty
AND stlnr = i_stb-stlnr
AND stlkn = i_stb-stlkn
AND stpoz = i_stb-stpoz
AND idnrk = i_stb-idnrk.
SORT i_stpo BY stlty stlnr stlkn stpoz idnrk.
ENDIF.
LOOP AT i_stb INTO wa_stb.
READ TABLE i_marc INTO wa_marc
WITH KEY matnr = wa_stb-idnrk
werks = wa_stb-werks
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-beskz = wa_marc-beskz.
wa_outtab-dzeit = wa_marc-dzeit.
wa_outtab-webaz = wa_marc-webaz.
wa_outtab-plifz = wa_marc-plifz.
wa_outtab-ekgrp = wa_marc-ekgrp.
ENDIF.
READ TABLE i_ekpo INTO wa_ekpo
WITH KEY matnr = wa_stb-idnrk.
IF sy-subrc = 0.
wa_outtab-netpr = wa_ekpo-netpr.
wa_outtab-peinh = wa_ekpo-peinh.
READ TABLE i_vend INTO wa_vend
WITH KEY ebeln = wa_ekpo-ebeln
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-lifnr = wa_vend-lifnr.
wa_outtab-name_sup = wa_vend-name1.
ENDIF.
ENDIF.
READ TABLE i_stpo INTO wa_stpo
WITH KEY stlty = wa_stb-stlty
stlnr = wa_stb-stlnr
stlkn = wa_stb-stlkn
stpoz = wa_stb-stpoz
idnrk = wa_stb-idnrk
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-potx1 = wa_stpo-potx1.
wa_outtab-potx2 = wa_stpo-potx2.
ENDIF.
READ TABLE i_mbew INTO wa_mbew
WITH KEY
matnr = wa_stb-idnrk
bwkey = wa_stb-werks.
IF sy-subrc IS INITIAL.
MOVE:
wa_mbew-verpr TO wa_outtab-verpr,
wa_mbew-stprs TO wa_outtab-stprs,
wa_mbew-bwprh TO wa_outtab-bwprh.
ENDIF.
wa_outtab-matnr = p_matnr.
wa_outtab-posnr = wa_stb-posnr.
wa_outtab-stufe = wa_stb-stufe.
wa_outtab-idnrk = wa_stb-idnrk.
wa_outtab-ojtxb = wa_stb-ojtxp.
wa_outtab-menge = wa_stb-menge.
wa_outtab-meins = wa_stb-meins.
MOVE: wa_stb-zzitem_draw_no TO wa_outtab-zzitem_draw_no.
IF wa_stb-upskz = 'X'.
SELECT * FROM stpu INTO TABLE i_stpu
WHERE stlty = wa_stb-stlty AND
stlnr = wa_stb-stlnr AND
stlkn = wa_stb-stlkn AND
stpoz = wa_stb-stpoz.
ENDIF.
LOOP AT i_stpu INTO wa_stpu.
wa_outtab-upmng = wa_stpu-upmng.
wa_outtab-ebort = wa_stpu-ebort.
wa_outtab-uposz = wa_stpu-uposz.
CONCATENATE v_ebort wa_stpu-ebort INTO v_ebort
SEPARATED BY space.
ENDLOOP.
MOVE strlen( v_ebort ) TO v_len.
MOVE: 0 TO x,
128 TO y.
DATA : lt_tab TYPE TABLE OF swastrtab.
DATA : ls_tab LIKE LINE OF lt_tab.
DATA : lv_ebort TYPE string.
CLEAR lv_ebort. CLEAR lt_tab.
MOVE v_ebort TO lv_ebort.
CALL FUNCTION 'SWA_STRING_SPLIT'
EXPORTING
input_string = lv_ebort
max_component_length = 128
TABLES
string_components = lt_tab
EXCEPTIONS
max_component_length_invalid = 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.
IF lt_tab[] IS NOT INITIAL.
LOOP AT lt_tab INTO ls_tab.
CLEAR lv_ebort.
MOVE: ls_tab-str TO lv_ebort.
CONDENSE lv_ebort.
MOVE lv_ebort TO wa_outtab-ebort.
APPEND wa_outtab TO i_outtab.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
* wa_outtab-idnrk.
ENDLOOP.
ELSE.
APPEND wa_outtab TO i_outtab.
ENDIF.
CLEAR v_ebort.
CLEAR: wa_stpu.
REFRESH: i_stpu.
LOOP AT i_ampl INTO wa_ampl WHERE bmatn = wa_stb-idnrk.
READ TABLE i_mara INTO wa_mara WITH TABLE KEY matnr = wa_ampl-ematn.
IF sy-subrc = 0.
LOOP AT i_outtab INTO wa_outtab
WHERE
idnrk = wa_stb-idnrk AND
flag NE 'X'.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
MOVE 'X' TO wa_outtab-flag.
MODIFY i_outtab FROM wa_outtab
TRANSPORTING mfrpn mfrnr name1 flag.
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-ebort,
* wa_outtab-idnrk,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
APPEND wa_outtab TO i_outtab.
ENDIF.
ENDIF.
REFRESH i_stpu.
CLEAR i_stpu.
ENDLOOP. CLEAR: wa_matnr1, wa_mfrnr, wa_outtab.
ENDLOOP.
Edited by: srinivasareddy j on Mar 9, 2011 7:16 AM
Edited by: srinivasareddy j on Mar 9, 2011 7:20 AM -
ALV grid display the subtotal not getting for one column at the output
Hi,
I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
Eventhough that column has some values.
So can anyone give the proper solution.
Waiting quick response.
Best Regards,
BansiHi
see this link .
https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
or try this program.
REPORT zalv.
DATA:
t_sflight TYPE TABLE OF sflight,
fs_sflight TYPE sflight.
DATA:
r_container TYPE REF TO cl_gui_custom_container,
r_grid TYPE REF TO cl_gui_alv_grid.
*FIELD CATALOG
DATA:
t_fcat TYPE lvc_t_fcat,
fs_fcat TYPE lvc_s_fcat.
*SORTING THE BASIC LIST
DATA:
t_sort TYPE lvc_t_sort,
fs_sort TYPE lvc_s_sort.
fs_fcat-fieldname = 'PRICE'.
fs_fcat-do_sum = 'X'.
APPEND fs_fcat TO t_fcat.
fs_sort-spos ='1'.
fs_sort-fieldname = 'CARRID'.
fs_sort-down = 'X'.
fs_sort-group = '*'.
fs_sort-subtot = 'X'.
APPEND fs_sort TO t_sort.
SELECT * FROM sflight INTO TABLE t_sflight.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN1'.
SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
**& Module HANDLER OUTPUT
MODULE list OUTPUT.
CREATE OBJECT r_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT r_grid
EXPORTING
i_parent = r_container.
CALL METHOD r_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_fieldcatalog = t_fcat
it_outtab = t_sflight
it_sort = t_sort.
ENDMODULE. "list OUTPUT
Regards
Hareesh Menon
Maybe you are looking for
-
ITunes 8.1 freezes when iPod touch is plugged in, unfreezes when pluggedout
I've just updated my iPod touch 1st gen to 2.2.1, it was working and syncing perfectly for two days. This morning, when the iPod touch was plugged into iTunes, iTunes froze when the iPod was recognized by the computer. I tried plugging the iPod touch
-
Select from nested table in a nested table security problem
please help running Oracle 9.2.0.3.0 on RH AS 2.1 I can select the inner most nested table as the creator, but can't use the same select statement as USER2. ORA-00942: table or view does not exist -- begin make of objects and tables create or replace
-
Problem in compiling this java need help
package test; public class simpleTest{ public simpleTest(){ int a =0; import test.*; public class testPackage{ public static void main(String [] args){ simpleTest sT=new simpleTest(); System.out.println("Packag
-
Maximum installable ram for ibook g4 800mhz?
i get conflicting answers...can i install 1g of ram into this thing?
-
Subcontracting Account Assignment Errors
I have created a subcontracting order. And carried out the goods issue to vendor via ME2O transaction. Now while performing GR I have to manually assign a cost centre for consumption of components in movement 543, else I get an error stating Account