SAP details:     Events  -  News -   Training  -  World wide sites  -  Sap Labs   -   SAP Magazine  -   SAP Screen saver -   Stock Price

Download ABAP source code

Program name  Program function  Author Date Added 
Z_Sapscript_program_1
Version:   
SapScript program to display Document details.    
 

REPORT Z_Sapscript_program_1.

TABLES: BSIK, LFA1.
PARAMETERS : ACCT_NO LIKE BSIK-HKONT DEFAULT '200501',
                             CMP_CODE LIKE BSIK-BUKRS DEFAULT '0001',
                              YEAR LIKE BSIK-GJAHR DEFAULT 1994.
DATA: SYM1(35),
            SYM2(35),
            SYM3(36).
DATA: BEGIN OF ITAB OCCURS 100,
               NAME1 LIKE LFA1-NAME1,
               AMOUNT LIKE BSIK-DMBTR,
               LIFNR LIKE LFA1-LIFNR.
DATA: END OF ITAB.

START-OF-SELECTION.
   SELECT * FROM BSIK WHERE HKONT = ACCT_NO "'0000200501'
                                             AND GJAHR = YEAR "'1994'
                                             AND BUKRS = CMP_CODE. "'0001'
           MOVE-CORRESPONDING BSIK TO ITAB.
           SELECT * FROM LFA1 WHERE LIFNR = BSIK-LIFNR.
                  MOVE-CORRESPONDING LFA1 TO ITAB.
                  APPEND ITAB.
            ENDSELECT.
            WRITE : / ITAB-AMOUNT , ITAB-NAME1.
   ENDSELECT.

END-OF-SELECTION. "EXIT.

CALL FUNCTION 'OPEN_FORM'
       EXPORTING
            APPLICATION = 'TX'
            ARCHIVE_INDEX = ' '
            ARCHIVE_PARAMS = ' '
            DEVICE = 'SCREEN'
            DIALOG = 'X'
            FORM = 'ZAMVENTRAN'
            LANGUAGE = SY-LANGU
           OPTIONS = ' '
       IMPORTING
           LANGUAGE = SY-LANGU
       EXCEPTIONS
           CANCELED = 01
           DEVICE = 02
           FORM = 03
           OPTIONS = 04
           UNCLOSED = 05.

LOOP AT ITAB.
       CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
            EXPORTING
                  NAME = '&SYM1&'
                  VALUE = ITAB-NAME1.
*                 VALUE_LENGTH = E03.
         CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
                EXPORTING
                     NAME = '&SYM2&'
                     VALUE = CMP_CODE.

          CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
                EXPORTING
                     NAME = '&SYM3&'
                     VALUE = YEAR.
           CALL FUNCTION 'START_FORM'
                  EXPORTING
                        FORM = 'ZAMVENTRAN'
                        LANGUAGE = SY-LANGU
                        STARTPAGE = 'PAGE1'
                  IMPORTING
                        LANGUAGE = SY-LANGU
                  EXCEPTIONS
                        FORM = 01
                        FORMAT = 02
                        UNENDED = 03
                        UNOPENED = 04
                        UNUSED = 05.

            CALL FUNCTION 'WRITE_FORM'
                 EXPORTING
*                      ELEMENT = 'T10'
*                      TYPE = E03
                        WINDOW = 'MAIN'.

            CALL FUNCTION 'CONTROL_FORM'
                  EXPORTING
                       COMMAND = 'NEW-PAGE'
                       EXCEPTIONS
                        UNOPENED = 01
                       UNSTARTED = 02.
 
             CALL FUNCTION 'END_FORM'.
ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.

 

 

 
 









   
 
PlanetSAP.com

Home     Post a article   Suggestion   Contact  

Disclaimer    Copyright; 1998-2001 Softron Systems, Inc. All rights reserved.