0% found this document useful (0 votes)
97 views

Chapter 08 - Multiple Line Selection

Chapter 08_Multiple Line Selection

Uploaded by

bakkali_bilal
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Chapter 08 - Multiple Line Selection

Chapter 08_Multiple Line Selection

Uploaded by

bakkali_bilal
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

IBM Global Business Services

Multiple Line Selection

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Objectives
The participants will be able to :
Write check boxes in the screen.
Providing additional information on single record on the screen.
Use READ-LINE statement with SY-INDEX.

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Providing Additional Information on a Single Record Only


First the user double-clicks on a
record.

Then a drill down list is created


showing data relevant to the record
initially selected by the user.

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Providing Additional Information on Multiple Records


First, the user clicks inside of the
checkboxes for the vendors that
the user is interested in.
Then a drill down window
appears that contains the
telephone numbers for each of
the previously selected vendors.

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Challenges
First we must learn techniques to
draw checkboxes on the screen.

Then we must learn techniques to loop through each of the lines on the
report and determine whether or not they were checked.
READ LINE 1.. checked? YES

or NO

READ LINE 2.. checked? YES

or NO

READ LINE 3 .. checked? YES or NO


READ LINE n .. checked? YES

Multiple Line Selection |

Dec-2008

or NO

IBM Corporation 2013

IBM Global Business Services

Coding Example : Writing Checkboxes to the Screen

REPORT Y190XX03 LINE-SIZE 255.


DATA: WA_LFA1 TYPE LFA1.
DATA: CHK1 TYPE C.

SELECT *
Create a single-character
variable.

START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1 WHERE TELF1 <> SPACE.
WRITE: / CHK1 AS CHECKBOX,
WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.
SKIP.
Then WRITE it to the
ENDSELECT.
report as a checkbox.
CHECK
SY-SUBRC

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

The READ LINE Statement


Programmatically Reading a Line in a Report

MEMORY
VAR1 = VEND021

READ LINE 11 FIELD VALUE WA_LFA1-LIFNR INTO VAR1.

A New
ABAP
Reserved Word
SYNTAX: READ LINE <#>.

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

The SY-INDEX System Field


Looping through Each of the Lines in the Report
READ LINE SY-INDEX FIELD VALUE WA_LFA1-LIFNR INTO VAR1.

READ LINE 1
READ LINE 2
A New
ABAP
System Field

READ LINE 3
READ LINE n

SYSTEM FIELD: SY-INDEX


8

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

The READ LINE Statement


REPORT Y190XX03 LINE-SIZE 255.
DATA:WA_LFA1 TYPE LFA1.
DATA: CHK1 TYPE C.
SELECT *

CHECK
SY-SUBRC

Write this code.


START-OF-SELECTION.
SELECT * FROM LFA1 INTO WA_LFA1 WHERE TELF1 <> SPACE.
WRITE: / CHK1 AS CHECKBOX,
WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.
HIDE: WA_LFA1-NAME1, WA_LFA1-TELF1.
SKIP.
ENDSELECT.

This code continues on the next page.

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Coding Example : The READ LINE Statement


READ LINE 1
READ LINE 2
READ LINE 3
READ LINE n

..checked? YES

or NO

.. checked? YES

or NO

.. checked? YES

or NO

.. checked? YES

10

AT PF06.
WINDOW STARTING AT 10 4 ENDING AT 77 12.
DO.
CLEAR CHK1.
READ LINE SY-INDEX FIELD VALUE CHK1.
IF SY-SUBRC <> 0.
EXIT.
ELSE.
CHECK CHK1 = X.
WRITE: / WA_LFA1-NAME1, WA_LFA1-TELF1.
ENDIF.
ENDDO.

or NO

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

The MODIFY LINE Statement


First the user clicks on the vendors
of interest.

Then the user presses the


F6 key on the keyboard.

When the user has finished reading the


data in the drill down window, he/she
returns to the initial screen to find that
it has been modified to show the records
that have already been selected.

11

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Coding Example : The MODIFY LINE Statement

REPORT Y190XX03 LINE-SIZE 255.


DATA:WA_LFA1 TYPE LFA1.
DATA: CHK1 TYPE C.
DATA: WAS_USED TYPE C.

Add new code here and here.

SELECT * FROM LFA1 INTO WA_LFA1 WHERE


TELF1 <> SPACE.
WRITE: / CHK1 AS CHECKBOX, WAS_USED,
WA_LFA1-LIFNR, WA_LFA1-NAME1,WA_LFA1-ORT01.
HIDE: WA_LFA1-NAME1, WA_LFA1-TELF1.
SKIP.
CHECK
ENDSELECT.
SELECT *
SY-SUBRC

12

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Coding Example : The MODIFY LINE Statement


AT PF06.
WINDOW STARTING AT 10 4 ENDING AT 77 12.
DO.
CLEAR CHK1.
READ LINE SY-INDEX FIELD VALUE CHK1.
IF SY-SUBRC <> 0.
Add new code here.
EXIT.
ELSE.
CHECK CHK1 = X.
MODIFY CURRENT LINE:
FIELD VALUE WAS_USED FROM *,
FIELD VALUE CHK1 FROM SPACE,
FIELD FORMAT CHK1 INPUT OFF.
WRITE: / WA_LFA1-NAME1, WA_LFA1-TELF1.
ENDIF.
ENDDO.

13

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Demonstration
Writing checkboxes, use of READ LINE and MODIFY LINE statement

14

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Practice
Writing checkboxes, use of READ LINE and MODIFY LINE statement

15

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Summary
Checkboxes can be written to the list by using AS CHECKBOX addition with the
WRITE command.
READ LINE statement can be used to read the contents of a list. With this
statement, the contents of the line are populated in system field SY-LISEL.
MODIFY LINE statement can be used to modify the list even after it is displayed.
The format of the lines in the list can also be changed using MODIFY LINE ..
FORMAT addition.

16

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

IBM Global Business Services

Questions
How do you draw checkboxes in the output list ?
How to read the contents of a list ?
How do you modify the contents of a list after it is displayed ?

17

Multiple Line Selection |

Dec-2008

IBM Corporation 2013

You might also like