DirectoryAcademicsBlog Details for "Total SAP"

Total SAP

Total SAP
ABAP,ABAP report,Interactive Report,ALV grid,ALV list,IDOC,User Exit,RFC,Smartform,sapscript,ABAP Performance,Remote Function Module RFC ,Function Module,Modularization techniques
Articles: 1, 2, 3, 4

Articles

A real life example for using a temporary program
2008-02-20 15:46:00
*&----------------------------------- ----------------------------------**& Chapter 25: A real life example for using a temporary program*&---------------------------- ----------------------------------------- *REPORT CHAP2503.* Variables for later usePARAMETERS TABNAME(10) DEFAULT 'CUSTOMERS'.DATA: SOURCE_TABLE(72) OCCURS 100 WITH HEADER LINE, PROGRAM_NAME LIKE SY-CPROG, SYNTAX_CHECK_MESSAGE(128), LINE_NO TYPE I.* Building the source codePERFORM BUILD_THE_SOURCE_CODE USING TABNAME.* Generating the temporary program, checking syntax errorsGENERATE SUBROUTINE POOL SOURCE_TABLE NAME PROGRAM_NAME MESSAGE SYNTAX_CHECK_MESSAGE LINE LINE_NO.IF SY-SUBRC NE 0. WRITE: / 'Syntax error, message', SYNTAX_CHECK_MESSAGE, / 'in line', LINE_NO. EXIT.ENDIF.* Calling a form externallyPERFORM DISPLAY_TABLE IN PROGRAM (PROGRAM_NAME).* Form to build the source code of the temporary programFORM BU...
More About: Life , Real , Program , Real Life
ABAP Sample program for Working with temporary programs
2008-02-20 15:46:00
*&----------------------------------- ----------------------------------**& Chapter 25: Working with temporary programs*&--------------------------- ----------------------------------------- -*REPORT CHAP2501.* Internal table for source code, field for name of temporary programDATA: SOURCE_TABLE(72) OCCURS 10 WITH HEADER LINE, PROGRAM_NAME LIKE SY-CPROG.* Building the source codeAPPEND 'report test.' TO SOURCE_TABLE.APPEND 'form display.' TO SOURCE_TABLE.APPEND 'write ''I am a temporary program''.' TO SOURCE_TABLE.APPEND 'endform.' TO SOURCE_TABLE.* Generating the temporary programGENERATE SUBROUTINE POOL SOURCE_TABLE NAME PROGRAM_NAME.* Calling a form externallyPERFORM DISPLAY IN PROGRAM (PROGRAM_NAME).
More About: Programs , Program , Sample
ABAP Sample program for Syntax errors in temporary programs
2008-02-20 15:46:00
*&----------------------------------- ----------------------------------**& Chapter 25: Syntax errors in temporary programs*&--------------------------- ----------------------------------------- -*REPORT CHAP2502.* Variables for later useDATA: SOURCE_TABLE(72) OCCURS 10 WITH HEADER LINE, PROGRAM_NAME LIKE SY-CPROG, SYNTAX_CHECK_MESSAGE(128), LINE_NO TYPE I.* Building the source codeAPPEND 'report test.' TO SOURCE_TABLE.APPEND 'form display.' TO SOURCE_TABLE.APPEND 'write ''I am a temporary program''.' TO SOURCE_TABLE.APPEND 'endform' TO SOURCE_TABLE.* Generating the temporary program, checking syntax errorsGENERATE SUBROUTINE POOL SOURCE_TABLE NAME PROGRAM_NAME MESSAGE SYNTAX_CHECK_MESSAGE LINE LINE_NO.IF SY-SUBRC NE 0. WRITE: / 'Syntax error, message', SYNTAX_CHECK_MESSAGE, / 'in line', LINE_N...
More About: Programs , Program , Errors , Sample
ABAP Sample program for Transferring data to a file
2008-02-20 15:45:00
*&----------------------------------- ----------------------------------**& Chapter 26: Transferring data to a file*&------------------------------- --------------------------------------*RE PORT CHAP2601.* Data declarations for later usePARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat' LOWER CASE.TABLES CUSTOMERS.DATA MSG_TEXT(50).* Get data for file transferDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.SORT ALL_CUSTOMERS BY CITY.LOOP AT ALL_CUSTOMERS. WRITE: / ALL_CUSTOMERS-CITY, ALL_CUSTOMERS-NAME.ENDLOOP.* Opening the File OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE MESSAGE MSG_TEXT.IF SY-SUBRC NE 0. WRITE: 'File cannot be opened. Reason:', MSG_TEXT. EXIT.ENDIF.* Transferring DataLOOP AT ALL_CUSTOMERS. TRANSFER ALL_CUSTOMERS-NAME TO FILENAME.ENDLOOP.* Closing the FileCLOSE DATASET FILENAME.
More About: Program , Sample
ABAP Sample program for Generating a persistent program
2008-02-20 15:45:00
*&----------------------------------- ----------------------------------**& Chapter 25: Generating a persistent program*&---------------------------- ----------------------------------------- *REPORT CHAP2504.* Internal table for source code, field for name of temporary programDATA: SOURCE_TABLE(72) OCCURS 10 WITH HEADER LINE, PROGRAM_NAME LIKE SY-CPROG.* Building the source codeAPPEND 'report zgenprog.' TO SOURCE_TABLE.APPEND 'write ''I am a generated program''.' TO SOURCE_TABLE.* Insert the report, if necessaryREAD REPORT 'zgenprog' INTO SOURCE_TABLE.IF SY-SUBRC NE 0. APPEND 'report zgenprog.' TO SOURCE_TABLE. APPEND 'write ''Here is zgenprog''.' TO SOURCE_TABLE. INSERT REPORT 'zgenprog' FROM SOURCE_TABLE.ENDIF.* Execute the reportSUBMIT ZGENPROG AND RETURN.
More About: Program , Sample
ABAP Sample program for Reading data from a file (presentation server)
2008-02-20 15:44:00
*&----------------------------------- ----------------------------------**& Chapter 26: Reading data from a file (presentation server)*&---------------------------- ----------------------------------------- *REPORT CHAP2604.* Data declarations for later usePARAMETERS FILENAME(128) DEFAULT 'c:usersdefault estfile.dat' LOWER CASE.TABLES CUSTOMERS.DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.CALL FUNCTION 'WS_UPLOAD' EXPORTING FILENAME = FILENAME TABLES DATA_TAB = ALL_CUSTOMERS EXCEPTIONS FILE_OPEN_ERROR = 1 OTHERS = 2.CASE SY-SUBRC. WHEN 1. WRITE 'Error when file opened'. EXIT. WHEN 2. WRITE 'Error during data transfer'. EXIT.ENDCASE.* Display the resultLOOP AT ALL_CUSTOMERS. WRITE: / ALL_CUSTOMERS-NAME, ALL_CUSTOMERS-CITY.ENDLOOP.
More About: File , Server , Program
ABAP Sample program for Transferring data to a file (presentation server)
2008-02-20 15:44:00
*&----------------------------------- ----------------------------------**& Chapter 26: Transferring data to a file (presentation server)*&---------------------------- ----------------------------------------- *REPORT CHAP2603.* Data declarations for later usePARAMETERS FILENAME(128) DEFAULT 'c:usersdefault estfile.dat' LOWER CASE.TABLES CUSTOMERS.DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Get data for file transferSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.SORT ALL_CUSTOMERS BY CITY.LOOP AT ALL_CUSTOMERS. WRITE: / ALL_CUSTOMERS-CITY, ALL_CUSTOMERS-NAME.ENDLOOP.* Transferring DataCALL FUNCTION 'WS_DOWNLOAD' EXPORTING FILENAME = FILENAME TABLES DATA_TAB = ALL_CUSTOMERS EXCEPTIONS FILE_OPEN_ERROR = 1 OTHERS = 2.CASE SY-SUBRC. WHEN 1. WRITE 'Error when file opened'. EXIT. WHEN 2. WRITE 'Error during data tra...
More About: File , Server , Program , Presentation
ABAP Sample program for Reading data from a file
2008-02-20 15:44:00
*&----------------------------------- ----------------------------------**& Chapter 26: Reading data from a file*&------------------------------- --------------------------------------*RE PORT CHAP2602.* Data declarations for later useTABLES CUSTOMERS.PARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat' LOWER CASE.DATA: MSG_TEXT(50), ALL_CUSTOMER_NAMES LIKE CUSTOMERS-NAME OCCURS 100 WITH HEADER LINE.* Opening the File OPEN DATASET FILENAME FOR INPUT IN TEXT MODE MESSAGE MSG_TEXT.IF SY-SUBRC NE 0. WRITE: 'File cannot be opened. Reason:', MSG_TEXT. EXIT.ENDIF.* Reading DataDO. READ DATASET FILENAME INTO ALL_CUSTOMER_NAMES. IF SY-SUBRC NE 0. EXIT. ENDIF. APPEND ALL_CUSTOMER_NAMES.ENDDO.* Closing the fileCLOSE DATASET FILENAME.* Display the resultLOOP AT ALL_CUSTOMER_NAMES. WRITE / ALL_CUSTOMER_NAMES.ENDLOOP.
More About: Program , Sample
ABAP Sample program for OLE Automation
2008-02-20 15:43:00
*&----------------------------------- ----------------------------------**& Chapter 28: Sample program for OLE Automation *&------------------------- ----------------------------------------- ---*REPORT CHAP2801.* Including OLE typesINCLUDE OLE2INCL.* Tables and variables for later useTABLES: CUSTOMERS.DATA: APPLICATION TYPE OLE2_OBJECT, WORKBOOK TYPE OLE2_OBJECT, SHEET TYPE OLE2_OBJECT, CELLS TYPE OLE2_OBJECT.* Creating an objectCREATE OBJECT APPLICATION 'excel.application'.IF SY-SUBRC NE 0. WRITE: / 'Error when opening excel.application', SY-MSGLI.ENDIF.* Setting propertiesSET PROPERTY OF APPLICATION 'Visible' = 1.* Calling methodsCALL METHOD OF APPLICATION 'Workbooks' = WORKBOOK.PERFORM ERRORS.CALL METHOD OF WORKBOOK 'Add'.PERFORM ERRORS.CALL METHOD OF APPLICATION 'Worksheets' = SHEET EXPORTING #1 = 1.PERFORM ERRORS.CALL METHOD OF SHEET 'Activate'.PERFORM ERRORS.PERFORM FILL_SHEET.* Subroutine for filling the spread sheetFORM FILL...
More About: Program
ABAP Report Code For How to define types and data objects
2008-02-18 06:40:00
*&----------------------------------- ----------------------------------**& Chapter 1: How to define types and data objects **&---------------------------------- -----------------------------------*REPOR T CHAP0101.* Elementary type character, length 20DATA CUSTOMER_NAME(25) TYPE C.* Non-elementary typeTYPES T_NAME(25) TYPE C.DATA NEW_CUSTOMER_NAME TYPE T_NAME.* Reference to a data objectDATA VENDOR_NAME LIKE CUSTOMER_NAME.* RecordDATA: BEGIN OF BOOKING, ID(4) TYPE C, FLIGHT_DATE TYPE D, NAME LIKE CUSTOMER_NAME, END OF BOOKING.* Internal tableDATA BOOKING_TABLE LIKE BOOKING OCCURS 100.
More About: Data , Report , Code , Objects , Types
ABAP Report Code For Connect 4
2008-02-18 06:38:00
ZCONECTA NO STANDARD PAGE HEADING MESSAGE-ID BD LINE-SIZE 132 LINE-COUNT 65.* Autor: Silva Huertas, Antonio Miguel* E-mail: alg@guay.comINCLUDE . * Tablas * Variables globales DATA: C1(8),"ColumnasC2(8),C3(8),C4(8),C5(8),C6 (8),C7(8),C8(8).DATA: TFS(20).DATA: D_RET LIKE SY-SUBRC.DATA: MAQUINA,TURNO,LINEA TYPE I,OFFS TYPE I VALUE 20,GANA_MAQUINA,GANA_USUARIO.* Constantes CONSTANTS: C_O VALUE 'O', C_X VALUE 'X'.* Tablas internas DATA: BEGIN OF TAB OCCURS 10, COL TYPE I, LIN TYPE I, XTYPE I, OTYPE I, BTYPE I, XA TYPE I, OA TYPE I, BA TYPE I,ENDOF TAB.* Parámetros PARAMETER: USUARIO OBLIGATORY DEFAULT C_X, ICONOS AS CHECKBOX DEFAULT C_X.*------------------------------------ ----------------------------------** AT SELECTION-SCREEN **--------------------------------------- -------------------------------* AT SELECTION-SCREEN. IF USUARIO = C_O. MAQUINA = C_X. ELSEIF USUARIO = C_X. MAQUINA = C_O. ELSE. MESSAGE E899 WITH 'Permitted values O y X'. ENDIF.*----------------...
More About: Report , Code , Connect
ABAP Report Code For Minesweeper
2008-02-18 06:38:00
*&=================================== ===========================*& Developed by ROMAN LOPEZ NAVARRO **& http://personales.com/espana/madrid/abap/ **& http://www.geocities.com/romlopabap/ **&================================== ============================*&------- ----------------------------------------- ---------------------**& Report ZBUSCAMIN **&---------------------------------- -----------------------------------** Una celda marcada como bomba ' B ' no admite ser marcada como detecta-* da ' D ' ya que implicitamente esta detectada.* Una vez que el juego acabo no se muestran mas mensajes aunque si se* permite seguir explorando las celdas ocultas.* Si algunas de las celdas marcadas como detectadas son incorrectas, es-* tas se muestran en un nuevo listado.* Evidentemente NUM_BOMB debe ser superior o igual a MAX_HERI.* El ...
More About: Code , Minesweeper
ABAP Report Code For Battleships
2008-02-18 06:37:00
*&=================================== ==========================**& Developed by ROMAN LOPEZ NAVARRO **& http://personales.com/espana/madrid/abap/ **& http://www.geocities.com/romlopabap/ **&================================== ===========================* REPORT ZBARCOS NO STANDARD PAGE HEADING. DATA:para imprimir la pantalla POS TYPE I, POSINI TYPE I VALUE 4, FILAS TYPE I VALUE 10, LONGITUD TYPE I, CABLET(255), NUMFILA(2),* Variables para las funciones RANDOM INTEGER2 LIKE DATATYPE-INTEGER2, CHAR0128 LIKE DATATYPE-CHAR0128,* Atributos de celda N * Variable UMERO LIKE DATATYPE-INTEGER2, " Numero de la casilla actual LETRA TYPE C, " Letra de la casilla actual NUMLETRA TYPE I, " Letra convertida a numero CELL_NAME(25), " Nombre de la celda* Limites de la celda s...
More About: Report , Code
ABAP Report Code For Restricting Selection Options
2008-02-18 06:36:00
REPORT Z_CONECT_A.* Include type pool SSCRTYPE-POOLS sscr.TABLES : marc.* defining the selection-screenselect-options : s_matnr for marc-matnr, s_werks for marc-werks.* Define the object to be passed to the RESTRICTION parameterDATA restrict TYPE sscr_restrict.* Auxiliary objects for filling RESTRICTDATA : optlist TYPE sscr_opt_list, ass type sscr_ass.INITIALIZATION.* Restricting the MATNR selection to only EQ and 'BT'. optlist-name = 'OBJECTKEY1'. optlist-options-eq = 'X'. optlist-options-bt = 'X'. APPEND optlist TO restrict-opt_list_tab. ass-kind = 'S'. ass-name = 'S_MATNR'. ass-sg_main = 'I'. ass-sg_addy = space. ass-op_main = 'OBJECTKEY1'. APPEND ass TO restrict-ass_tab.* Restricting the WERKS selection to CP, GE, LT, NE. optlist-name = 'OBJECTKEY2'. optlist-options-cp = 'X'. optlist-options-ge = 'X'. optlist-options-lt = 'X'. optlist-options-ne = 'X'. APPEND optlist TO restrict-opt_list_tab. ass-kind = 'S'. ass-name = 'S_WERKS'. ass-sg_mai...
More About: Report , Code , Options , Selection
ABAP Report Code For Compare 2 files and show the differences
2008-02-18 06:35:00
REPORT Ycompare MESSAGE-ID Z1 NO STANDARD PAGE HEADING LINE-SIZE 255. *---------------------------------------- -----------------------------** Topic: Compare 2 unix or pc files and print the differences**---------------------------- ----------------------------------------- * 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. *---------------------------------------- ---------------------------** Parameters. **--------------------------------------- ----------------------------* SELECTION-SCREEN SKIP 2. PARAMETERS: PARCOM1(45) TYPE C LOWER CASE, PARCOM2(45) TYPE C LOWER CASE, PARCOM3 LIKE RLGRAP-FILENAME, PARCOM4 LIKE RLGRAP-FILENAME , P_PC RADIOBUTTON GROUP ONE, P_UNIX RADIOBUTTON ...
More About: Show , Report , Code , Differences
ABAP Report Code For Progress Indicator
2008-02-18 06:34:00
REPORT ZV_DELETE .DATA: A LIKE SY-UCOMM.DO 100 TIMES. DO 300 TIMES. GET TIME. ENDDO. A(3) = SY-INDEX.A+3 = '%'. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING PERCENTAGE = SY-INDEX TEXT = A.ENDDO.WRITE: / 'PROGRESS INDICATOR'.
More About: Report , Code , Progress , Indicator
ABAP Report Code For Popup Help
2008-02-18 06:34:00
*-- F4 help for Payroll AdministratorAT SELECTION SCREEN ON VALUE REQUEST FOR P_SACHA. PERFORM VALUES_SACHA.*-- F4 help for Pay Scale GroupAT SELECTION SCREEN ON VALUE REQUEST FOR P_TRFGR.*-- F4 help for Pay Scale LevelAT SELECTION SCREEN ON VALUE REQUEST FOR P_TRFST.*-------------------------------- -------------------------------------** FORM VALUES_SACHA*---------------------------- ----------------------------------------- ** Provide popup help for the Payroll Admin field*----------------------------------- ----------------------------------*FORM VALUES_SACHA. REFRESH: LTAB_DYNPSELECT, LTAB_DYNPVALUETAB. PERFORM READ_VALUE_FROM_SCREEN USING SY-REPID SY-DYNNR 'PA0001-WERKS' CHANGING LTAB_DYNPSELECT-FLDNAME LTAB_DYNPSELECT-FLDINH. APPEND LTAB_DYNPSELECT. LTAB_DYNPSELECT-FLDNAME = 'MANDT'. APPEND LTAB_DYNPSELECT. LTAB_DYNPSELECT-FLDNAME = 'SACHX'. APPEND LTAB_DYNPSELECT. PERFORM SHOW_HELP TABLES LTA...
More About: Report , Code , Popup
ABAP Report Code For Outstanding PO Report
2008-02-18 06:33:00
ABAP/4 Program: Outstanding PO Report ----------------------------------- ----------------------------------------- ----This report displays information for outstanding purchase orders. The report has two parts:one is the standard report, and the other is called from the Project Expense report. Note that both reportsoutput GL Account, cost center, and cost object information (from table EKKN) as a single value on the outputline. Actually, each line may have several cost centers and cost object to which the invoices were allocated;however, the user only wanted one (any one) to be listed.Standard Report: The standard report lists info (limited by selection criteria) for purchase order items whoseGR and IR are not equal. The report first accesses the header table EKKO, limited by purchasing group andpurchase order. It then accesses EKPO, limited by PO item and material selection criteria. An internal tablesums keeps subtotals of the related GR/IR quantities and values, read from EKBE, for...
More About: Code
ABAP Report Code For Lock / Unlock Editor lock field
2008-02-18 06:33:00
Lock/Unlock the ABAP Editor Lock Field REPORT ZEDITOR.TABLES: TRDIR. "System table TRDIRPARAMETERS: PROGRAM LIKE TRDIR-NAME.PARAMETERS: EDITOR LIKE TRDIR-EDTX.SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.TRDIR-EDTX = EDITOR.MODIFY TRDIR.IF SY-SUBRC EQ 0. WRITE: / 'Editor Lock update Successful ', TRDIR-NAME. IF TRDIR-EDTX = 'X'. WRITE: ' Lock'. ELSE. WRITE: ' UnLock'. ENDIF.ELSE. WRITE: / 'Editor Lock update Unsuccessful ', TRDIR-NAME.ENDIF.
More About: Report , Code , Lock
ABAP Report Code For Preventing same job from being started twice
2008-02-18 06:32:00
* Left Column Scroll Lock just like Excel* Author by : SAP Hints and Tips on Configuration and ABAP/4 Programming* REPORT ZSCROLL NO STANDARD PAGE HEADING LINE-COUNT 4 LINE-SIZE 140.START-OF-SELECTION. DO 3 TIMES. WRITE: / '01234567890123456789'. DO 10 TIMES. WRITE sy-index. ENDDO. ENDDO. SET LEFT SCROLL-BOUNDARY COLUMN 21. DO 3 TIMES. WRITE: / '0123456789'. DO 10 TIMES. WRITE sy-index. ENDDO. ENDDO. SET LEFT SCROLL-BOUNDARY COLUMN 11.TOP-OF-PAGE. SY-TITLE = 'Column Locking'. WRITE: / SY-TITLE.*--- End of Program
More About: Report , Code
ABAP Report Code For Preventing same job from being started twice
2008-02-18 06:32:00
Prevent user from submitting the same jobname ZXXX twicetables: tbtco.data: t_jobcnt(1) type n, t_sdluname like tbtco-sdluname, t_strtdate like tbtco-strtdate, t_strttime like tbtco-strttime.select * from tbtco where jobname = 'ZXXX' and strtdate = sy-datum and status = 'R'. t_jobcnt = t_jobcnt + 1. if t_jobcnt = 1. t_sdluname = tbtco-sdluname. t_strtdate = tbtco-strtdate. t_strttime = tbtco-strttime. endif.endselect.if sy-subrc = 0. if t_jobcnt message e123 with t_sdluname 'have execute the program on' t_strtdate t_strttime. endif.endif.
More About: Report , Code
ABAP Report Code For Hiding ABAP Source Code
2008-02-18 06:31:00
Hiding ABAP Source codePROGRAM ZHIDE NO STANDARD PAGE HEADING.********************************* **************************************** This program hides any ABAP's source code and protects it with a* password in this source code. So the first candidate to be hidden* should be ZHIDE itself.** After hiding, you can still run the abap (the load version is intact)* but it cannot be displayed, edited, traced, transported or generated.** If the ABAP is not hidden, the program hides it, if it is hidden, it* unhides it.** To execute this program, change the user name and password in this* source code first.*********************************** *************************************SELE CTION-SCREEN BEGIN OF BLOCK BLOCK.SELECTION-SCREEN BEGIN OF LINE.SELECTION-SCREEN COMMENT 1(8) PWD.SELECTION-SCREEN POSITION 35.PARAMETERS: PASSWORD(8) MODIF ID AAA.SELECTION-SCREEN END OF LINE.PARAMETERS: PROGRAM(8).SELECTION-SCREEN END OF BLOCK BLOCK.*AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF SCREEN-G...
More About: Report , Code , Source Code
ABAP Report Code For Working with Excel
2008-02-18 06:31:00
REPORT ZZBGS010 .*--------------------------------------- -------------------------------** Example: Interface between Microsoft Excel and ABAP/4 with up- and ** downloading of data plus executing Microsoft Excel. **--------------------------------------- -------------------------------*TABLES: USR04.DATA: SIZE TYPE I.DATA: BEGIN OF USER OCCURS 100. INCLUDE STRUCTURE USR04.DATA: END OF USER.* ----------------------------------------- ----------------------------** Example: Select some data into an internal table. ** ----------------------------------------- ----------------------------* SELECT * FROM USR04 INTO TABLE USER .* ----------------------------------------- ----------------------------** Example: Downloading data in Microsoft Excel Format with automatic ** prompt popup dialog. ** ----------------------------------------- ----------------------------* CALL FUNCTION 'DOWNLOAD' EXPORTI...
More About: Report , Code , Working
ABAP Report Code For Export data from Excel
2008-02-18 06:30:00
REPORT ZEXCEL LINE-SIZE 170 LINE-COUNT 58 NO STANDARD PAGE HEADING. DATA: BEGIN OF TBXLS OCCURS 5, LINE LIKE SY-TABIX, COLN TYPE I, STRING(1024) TYPE C, END OF TBXLS, BEGIN OF TABXLS OCCURS 5, LINEA TYPE I, CODIGO(10) TYPE C, NUMLINEA TYPE I, TEXTO(80), END OF TABXLS. DATA: P_NCOLN TYPE I.* Ole objects declaration DATA: H_APPL LIKE OBJ_RECORD, H_WORK LIKE OBJ_RECORD, H_CELL LIKE OBJ_RECORD. INCLUDE OLE2INCL. INCLUDE DOCSINCL. SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME. PARAMETERS: P_CAMI LIKE RLGRAP-FILENAME. "Archivo Excel PARAMETERS: P_NLINE LIKE SY-INDEX. "Numero aproximado de lineas SELECTION-SCREEN END OF BLOCK B0. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CAMI. CALL FUNCTION 'WS_FILENAME_GET' EXPORTING DEF_FILENAME = ' ' DEF_PATH = P_CAMI MASK ...
More About: Data , Report , Code , Export
ABAP Report Code For Creating a dynamic structure
2008-02-18 06:30:00
Question : Subject : Dynamic structuredoes anyone know if it's possible to declare a dynamic structure?my program receives a record-field of 1000, and I need to overlay this record with a structure that needs tobe dynamic.Reply : Subject : Dynamic structureif your structure changes from one defined structure to another one, you can try this:ASSIGN yourfield CASTING TYPE yourstructureor CREATE DATA yourdata TYPE yourstructure.If your structure has to be really dynamic - like ALV - you can use the class CL_ALV_TABLE_CREATE.try this example:================================= ====REPORT zmaschl_create_data_dynamic .TYPE-POOLS: slis.DATA: it_fcat TYPE slis_t_fieldcat_alv, is_fcat LIKE LINE OF it_fcat.DATA: it_fieldcat TYPE lvc_t_fcat, is_fieldcat LIKE LINE OF it_fieldcat.DATA: new_table TYPE REF TO data.DATA: new_line TYPE REF TO data.FIELD-SYMBOLS: TYPE ANY TABLE, TYPE ANY, TYPE ANY.* Build fieldcatCALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' ...
More About: Report , Creating , Code , Structure
ABAP Report Code For Copy SAP table definition to a local file
2008-02-18 06:29:00
REPORT ZAPC0046 NO STANDARD PAGE HEADING LINE-SIZE 112. DEFINE DEC_TABINT. TABLES &1. DATA I_&1 LIKE &1 OCCURS 100 WITH HEADER LINE. END-OF-DEFINITION. DEC_TABINT: DD01L, "DOMINIOS DD01T, "DOMINIOS - TEXTOS DD07L, "DOMINIOS - VALORES FIJOS DD07T, "DOMINIOS - VALORES FIJOS - TEXTOS DD02T, DD02L, DD03L, DD03T, DD04L, DD04T, DD08L, "RELACIONES DD08T, DD09L. "OPCIONES TECNICAS. SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME. SELECT-OPTIONS: S_TABNAM FOR DD02L-TABNAME DEFAULT 'Z*' OPTION CP SIGN I, S_ROLLNA FOR DD04L-ROLLNAME DEFAULT 'Z*' OPTION CP ...
More About: File , Report , Code , Local , Definition
ABAP Report Code For Displaying Selection Options in your report
2008-02-18 06:26:00
ABAP/4 Program: Describe Select-Options back to ABAP/4 index------------------------------------ ----------------------------------------- ---When printing a report, you can print the search conditions or report parameters that the user entered.For instance, if a report output was restricted to plants between 1011 and 1501, you may want to print"Plants Between 1011 and 1501" on the report. This procedure describes the selected parameters.Describe Select-Optionsselect-options: sel_opt for sy-datum. . . .loop at sel_opt. perform describe_select_options using 'Date' sel_opt-sign sel_opt-option sel_opt-low sel_opt-high changing datedesc. write: / datedesc.endloop. . . .*&---------------------------------- -----------------------------------**& ; Form DESCRIBE_SELECT_OPTIONS*&---...
More About: Report , Code , Selection
ABAP Report Code For Display daily cash receipts (ALV)
2008-02-18 06:26:00
REPORT ZDAILY_RECEIPTS .*--------------------------------------- --------------------------------*/ Description :This program creates an ALV report for Daily Cash * Receipts for a selected date range.*---------------------------------- -------------------------------------* Global data declarationTYPE-POOLS: slis.* Global structure of listTYPES: BEGIN OF i_cust_invoices, "This is a temp-table where SELECT "data is to be stored. bkpf LIKE bkpf, "Acct Doc Header structure bseg LIKE bseg, "Acct Doc Segment struc kna1 LIKE kna1, "Customer Master struc skat LIKE skat, "Chart of Accts struc END OF i_cust_invoices.TABLES: bkpf, "TABLES: def of Database tables. bseg, kna1, skat.*/ Selection and Input ParametersSELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME.SELECT-OPTIONS: s_belnr FOR bseg-belnr, "Acct Doc number s_budat ...
More About: Report , Display , Code
ABAP Report Code For ABAP Program to check for a holiday using factory cale
2008-02-18 06:24:00
REPORT Z_HOLIDAY.* ABAP Program to check for holidays using the factory calendar* include zday .* substitute tdate = 'yyyymmdd'.* tholiday_found = 'X' -> Holiday TABLES THOCS.DATA: BEGIN OF INT_THOCS OCCURS 100, THOCS LIKE THOCS.DATA: END OF INT_THOCS.DATA: TDAY(1),* TDATE LIKE SY-DATUM, THOLIDAY_ATTRIBUTES, THOLIDAY_FOUND(1).PARAMETERS: P_DATE LIKE SY-DATUM DEFAULT SY-DATUM.*&------- Selection ------------------------START-OF-SELECTIO N. PERFORM HOLIDAY.FORM HOLIDAY.CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO' EXPORTING DATE = P_DATE HOLIDAY_CALENDAR_ID = 'XX'* WITH_HOLIDAY_ATTRIBUTES = ' ' IMPORTING HOLIDAY_FOUND = THOLIDAY_FOUND TABLES HOLIDAY_ATTRIBUTES = INT_THOCS EXCEPTIONS CALENDAR_BUFFER_NOT_LOADABLE = 1 DATE_AFTER_RANGE = 2 DATE_BEFORE_RANGE = 3 DATE_INVALID = ...
More About: Factory , Report , Code , Check
ABAP Report Code For ALV Aged Trial Balance Report
2008-02-18 06:24:00
*---------------------------------------- ------------------------------** Report : ZARAGEDTB ** Author : Keshav Goel ** Application : FINANCIAL ACCOUNTING* Date created : Nov 2001 ** Description : Aged Trial balance report using select-options for* Sales Group and Pricing Group. The logic is copied from* Aged trial balance Print program which already exists.* Output is displayed using ALV.*------------------------------------ ----------------------------------*REPORT ZARAGEDTB NO STANDARD PAGE HEADING LINE-SIZE 132 LINE-COUNT 65.*------------------------------------- ---------------------------------** Tables*---------------------------------- ------------------------------------*TABL ES: BSID, "open items (Accounting: Secondary Index...
More About: Code , Balance
More articles from this author:
1, 2, 3, 4
40528 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - SEO by FeWorks
eXTReMe Tracker