Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
Hello,

By default, one cannot schedule local and remote client copies as periodic job in SM37. Reason for that is because client copy program RSCLXCOP does neither allow inputs in dialog mode from SE38 (no selection screens) nor does it allow custom variant creation or execution in dialog/batch. Hence one always ends up creating new client copy job in SCCL or SCC9 every week or specific period.

E.g.







 

So in case you have a requirement to periodically run local or remote client copies, you must edit program RSCLXCOP as shown below. Post this editing you can create variant of the report and schedule periodic batch job to use that variant serving the requirement.

 

Edited version of the program RSCLXCOP:

============================================================================

REPORT RSCLXCOP MESSAGE-ID TA LINE-SIZE 100.
*---------------------------------------------------------------------*
* Erweitertes Client Copy: *
* Mandanten kopieren *
* nur Paramterdeklarationen fuer das Selektionsbild *
* ( vierstellige Paramter IDs fuer CCCEXIT ) *
*---------------------------------------------------------------------*

*{ INSERTED BLOCK START

PARAMETERS: PROFIL LIKE CCPROF-PROFIL DEFAULT SPACE. " Client copy profile
PARAMETERS: COPYCLI LIKE CCCFLOW-MANDT. " Source client for application data copy
PARAMETERS: USERCLI LIKE CCPROF-USER_MANDT DEFAULT SPACE. " Source client for user copy
PARAMETERS: APPL LIKE STRMPAR-CCAPPLDATA. " Copy application data?
PARAMETERS: SUSR LIKE STRMPAR-CCSUSR DEFAULT ' '." Copy user data?
PARAMETERS: MODUS LIKE STRMPAR-CCMODUS DEFAULT 'C'. " C/M/E/I (Copy/Remote/Export/Import)
PARAMETERS: DELTABS LIKE CCCFLOW-DELTABS DEFAULT 'X'. " Delete rest (e.g. default 'X' for SAP_ALL, unselect for SAP_USER)
PARAMETERS: ALTINP LIKE STRMPAR-CCSELMODE. " A/C/S (All/CommF/Copy Err)
PARAMETERS: PROF LIKE STRMPAR-CCPROF. " Prof/Berecht
PARAMETERS: VARCOP LIKE CCPROF-CCVARCOP DEFAULT SPACE. " Variant

*} INSERTED BLOCK END

 

*{ DELETED BLOCK START
*\PARAMETERS: COPYCLI LIKE CCCFLOW-MANDT " source client
*\ NO-DISPLAY.
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: APPL LIKE STRMPAR-CCAPPLDATA " Anw.daten
*\ NO-DISPLAY.
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: SUSR LIKE STRMPAR-CCSUSR DEFAULT ' '" Benutzerstämme
*\ NO-DISPLAY.
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: DELTABS LIKE CCCFLOW-DELTABS DEFAULT 'X'
*\ NO-DISPLAY. " Lösche Rest
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: MODUS LIKE STRMPAR-CCMODUS DEFAULT 'C' "C/M/E/I
*\ NO-DISPLAY. " Copy/Remote/Export/Import
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: ALTINP LIKE STRMPAR-CCSELMODE " A/C/S
*\ NO-DISPLAY. " All/CommF/Copy Err
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: PROF LIKE STRMPAR-CCPROF " Prof/Berecht
*\ NO-DISPLAY.
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: PROFIL LIKE CCPROF-PROFIL DEFAULT SPACE
*\ NO-DISPLAY. " Kopierprofil
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: USERCLI LIKE CCPROF-USER_MANDT DEFAULT SPACE
*\ NO-DISPLAY. " Quelle Benutzer
*} DELETED BLOCK END

*{ DELETED BLOCK START
*\PARAMETERS: VARCOP LIKE CCPROF-CCVARCOP DEFAULT SPACE
*\ NO-DISPLAY. " Varianten
*} DELETED BLOCK END

 

*\ Below is the unchanged content of the program

PARAMETERS: RESTART LIKE STRMPAR-CCRESTART " Restart
NO-DISPLAY.

PARAMETERS: SUPCOPY LIKE STRMPAR-CCTESTRUN " X = Simulation
NO-DISPLAY. " R = Res. Anal.

PARAMETERS: COMFILE LIKE E070-TRKORR " Commfile-Eingabe
NO-DISPLAY. " für SCC1

PARAMETERS: CLII LIKE STRMPAR-CCCLIINDEP DEFAULT SPACE
NO-DISPLAY. " mand.unabh. Cust.

PARAMETERS: CCRESET LIKE CCPROF-CCRESET DEFAULT SPACE
NO-DISPLAY. " SCC5

