• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Message, Debugging, File Transfer and Type Group
 

Message, Debugging, File Transfer and Type Group

on

  • 2,739 views

6th part of series shared on http://sapdocs.info/sap/abap/documents-for-sap-abap-beginners/

6th part of series shared on http://sapdocs.info/sap/abap/documents-for-sap-abap-beginners/

Statistics

Views

Total Views
2,739
Views on SlideShare
2,738
Embed Views
1

Actions

Likes
0
Downloads
270
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Message, Debugging, File Transfer and Type Group Message, Debugging, File Transfer and Type Group Presentation Transcript

    • ABAP Chapter 6
      • Message
      • Debugging
      • File Transfer
      • Type Group
    • Message in ABAP
    • User 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 e 000 (38) with ‘----’ ‘---’ ‘---’ ‘---’ . …
    • Message Type Syntax Message [ A < nnn > ] ( message class ) with < field1 > < field2 > … E, W, I, S
    • Messages Type - A(Abend) Message A000(38)... Program Start Selection Screen A Message Exit
    • Messages Type - E(Error) Message E 000(38) .. . Program Start Selection Screen E Message New input Require
    • Messages Type - W(Warning) Message W 000(38).. . Program Start Selection Screen W Message New input possible List Enter
    • Messages Type - I(Information) Message I 000(38).. . Program Start Selection Screen I Message List Enter
    • Messages Type - S(Success) Message S 000(38).. . Program Start Selection Screen List (Next Screen)
    • Dynamic Message Report ztest1. Parameters today like sy-datum . At s election-screen. if today <> sy-datum. m essage e000(38) with ‘ Please enter today : ’ sy-datum . endif. Start-of-selection. Write: / ‘ Today is :’, t oday .
    • Debugging
    • Debugging Mode
    • Debugging Mode : Internal Table
    • Debugging Mode : Internal Table
    • Debugging Mode : Watchpoint
    • Watchpoint : SAP ECC 6.0
    • How 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
    • ABAP Practice
    • File Transfer
    • File Transfer (Application Server)
      • There are 3 steps for file transfer
          • Open File
          • Read/Write File
          • Close File
    • File Transfer * Prepare Internal Table Data all_customers like customers occurs 0 with header line. Data msg_txt(50). Parameters filename(128) default ‘cust omersdata .t xt ’ lower case. Start-of-selection. Select * from customers into table all_customers.
    • File Transfer * Opening a file Open dataset filename for output in text mode encoding default message msg_txt. If sy-subrc <> 0. Write: ‘File cannot be opened .Reason :’,msg_txt. else.
    • File Transfer * Transferring data to a file Loop at all_customers. Transfer all_customers to filename. Endloop. * Closing a file Close dataset filename. Endif.
    • Transaction : AL11
    • File Transfer (Appending Data) * Opening a file Open dataset filename for appending in text mode encoding default message msg_txt. If sy-subrc <> 0. Write: ‘File cannot be opened .Reason :’,msg_txt. else . ...
    • Reading Data from OS File * Reading data from a file Parameters filename(128) default ‘cust omersdata .t xt ’ lower case. Data msg_txt(50). Data all_customers like customers occurs 0 with header line. Start-of-selection. Open dataset filename for input in text mode encoding default message msg_txt. If sy-subrc <> 0. Write: ‘File cannot be opened .Reason :’,msg_txt. else .
    • Reading 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.
    • Deleting OS File Parameters filename(128) default ‘cust omersdata . txt ’ lower case. START-OF-SELECTION. Delete dataset filename. If sy-subrc = 0. write: / ‘Delete OK’. Endif.
    • Working with File on Presentation Server
    • Download Data to PC * Download data from PC parameters filename like rlgrap-filename default ‘c:cust omers .txt’. Data all_customers like customers occurs 0 with header line. START-OF-SELECTION. Select * from customers into table all_customres.
    • Download Data to PC C ALL FUNCTION ‘DOWNLOAD’ Exporting filename = filename Tables data_tab = all_customers Exceptions file_open_error = 1 … others = 5 .
    • Download Data to PC Case sy-subrc. When 1. Write: ‘Error when file opened’. When 2. Write: ‘Error during data transfer’. … When 0. Write: / ‘Data Download Finish’. Endcase.
    • Upload Data from PC * Upload data to PC parameters filename like rlgrap-filename default ‘c:cust omers .txt’. Data all_customers like customers occurs 0 with header line. START-OF-SELECTION.
    • Upload Data from PC CALL FUNCTION ‘UPLOAD’ Exporting filename = filename Tables data_tab = all_customers Exceptions file_open_error = 1 … others = 5 .
    • Upload Data from PC Case sy-subrc. When 1. Write: ‘Error when file opened’. When 2. Write: ‘Error during data transfer’. … When 0. Insert customers from table all_customers. … Endcase.
    • Upload/Download Data in Background Call function ‘WS_ DOWNLOAD’ Exporting filename = filename ... and Call function ‘ WS_UP LOAD’ Exporting filename = filename ...
    • Type Group : SE11
    • Type Group ABAP Program
    • Exercise IV
    • Exercise III : User Master usr02-bname usr02-trdat adcp-tel_number
    • Exercise IV : Drill-Down Report