Você está na página 1de 11

IBM Global Services

Providing Additional Information on a Single Record Only

First the user doubleclicks on a single record.

Then a drill down list is created which shows data that is relevant only to the single record selected by the user.

Slide 1

1.3.9 |

Copyright IBM Corporation 2003

IBM Global 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.

Slide 2

1.3.9 |

Copyright IBM Corporation 2003

IBM Global 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 READ LINE 2.. checked? YES

or NO or NO

READ LINE 3 .. checked? YES or NO READ LINE n .. checked? YES


Slide 3 1.3.9 |

or NO
Copyright IBM Corporation 2003

IBM Global Services

Coding Example Writing Checkboxes to the Screen

REPORT Y190XX03 LINE-SIZE 255. TABLES: LFA1. DATA: CHK1.

Create a single-character variable.

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

report as a checkbox.

Slide 4

1.3.9 |

Copyright IBM Corporation 2003

IBM Global Services

The READ LINE Statement


Programmatically Reading a Line in a Report

MEMORY VAR1 = VEND003

READ LINE 11 FIELD VALUE LFA1-LIFNR INTO VAR1.

SYNTAX: READ LINE <#>.


Slide 5 1.3.9 |

A New ABAP Reserved Word


Copyright IBM Corporation 2003

IBM Global Services

The SY-INDEX System Field


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

READ LINE 1
READ LINE 2

READ LINE 3
A New ABAP System Field SYSTEM FIELD: SY-INDEX
Slide 6 1.3.9 |
Copyright IBM Corporation 2003

READ LINE n

IBM Global Services

The READ LINE Statement

REPORT Y190XX03 LINE-SIZE 255. TABLES: LFA1. DATA: CHK1.

SELECT *

CHECK SY-SUBRC

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

This code continues on the next page.


Slide 7 1.3.9 |
Copyright IBM Corporation 2003

IBM Global Services

Coding Example The READ LINE Statement

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

..checked? YES .. checked? YES

or NO or NO

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: / LFA1-NAME1, LFA1-TELF1. ENDIF. ENDDO.

.. checked? YES
.. checked? YES
Slide 8 1.3.9 |

or NO
or NO
Copyright IBM Corporation 2003

IBM Global 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.
Slide 9 1.3.9 |
Copyright IBM Corporation 2003

IBM Global Services

Coding Example The MODIFY LINE Statement

REPORT Y190XX03 LINE-SIZE 255. TABLES: LFA1. DATA: CHK1. DATA: WAS_USED.

Add new code here and here.

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

CHECK SY-SUBRC

Slide 10

1.3.9 |

Copyright IBM Corporation 2003

IBM Global 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 * CHK1 FROM SPACE FIELD FORMAT CHK1 INPUT OFF. WRITE: / LFA1-NAME1, LFA1-TELF1. ENDIF. ENDDO.
Slide 11 1.3.9 |
Copyright IBM Corporation 2003

Você também pode gostar