ALV and checkbox display
hi all, i have a few problems here.
Firstly, i need to display records in an ALV from an internal table.
Secondly, i need to include checkboxes beside each and every records for the user to choose which records he wants to see.
Thirdly, after the user has checked the fieldss that he wants, i need to display the details of all the records based on the ticked checkboxes in another screen.
please help me if anyone knows.
thx!
Hi Meei,
Thats very simple ....
1 . In the internal table where you are displaying declare some thing like below.
Data : begin of i_department occurs 0,
vbeln like ztmsh-vbeln, "Sales and Distribution Docu No
deprt like ztmsh-deprt, "Department
meala like ztmsd-meala, "Meal Allowance
sitea like ztmsd-sitea, "Site Allowance($)
CHECKBOX(1) TYPE C,declare some thing here for creating check box
end of i_department.
2. Build a field catlog for the check box something like below..
i_temp-fieldname = 'CHECKBOX'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-col_pos = 1.
i_temp-CHECKBOX = 'X'.
i_temp-outputlen = 4.
i_temp-seltext_l = 'Flag'.
i_temp-input = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
3. Now u can see the checkbox in the output once you select it will automatically flag in your internal table.and using the USer-command u can play around.
I have pasted a entire coding here pls check the flow.
REPORT Z_TIME_SHEET_REPT.
TABLES
Tables : ztmsh, "Time Sheet Header
ztmsd, "Time Sheet Data
zempy. "Employee
Data Definations
Internal Table for Employee input data
Data : begin of i_employee occurs 0,
vbeln like ztmsh-vbeln, "Sales and Distribution Document Number
deprt like ztmsh-deprt, "Department
tmsdt like ztmsh-tmsdt, "Date
jbcpl like ztmsh-jbcpl, "Job Complete
empid like zempy-empid, "Employee ID
empnam(50) type c , "Employee Name
nmltm like ztmsd-nmltm, "Normal Time
ovrtm like ztmsd-ovrtm, "Over Time
meala like ztmsd-meala, "Meal Allowance
sitea like ztmsd-sitea, "Site Allowance($)
end of i_employee.
Internal Table For Department Input Data
Data : begin of i_department occurs 0,
vbeln like ztmsh-vbeln, "Sales and Distribution Document Number
deprt like ztmsh-deprt, "Department
tmsdt like ztmsh-tmsdt, "Date
jbcpl like ztmsh-jbcpl, "Job Complete
nmltm like ztmsd-nmltm, "Normal Time
ovrtm like ztmsd-ovrtm, "Over Time
hlftm like ztmsd-hlftm, "1.5 Time
dbltm like ztmsd-dbltm, "Double Time
meala like ztmsd-meala, "Meal Allowance
sitea like ztmsd-sitea, "Site Allowance($)
CHECKBOX(1) TYPE C,
end of i_department.
Temp Internal tablee for holding department values
Data : begin of i_t_dept occurs 0,
vbeln like ztmsh-vbeln, "Sales and Distribution Document Number
deprt like ztmsh-deprt, "Department
tmsdt like ztmsh-tmsdt, "Date
jbcpl like ztmsh-jbcpl, "Job Complete
nmltm like ztmsd-nmltm, "Normal Time
ovrtm like ztmsd-ovrtm, "Over Time
end of i_t_dept.
internal table for detailed data
data : begin of i_detail occurs 0 ,
vbeln like ztmsh-vbeln, "Sales and Distribution Document Number
deprt like ztmsh-deprt, "Department
tmsdt like ztmsh-tmsdt, "Date
jbcpl like ztmsh-jbcpl, "Job Complete
nmltm like ztmsd-nmltm, "Normal Time
ovrtm like ztmsd-ovrtm, "Over Time
cadsv like ztmsh-cadsv, "CAD Services
stsvy like ztmsh-stsvy, "SiteSurvey
cstdw like ztmsh-cstdw, "Construction Drawing
sppln like ztmsh-sppln, "Space Planning
dsndw like ztmsh-dsndw, "Design Drawings
drw3d like ztmsh-drw3d, "3D Drawings
dwplt like ztmsh-dwplt, "Drawing Plots
otamt like ztmsh-otamt, "Others
inact like ztmsh-inact, "In store Activity type
ictnq like ztmsh-ictnq, "In store Activity Quantity
inctn like ztmsh-inctn, "In store Activity Loading
mitim like ztmsh-mitim, "Movement Volume in Type
mivlm like ztmsh-mivlm, "Movement Volume in Loading
motim like ztmsh-motim, "Movement Volume Out Type
movlm like ztmsh-movlm, "Movement Volume Out Loading
outtm like ztmsh-outtm, "Out of Store Activity Type
outact like ztmsh-outact, "Out of Store Activity Loading
frklft like ztmsh-frklft, "Forklift
strpt like ztmsh-strpt, "Storage Protection
rbbsh like ztmsh-rbbsh, "Rubbish
crtes like ztmsh-crtes, "Crates
vhlhr like ztmsh-vhlhr, "Vechile
toll like ztmsh-toll, "Toll
park like ztmsh-park, "Parking
hrdwr like ztmsh-hrdwr, "Hardware
trlly like ztmsh-trlly, "# of Trollys
dolly like ztmsh-dolly, "# of Dollies
oepno like ztmsh-oepno, "# of Other Equipment
oteqp like ztmsh-oteqp, "Other Eqipment
end of i_detail.
ALV Field Catlog declaration
TYPE-POOLS : slis.
data : i_depart TYPE slis_t_fieldcat_alv,
i_emp TYPE slis_t_fieldcat_alv,
i_design TYPE slis_t_fieldcat_alv,
i_warehouse TYPE slis_t_fieldcat_alv,
i_transport TYPE slis_t_fieldcat_alv,
i_install TYPE slis_t_fieldcat_alv,
i_temp TYPE slis_fieldcat_alv,
l_layout TYPE slis_layout_alv.
Events
DATA: v_events TYPE slis_t_event,
wa_event TYPE slis_alv_event.
Tempary Variables
data: wa_nmltm type p decimals 2,
wa_ovrtm type p decimals 2,
wa_meala type p decimals 2,
wa_sitea type p decimals 2,
wa_HLFTM type p decimals 2,
wa_DBLTM type p decimals 2,
w_nmltm(5) type c,
w_ovrtm(5) type c,
w_meala(5) type c,
w_sitea(5) type c,
wa_first(25) type c,
wa_last(25) type c.
data : repid type sy-repid.
Selection Screen
*Select options
selection-screen begin of block blk1.
select-options : s_vbeln for ztmsh-vbeln,
s_tmsdt for ztmsh-tmsdt.
selection-screen end of block blk1.
Radio Buttons
selection-screen begin of block blk2 WITH FRAME TITLE TLT1.
Parameters: dept radiobutton GROUP SX,
emp radiobutton GROUP SX.
selection-screen end of block blk2.
Intialization
INITIALIZATION.
TLT1 = 'Time Sheet Summary Report'.
repid = sy-repid.
s_tmsdt-low = sy-datum.
s_tmsdt-high = sy-datum.
append s_tmsdt.
START-OF-SELECTION.
START-OF-SELECTION.
if dept = 'X'.
perform 100_time_sheet.
perform 200_build_field_catlog.
perform 400_ALV_Display.
elseif emp = 'X'.
perform 100_time_sheet.
perform 500_build_field_catlog.
Perform 600_ALV_display.
endif.
*& Form 100_time_sheet
text
FORM 100_time_sheet.
select * from ztmsh
where vbeln in s_vbeln
and tmsdt in s_tmsdt.
if ztmsh-vbeln ne space.
perform empl_calcuation .
if emp = 'X'.
clear i_employee.
elseif dept = 'X'.
clear i_department.
endif.
ENDIF.
endselect.
ENDFORM. " 100_time_sheet
*& Form 200_build_field_catlog
Department Wise Summary Report
FORM 200_build_field_catlog .
refresh i_depart.
i_temp-fieldname = 'CHECKBOX'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-col_pos = 1.
i_temp-fix_column = 'X'.
i_temp-CHECKBOX = 'X'.
i_temp-outputlen = 4.
i_temp-seltext_l = 'Flag'.
i_temp-input = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'VBELN'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'VBELN'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Work Order No'.
i_temp-col_pos = 2.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'DEPRT'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'DEPRT'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Department'.
i_temp-col_pos = 3.
i_temp-outputlen = 15.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'TMSDT'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'TMSDT'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Time Sheet Date'.
i_temp-col_pos = 4.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'JBCPL'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'JBCPL'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Time Sheet Status'.
i_temp-col_pos = 5.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'NMLTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'NMLTM'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Total NH'.
i_temp-col_pos = 6.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'OVRTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'OVRTM'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Total AH'.
i_temp-col_pos = 7.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'HLFTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'HLFTM'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Total 1.5 Time'.
i_temp-col_pos = 8.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'DBLTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'DBLTM'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Total 2.0 Time'.
i_temp-col_pos = 9.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'MEALA'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'MEALA'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Tot Meal Allowence'.
i_temp-col_pos = 10.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
i_temp-ref_fieldname = 'SITEA'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'SITEA'.
i_temp-tabname = 'I_DEPARTMENT'.
i_temp-seltext_l = 'Tot Site Allowence($)'.
i_temp-col_pos = 11.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_DEPART.
CLEAR i_temp.
ENDFORM. " 200_build_field_catlog
*& Form 300_populate_events
Top Of Page Events for Warehouse Report
FORM 300_populate_events .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = v_events.
READ TABLE v_events
INTO wa_event
WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY v_events
FROM wa_event TRANSPORTING form
WHERE name = wa_event-form.
endif.
ENDFORM. " 300_populate_events
*& Form 400_ALV_Display
Department ALV Display
FORM 400_ALV_Display .
sort i_department by vbeln deprt tmsdt.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = 'PO_STATUS '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME = 'i_department'
IS_LAYOUT = l_layout
IT_FIELDCAT = i_depart
IT_EVENTS = v_events
TABLES
T_OUTTAB = i_department
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " 400_ALV_Display
*& Form 500_build_field_catlog
Employee wise Summary Report
FORM 500_build_field_catlog .
refresh i_depart.
i_temp-ref_fieldname = 'VBELN'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'VBELN'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Work Order No'.
i_temp-col_pos = 1.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'DEPRT'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'DEPRT'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Department'.
i_temp-col_pos = 2.
i_temp-outputlen = 15.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'TMSDT'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'TMSDT'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Time Sheet Date'.
i_temp-col_pos = 3.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'JBCPL'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'JBCPL'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Time Sheet Status'.
i_temp-col_pos = 4.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'EMPID'.
i_temp-ref_tabname = 'ZEMPY'.
i_temp-fieldname = 'EMPID'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Employee ID'.
i_temp-col_pos = 5.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'JBCPL'.
i_temp-ref_tabname = 'ZTMSH'.
i_temp-fieldname = 'EMPNAM'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Employee Name'.
i_temp-col_pos = 6.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'NMLTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'NMLTM'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Total NH'.
i_temp-col_pos = 7.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'OVRTM'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'OVRTM'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Total AH'.
i_temp-col_pos = 8.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'MEALA'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'MEALA'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Tot Meal Allowence'.
i_temp-col_pos = 9.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
i_temp-ref_fieldname = 'SITEA'.
i_temp-ref_tabname = 'ZTMSD'.
i_temp-fieldname = 'SITEA'.
i_temp-tabname = 'I_EMPLOYEE'.
i_temp-seltext_l = 'Tot Site Allowence($)'.
i_temp-col_pos = 10.
i_temp-fix_column = 'X'.
APPEND i_temp TO i_emp.
CLEAR i_temp.
ENDFORM. " 500_build_field_catlog
*& Form 600_ALV_display
Employee Wise ALV Display
FORM 600_ALV_display .
sort i_employee by vbeln deprt tmsdt.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = 'PO_STATUS '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME = 'i_employee'
IS_LAYOUT = l_layout
IT_FIELDCAT = i_emp
IT_EVENTS = v_events
TABLES
T_OUTTAB = i_employee
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " 600_ALV_display
*& Form Po-Status.
FORM po_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZBUTTON' EXCLUDING rt_extab.
ENDFORM. "po_status
*& Form User_command.
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data : valid type i,
cnt like ztmsh-deprt.
clear i_department.
loop at i_department where CHECKBOX = 'X'.
on change of i_department-deprt.
if cnt ne space.
if valid ne 0.
message 'Please select same department' type 'I'.
valid = 2.
exit.
cnt = i_department-deprt.
endif.
endon.
valid = 1.
endloop.
if valid = 1.
case ucomm.
when 'DESIGN' .
perform transfer_table.
perform design_report.
perform des_build_field_catlog.
Perform design_ALV_display.
when 'WAREHOUSE'.
perform transfer_table.
perform design_report.
perform war_build_field_catlog.
perform 300_populate_events.
perform warehouse_ALV_display.
when 'TRANSPORT'.
perform transfer_table.
perform design_report.
perform tran_build_field_catlog.
perform top_of_page.
perform Transport_ALV_display.
when 'INSTALLAT'.
perform transfer_table.
perform design_report.
perform inst_build_field_catlog.
perform Install_ALV_display.
endcase.
elseif valid = 0.
message 'Please select a department' type 'I' .
endif.
endform. "user_command
*& Form empl_calcuation
Employee total hours calculation
FORM empl_calcuation .
data : w_hours(3) type C,
w_min(3) type c,
w_hours1(3) type c,
w_min1(3) type c,
w_hours2(3) type c,
w_min2(3) type c,
w_hours3(3) type c,
w_min3(3) type c,
w_hours4(3) type c,
w_min4(3) type c,
t_nmltm(5) type c,
t_ovrtm(5) type c,
t_meala(5) type c,
t_sitea(5) type c,
t_HLFTM(5) type c,
t_DBLTM(5) type c,
temp type i.
clear :wa_nmltm,
wa_ovrtm,
wa_meala,
wa_sitea,
wa_HLFTM,
wa_DBLTM.
To convert into Minutes
select * from ztmsd
where vbeln = ztmsh-vbeln
and tmsdt = ztmsh-tmsdt
and deprt = ztmsh-deprt.
*uncommenting the below code between the select and endselect will work
*for normal time scenario (eg: 2.55+3.55 =6.50) *
Normal Time
t_nmltm = ztmsd-nmltm.
SPLIT t_nmltm at '.' into w_hours w_min.
temp = w_hours.
w_hours = temp.
w_hours = w_hours * 60.
wa_nmltm = wa_nmltm + t_nmltm.
Over Time
t_ovrtm = ztmsd-ovrtm.
SPLIT t_ovrtm at '.' into w_hours1 w_min1.
temp = w_hours1.
w_hours1 = temp.
w_hours1 = w_hours1 * 60.
wa_ovrtm = wa_ovrtm + t_ovrtm.
Meal Allowence
t_meala = ztmsd-meala.
SPLIT t_meala at '.' into w_hours2 w_min2.
temp = w_hours2.
w_hours2 = temp.
w_hours2 = w_hours2 * 60.
wa_meala = wa_meala + t_meala .
Site Allowence
t_sitea = ztmsd-sitea.
wa_sitea = wa_sitea + t_sitea.
if dept = 'X'.
1.5 Time
t_HLFTM = ztmsd-HLFTM.
SPLIT t_HLFTM at '.' into w_hours3 w_min3.
temp = w_hours3.
w_hours3 = temp.
w_hours3 = w_hours3 * 60.
wa_HLFTM = wa_HLFTM + t_hlftm.
Double Time
t_DBLTM = ztmsd-DBLTM.
SPLIT t_DBLTM at '.' into w_hours4 w_min4.
temp = w_hours4.
w_hours4 = temp.
w_hours4 = w_hours4 * 60.
wa_DBLTM = wa_DBLTM + t_dbltm.
endif.
endselect.
if sy-subrc = 0.
uncommenting the below will work for normal time scenario
(eg: 2.55+3.55 =6.50)
and change in the appending coloum wa_ to t_
to convert into Hours
perform min_to_hrs_nmltm using wa_nmltm changing t_nmltm.
perform min_to_hrs_ovrtm using wa_ovrtm changing t_ovrtm.
perform min_to_hrs_meala using wa_meala changing t_meala.
perform min_to_hrs_sitea using wa_sitea changing t_sitea.
if emp = 'X'. "Report By Employee
Employee Id
select single empid deprt into ztmsd
from ztmsd
where vbeln = ztmsh-vbeln.
if sy-subrc = 0.
Employee Name
select single empye_f empye_l
into (wa_first,wa_last )
from zempy
where empid = ztmsd-empid.
if sy-subrc = 0 .
concatenate wa_first
wa_last
into i_employee-empnam.
Appending To internal Table
i_employee-empid = ztmsd-empid.
i_employee-deprt = ztmsh-deprt.
i_employee-nmltm = wa_nmltm.
i_employee-ovrtm = wa_ovrtm.
i_employee-meala = wa_meala.
i_employee-sitea = wa_sitea.
i_employee-vbeln = ztmsh-vbeln.
i_employee-tmsdt = ztmsh-tmsdt.
i_employee-jbcpl = ztmsh-jbcpl.
APPEND i_employee.
endif.
endif.
elseif dept = 'X'. "Report By Department
uncommenting the below will work for normal time scenario
(eg: 2.55+3.55 =6.50)
and change in the appending coloum wa_ to t_
perform min_to_hrs_HLFTM using wa_HLFTM changing t_HLFTM.
perform min_to_hrs_DBLTM using wa_DBLTM changing t_DBLTM.
Appending To internal Table
i_department-deprt = ztmsh-deprt.
i_department-nmltm = wa_nmltm.
i_department-ovrtm = wa_ovrtm.
i_department-meala = wa_meala.
i_department-sitea = wa_sitea.
i_department-vbeln = ztmsh-vbeln.
i_department-tmsdt = ztmsh-tmsdt.
i_department-jbcpl = ztmsh-jbcpl.
i_department-hlftm = t_hlftm.
i_department-dbltm = t_dbltm.
APPEND i_department.
endif.
endif.
ENDFORM. " empl_calcuation
*& Form min_to_hrs_nmltm
text
-->P_WA_NMLTM text
FORM min_to_hrs_nmltm USING P_WA_NMLTM
CHANGING P_T_nmltm.
data : hours(2) type c,
minutes_n(2) type c,
nmltm(10) type c.
if p_wa_nmltm >= 60.
hours = P_WA_NMLTM / 60.
endif.
minutes_n = P_WA_NMLTM MOD 60.
concatenate hours
minutes_n
into P_T_nmltm.
ENDFORM. " min_to_hrs_nmltm
*& Form min_to_hrs_ovrtm
text
FORM min_to_hrs_ovrtm USING P_WA_OVRTM
CHANGING P_T_OVRTM.
data : hours(2) type c,
minutes_n(2) type c.
if p_wa_ovrtm >= 60.
hours = P_WA_OVRTM / 60.
endif.
minutes_n = P_WA_OVRTM MOD 60.
concatenate hours
minutes_n
into P_T_OVRTM.
ENDFORM. " min_to_hrs_ovrtm
*& Form min_to_hrs_meala
FORM min_to_hrs_meala USING P_WA_meala
CHANGING P_T_MEALA.
data : hours(2) type c,
minutes_n(2) type c.
if p_wa_meala >= 60.
hours = P_WA_meala / 60.
endif.
minutes_n = P_WA_meala MOD 60.
concatenate hours
minutes_n
into P_T_meala.
ENDFORM. " min_to_hrs_meala
*& Form min_to_hrs_sitea
FORM min_to_hrs_sitea USING P_WA_sitea
CHANGING P_T_SITEA.
data : hours(2) type c,
minutes_n(2) type c.
if p_wa_sitea >= 60.
hours = P_WA_sitea / 60.
endif.
minutes_n = P_WA_sitea MOD 60.
concatenate hours
minutes_n
into P_T_sitea.
ENDFORM. " min_to_hrs_sitea
*& Form min_to_hrs_HLFTM
FORM min_to_hrs_HLFTM USING P_WA_HLFTM
CHANGING P_T_HLFTM.
data : hours(2) type c,
minutes_n(2) type c.
if p_wa_hlftm >= 60.
hours = P_WA_HLFTM / 60.
endif.
minutes_n = P_WA_HLFTM MOD 60.
concatenate hours
minutes_n
into P_T_HLFTM.
ENDFORM. " min_to_hrs_HLFTM
*& Form min_to_hrs_DBLTM
FORM min_to_hrs_DBLTM USING P_WA_DBLTM
CHANGING P_T_DBLTM.
data : hours(2) type c,
minutes_n(2) type c.
if p_wa_dbltm >= 60.
hours = P_WA_DBLTM / 60.
endif.
minutes_n = P_WA_DBLTM MOD 60.
concatenate hours
minutes_n
into P_T_DBLTM.
ENDFORM. " min_to_hrs_DBLTM
*& Form design_report
FORM design_report .
select * into corresponding fields of table i_detail
from ztmsh for all entries in i_t_dept
where vbeln = i_t_dept-vbeln
and deprt = i_t_dept-deprt
and tmsdt = i_t_dept-tmsdt .
loop at i_detail.
read table i_t_dept with key vbeln = i_detail-vbeln
deprt = i_detail-deprt
tmsdt = i_detail-tmsdt .
if sy-subrc = 0.
i_detail-nmltm = i_t_dept-nmltm.
i_detail-ovrtm = i_t_dept-ovrtm.
modify i_detail.
endif.
endloop.
ENDFORM. " design_report
*& Form transfer_table
Doin some operation using the checkbox
FORM transfer_table .
clear i_t_dept[].
loop at i_department where checkbox = 'X'.
move-corresponding : i_department to i_t_dept.
append i_t_dept.
endloop.
ENDFORM. " transfer_table
Regards,
karthik.
Edited by: karthikeyan sukumar on Jan 3, 2008 9:46 AM
Similar Messages
-
Guys,
Ive a problem with a ALV and checkboxs. i have one with column type checkbox, i need mark rows and take them afterward using a button (in ALV) but rows arent marked when i use button. i have seen that it only happend when i use double click in grid (alv).
How could i use only button after marked my rows ?????
Thankswa_fieldcat-edit = 'X'.
modify i_fieldcat from wa_fieldcat index sy-tabix.
* Form f_alv_edit_oruser *
* Form for display alv *
form f_alv_edit_oruser.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = i_fieldcat[]
is_layout = pt_grplayout2
i_callback_program = 'YSCCU0007'
i_callback_html_top_of_page = p_header
i_callback_user_command = v_user_command1
it_events = i_events[]
tables
t_outtab = i_yscchdr.
endform. " F_alv_edit_oruser
* Form f_user_command1 *
* This form will handle the user command from fm REUSE *
form f_user_command1 using p_ucomm type sy-ucomm
rs_selfield type slis_selfield.
data p_ref1 type ref to cl_gui_alv_grid. "<<<
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR' "<<<
importing "<<<
e_grid = p_ref1. "<<
call method p_ref1->check_changed_data. " <<<<
case p_ucomm.
when '&DATA_SAVE'.
endcase.
rs_selfield-refresh = c_x. " Grid refresh
endform. " F_user_command1 -
Hi everyone,
I created checkboxes in my ALV.
The problem is when I double click on a checkbox, I get a dump.
Here is the code.
REPORT ztestdfalv1 .
*Data Declaration
DATA: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekko.
DATA: BEGIN OF it_ekko OCCURS 0.
INCLUDE STRUCTURE t_ekko.
DATA: END OF it_ekko.
*ALV data declarations
TYPE-POOLS: slis. "ALV Declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form build_fieldcatalog
* text
FORM build_fieldcatalog.
REFRESH fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'Select'.
fieldcatalog-seltext_m = 'Select please'.
fieldcatalog-checkbox = 'X'.
fieldcatalog-edit = 'X'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-hotspot = 'X'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
"Permet d'ajuster les colonnes au text
* gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
* i_grid_title = 'My Title'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE:/ sy-subrc.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
* FORM SET_PF_STATUS *
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN1'.
ENDFORM. "set_pf_status
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
CHECK rs_selfield-tabindex > 0.
IF rs_selfield-value EQ '6000000001'.
CALL TRANSACTION 'ZDF2'.
ENDIF.
WHEN 'REFRESH'.
PERFORM data_retrieval.
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command
Here is the Dum.
This error may occur for any of the following reasons:
- You address a typed field symbol before it is set using ASSIGN
- You address a field symbol that points to a line in an internal table
that has been deleted
- You address a field symbol that had previously been reset using
UNASSIGN, or that pointed to a local field that no longer exists
- You address a global function interface parameter, even
though the relevant function module is not active,
that is it is not in the list of active calls. You can get the list
of active calls from the this short dump.
Thanks for the help !
Best Regards.Hi David,
First of all you need to have the field "SELECT" as part of the internal table that you pass to the fm REUSE_ALV_GRID_DISPLAY.
Here,
DATA: BEGIN OF t_ekko,
<b> select,</b>
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekko.
And then in your field catalog prepare logic, give the field name in BOLD,
FORM build_fieldcatalog.
REFRESH fieldcatalog.
CLEAR fieldcatalog.
<b> fieldcatalog-fieldname = 'SELECT'.</b>
fieldcatalog-seltext_m = 'Select please'.
Hope this helps..
Sri -
ALV and Checkbox : retrieving what we select
Hi everyone,
I created checkoxes in an ALV.
I am trying to retrieve what lines I selected from the ALV.
Thanks in advance.Hi everyone,
The scenario is :
I added a button (refresh) in the ALV. When I click on it I want to know which lines I selected via the checkboxes.
I am using normal ALV (no classes).
If I click on my refresh button my internal table has no flag = 'X'.
But if I click on a row (after selecting the checkbox) I do see the flag='X'.
So it works when I click on the row of the ALV but does not work if I click on the refresh button that I added.
Here is the code.
REPORT ztestdfalv1 .
*Data Declaration
DATA: BEGIN OF t_ekko,
select(1),
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
END OF t_ekko.
DATA: BEGIN OF it_ekko OCCURS 0.
INCLUDE STRUCTURE t_ekko.
DATA: END OF it_ekko.
*ALV data declarations
TYPE-POOLS: slis. "ALV Declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form build_fieldcatalog
* text
FORM build_fieldcatalog.
REFRESH fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'SELECT'.
fieldcatalog-seltext_m = 'Select please'.
fieldcatalog-checkbox = 'X'.
fieldcatalog-edit = 'X'.
fieldcatalog-input = 'X'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-hotspot = 'X'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
"Permet d'ajuster les colonnes au text
* gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-box_fieldname = 'SELECT'.
* gd_layout-box_tabname = 'IT_EKKO'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
* i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
* i_grid_title = 'My Title'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE:/ sy-subrc.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
* FORM SET_PF_STATUS *
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN1'.
ENDFORM. "set_pf_status
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
CHECK rs_selfield-tabindex > 0.
IF rs_selfield-value EQ '6000000001'.
CALL TRANSACTION 'ZDF2'.
ENDIF.
WHEN 'REFRESH'.
LOOP AT it_ekko WHERE select = 'X'.
ENDLOOP.
PERFORM data_retrieval.
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command
Thanks.
Message was edited by: David Fryda -
Is it possible to have sorting by group and checkboxes in the same ALV
Hi there,
Does anyone know whether it is possible to have sorting and group on one field in ALV and checkboxes set on another field in ALV?
eg.
Fieldname
===========
Name----
Text
Allowance----
Numeric -> Sort & Group
Verified----
Checkbox
How do I code it if it is possible to have grouping and check box all in one ALV. Meaning I want some data that are the same to merge using sort, while still having the checkbox available for my other field (Verified).
Thanks in advance.
Lawrencehi,
GROUP BY clause is used on database tables with select statement.
sort is used on internal tables.
can u clearly explain y u need group by and sort on the same field.
if u are extracting from dbtable using grou by clause on a field, then no need to sort it again.
if u want sort u can do it by giveing "sort itab by field". thats not a problem.
now coming to check box.instead of using SLIS type field catalog, u use LVC type.
in LVC_S_LAYO, u can fine box_fname.
while defining layout, u declare a variable of type LVC_S_LAYO
AND GIVE BOX_FNAME = internal table field name -
Webdynpro ALV checkbox displays 'X'
Hello Webdynpro Champions,
I have an issue with displaying ALV output in Webdynpro.
I have a checkbox as my first column.
This checkbox is bound to a context node.
When I check this checkbox, in the ALV output I get 'X' displayed in the output. I think this is unwanted in my case and hence will like to curb it and not display that X next to my checkbox in the ALV output.
Any ideas how to disable that X from gettting displayed in the ALV output?Hello,
This one can you can solve by removing this (or smilar) method call from the place where you setup your ALV layout:
lrc_checkbox->set_text_fieldname( 'CBXCOLNAME' ).
As you probably have this call in your coding (copy&paste from different cell editor example? ), you will see column's text (autoo-mapped to content) next to your checkbox.
Best regards,
Marcin -
What is the difference between list display and grid display in alv report
Hai genious
i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me what is the main difference between list display and grid display in alv report
thanks®ards
chinnuHi ,
1. For all practical purposes, they are the same.
2. Some differences:
a) from abap coding point of view,
alv list is done with Function modules,
alv gris can also be done with FM,
but can also be done using OO concepts.
b) Alv grid (using oo concept) requires
designing the screen layout .
Hence, in one screen, we can show more
then one alv grid
(we cannot show more than
one alv list on one screen)
c) ALV grid uses ActiveX controls
present on the Presentation Server.
Hence, it consumes More Memory
on the presentation server.
d) ALV LIST is Display Only.
Whereas
ALV Grid Can Be made EDITABLE for entry purpose.
e) In alv grid, these options are possible,
but not in alv list.
without horizontal lines
without vertical lines
without cell merging during sorts
display total lines above the entries
I hope it helps.
Regards,
Mamta
Edited by: Mamta Verma on Nov 27, 2008 6:41 AM -
ALV report which displays Delivery and Invoice details..by linking vbfa.
Hi...
I wants to develop an ALV Report, which displays Delivery details as well as Invoice details for a range of given sale orders.
For this report I am using Tables : VBAK,VBAP,LIKP,LIPS,VBFA tables .
Here VBFA is a table for Document flow how to link this with report ??
Please reply.
Regards ,
ASHOK
Moderator message : Not enough re-search before posting, spec dumping not allowed. Thread locked.
Edited by: Vinod Kumar on Aug 1, 2011 9:58 AMVBFA has VBELV and POSNV can be used to map VBAP (sales order item) i.e.
VBFA-VBELV = VBAP-VBELN AND
VBFA-POSNV = VBAP-POSNV
with VBTYP_N = J Values available in VBFA-VBELN and VBFA-POSNN will be LIPS -VBELN and LIPS-POSNR
VBTYP_N/ VBTYP_V = J stands for delivery and C stands for order
Nitesh -
ALV: how to display only subtotals and total rows in the output
ALV: how to display only subtotals and total rows in the output
i am getting output
i am getting subtotals for respective fields
but i want to display only subtotals and totals rows in the output
i have tried the
totals_only parameter in slis_layout_alv
but it is not working.hi,
For TOTAL
For the amount field / quantity field in the field catalog give DO_SUM = 'X' for WHOLE total
For SUBTOTAL
For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
DATA: lt_sort type SLIS_T_SORTINFO_ALV,
ls_sort type slis_sortinfo_alv.
CLEAR ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'Give the field name that you do the sum'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO lt_sort.
fieldcatalog-do_dum = 'X'.
for subtotals
WA_SORT-FIELDNAME = 'ERSDA'.
WA_SORT-SPOS = '2'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOTAL = 'X'.
APPEND WA_SORT TO IT_SORT.
Refer
http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
regards,
Prabhu
reward if it is helpful -
Hi experts, how are you.
What is the difference between ALV Grid Display and ALV List Display?ALV LIST Can be coded using only FMs
ALV GRID Can be coded using FMs and object oriented concepts
ALV LIST Can be displayed hieraicharlly
ALV GRID cannot be displayed hierarichally
ALV grid uses ActiveX controls
present on the Presentation Server.
Hence, it consumes More Memory
on the presentation server.
ALV LIST is Display Only.
Whereas
ALV Grid Can Be made EDITABLE for entry purpose.
In alv grid, these options are possible,
but not in alv list.
without horizontal lines
without vertical lines
without cell merging during sorts
display total lines above the entries
Thanks
Seshu -
How to display table data without using ALV and table element.
Hi,
Its possible to display table data without using ALV and table element.
Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
(every time i am fetching single row data ),
But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
settings and header data etc..things.
Give solution to display data part..
Regards,
Rakhi.Hi,
Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
* Standard Filter Function setting to FALSE
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
* Standard Filter Function setting to FALSE Ends
Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
Hope this answers your query.
Thanks.
Kumar Saurav. -
Which are the standard classes for events in ALV and explain each class pls
which are the standard classes for events in ALV and explain each class pls
POINTS WILL BE AWARDED,
REGARDS,
jagrut bharatkumar Shuklahi,
some links.
www.sapgenie.com
www.abap4u.com
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
download the PDF from following link.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
programs as detailed below:
BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
The report checks the input value(s) semantically and provides protocol messages in case of error
BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
implement the saving of the new data.
BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
(1) how to define a column for editable checkboxes for an attribute of your list
(2) how to evaluate the checked checkboxes
(3) how to switch between editable and non-editable checkboxes
BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
Grid Control.
BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
are dealt with:
(1) how to replace the standard f4 help
(2) how to pass the selected value to the ALV Grid Control
(3) how to build an f4 help, whose value range depend on a value of another cell.
Rgds
Anversha -
What are the function modules used in interactive ALV and parameters?
what are the function modules used in interactive ALV and parameters?
hi sunil
check these links,
About ALV:
http://www.geocities.com/mpioud/Abap_programs.html
ALV Group Heading
http://www.sap-img.com/fu037.htm
and few more,
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
also run the folowing code and see
check this sample code.you will be well versed with all the events of a interactive alv report.mark points if useful.
*& Report ZALV4_INTERACTIVE *
*& interactive alvs *
REPORT ZALV4_INTERACTIVE NO STANDARD PAGE HEADING
MESSAGE-ID ZMSG
LINE-COUNT 37(3)
LINE-SIZE 134.
TYPE-POOLS : SLIS.
TABLES DECLARATION ********************
TABLES : VBRK, " BILLING MASTERS TABLE
VBRP. " BILLING ITEM TABLE
TYPES DECLARATION ********************
TYPES : BEGIN OF TY_VBRK, " types for billing masters table
VBELN TYPE VBRK-VBELN, " billing document
WAERK TYPE VBRK-WAERK, " document currency
VKORG TYPE VBRK-VKORG, " sales organization
FKDAT TYPE VBRK-FKDAT, " billing date
BUKRS TYPE VBRK-BUKRS, " company code
BUTXT TYPE T001-BUTXT, " company name
NETWR TYPE VBRK-NETWR, " net currency value
LINE_COLOR(4) TYPE C,
END OF TY_VBRK.
TYPES : BEGIN OF TY_VBRP, " types for billing document item data
POSNR TYPE VBRP-POSNR, " billing item
FKIMG TYPE VBRP-FKIMG, " actual invoiced quantitty
VRKME TYPE VBRP-VRKME, " sales unit
NETWR TYPE VBRP-NETWR, " net currency value
MATNR TYPE VBRP-MATNR, " material number
ARKTX TYPE VBRP-ARKTX, " short text for sales order item
END OF TY_VBRP.
FIELD CATALOG ********************
DATA : WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
LAYOUT DECLARATION ********************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
EVENTS DECLARATION ********************
DATA : TY_EVENTS TYPE SLIS_ALV_EVENT,
IT_EVENTS TYPE SLIS_T_EVENT.
PF STATUS ********************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
USER COMMAND ********************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
INTERNAL TABLES ********************
DATA : IT_VBRK TYPE TABLE OF TY_VBRK, "internal table for billing master
IT_VBRP TYPE TABLE OF TY_VBRP, "internal table for billing item
*internal table for field catalog
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
WORK AREA ********************
DATA : WA_VBRK LIKE LINE OF IT_VBRK, "work area for billing master
WA_VBRP LIKE LINE OF IT_VBRP. "work area for billing item
VARIABLE DECLARATION ********************
DATA : V_DATE TYPE SY-DATUM, " variable to store date values
V_VBELN TYPE VBRK-VBELN, " variable for billing document
V_FKDAT TYPE VBRK-FKDAT, " variable for billing date
V_FLAG(1). " variable for flag
SELECTION SCREEN ********************
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN , " Billing document
S_FKDAT FOR VBRK-FKDAT, " Billing date
S_MATNR FOR VBRP-MATNR. " Material number
PARAMETERS : R1 RADIOBUTTON GROUP G1, "whole item details
R2 RADIOBUTTON GROUP G1. "selected item details
INITIALIZATION ********************
INITIALIZATION.
V_FLAG = 'X'.
V_DATE = SY-DATUM - 20.
S_FKDAT-SIGN = 'I'.
S_FKDAT-OPTION = 'EQ'.
S_FKDAT-LOW = V_DATE.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
SELECTION SCREEN VALIDATION ********************
AT SELECTION-SCREEN.
PERFORM CONVERSION. " performs data conversion for input
PERFORM VBELN_VALIDATE. " validating the billing document
PERFORM FKDAT_VALIDATE. " validating the billing date
START OF SELECTION ********************
START-OF-SELECTION.
SET TITLEBAR 'AAAA'.
PERFORM VBRK_POPULATE. " populating the billing master detais
PERFORM FIELDCATALOG. " designing the field catalog
PERFORM EVENTS. " performing the events for top of page
PERFORM DISP_BASICLIST." displaying the basic list
*& Form VBELN_VALIDATE
text validating the billing document
--> p1 text
<-- p2 text
FORM VBELN_VALIDATE .
IF S_VBELN IS INITIAL.
MESSAGE E000 WITH 'Make entries in all required fields'.
ELSE.
SELECT SINGLE VBELN
FROM VBRK
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'BILLING DOCUMENT DOESNT EXIST'.
ENDIF.
ENDIF.
ENDFORM. " VBELN_VALIDATE
*& Form FKDAT_VALIDATE
text validating the billing date
--> p1 text
<-- p2 text
FORM FKDAT_VALIDATE .
SELECT SINGLE FKDAT
FROM VBRK
INTO V_FKDAT
WHERE FKDAT IN S_FKDAT.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'BILLING DATE DOESNT EXIST'.
ENDIF.
ENDFORM. " FKDAT_VALIDATE
*& Form VBRK_POPULATE
text populating the billing master details
--> p1 text
<-- p2 text
FORM VBRK_POPULATE .
DATA : LD_COLOR(1) TYPE C.
LD_COLOR = 5.
SELECT VBRK~VBELN
VBRK~WAERK
VBRK~VKORG
VBRK~FKDAT
VBRK~BUKRS
VBRK~NETWR
T001~BUTXT
FROM VBRK INNER JOIN T001
ON VBRKBUKRS = T001BUKRS
INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
WHERE VBRK~VBELN IN S_VBELN AND
VBRK~FKDAT IN S_FKDAT.
LOOP AT IT_VBRK INTO WA_VBRK.
LD_COLOR = LD_COLOR + 1.
IF LD_COLOR = 8.
LD_COLOR = 1.
ENDIF.
CONCATENATE 'C' LD_COLOR '10' INTO WA_VBRK-LINE_COLOR.
MODIFY IT_VBRK FROM WA_VBRK.
ENDLOOP.
ENDFORM. " VBRK_POPULATE
*& Form CONVERSION
text data conversion to take leading zeroes into account
--> p1 text
<-- p2 text
FORM CONVERSION .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = S_VBELN
IMPORTING
OUTPUT = S_VBELN.
ENDFORM. " CONVERSION
*& Form DISP_BASICLIST
text displaying the basic list
--> p1 text
<-- p2 text
FORM DISP_BASICLIST .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT =
IT_EVENTS = 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_VBRK
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISP_BASICLIST
*& Form FIELDCATALOG
text designing the field catalog
--> p1 text
<-- p2 text
FORM FIELDCATALOG .
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-SELTEXT_L = 'BILLING DOCUMENT'.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-EMPHASIZE = 'C610'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'WAERK'.
WA_FIELDCAT-SELTEXT_L = 'DOCUMENT CURRENCY'.
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'VKORG'.
WA_FIELDCAT-SELTEXT_L = 'SALES ORGANIZATION'.
WA_FIELDCAT-EMPHASIZE = 'C610'.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'FKDAT'.
WA_FIELDCAT-SELTEXT_L = 'BILLING DATE'.
WA_FIELDCAT-COL_POS = 4.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_L = 'COMPANY CODE'.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'BUTXT'.
WA_FIELDCAT-SELTEXT_L = 'COMPANY NAME'.
WA_FIELDCAT-COL_POS = 6.
WA_FIELDCAT-OUTPUTLEN = 25.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'NETWR'.
WA_FIELDCAT-SELTEXT_L = 'NET CURRENCY VALUE'.
WA_FIELDCAT-COL_POS = 7.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
ENDFORM. " FIELDCATALOG
*& Form SET_PF_STATUS
text set the pf status
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'Z50658_PFSTATUS' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text set the user command
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'CLICK'.
IF R1 = 'X'.
IF NOT IT_VBRK IS INITIAL.
SELECT POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO CORRESPONDING FIELDS OF TABLE IT_VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN = IT_VBRK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH ' NO BILLING DETAILS FOUND'.
ELSE.
IF V_FLAG = 'X'.
PERFORM DET_FIELDCATALOG.
V_FLAG = ''.
ENDIF.
PERFORM DET_LISTDISPLAY.
ENDIF.
ENDIF.
ENDIF.
IF R2 = 'X'.
READ TABLE IT_VBRK INTO WA_VBRK INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO CORRESPONDING FIELDS OF WA_VBRP
WHERE VBELN = WA_VBRK-VBELN.
ENDIF.
APPEND WA_VBRP TO IT_VBRP.
ENDIF.
IF V_FLAG = 'X'.
PERFORM DET_FIELDCATALOG. "designing the field catalog for items
V_FLAG = ''.
ENDIF.
PERFORM DET_LISTDISPLAY. "displaying the secondary list
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'UP'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
CALL TRANSACTION 'SE38'.
ENDCASE.
ENDFORM. "SET_USER_COMMAND
*& Form DET_FIELDCATALOG
text designing the field catalog for item details
--> p1 text
<-- p2 text
FORM DET_FIELDCATALOG .
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'POSNR'.
WA_FIELDCAT1-SELTEXT_L = 'BILLING ITEM'.
WA_FIELDCAT1-COL_POS = 1.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'FKIMG'.
WA_FIELDCAT1-SELTEXT_L = 'INVOICE QUANTITY'.
WA_FIELDCAT1-COL_POS = 2.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'VRKME'.
WA_FIELDCAT1-SELTEXT_L = 'SALES UNIT'.
WA_FIELDCAT1-COL_POS = 3.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'NETWR'.
WA_FIELDCAT1-SELTEXT_L = 'NET CURRENCY VALUE'.
WA_FIELDCAT1-COL_POS = 4.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'MATNR'.
WA_FIELDCAT1-SELTEXT_L = 'MATERIAL NUMBER'.
WA_FIELDCAT1-COL_POS = 5.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'ARKTX'.
WA_FIELDCAT1-SELTEXT_L = 'SALES ORDER ITEM'.
WA_FIELDCAT1-COL_POS = 6.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_LAYOUT1-ZEBRA = 'X'.
ENDFORM. " DET_FIELDCATALOG
*& Form DET_LISTDISPLAY
text displaying the secondary list
--> p1 text
<-- p2 text
FORM DET_LISTDISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT1
IT_FIELDCAT = IT_FIELDCAT1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = 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_VBRP
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.
CLEAR IT_VBRP[].
ENDFORM. " DET_LISTDISPLAY
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR TY_EVENTS.
TY_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
TY_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND TY_EVENTS TO IT_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
SKIP.
ULINE.
WRITE :/2 ' DATE :', SY-DATUM,
45 'INTELLIGROUP ASIA PVT LTD',
110 'TIME :', SY-UZEIT.
WRITE : /3 'USER :', SY-UNAME,
45 'TITLE :', SY-TITLE,
110 'PAGE :', SY-PAGNO.
ULINE.
SKIP.
ENDFORM. "TOP_OF_PAGE
Cheers
navjot
Reward with points if it is helpful
Message was edited by:
navjot sharma -
ALV not getting displayed in a view
Hi,
I've created a webdynpro application, in which I'm using ALV's in a view. The view is called through another view on the click of a push button.
The application works perfectly fine for the first time i.e. I get proper ALV in my view after I click on the required button. But when I close my view (one with ALV) and then click on the button again to launch this view, then I dont see the ALV in the view. However the other elements like dropdowns etc are perfectly visible in this case as well.
To see the ALV's I have to refresh the application and start afresh, then only its visible. Does anyone have some inputs regarding this?
thanks & Regards,
Vipul.hi ,
for ur view in which u r displaying the ALV in tht ..
Change the Lifetime property of view into when visible instead of framework controlled under views' property.
regards,
amit -
Values from alv hierarchical list display
hi all,
i need to display sme values from vbak and vbap tables in ALV hierarchical list display.if i click on the sales order of the header, it should directly go to the second screen of transaction VA03 with the sales details displayed..
i got the parameter id, how can i assign the selected sales order value to this parameter id?...
regards,
Hamsa PriyaHi,
Check this example..Marked in bold..
TYPE-POOLS: slis.
DATA: BEGIN OF itab OCCURS 0,
vbeln TYPE vbeln,
expand,
END OF itab.
DATA: BEGIN OF itab1 OCCURS 0,
vbeln TYPE vbeln,
posnr TYPE posnr,
matnr TYPE matnr,
netpr TYPE netpr,
END OF itab1.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-outputlen = '12'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-outputlen = '12'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'POSNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'POSNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'MATNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'NETPR'.
s_fieldcatalog-do_sum = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
DATA: s_layout TYPE slis_layout_alv.
s_layout-subtotals_text = 'SUBTOTAL TEXT'.
s_layout-key_hotspot = 'X'.
s_layout-expand_fieldname = 'EXPAND'.
SELECT vbeln UP TO 100 ROWS
FROM
vbak
INTO TABLE itab
WHERE vbeln > '0060000040'.
IF NOT itab[] IS INITIAL.
SELECT vbeln posnr matnr netpr
FROM vbap
INTO TABLE itab1
FOR ALL ENTRIES IN itab
WHERE vbeln = itab-vbeln.
ENDIF.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
DATA: s_keyinfo TYPE slis_keyinfo_alv.
s_keyinfo-header01 = 'VBELN'.
s_keyinfo-item01 = 'VBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
<b> i_callback_user_command = 'USER_COMMAND'</b>
is_layout = s_layout
it_fieldcat = t_fieldcatalog
i_tabname_header = 'ITAB'
i_tabname_item = 'ITAB1'
is_keyinfo = s_keyinfo
TABLES
t_outtab_header = itab
t_outtab_item = itab1
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.
<b>FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
IF ucomm = '&IC1' AND selfield-fieldname = 'VBELN'.
READ TABLE itab INDEX selfield-tabindex.
IF sy-subrc = 0.
document
SET PARAMETER ID 'AUN' FIELD itab-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDFORM.</b>
Thanks,
Naren
Maybe you are looking for
-
Was not able to use my geeksquad warrenty on my Phone.
When I bought IPhone for myself and my wife I decided to purchase the geek squad insurance. The Best Buy employee who sold us the phones did not say anything about the insurance lasting 2 years, so I was under the impression that the insurance was g
-
I cant seem to get iphoto to work
HI i needed to download i photo but i cant seem to open in after downloading the i photo library
-
Outgoing Payment in FICA( Cash & Bank)
Hi All, Can anyone give idea about the above subjects. Since i know how to post incoming payments. In case if the customer paid overpayment or payment of security deposits. Could anyone please give procedure with T.Code for this. Thanks for your help
-
Can't find com.apple.desktop.plist file in Preferences folder.
I have three desktop spaces, and I have them randomly changing backgroud from a selection of pictures in a folder. To quickly find out which picture was currently use for each desktop, I have a AppleScript that returns some infomation within the com.
-
CS3/CS4/CS5 Win/Mac: How can I convert a Windows string to mac?
Hi I have a Windows coded string. I like to convert this string into a Macintosh string. This means several characters are changed, e.g. ä, ö or ü. Is there a method in the Indesign SDK? How can I convert a windows string into a macintosh string and