Course - Sesion 2

Post on 07-Jul-2018

213 views 0 download

transcript

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 1/52

Lesson 4: Diálogos de UsuariosThis section describes the dialogs that you can use in ABAP to

communicate with program users. It explains how to pass data

between user dialogs and ABAP programs, how to define userdialogs within your programs, and how to process user input.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 2/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 3/52

A screen consists of the input/output mask and the flow logic. The screen flow logicis divided into the Process Before Output (PBO) event, which is processed before

the screen is displayed, and the Process After Input (PAI) event, which is processed

after a user action on the screen.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 4/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 5/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 6/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 7/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 8/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 9/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 10/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 11/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 12/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 13/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 14/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 15/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 16/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 17/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 18/52

Lesson 5: Técnicas para la Creación deListas

Lists provide a freely-definable area that you fill using the WRITE, ULINE;

and SKIP statements.

- Creating Simple Lists with the WRITE Statement.

- Creating Complex Lists

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 19/52

Creating Simple Lists with the WRITE Statement

The basic ABAP statement for displaying data on the screen is WRITE.

Syntax: WRITE <f>.

This statement writes field <f> to the current list in its standard output format. By

default, the list is displayed on the screen.

Field <f> can be:

- Any data object (see Data Objects)

- A field symbol

- A text symbol

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 20/52

WRITE 'Hello, here I am!'.

WRITE: 'COMPANY: ', spfli-carrid.

DATA number TYPE p VALUE '-1234567.89' DECIMALS 2.

WRITE: 'Number', number, 'is packed'.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 21/52

Positioning WRITE Output on the List

You can position the output of a WRITE statement on the list by making a format

specification before the field name as follows:

Syntax: WRITE AT [/][<pos>][(<len>)] <f>.

Where

- The slash '/' denotes a new line.

- pos> is a number or variable up to three digits long denoting the position on the

screen.

- <len> is a number or variable up to three digits long denoting the output length.

If the format specification contains only direct values (that is, no variables), you can

omit the keyword AT.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 22/52

WRITE 'First line.'.WRITE 'Still first line.'

WRITE / 'Second line.'

WRITE /13 'Third line.‘ 

First Line. Still first line.

Second line.Third line.

DATA: len TYPE i VALUE 10,

pos TYPE i VALUE 11,text(10) TYPE c VALUE '1234567890'

WRITE 'The text ------------ appears in the text.'.

WRITE AT pos(len) text.

The text -1234567890- appears in the text.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 23/52

WRITE AT /pos sy-vline.

|

ULINE AT /10(492).

 ___________________________________________________________

SKIP 2.  “The SKIP <n> statement creates <n> blank lines.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 24/52

Formatting Options 

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 25/52

Creating Complex Lists

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 26/52

REPORT demo_list_standard.

TABLES spfli.SKIP.

ULINE AT /(62).

SELECT * FROM spfli

WHERE connid GE 0017 AND

connid LE 0400.

WRITE: / sy-vline, spfli-connid, sy-vline,

(15) spfli-cityfrom, 26 sy-vline,

31 spfli-cityto, 51 sy-vline, 62 sy-vline,

/ sy-vline, 8 sy-vline,

spfli-deptime UNDER spfli-cityfrom, 26 sy-vline,

spfli-arrtime UNDER spfli-cityto, 51 sy-vline,spfli-fltime, 62 sy-vline.

ULINE AT /(62).

ENDSELECT.

WRITE: /10 'SAP *** SAP *** SAP *** SAP *** SAP *** SAP',

/19(43) 'Flight Information System',

/19(43) 'International Connections'.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 27/52

Determining the List Width

To determine the width of the output list, use the LINE-SIZE option of the

REPORT statement.

Syntax: REPORT <rep> LINE-SIZE <width>.

This statement determines the width of the output list of program <rep> as

<width> characters.

REPORT demo_list_line_size LINE-SIZE 40.

While creating the list, the system field SY-LINSZ contains the current line

width. To adapt the list width to the current window width 

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 28/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 29/52

Defining a Page Header and Footer

Syntax:

TOP-OF-PAGE.

WRITE: ....

Syntax:

END-OF-PAGE.

WRITE: ....

REPORT ZZZZZ NO STANDARD PAGE HEADING.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 30/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 31/52

Lesson 6: Open SQLThe ABAP Programming Language:

- It is especially designed for dialog-based business applications.

- Enables multi-language applications.

- Enables SQL access  –  OPEN SQL.

- Has been enhanced as an object-oriented language.

- Is platform-independent.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 32/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 33/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 34/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 35/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 36/52

Standard Types

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 37/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 38/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 39/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 40/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 41/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 42/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 43/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 44/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 45/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 46/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 47/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 48/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 49/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 50/52

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 51/52

FOR ALL ENTRIES Addition

SELECT .. FOR ALL ENTRIES was created in Open SQL at a time when it was not yet

possible to perform database JOINs (this was not supported for all SAP-approved DBMS).

Nowadays, this technique is often used when some data is already available in an

internal table but additional data is to be read from the database. In such cases, itreplaces a SELECT SINGLE statement inside a LOOP over the internal table and

normally shows a much better performance than such a loop.

8/19/2019 Course - Sesion 2

http://slidepdf.com/reader/full/course-sesion-2 52/52