Sunday, April 29, 2012

Testing tool designed to ensure minimu transport requests for any object changed in development

                                                                
* This program is for testing purposes only.
* Make sure the correct version of this program is available in QA or PA

* This program will copy the code and text elements of the program in
* in DEV that got changed and which requires testing in QA before the
* CTS is released to QA and PA. ESSENTIALLY THIS WILL RUN THE CODE IN
* DEVELOPMENT IN QUALITY CLIENT WITHOUT TRANSPORTING THE CHNAGE TO QA.

* Using this tool will minimize the number of times the chnaged object
* has to be moved from DEV to QA for testing to be completed.

* EXECUTE THIS PROGRAM FROM QA FOR TESTING ANY PROGRAM
report  zz_test_program_rfc_read message-id fb.
tables: trdir.
* By default the changed program will be in DEV - choose correct name
* of the DEv clnt in the system
parameters: rfcdest like rsedr-sysid obligatory default 'DA1CLNT100'.

* The name of the report you changed in DEV that needs to be tested
* in QA
parameters: p_rep like rsedr-repid obligatory.

* By default the program code and txt elements will be uploaded to
* this name so that the original version in QA is not overwritten.
parameters: p_rep1 like rsedr-repid obligatory default 'Z_NEW_REPORT'.

data: begin of itab occurs 0.
        include structure  d022s.
data: end of itab.

data: progname like sy-cprog.
data: source_table(72) occurs 0 with header line.
data: entry like textpool-entry.
data: itab1  like textpool occurs 50 with header line.
data: itab2  like textpool occurs 50 with header line.

*------------------------------------------------
perform call_program.
if sy-subrc ne 0.
  message e000 with 'Program not generated.'.
endif.

submit (p_rep1) via selection-screen and return.
*&---------------------------------------------------------------------*
*&      Form  call_program
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form call_program .

  perform read_report.
  loop at itab.
    move itab to source_table.
    append source_table. clear source_table.
  endloop.
*
  insert report p_rep1 from source_table state 'A' ." keeping directory
* entry
 .
  if sy-subrc ne 0.
    message e000 with 'Program not generated.'.
  endif.
*
  perform upload_texts.

endform.                    " call_program
*&---------------------------------------------------------------------*
*&      Form  read_report
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form read_report .

  call function 'RFC_READ_DEVELOPMENT_OBJECT'
    destination rfcdest
    exporting
      program = p_rep
    tables
      qtab    = itab
      texttab = itab2.

  if sy-subrc ne 0.
    message e000 with 'Program not read from development.'.
  endif.

endform.                    " read_report
*&---------------------------------------------------------------------*
*&      Form  upload_texts
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form upload_texts .

  insert textpool p_rep1 from itab2 language sy-langu.
  if sy-subrc ne 0.
    message e000 with 'Texts not generated.'.
  endif.

endform.                    " upload_texts

No comments:

Post a Comment