2014 Aug 22 10:17 AM
Hi experts,
I'm absolute new to ABAP and learning ABAP OO programming now.
Now I have checkbox in a block as below:
SELECTION-SCREEN BEGIN OF BLOCK mail_send WITH FRAME.
SELECTION-SCREEN begin of LINE.
PARAMETERS p_send AS CHECKBOX DEFAULT ' ' USER-COMMAND UC_SEND.
SELECTION-SCREEN COMMENT 4(55) text-002.
SELECTION-SCREEN end of LINE.
SELECTION-SCREEN END OF BLOCK mail_send.
And in other class I have method send_mail.
How can I execute this method when the checkbox is marked?
Thanks and regards
Chistine
2014 Aug 22 10:43 AM
Hi Christine,
Just use a conditional statement. The value checkbox fields is 'X' when checked so you can use it compare its value. If its 'X' simply call your method.
Hi experts,
I'm absolute new to ABAP and learning ABAP OO programming now.
Now I have checkbox in a block as below:
SELECTION-SCREEN BEGIN OF BLOCK mail_send WITH FRAME.
SELECTION-SCREEN begin of LINE.
PARAMETERS p_send AS CHECKBOX DEFAULT ' ' USER-COMMAND UC_SEND.
SELECTION-SCREEN COMMENT 4(55) text-002.
SELECTION-SCREEN end of LINE.
SELECTION-SCREEN END OF BLOCK mail_send.
And in other class I have method send_mail.
How can I execute this method when the checkbox is marked?
Thanks and regards
Chistine
2014 Aug 22 10:30 AM
Hi,
In side method send_mail put condition like abap
If p_send = 'X'. (if check box selected)
--------------------
------------------
------------------
endif.
2014 Aug 22 10:44 AM
2014 Aug 22 10:43 AM
Hi Christine,
Just use a conditional statement. The value checkbox fields is 'X' when checked so you can use it compare its value. If its 'X' simply call your method.
2014 Aug 22 10:50 AM
Hi Shivam,
thanks.
It works.
but I must add the codes after the End-of-Selection. why?
2014 Aug 22 10:55 AM
Hello Christine,
The END-OF-SELECTION event is triggered in type executable programs once the logical database has finished reading all data and before the list processor is started.
It tells the server that all the database reading is completed and no further reading is going to take place..
2014 Aug 22 10:56 AM
Hi Christine,
do I get it right that you want to call the method as soon as the checkbox is ticked by the user (before the execution of the report)?
Then, you must use the following coding:
TABLES: sscrfields.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'UC_SEND'.
if p_send = 'X'.
* call your method here
endif.
ENDIF.
However, let me remark that this behaviour might be surprising for the user.
Regards,
Ulrich