2008 Jan 29 9:37 AM
Hi experts,
I have an requirementI have to develop the interactive ALV report in that again I need to provide pushbutton, radio, check box in the basic list and secondary list.
Can you send me piece of code how to make push button functionality in the display screen.
Thanks in advance .
Regards,
Vijay
Edited by: vijay krishna on Jan 30, 2008 7:01 AM
2008 Jan 30 6:14 AM
REPORT ZSAN_WEEKDAY .
tables: mara.
selection-screen skip 1.
selection-screen begin of block block0 with frame title text-000.
selection-screen skip 1.
selection-screen begin of line.
selection-screen pushbutton 10(20) text-003 user-command engl.
selection-screen pushbutton 50(20) text-004 user-command germ.
selection-screen end of line.
selection-screen end of block block0.
Selection parameters
selection-screen skip 2.
selection-screen begin of block block1 with frame title text-001
no intervals.
selection-screen begin of line.
parameters: p_ex1 radiobutton group rad1 .
selection-screen comment 5(30) text-ex1.
selection-screen end of line.
parameters: p_jdate1 type d default sy-datum.
selection-screen skip 1.
selection-screen begin of line.
parameters: p_ex2 radiobutton group rad1 .
selection-screen comment 5(30) text-ex2.
selection-screen end of line.
select-options: s_jdate2 for mara-laeda.
selection-screen skip 1.
selection-screen begin of line.
parameters: p_ex3 radiobutton group rad1.
selection-screen comment 5(20) text-ex3.
selection-screen end of line.
parameters: p_jdate3 like mara-laeda.
selection-screen skip 1.
selection-screen begin of line.
parameters: p_ex4 radiobutton group rad1 .
selection-screen comment 5(30) text-ex4.
selection-screen end of line.
select-options: s_jdate4 for mara-laeda no-extension no intervals.
selection-screen end of block block1.
selection-screen skip.
selection-screen begin of block block2 with frame title text-002
no intervals.
selection-screen begin of line.
parameters: P_ex5 as checkbox.
selection-screen comment 5(30) text-ex5.
selection-screen end of line.
selection-screen skip.
selection-screen begin of line.
parameters: P_ex6 as checkbox.
selection-screen comment 5(30) text-ex6.
selection-screen end of line.
selection-screen skip.
selection-screen begin of line.
parameters: P_ex7 as checkbox.
selection-screen comment 5(30) text-ex7.
selection-screen end of line.
selection-screen end of block block2.
AT selection-screen.
AT selection-screen.
if ( p_ex1 = 'X' ) and
( ( p_jdate1 = 'IEQ?' ) or ( p_jdate1 is initial ) ).
message E017 with 'Selection Option with Default field has no value'.
elseif ( p_ex1 = 'X' ) and
not ( ( p_jdate1 = 'IEQ?' ) or ( p_jdate1 is initial ) ).
message I017 with 'We are now using Example 1'.
endif.
if ( p_ex2 = 'X' ) and
( ( s_jdate2 = 'IEQ?' ) or ( s_jdate2 is initial ) ).
message E017 with 'Selection Option using for field has no value'.
elseif ( p_ex2 = 'X' ) and
not ( ( s_jdate2 = 'IEQ?' ) or ( s_jdate2 is initial ) ).
message I017 with 'And now Example 2 is selected'.
endif.
if ( p_ex3 = 'X' ) and
( ( p_jdate3 = 'IEQ?' ) or ( p_jdate3 is initial ) ).
message E017 with 'Parameter w/ like statement field has no value'.
elseif ( p_ex3 = 'X' ) and
not ( ( p_jdate3 = 'IEQ?' ) or ( p_jdate3 is initial ) ).
message I017 with 'We are now using Example 3'.
endif.
if ( p_ex4 = 'X' ) and
( ( s_jdate4 = 'IEQ?' ) or ( s_jdate4 is initial ) ).
message E017 with 'Selection Option with no interval has no value'.
elseif ( p_ex4 = 'X' ) and
not ( ( s_jdate4 = 'IEQ?' ) or ( s_jdate4 is initial ) ).
message I017 with 'We are now using Example 4'.
endif.
if p_ex5 = 'X'.
perform get_price_data.
else.
message I017 with 'No Pricing Data selected'.
endif.
if p_ex6 = 'X'.
perform get_cost_data.
else.
message I017 with 'No Costing Data selected'.
endif.
if p_ex7 = 'X'.
perform get_revenue_data.
else.
message I017 with 'No Revenue Data selected'.
endif.
form get_cost_data.
...
endform.
form get_revenue_data.
...
endform.
form get_price_data.
...
endform.
2008 Jan 30 6:16 AM
HI,
For pushbutton:
You can put push button in the output list. You have to use SET PF-STATUS statement.
Just follow these stepts.
1. write SET PF-STATUS 'TEST'.
2. double click on TEST.
3. It will ask you to create status object. click on YES.
4. give the short description and press enter.
5. next screen you will find three things like... MENU BAR, APPLICATION TOOL BAR and FUNCTION KEYS.
6. click on the down arrow that appears next to APPLICATION TOOL BAR.
7. in the items, in first box write your name and press down the text. one popup box will come. press enter.
8. give the function text and press enter.
9. assign key for your push button. and press enter.
10. press enter and activate.
and run your program. you will get push button on output list.
Don't know about pushbuttons, but perhaps a good alternative: interactive lists with hotspots.
See:
http://www.erpgenie.com/abap/ireports.htm
http://abapprogramming.blogspot.com/2007/11/abap-multiple-interactive-report-sample_12.html
For checkboxes:
Check the following code...
DATA: BEGIN OF itab OCCURS 0,
check,
value(20),
END OF itab.
SET PF-STATUS 'TEST1'.
itab-value = 'ETSAT'.
APPEND itab.
itab-value = 'ETSATADSF'.
APPEND itab.
itab-value = 'ETSAT'.
APPEND itab.
LOOP AT itab.
WRITE: / itab-check AS CHECKBOX,
itab-value.
ENDLOOP.
AT USER-COMMAND.
DATA: wa LIKE itab.
DATA: itab_download LIKE itab OCCURS 0 WITH HEADER LINE.
IF sy-ucomm = 'DOWNLOAD'.
DESCRIBE TABLE itab.
DO sy-tfill TIMES.
READ LINE sy-index FIELD VALUE itab-check.
IF sy-subrc 0.
EXIT.
ENDIF.
CHECK itab-check = 'X'.
itab_download-value = itab-value.
APPEND itab_download.
ENDDO.
DOWNLOAD
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = 'C:\TEST.XLS '
TABLES
data_tab = itab_download.
ENDIF.
For radio button :
Declare parameter as RADIOBUTTON
like
Single radio button
PARAMETER p_purch RADIOBUTTON.
Two radio button with same group.
PARAMETER p_sales RADIOBUTTON GROUP opt.
PARAMETER p_purch RADIOBUTTON GROUP opt.
Reward Points if found helpfull..
Cheers,
Chandra Sekhar.
2008 Jan 30 6:17 AM
Hi ,
You cant disply push button and radi botton in the report output . If you want to have push button then then you can have them in application tool bar using GUI status. Otherwise need to go for module pool.
Regards,
Nageswar
2008 Jan 30 6:18 AM
Hi
Go through the following program. It contains around 2000 lines. Don't go through all the code. Just observe the functionality and code of the Radio Buttons, Check boxes and Push buttons in the selection screen.
SSCRFIELDS is a structure, it is used maintain pushbuttons in the selection screen or on the Application tool bar, up to 5 buttons we can maintain.
Go through the following program.
BCALV_TEST_FULLSCREEN_EVENTS
Reward me if it is useful.
2008 Jan 30 6:19 AM
Display Check box in output:
Declare a single CHAR field in the Output Internal table as a first field and display the checkbox in the output.
then in the USER COMMAND event after selecting the some of the check boxes in a DO...ENDDO loop read the SY-LISEL field and capture that record if the check box is checked and move all those records into another internal table
and delete them from the output list
Reward if useful.