Code: Alles auswählen.
REPORT z_copy_status_submit.
DATA:
object_name TYPE trobj_name.
PARAMETER:
p_prog_s TYPE trdir-name OBLIGATORY,
p_stat_s TYPE rsmpe-status NO-DISPLAY,
p_prog_t TYPE trdir-name OBLIGATORY,
p_stat_t TYPE rsmpe-status NO-DISPLAY.
SELECT-OPTIONS:
s_stat_s FOR p_stat_s OBLIGATORY.
LOOP AT s_stat_s.
p_stat_s = s_stat_s-low.
p_stat_t = s_stat_s-low.
SUBMIT Z_COPY_STATUS
WITH P_prog_s = p_prog_s
WITH P_stat_s = p_stat_s
WITH P_prog_t = p_prog_t
WITH P_stat_t = p_stat_t
AND RETURN.
ENDLOOP.
Code: Alles auswählen.
REPORT z_copy_status.
DATA:
object_name TYPE trobj_name.
PARAMETER:
p_prog_s TYPE trdir-name OBLIGATORY,
p_stat_s TYPE rsmpe-status NO-DISPLAY,
p_prog_t TYPE trdir-name OBLIGATORY,
p_stat_t TYPE rsmpe-status NO-DISPLAY.
CALL FUNCTION 'RS_CUA_COPY_STA'
EXPORTING
im_program = p_prog_s
im_status = p_stat_s
im_tprogram = p_prog_t
im_tstatus = p_stat_t
suppress_dialog = 'X'
generate = 'X'
* IMPORTING
* cobjectname = object_name
* S_STATUS = S_STATUS
* CPROGRAM = CPROGRAM
* S_PROGRAM = S_PROGRAM
EXCEPTIONS
not_executed = 1
insufficient_parameters = 2
unknown_version = 3
s_program_not_found = 4
t_program_not_found = 5
s_status_not_found = 6
t_status_found = 7
wrong_program_type = 8
invalid_status_name = 9
permission_failure = 10
generation_failure = 11
OTHERS = 12.
IF sy-subrc = 0.
object_name = p_prog_t.
CALL FUNCTION 'CUAD_OBJECT_ACTIVATE'
EXPORTING
object_name = object_name
* EXCEPTIONS
* NOT_FOUND = 1
* SYNTAX_ERROR = 2
* GENERATION_FAILED = 3
* OTHERS = 4
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
COMMIT WORK.
ENDIF.