*----------------------------------------------------------------------* * LAYOUT * *----------------------------------------------------------------------* PARAMETERS: pa_src(255) TYPE C LOWER CASE. *----------------------------------------------------------------------* * FORM INSERT_REPORT * *----------------------------------------------------------------------* FORM insert_report. TYPES: BEGIN OF ty_datatab, line(255) TYPE C, END OF ty_datatab. DATA: lt_datatab TYPE TABLE OF ty_datatab, ls_datatab TYPE OF lt_datatab. DATA: lt_filetab TYPE TABLE OF ty_datatab, ls_filetab TYPE lt_filetab. DATA: lv_filename TYPE STRING, lv_progname TYPE PROGNAME, lv_korr TYPE TRKORR, lv_flag TYPE C. lv_filename = pa_src. CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD( EXPORTING FILENAME = lv_filename CHANGING DATA_TAB = lt_filetab ). LOOP AT lt_filetab INTO ls_filetab. lv_filename = ls_filetab. CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD( EXPORTING FILENAME = lv_filename CHANGING DATA_TAB = lt_datatab ). READ TABLE lt_datatab INTO ls_datatab INDEX 3. lv_progname = ls_datatab. SHIFT lv_progname BY 2 PLACES. TRANSLATE lv_progname USING '. '. TRANSLATE lv_progname TO UPPER CASE. CONDENSE lv_progname. CALL FUNCTION 'RS_CORR_INSERT' EXPORTING OBJECT = lv_progname OBJECT_CLASS = 'PROG' DEVCLASS = 'ZBO' KORRNUM = lv_korr SUPPRESS_DIALOG = lv_flag IMPORTING KORRNUM = lv_korr EXCEPTIONS CANCELLED = 1 PERMISSION_FAILURE = 2 UNKNOWN_OBJECTCLASS = 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. lv_flag = 'X'. INSERT REPORT lv_progname FROM lt_datatab. ENDLOOP. ENDFORM.
mercoledì 16 marzo 2016
Inserire o modificare report in modo massivo
Iscriviti a:
Commenti sul post (Atom)
Nessun commento:
Posta un commento