REPORT ZBROWSE MESSAGE-ID Z1
NO STANDARD PAGE HEADING
* LINE-COUNT 65
LINE-SIZE 255.
*---------------------------------------------------------------------*
* Topic: Browse a file on the appication server
* *
* Author: Sheila Titchener
* *
*---------------------------------------------------------------------*
DATA: BEGIN OF TAB1 OCCURS 0,
LINE(5000),
END OF TAB1.
DATA: BEGIN OF TAB2 OCCURS 0,
LINE(5000),
END OF TAB2.
DATA: PARCOM_LOC(100) TYPE C.
DATA: COLOR TYPE I.
DATA: COUNT(16) TYPE C.
DATA: MESS(50).
*-------------------------------------------------------------------*
* Parameters. *
*-------------------------------------------------------------------*
SELECTION-SCREEN SKIP 2.
PARAMETERS: PARCOM1(55) TYPE C LOWER CASE.
* parcom2(55) type c lower case,
* parcom3 like rlgrap-filename,
* parcom4 like rlgrap-filename ,
* p_pc radiobutton group one,
*8 p_unix radiobutton group one.
*-------------------------------------------------------------------*
* Parameter validation *
*-------------------------------------------------------------------*
*-------------------------------------------------------------------*
* TOP-OF-PAGE. *
*-------------------------------------------------------------------*
TOP-OF-PAGE.
PERFORM WRITE_PAGE_HEADING.
*-------------------------------------------------------------------*
* INITIALIZATION. *
*-------------------------------------------------------------------*
INITIALIZATION.
PARCOM1 = '\\sapdev1\export\'.
*-------------------------------------------------------------------*
* START-OF-SELECTION. *
*-------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM COLLECT_DATA.
PERFORM WRITE_FILE_CONTENT.
*---------------------------------------------------------------------*
* FORM COLLECT_DATA. *
*---------------------------------------------------------------------*
FORM COLLECT_DATA.
OPEN DATASET PARCOM1 FOR INPUT IN TEXT MODE MESSAGE MESS.
IF SY-SUBRC NE 0.
WRITE: 'Unable to open', PARCOM1.
WRITE: / MESS.
ELSE.
DO.
READ DATASET PARCOM1 INTO TAB1.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
APPEND TAB1.
ENDDO.
CLOSE DATASET PARCOM1.
ENDIF.
ENDFORM.
*-------------------------------------------------------------------*
* FORM WRITE_FILE_CONTENT. *
*-------------------------------------------------------------------*
FORM WRITE_FILE_CONTENT.
DATA: E LIKE SY-FDPOS.
LOOP AT TAB1.
E = STRLEN( TAB1-LINE ).
IF E GE 0.
PERFORM COLORLINE USING ' 0' TAB1-LINE+0(99).
PERFORM STREGER_3.
ENDIF.
IF E GE 100.
PERFORM COLORLINE USING '100' TAB1-LINE+99(100).
PERFORM STREGER_3.
ENDIF.
* write: /10 tab1.
*
ENDLOOP.
ENDFORM.
*-------------------------------------------------------------------*
* FORM WRITE_PAGE_HEADING. *
*-------------------------------------------------------------------*
FORM WRITE_PAGE_HEADING.
WRITE:/1(110) SY-ULINE.
PERFORM STREGER_2.
FORMAT INTENSIFIED.
WRITE: / PARCOM1 COLOR 1.
PERFORM STREGER_2.
WRITE:/1(110) SY-ULINE.
PERFORM STREGER_2.
FORMAT INTENSIFIED.
WRITE: /2(109) SPACE COLOR 3.
WRITE: 2 'Offset' COLOR 3,
10 '0....+....1....+....2....+....3....+....' COLOR 3,
50 '4....+....5....+....6....+....7....+....' COLOR 3,
90 '8....+....9....+....' COLOR 3.
PERFORM STREGER_3.
FORMAT RESET.
WRITE:/1(110) SY-ULINE.
ENDFORM.
*-------------------------------------------------------------------*
* FORM STREGER_2. *
*-------------------------------------------------------------------*
FORM STREGER_2.
PERFORM WRITE_VLINE USING ' ' 1.
PERFORM WRITE_VLINE USING ' ' 80.
ENDFORM.
*-------------------------------------------------------------------*
* FORM STREGER_3. *
*-------------------------------------------------------------------*
FORM STREGER_3.
PERFORM WRITE_VLINE USING ' ' 1.
PERFORM WRITE_VLINE USING ' ' 9.
PERFORM WRITE_VLINE USING ' ' 110.
ENDFORM.
*-------------------------------------------------------------------*
* WRITE_VLINE. *
*-------------------------------------------------------------------*
FORM WRITE_VLINE USING MODE POS.
IF MODE NE 'T'.
FORMAT INTENSIFIED.
ENDIF.
POSITION POS.
WRITE: SY-VLINE.
IF MODE NE 'T'.
FORMAT RESET.
ENDIF.
ENDFORM.
*-------------------------------------------------------------------*
* FORM COLORLINE. *
*-------------------------------------------------------------------*
FORM COLORLINE USING TEXT1 TEXT2.
ON CHANGE OF SY-TABIX.
COLOR = COLOR + 1.
COLOR = COLOR MOD 2.
ENDON.
FORMAT RESET.
IF COLOR = 1.
WRITE: /2(79) SPACE COLOR 2.
IF TEXT1 = ' 0'.
WRITE: 3 TEXT1 COLOR 2, 11 TEXT2 COLOR 2.
ELSE.
WRITE: 3 TEXT1 COLOR 2, 10 TEXT2 COLOR 2.
ENDIF.
ELSE.
WRITE: /2(79) SPACE COLOR 4.
IF TEXT1 = ' 0'.
WRITE: 3 TEXT1 COLOR 4, 11 TEXT2 COLOR 4.
ELSE.
WRITE: 3 TEXT1 COLOR 4, 10 TEXT2 COLOR 4.
ENDIF.
ENDIF.
ENDFORM.
*-------------------------------------------------------------------*
* FORM WRITE_NUMBER_OF_CONTENT. *
*-------------------------------------------------------------------*
FORM WRITE_NUMBER_OF_CONTENT.
DESCRIBE TABLE TAB1 LINES COUNT.
FORMAT RESET. CONDENSE COUNT.
RESERVE 3 LINES.
WRITE:/1(80) SY-ULINE.
WRITE: /2(79) SPACE COLOR 2.
WRITE: 2 'Number of records in file:' COLOR 2,
29 COUNT COLOR 2.
PERFORM STREGER_2.
WRITE:/1(80) SY-ULINE.
ENDFORM.
Tuesday, May 6, 2008
Sample SAP ABAP Program to Browse a file on the application server
Labels:
Sample ABAP Code Programs
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2008
(300)
-
▼
May
(80)
- Object oriented programming (OOP) All Steps
- Object oriented programming (OOP) Step2
- Object oriented programming (OOP) Step-by-step
- Object oriented programming (OOP) explained with a...
- Interview Question on BAPI, RFC, ABAP Objects, Tables
- The Other 50 ABAP Interview Faq's
- More than 100 ABAP Interview Faq's
- Events in Report
- Example: The IDoc Type ORDERS01
- Program for Outbound IDOC
- Basic Configuration in IDOC
- Sample ABAP Program to Upload table using new func...
- Sample ABAP Program for Submitting report with sel...
- Sample ABAP Program for Submitting report with sel...
- Sample ABAP Program for Sending SAP Mail
- Sample ABAP Program for Search Layout sets for giv...
- Sample ABAP Program for Sapscript PerForm Module
- Sample ABAP Program for Create IDOC
- Sample ABAP Program for Output file to application...
- Sample ABAP Program for Module Pool Skeleton
- Sample ABAP Program for Module Pool containing scr...
- Sample ABAP Program for MB1B Call Transaction
- Sample ABAP Program of Function Module to Convert ...
- Sample ABAP Program of FTP Function Module
- Sample ABAP Program to EXPORT LIST TO MEMORY
- Sample ABAP Program to Execute Unix command from w...
- Sample ABAP Program to Get Output in EXCEL
- Sample ABAP Program to Implement EDI
- Sample Program to dynamically change upload/downlo...
- Sample ABAP Program to download table using new fu...
- Sample ABAP Program to Download file to Presentati...
- Sample ABAP Program to display pop message to avoi...
- Sample ABAP Program of ALV Grid
- Sample ABAP Program of Dialogue Module Pool
- Sample ABAP Program to DIALOGUE FLOW LOGIC
- Sample ABAP Program to Delete a file from the appl...
- Sample ABAP Program to Compare to Unix or PC files...
- Sample ABAP Program to Colour cells in ALV
- Sample ABAP Program to Calculate difference betwee...
- Sample ABAP Program of BW User Exit
- Sample SAP ABAP Program to Browse a file on the ap...
- Sample SAP ABAP Program of ALV Grid control using ...
- SE30 - Runtime Analysis Tool
- List of System fields
- Write a report that displays the text 'Hello world...
- HR (Human Resource) Tutorials Free downloads
- FI (Financial) Tutorials Free downloads
- PM (Plant Maintenance) Tutorials Free downloads
- WM (Warehouse Management) Tutorials Free downloads
- QM (Quality Management) Tutorials Free downloads
- PP (Production Planning) Tutorials Free downloads
- SD (Sales and Distribution) Tutorials Free downloads
- MM (Material Management) Tutorials Free downloads
- IDOC INTRODUCTION & STRUCTURE
- Step-by-Step Guide for using LSMW to Update Custom...
- LIST of TABLES
- Transporting Objects and Standard Text from one cl...
- SAP R/3 INTERVIEW ARCHITECTURE QUESTIONS
- SAP TRANSACTIONS INTERVIEW QUESTIONS
- SAP MODULARIZATION INTERVIEW QUESTIONS
- SAP LOGICAL DATABASE INTERVIEW QUESTIONS
- SAP R/3 DATA DICTIONARY INTERVIEW QUESTIONS
- SAP BDC INTERVIEW QUESTIONS & ANSWERS
- SAP ABAP MENU PAINTER & SCREEN PAINTER Tutorials
- SAP ABAP WORKFLOW Tutorials PDF Free downloads
- SAP ABAP ITS Tutorials PDF Free downloads
- SAP ABAP EDI Tutorials PDF Free downloads
- SAP ABAP BAPI Tutorials PDF Free downloads
- SAP ABAP Change&Transport System Tutorials PDF Fre...
- SAP ABAP OBJECTS Tutorials PDF Free downloads
- SAP ABAP USER EXITS Tutorials PDF Free downloads
- SAP ABAP ALE Tutorials PDF Free downloads
- SAP ABAP IDOC Tutorials PDF Free downloads
- SAP ABAP LSMW Tutorials PDF Free downloads
- SAP ABAP BDC (Batch Data Communication) Tutorials ...
- SAP ABAP SAPSCRIPTS Tutorials Free downloads
- ALV Grid free download
- SAP ABAP INTERACTIVE REPORTING FAQs
- SAP ABAP REPORTING GENERAL
- SAP REPORTS FAQ
-
▼
May
(80)
No comments:
Post a Comment