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_call_ABAP_program
Version: 3.0 & above
Call or Execute, ABAP program with variant
Module:  FI/MM
   
 

REPORT Z_call_ABAP_program  NO STANDARD PAGE HEADING.

TABLES : BKPF , INDX.

PARAMETERS : ZBUKRS LIKE BKPF-BUKRS OBLIGATORY DEFAULT '0001',
                             ZGJAHR LIKE BKPF-GJAHR OBLIGATORY DEFAULT '1995'.
SELECT-OPTIONS : ZPERIOD FOR BKPF-MONAT OBLIGATORY.

DATA : BEGIN OF CHECK_TAB OCCURS 100,
                 CLIENT LIKE BSEG-MANDT ,
                 COMPANY LIKE BKPF-BUKRS ,
                 FINYR LIKE BKPF-GJAHR ,
                 MONAT LIKE BKPF-MONAT ,
                 LDDT LIKE BKPF-CPUDT ,
             END OF CHECK_TAB.
DATA : BEGIN OF CHECK_TABO OCCURS 100,
                  CLIENT LIKE BSEG-MANDT ,
                  COMPANY LIKE BKPF-BUKRS ,
                  FINYR LIKE BKPF-GJAHR ,
                  MONAT LIKE BKPF-MONAT ,
                  LDDT LIKE BKPF-CPUDT ,
              END OF CHECK_TABO.

DATA : BEGIN OF CT_KEY ,
                  CLIENT LIKE BSEG-MANDT ,
                  COMPANY LIKE BKPF-BUKRS ,
                  FINYR LIKE BKPF-GJAHR ,
                  MONAT LIKE BKPF-MONAT ,
                  LDDT LIKE BKPF-CPUDT ,
               END OF CT_KEY.

START-OF-SELECTION.
IMPORT CHECK_TAB FROM DATABASE INDX(VP) ID 'CDSDATE'.

LOOP AT CHECK_TAB.
      MOVE-CORRESPONDING CHECK_TAB TO CHECK_TABO. APPEND CHECK_TABO.
ENDLOOP.

LOOP AT CHECK_TAB.
     IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
          CHECK_TAB-COMPANY = ZBUKRS.
          CLEAR CT_KEY.
           MOVE: CHECK_TAB-CLIENT TO CT_KEY-CLIENT ,
           CHECK_TAB-COMPANY TO CT_KEY-COMPANY,
           CHECK_TAB-FINYR TO CT_KEY-FINYR ,
            CHECK_TAB-MONAT TO CT_KEY-MONAT ,
            CHECK_TAB-LDDT TO CT_KEY-LDDT.

            EXPORT : CHECK_TAB CT_KEY TO MEMORY.
            SUBMIT ZCDSDTUP
                      WITH YCLIENT = SY-MANDT
                      WITH YCOMPANY = ZBUKRS
                      WITH YFINYR = ZGJAHR
                      WITH YMONAT = CHECK_TAB-MONAT
                      WITH YLDDT = CHECK_TAB-LDDT
                      VIA SELECTION-SCREEN AND RETURN.

               IMPORT CHECK_TAB FROM MEMORY .
        ENDIF.
ENDLOOP. 

SKIP 2.
WRITE :/2 'Position Before Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' ,
35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TABO.
     IF CHECK_TABO-FINYR = ZGJAHR AND CHECK_TABO-MONAT IN ZPERIOD AND
         CHECK_TABO-COMPANY = ZBUKRS.
         WRITE :/5 CHECK_TABO-CLIENT,11 CHECK_TABO-COMPANY,19 CHECK_TABO-FINYR,
                      29 CHECK_TABO-MONAT, 38 CHECK_TABO-LDDT.
      ENDIF.
ENDLOOP.

SKIP 3.
WRITE :/2 'Position After Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' , 35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TAB.
     IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
          CHECK_TAB-COMPANY = ZBUKRS.
          WRITE :/5 CHECK_TAB-CLIENT ,11 CHECK_TAB-COMPANY , 19 CHECK_TAB-FINYR,
                       29 CHECK_TAB-MONAT , 38 CHECK_TAB-LDDT.
     ENDIF.
ENDLOOP.

SKIP 3. ULINE.
WRITE :/7 'PLEASE CONFIRM CAREFULLY THE ABOVE DATES ' ,
               /5 'BEFORE RUNNING THE DATA DOWNLOAD PROGRAM FOR CDS.'.

EXPORT CHECK_TAB TO DATABASE INDX(VP) ID 'CDSDATE'.

 

 

 
 









   
 
PlanetSAP.com

Home     Post a article   Suggestion   Contact  

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