At-events in lists usage

Source: Internet
Author: User

*&---------------------------------------------------------------------*
* & Report
* & Author: XiaoYu
*&---------------------------------------------------------------------*
* & Production date: 2009/08/03
* & Summary: At-events in lists
*&---------------------------------------------------------------------*

Report.

*&---------------------------------------------------------------------*
* & At line-selection
*&---------------------------------------------------------------------*

Data Text (20 ).

Start-of-selection.
Perform write_and_hide using space.

At line-selection.
Case text.
When 'list Index '.
Perform write_and_hide using 'X' space.
When 'user command '.
Perform write_and_hide using space 'x '.
When others.
Subtract 2 from SY-LSIND.
Perform write_and_hide using space.
Endcase.
Clear text.

Form write_and_hide using p_flag_lsind p_flag_ucomm.
Write/'sy-lsind :'.
Perform write_with_color using SY-LSIND p_flag_lsind.
TEXT = 'list Index '.
Hide text.
Write/'sy-ucomm :'.
Perform write_with_color using SY-UCOMM p_flag_ucomm.
TEXT = 'user command '.
Hide text.
If SY-LSIND> 0.
Write/'pick here to go back one list level '.
Endif.
Endform.

Form write_with_color using p_value
P_flag_positive.
If p_flag_positive = space.
Write p_value color col_normal.
Else.
Write p_value color col_positive.
Endif.
Endform.

*&---------------------------------------------------------------------*
* & Hide
*&---------------------------------------------------------------------*

Data: Square type I,
Cube type I.

Start-of-selection.
Format hotspot.
Do 10 times.
Square = sy-index ** 2.
Cube = sy-index ** 3.
Write/sy-index.
Hide: Square, cube.
Enddo.

At line-selection.
Write: Square, cube.

*&---------------------------------------------------------------------*
* & At user-command
*&---------------------------------------------------------------------*

Data: number1 type I value 20,
Number2 type I value 5,
Result type I.

Start-of-selection.
Write:/number1 ,'? ', Number2.

At user-command.
Case SY-UCOMM.
When 'add '.
Result = number1 + number2.
When 'subt '.
Result = number1-number2.
When 'mresult '.
Result = number1 * number2.
When 'divi '.
Result = number1/number2.
When others.
Write 'unknown function Code '.
Exit.
Endcase.
Write:/'result: ', result.

*&---------------------------------------------------------------------*
* & At PFN
*&---------------------------------------------------------------------*

Data number type SY-INDEX.

Start-of-selection.
Do 9 times.
Write:/'row', (2) SY-INDEX.
Number = SY-INDEX.
Hide number.
Enddo.

At pf8.
Check number is initial.
Write:/'cursor was in row', (2) number.
Clear number.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.