From owner-freebsd-ports Tue Aug 20 1:56:26 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01D8C37B400; Tue, 20 Aug 2002 01:56:12 -0700 (PDT) Received: from abaptools.com (adsl-67-38-248-43.dsl.bcvloh.ameritech.net [67.38.248.43]) by mx1.FreeBSD.org (Postfix) with SMTP id 1E3CF43E3B; Tue, 20 Aug 2002 01:56:10 -0700 (PDT) (envelope-from mail@abaptools.com) From: mail@abaptools.com Reply-To: mail@abaptools.com To: mail@abaptools.com Subject: ABAP/4 Tools Newsletter Message-Id: <20020820085610.1E3CF43E3B@mx1.FreeBSD.org> Date: Tue, 20 Aug 2002 01:56:10 -0700 (PDT) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ******************************************************* ABAP/4 Tools Newsletter #1, August 19, 2002 ******************************************************* NEWS: Our new domain http://www.abaptools.com is now fully active with links to hundreds of ABAP/4 program samples. We are the largest single source of ABAP/4 code on the web. We also carry discounted software, books and utilities for the ABAP programmer available via secured purchase. AUGUST SPECIAL: SAVE $20 when you purchase the Data Dictionary and TableView Light Combo. The DataSuite Data Dictionary is the Windows stand-alone utility that allows viewing and analysis of R/3 data structures. TableView Light is a data migration and ABAP generation utility that extracts data to Windows destinations and builds ABAP code. Take advantage of this special offer and receive both of these popular utilities at significant savings. For more information, visit http://www.abaptools.com today. AUGUST BOOK SPECIAL: SAP R/3 Data Integration Techniques Using ABAP/4 and Visual Basic. Only 39.95 US. A savings of 10.00 off the Amazon price. FEATURED ABAP/4: The example ABAP below demonstrates how to manually parse individual fields from an ASCII delimited text file. A record is simulated using the DATA statements, and the fields are extracted and written to the display. ----------------------------------------------------------------------------------------------------- REPORT YDLMTEXT . * Demonstration of the use of field symbols to parse a delimited ascii * * text file. The max length of the input record must be known so that * * a buffer can be setup large enough to handle the record (line). * DATA: C25(25) TYPE C, " Work Field (will hold field value) COUNTER TYPE I VALUE 1. " Number of fields in input string * Buffer. This represents one 'line' as read from a text file * DATA: BEGIN OF BUFF, B1(69) TYPE C VALUE '"Well","she","was","just","seventeen","you","know","what","I","mean",', B2(64) TYPE C VALUE '"and","the","way","she","looked","was","way","beyond","compare",', B3(60) TYPE C VALUE '"So","how","could","I","dance","with","another","whooooooo",', B4(41) TYPE C VALUE '"when","I","saw","her","standing","there"'. DATA END OF BUFF. START-OF-SELECTION. WHILE COUNTER LT 34. " Execute for each field to parse PERFORM NEXT_FIELD USING BUFF C25. " #1 WRITE:/1 C25. COUNTER = COUNTER + 1 . ENDWHILE. ** Routine to get the next field and adjust the input line ** FORM NEXT_FIELD CHANGING TL BF. DATA: CMA TYPE I, " Location of Comma BDX TYPE I, " Workin Index LBT(1) TYPE C. " Leftmost byte FIELD-SYMBOLS: , . CLEAR BF. CHECK NOT TL IS INITIAL. LBT = TL. IF LBT EQ '"'. " COMMA WITHIN DBL QUOTES ASSIGN TL+1 TO . TL = . " ELIMINATE FIRST DQ WHILE NE '"' AND ( NOT TL IS INITIAL ) . ASSIGN TL+0(1) TO . ASSIGN TL+0(1) TO . IF NE ',' AND NE '"'. CONCATENATE BF INTO BF. ENDIF. ASSIGN TL+1 TO . TL = . ENDWHILE. ASSIGN TL+2(232) TO . " MUST ALWAYS BE RECLEN - 2 . TL = . EXIT. ENDIF. ** No double-quotes, just parse through comma *** IF TL CA ','. CMA = SY-FDPOS + 1. IF CMA GT 1. BDX = CMA - 1 . ASSIGN TL+0(BDX) TO . BF = . ELSE. CLEAR BF. ENDIF. BDX = CMA. ASSIGN TL+CMA TO . TL = . ELSE. BF = TL . CLEAR TL. ENDIF. ENDFORM. ----------------------------------------------------------------------------------------------------------------- That's all for August. As always, we ask users to submit favorite ABAP routines to http://www.abaptools.com *********************************************************************************** This newsletter is a monthly service of abaptools.com. To be removed from our mailing list, simply reply to this newsletter with 'remove' in the subject line. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message