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_COMMIT_ROLLBACK
Version: 3.0 & above
COMMIT & ROLLBACK Data 
Module: FI
   
 
REPORT Z_IMPORT_EXPORT_to_cluster  NO STANDARD PAGE HEADING.
TABLES : ZGLGRP , SKB1.
PARAMETERS : IFILE(30) DEFAULT '/tmp/cdslink.dat' LOWER CASE,
                              PBUKRS LIKE BKPF-BUKRS ,
                              PKTOPL LIKE ZGLGRP-KTOPL.
DATA : BEGIN OF TAB1 OCCURS 100 ,
                   NEWGL(6) ,
                   OLDGL(4) ,
                   LINK(2) ,
              END OF TAB1.
DATA : BEGIN OF TAB2 OCCURS 100.
                INCLUDE STRUCTURE ZGLGRP.
DATA : END OF TAB2.
DATA : LIN(4) TYPE N ,
             GLOK(1) VALUE 'N' ,
             GL10(10) ,

START-OF-SELECTION.
OPEN DATASET IFILE FOR INPUT IN TEXT MODE.
DO.
    CLEAR TAB1.
    READ DATASET IFILE INTO TAB1.
    IF SY-SUBRC NE 0.
         EXIT.
     ENDIF.
     PERFORM GET_GLOK.
     IF GLOK = 'Y'.
          CLEAR TAB2.
          MOVE : SY-MANDT TO TAB2-MANDT , PKTOPL TO TAB2-KTOPL ,
                        PBUKRS TO TAB2-BUKRS , GL10 TO TAB2-HKONT ,
                        TAB1-LINK TO TAB2-ZCDSGRP.
           APPEND TAB2.
      ELSE.
           APPEND TAB1.
      ENDIF.
ENDDO.
END-OF-SELECTION.
*
MODIFY ZGLGRP FROM TABLE TAB2.
DESCRIBE TABLE TAB2 LINES LIN.
IF LIN NE SY-DBCNT.
     LIN = LIN - SY-DBCNT.
     ROLLBACK WORK.
     WRITE :/2 'Update Failed For ' , LIN ,
   ' Records. Table ROLLED BACK Entirely'.
ELSE.
      COMMIT WORK.
ENDIF.
*
CLEAR LIN.
DESCRIBE TABLE TAB1 LINES LIN.
IF LIN > 0.
    WRITE :/2 'Reocrds Not Updated '. ULINE /2(25).
    LOOP AT TAB1.
          WRITE :/4 TAB1-NEWGL , TAB1-LINK .
     ENDLOOP.
ENDIF.

FORM GET_GLOK.
    MOVE 'N' TO GLOK.
    CLEAR GL10. MOVE : '0000' TO GL10 , TAB1-NEWGL TO GL10+4(6).
    SELECT SINGLE * FROM SKB1 WHERE BUKRS = PBUKRS
             AND SAKNR = GL10.
     IF SY-SUBRC EQ 0.
         MOVE 'Y' TO GLOK.
     ENDIF.
ENDFORM.
 

 

 
 









   
 
PlanetSAP.com

Home     Post a article   Suggestion   Contact  

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