ABAP Message, Debugging, File Transfer and Type Group
-
Upload
y-z-mercan -
Category
Education
-
view
11.254 -
download
4
description
Transcript of ABAP Message, Debugging, File Transfer and Type Group
![Page 1: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/1.jpg)
ABAP Chapter 6 Message Debugging File Transfer Type Group
![Page 2: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/2.jpg)
Message in ABAP
![Page 3: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/3.jpg)
User MessagesUser Messages
If user has entered inconsistent values,you output a dialog message with MESSAGE statement
Dialog messages are stored in table T100 (Transaction : SE91)
r eport ztest.
…. AT SELECTION-SCREEN. … m essage e000(38) with ‘----’ ‘---’ ‘---’ ‘---’ . …
![Page 4: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/4.jpg)
Message TypeMessage Type
SyntaxMessage [ A<nnn> ](message class) with <field1> <field2> …
E, W, I, S
![Page 5: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/5.jpg)
Messages Type - A(Abend)Messages Type - A(Abend)
Message A000(38)...
Program Start
SelectionScreen
A Message Exit
![Page 6: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/6.jpg)
Messages Type - E(Error)Messages Type - E(Error)
Message E000(38) ...
Program Start
SelectionScreen
E Message
New input
Require
![Page 7: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/7.jpg)
Messages Type - W(Warning)Messages Type - W(Warning)
Message W000(38)...
Program Start
SelectionScreen
W Message
New input
possible
List
Enter
![Page 8: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/8.jpg)
Messages Type - I(Information)Messages Type - I(Information)
Message I000(38)...
Program Start
SelectionScreen
I Message
List
Enter
![Page 9: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/9.jpg)
Messages Type - S(Success)Messages Type - S(Success)
Message S000(38)...
Program Start
SelectionScreen
List(Next Screen)
![Page 10: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/10.jpg)
Dynamic MessageDynamic Message
1Report ztest .PPPPPPPPPP today PPPP sy-datum.PP P -election screen. if today -PPPPPP<> . m essage e000(38) P‘ Please enter today : ’ sy-datum. .-PP-PPPPPPPPPP. : / ‘Today is :’, today.
![Page 11: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/11.jpg)
Debugging
![Page 12: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/12.jpg)
Debugging Mode Debugging Mode
![Page 13: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/13.jpg)
Debugging Mode : Internal Table Debugging Mode : Internal Table
![Page 14: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/14.jpg)
Debugging Mode : Internal Table Debugging Mode : Internal Table
![Page 15: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/15.jpg)
Debugging Mode : Watchpoint Debugging Mode : Watchpoint
![Page 16: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/16.jpg)
Watchpoint : SAP ECC 6.0 Watchpoint : SAP ECC 6.0
![Page 17: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/17.jpg)
How to Set Debugging ModeHow to Set Debugging Mode
If you want to test transaction,enter /h in the command field,press ENTER and execute the transaction
Set breakpoints in the program Utilities->Breakpoints->Set Uses BREAK-POINT statement
![Page 18: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/18.jpg)
ABAP Practice
![Page 19: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/19.jpg)
File Transfer
![Page 20: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/20.jpg)
File Transfer (Application Server)File Transfer (Application Server)
There are 3 steps for file transfer
Open FileRead/Write FileClose File
![Page 21: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/21.jpg)
File TransferFile Transfer
* Prepare Internal TableData all_customers like customers occurs 0 with header line.
50Data msg_txt( ). PPPPP(128) ‘ omersdata.xt PPPPP’ .Start-of-selection. Select * from customers into table all_customers.
![Page 22: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/22.jpg)
File TransferFile Transfer
PPPPPPP P PPPP* Open dataset filename for output in text mode
encoding default _. - PP <>0. : ‘ . : ’ , _.else.
![Page 23: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/23.jpg)
* Transferring data to a file Loop at all_customers. Transfer all_customers to filename. Endloop. * Closing a file Close dataset filename. Endif.
File TransferFile Transfer
![Page 24: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/24.jpg)
Transaction : AL11
![Page 25: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/25.jpg)
File Transfer (Appending Data)File Transfer (Appending Data)
PPPPPPP P PPPP*
Open dataset filename for appending PP PPPP PPPP encoding default _. - PP <>0. : ‘ . : ’ , _.else.
...
![Page 26: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/26.jpg)
Reading Data from OS FileReading Data from OS File
* Reading data from a file 128Parameters filename( ) default ‘customersdata.txt ’ lower case.
Data msg_txt(50). 0Data all_customers like customers occurs with header line.
Start-of-selection. PPPP PPPPPPP PPPPPPPP PPP PPPPP PP PPPP PPPP encoding default _. - P P < > 0 . : ‘ . : ’ , _. else.
![Page 27: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/27.jpg)
Reading Data from OS FileReading Data from OS File
Do. Read dataset filename into all_customers. if sy-subrc <> 0. Exit. endif. Append all_customers. Enddo. Close dataset filename. Endif.
![Page 28: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/28.jpg)
Deleting OS File Deleting OS File
PPPPP(128) ‘ omersdata.txt PPPPP’ .START-OF-SELECTION. Delete dataset filename. If sy-subrc = 0. write: / ‘Delete OK’. Endif.
![Page 29: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/29.jpg)
Working with File on Presentation Server
![Page 30: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/30.jpg)
Download Data to PCDownload Data to PC
PPPPPPPP PPPP PPPP PP*
parameters PPPPPPPP PPPP PPPPPP-PPPPPPPP default ‘:omers .txt’.
Data all_customers like customers occurs 0 PPPPPP PPPPP.START-OF-SELECTION. PPPPPP PPP PPPP PPPPP PPPPPPPPPP PPPP* _ .
![Page 31: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/31.jpg)
Download Data to PCDownload Data to PC
CALL FUNCTION ‘DOWNLOAD’ Exporting filename = filename PPPPPP data_tab = all_customers Exceptions file_open_error = 1 … PPPPPP =5.
![Page 32: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/32.jpg)
Download Data to PCDownload Data to PC
PP-PPPPPP. When 1. Write: ‘Error when file opened’. When 2. Write: ‘Error during data transfer’. … When 0.
Write: / ‘Data Download Finish’..
![Page 33: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/33.jpg)
Upload Data from PCUpload Data from PC
* Upload data to PCparameters PPPPPPPP like -rlgrap filename default ‘c:\customers .txt’.
Data all_customers like customers occurs 0 with header line.START-OF-SELECTION.
![Page 34: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/34.jpg)
Upload Data from PCUpload Data from PC
CALL FUNCTION ‘UPLOAD’ Exporting filename = filename PPPPPP data_tab = all_customers Exceptions file_open_error = 1 … PPPPPP =5.
![Page 35: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/35.jpg)
Upload Data from PCUpload Data from PC
PP-PPPPPP. When 1. Write: ‘Error when file opened’. When 2. Write: ‘Error during data transfer’. … When 0.
Insert customers from table all_customers.…
.
![Page 36: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/36.jpg)
Upload/Download Data in BackgroundUpload/Download Data in Background
Call function ‘WS_DOWNLOAD’ Exporting P PPPPPPPP=
... and
Call function ‘WS_UPLOAD’ Exporting filename = filename ...
![Page 37: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/37.jpg)
Type Group : SE11
![Page 38: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/38.jpg)
Type GroupABAP Program
![Page 39: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/39.jpg)
Exercise IV
![Page 40: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/40.jpg)
Exercise III : User Master
usr02-bname
usr02-trdat
adcp-tel_number
![Page 41: ABAP Message, Debugging, File Transfer and Type Group](https://reader030.fdocuments.in/reader030/viewer/2022012319/54b5d2394a7959a1268b45f1/html5/thumbnails/41.jpg)
Exercise IV : Drill-Down Report