Create uncompressed Transport

Nützliche Abap Codes und Code Fragmente

Create uncompressed Transport

Postby Tron » Wed May 06, 2020 9:42 pm

Moin.
So denn:
Das Coding arbeitet mit einem Serververzeichnis e.g. C:\000
In DIR_WORK wird das LOG (Jens.log) geschrieben .
Nicht freigegebene Transporte werden "released" und nach C:\000 geschrieben.
Von der Vorgehensweise würde ich den Transport "normal" freigeben und dann noch mal mit diesem Programm eine "unkomprimierte Fassung erzeugen.
So erhält man auch die Cofiles Datei.
Für Unix sind die Pfade ggf. anzupassen.

Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. *&---------------------------------------------------------------------*
  2. *& YBC_RUN_R3TRANS_COMMAND
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8.  
  9. REPORT  ybc_run_r3trans_command.
  10.  
  11. DATA:tabl TYPE TABLE OF tab512 WITH HEADER LINE,
  12.            tpcmd(256).
  13.  
  14.  
  15. DATA sep(1).
  16. DATA tr_path(256).
  17. DATA t_script TYPE TABLE OF tab512.
  18. DATA s_script TYPE tab512.
  19. DATA fn TYPE string.
  20.  
  21. PARAMETERS p_trkorr TYPE trkorr DEFAULT 'NSPK900039'.
  22. PARAMETERS p_work(40) DEFAULT 'c:\000'.
  23.  
  24.  
  25. * Get APPSERVERS Path separator ***
  26. CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SEP'
  27.      ID 'VALUE' FIELD sep.
  28.  
  29. * Get Executable PATH
  30. CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'DIR_CT_RUN'
  31.      ID 'VALUE' FIELD tr_path.
  32.  
  33. *  EXPORT
  34. *  CLIENT = 001
  35. *  COMPRESS = " "
  36. *  FILE = "C:\000\R900056.NSP"
  37. *  USE COMMANDFILE NSPK900056
  38. *  EXPORT
  39. *  CREATECOFILE (ist nich das Selbe Format)
  40.  
  41. s_script-wa = 'EXPORT'.APPEND s_script TO t_script.
  42. s_script-wa = 'COMPRESS = " "'.APPEND s_script TO t_script.
  43. CONCATENATE 'FILE = "' p_work sep 'R' p_trkorr+4 '.' sy-sysid '"' INTO  s_script-wa. APPEND s_script TO t_script.
  44. CONCATENATE 'USE COMMANDFILE' p_trkorr INTO  s_script-wa SEPARATED BY space. APPEND s_script TO t_script.
  45.  
  46.  
  47. CONCATENATE  p_work sep 'expo.txt' INTO fn.
  48.  
  49. OPEN DATASET fn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
  50. LOOP AT t_script INTO s_script.
  51.   TRANSFER s_script-wa TO fn.
  52. CLOSE DATASET fn.
  53.  
  54. * R3trans -w NSPK900039.log -v -u 18 C:\000\EXPO.txt
  55. clear tpcmd .
  56. concatenate tr_path sep 'R3Trans.exe' into tpcmd.
  57. concatenate tpcmd '-w Jens.log -v -u 18' fn into tpcmd separated by space.
  58.  
  59. REFRESH tabl.
  60. CALL 'SYSTEM' ID 'COMMAND' FIELD tpcmd ID 'TAB' FIELD tabl-*sys*.
  61.  
  62. LOOP AT tabl.
  63.   WRITE : / tabl-wa COLOR COL_TOTAL.
  64.  
  65.  
GeSHi ©


gruß Jens
Tron
.....
.....
 
Posts: 1098
Joined: Sat Aug 04, 2007 10:21 pm

Linux: Create uncompressed Transport

Postby Tron » Sat May 09, 2020 12:36 pm

... hier noch das Ganze für das Linux Mini SAP
1.) Seververzeichnis (e.g.DIR_XTRANS) anlegen und in AL11 publizieren.
000.png
000.png (33.98 KiB) Viewed 155 times


2.) R3trans von den Executable Verz. /usr/sap/NPL/SYS/exe/run/ nach DIR_XTRANS kopieren.