PARAMETERS: TARGET LIKE CCPROF-TARGET_SYS DEFAULT SPACE
NO-DISPLAY. " SCC8
PARAMETERS: DELT000 LIKE CCPROF-T000_DEL DEFAULT SPACE
NO-DISPLAY. " SCC5
PARAMETERS: SOURSYS LIKE RFCDES-RFCDEST
NO-DISPLAY. " SCC9
PARAMETERS: INCL LIKE STRMPAR-INCL_TASK
NO-DISPLAY. " SCC1
PARAMETERS: NOMAST LIKE CCPROF-NO_CDPOS DEFAULT SPACE
NO-DISPLAY. " X = Test ; R = Recovery
PARAMETERS: TSTAMP LIKE CCCFLOW-TSTAMP "For 'Copy errors'
NO-DISPLAY.
*INCLUDE RSCCDATA.
DATA: BEGIN OF DUMMY.
INCLUDE STRUCTURE CCPROF.
DATA: END OF DUMMY.

TABLES: CCPROF, CCPROFSR.
*---------------------------------------------------------------------*
* Dynamische Parametervorbelegungen (nur bei RESTART) *
*---------------------------------------------------------------------*

IF ALTINP IS INITIAL.
MESSAGE I134.
* Der Report RSCLXCOP darf nicht direkt gestartet werden
EXIT.
ENDIF.

DUMMY-PROFIL = PROFIL.
DUMMY-MANDANT = COPYCLI.
DUMMY-USER_STAMM = SUSR.
DUMMY-SOURCE_SYS = SOURSYS.
DUMMY-APPL_DATA = APPL.
DUMMY-USER_PRFL = PROF.
IF ALTINP <> 'C'.
SELECT SINGLE * FROM CCPROF WHERE PROFIL = PROFIL.
IF SY-SUBRC = 0.
DUMMY-MANDT_DATA = CCPROF-MANDT_DATA.
ELSE.
MESSAGE ID 'TA' TYPE 'E' NUMBER '210' WITH PROFIL.
* Profil & nicht vorhanden
ENDIF.
ELSE.
DUMMY-MANDT_DATA = 'X'.
ENDIF.
DUMMY-CLEAR_REST = DELTABS.
DUMMY-NKRESET = 'X'.
DUMMY-CLII = CLII.
DUMMY-NO_CDPOS = NOMAST.
DUMMY-CCRESET = CCRESET.
IF CCRESET = 'X'.
DUMMY-T000_DEL = DELT000.
ENDIF.
DUMMY-USER_MANDT = USERCLI.
DUMMY-TARGET_SYS = TARGET.
DUMMY-CCVARCOP = VARCOP.
CCPROFSR-SRCCLIENT = COPYCLI.
CCPROFSR-SRCUCLINT = USERCLI.
CCPROFSR-SOURCE_SYS = SOURSYS.
CCPROFSR-TARGET_SYS = TARGET.
CCPROFSR-PROFIL = PROFIL.

IF ALTINP = 'C'.
CALL FUNCTION 'SCCR_PERFORM_SCC1'
EXPORTING
CCSUPCOPY = SUPCOPY
CCCOMFILE = COMFILE
QUELLMANDANT = COPYCLI
INCL_TASK = INCL.

ELSEIF ALTINP = 'S'.
CALL FUNCTION 'SCCR_PERFORM_TABLE_COPY'
EXPORTING
PROFILE = DUMMY
CCMODUS = MODUS
CCSUPCOPY = SUPCOPY
CCCOMFILE = COMFILE
CCTABLIST = SPACE
CCRESTART = RESTART
QUELLMANDANT = COPYCLI
PROF_PARM = CCPROFSR
CHANGING
TSTAMP = TSTAMP.

ELSE.
CALL FUNCTION 'SCCR_PERFORM_CLIENT_COPY'
EXPORTING
PROFILE = DUMMY
CCALTINP = ALTINP
CCMODUS = MODUS
CCSUPCOPY = SUPCOPY
CCCOMFILE = COMFILE
CCTABLIST = SPACE
CCRESTART = RESTART
QUELLMANDANT = COPYCLI
INCL_TASK = INCL
PROF_PARM = CCPROFSR.
ENDIF.

*\ End of program


============================================================================

 

Once you have edited program, you would be allowed run program directly in dialog or batch, you can create as many variants as required e.g. for local or remote client copy, user master copy etc. I have added below few examples for your reference.



Variant for client copy with SAP_ALL profile and client 121 as Source Client



Variant for client copy with SAP_USER profile and client 121 as Source Client



Periodic job from SM37 and one of the job log



 

I hope above details will help BASIS administrators setup client copies periodically via SM37 or BPA/CPS like we did on our end.

 

Reference SAP note: 303007

 
Labels in this area