3.) Programm anlegen
Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. *&---------------------------------------------------------------------*
  2. *& Report ZXTRANS
  3. *&---------------------------------------------------------------------*
  4. *&
  5. *&---------------------------------------------------------------------*
  6. REPORT zxtrans.
  7. DATA:tabl        TYPE TABLE OF tab512 WITH HEADER LINE,
  8.      tpcmd(2048).
  9.  
  10. DATA lv_workdir(256).
  11.  
  12. DATA sep(1).
  13. DATA tr_path(256).
  14. DATA t_script TYPE TABLE OF tab512.
  15. DATA s_script TYPE tab512.
  16. DATA fn(256) .
  17. DATA p1(256) .
  18. DATA l_value TYPE  text255.
  19.  
  20. PARAMETERS p_trkorr TYPE trkorr DEFAULT 'NPLK900036'.
  21. PARAMETERS p_work(20)  DEFAULT 'DIR_XTRANS'.
  22.  
  23.  
  24.  
  25. ** Get APPSERVERS Path separator ***
  26. *CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SEP'
  27. *     ID 'VALUE' FIELD sep.
  28.  
  29. CALL FUNCTION 'RSPO_R_SAPGPARAM'
  30.   EXPORTING
  31.     name   = 'DIR_SEP'
  32.   IMPORTING
  33.     value  = l_value
  34.   EXCEPTIONS
  35.     error  = 1
  36.     OTHERS = 2.
  37.  
  38. sep = l_value.
  39.  
  40. * Get Workdir
  41. SELECT SINGLE dirname FROM user_dir INTO lv_workdir WHERE aliass EQ p_work.
  42. CONCATENATE lv_workdir sep INTO lv_workdir.
  43. tr_path = lv_workdir.
  44.  
  45. *  EXPORT
  46. *  CLIENT = 001
  47. *  COMPRESS = " "
  48. *  FILE = "/usr/sap/NPL/interface/Xtrans/R900056.NSP"
  49. *  USE COMMANDFILE NSPK900056
  50. *  EXPORT
  51. *  CREATECOFILE (ist nich das Selbe Format)
  52.  
  53. s_script-wa = 'EXPORT'.APPEND s_script TO t_script.
  54. s_script-wa = 'COMPRESS = " "'.APPEND s_script TO t_script.
  55. CONCATENATE 'FILE = "' tr_path 'R' p_trkorr+4 '.' sy-sysid '"' INTO  s_script-wa. APPEND s_script TO t_script.
  56. CONCATENATE 'USE COMMANDFILE' p_trkorr INTO  s_script-wa SEPARATED BY space. APPEND s_script TO t_script.
  57. CONCATENATE  lv_workdir 'ExportCMD.txt' INTO fn.
  58.  
  59. OPEN DATASET fn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
  60. LOOP AT t_script INTO s_script.
  61.   TRANSFER s_script-wa TO fn.
  62. CLOSE DATASET fn.
  63.  
  64. * R3trans -w /path/NSPK900039.log -v -u 18 /path/ExportCMD.txt
  65. CLEAR: tpcmd,p1 .
  66. CONCATENATE tr_path  'R3trans' INTO tpcmd.
  67. CONCATENATE tpcmd '-w' lv_workdir INTO p1 SEPARATED BY space.
  68. CONCATENATE p1  p_trkorr '.log' INTO tpcmd.
  69. CONCATENATE tpcmd '-v -u 18' fn INTO tpcmd SEPARATED BY space.
  70.  
  71. REFRESH tabl.
  72. CALL 'SYSTEM' ID 'COMMAND' FIELD tpcmd ID 'TAB' FIELD tabl-*sys*.
  73.  
  74. LOOP AT tabl.
  75.   WRITE : / tabl-wa COLOR COL_TOTAL.
GeSHi ©


4.) Einen Transportauftrag wählen uns starten.

Ergebnis:
Hier ist der Transportkurztext :
006.png
006.png (107.66 KiB) Viewed 155 times


Alle Dateien sind nunmehr hier abgelegt.
004.png
004.png (26.91 KiB) Viewed 155 times


Ich habe auch das ALOG und Cofiles eingesehen... Völlig unbeeindruckt.
gruß Jens
Tron
.....
.....
 
Posts: 1098
Joined: Sat Aug 04, 2007 10:21 pm


Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron
  • Latest Topics