Anda di halaman 1dari 18

************************************************************************ * Title : Z_DAILY_LOAD_STATUS * * * * Description : Download Daily Load Status Report * * ** * * * * ************************************************************************ *Purpose: * * * * This Program is used * * - to download

Daily Load Status Report * * - save the report in the WINBIND shared folder * * To reduce manual entry of records * * - Check status of the Daily Loads * * - Eliminate manual errors while updating the Report * * * ************************************************************************ * Inputs : Date range * * InfoProvider Names * * Output file path(except file name) * * * * Outputs : Excel file containing Daily loads (or) * * .CSV file to Application Server * * * ************************************************************************ * * * Processing Steps: * * * * 1. Read matching data from Tables related to Infoproviders based on * * the date specified * * 2. output data to output file * * * ************************************************************************ ************************************************************************ REPORT Z_DAILY_LOAD_STATUS NO STANDARD PAGE HEADING LINE-SIZE 300 LINE-COUNT 2000. ************************************************************************ * DATA Declarations * ************************************************************************ data: c(30) type c, p_sep(01) type c value ','. " field separator

* Frame1 for selection screen selection-screen begin of block bl1 with frame title text-bl1. SELECT-OPTIONS: SEL_CUBE for c, s_datum for sy-datum.

selection-screen end of block bl1. *Frame2 for selectin Screen selection-screen begin of block bl2 with frame title text-bl2. * Output to Presentation Server parameters: p_phys radiobutton group rad1 default 'X', path(100) type c. * Output to Application server parameters: p_log radiobutton group rad1, path1 type FILENAME-FILEEXTERN default 'Z_DAILY_LOAD_STATUS'. '/userdata/is/erp/dataconversion/'.

selection-screen end of block bl2. data: begin of work, filename type rlgrap-filename, buffer(1024) type c, end of work. ************************************************************************ * Internal Tables * ************************************************************************ types: Begin of IT_MON , I_OBJ_TYPE type TADIR-OBJECT, I_PROV_NM type TADIR-OBJ_NAME, I_PROV_DESC type RSDCUBET-TXTLG, I_ISOURCE type RSUPDINFO-ISOURCE, I_IPACK_DESC type RSLDPIOT-TEXT , I_RNR type RSREQDONE-RNR, I_TR_RECS type RSREQDONE-RECORDS, I_UPD_RECS type RSMONICDP-REC_INSERT, I_RNR_STAT type RSREQDONE-TSTATUS, I_START_DATE type sy-datum," RSREQDONE-TDATUM, I_START_TIME type sy-uzeit," RSREQDONE-TUZEIT, I_END_TIME type sy-uzeit,"RSREQDONE-QMUZEIT, End of IT_MON. types: Begin of IT_RSREQDONE, R_LOGDPID type RSREQDONE-LOGDPID, R_RNR type RSREQDONE-RNR, R_TSTATUS type RSREQDONE-TSTATUS, R_DATUM type RSREQDONE-DATUM, R_UZEIT type RSREQDONE-UZEIT, R_QMSTATUS type RSREQDONE-QMSTATUS, R_TDATUM type RSREQDONE-TDATUM, " work fields

R_TUZEIT type RSREQDONE-TUZEIT, R_ROLLUP type RSREQDONE-ROLLUP, R_COMPRESSED type RSREQDONE-COMPRESSED, R_CODS_ACTIVATED type RSREQDONE-CODS_ACTIVATED, R_TIMESTAMPBEGIN type RSREQDONE-TIMESTAMPBEGIN, R_TIMESTAMPEND type RSREQDONE-TIMESTAMPEND, R_RECORDS type RSREQDONE-RECORDS, End of IT_RSREQDONE. types: Begin of IT_request1, OBJECT type TADIR-OBJECT, OBJ_NAME type TADIR-OBJ_NAME, ISOURCE type RSUPDINFO-ISOURCE, LOGDPID type RSLDPIO-LOGDPID, R_RNR type RSREQDONE-RNR, R_TSTATUS type RSREQDONE-TSTATUS, R_DATUM type RSREQDONE-DATUM, R_UZEIT type RSREQDONE-UZEIT, R_QMSTATUS type RSREQDONE-QMSTATUS, R_TDATUM type RSREQDONE-TDATUM, R_TUZEIT type RSREQDONE-TUZEIT, R_TIMESTAMPBEGIN type RSREQDONE-TIMESTAMPBEGIN, R_TIMESTAMPEND type RSREQDONE-TIMESTAMPEND, R_RECORDS type RSREQDONE-RECORDS, End of IT_Request1. types: Begin of it_ctext1 , OBJECT type TADIR-OBJECT, OBJ_NAME type TADIR-OBJ_NAME, TXTLG type RSDCUBET-TXTLG, ISOURCE type RSUPDINFO-ISOURCE, LOGDPID type RSLDPIO-LOGDPID, LT_TEXT type RSLDPIOT-TEXT, R_RNR type RSREQDONE-RNR, R_TSTATUS type RSREQDONE-TSTATUS, R_DATUM type RSREQDONE-DATUM, R_UZEIT type RSREQDONE-UZEIT, R_QMSTATUS type RSREQDONE-QMSTATUS, R_TDATUM type RSREQDONE-TDATUM, R_TUZEIT type RSREQDONE-TUZEIT, R_TIMESTAMPBEGIN type RSREQDONE-TIMESTAMPBEGIN, R_TIMESTAMPEND type RSREQDONE-TIMESTAMPEND, R_RECORDS type RSREQDONE-RECORDS, u_records type RSMONICDP-REC_INSERT, End of it_ctext1. types: Begin of IT_RSUPDINFO , U_INFOCUBE type RSUPDINFO-INFOCUBE, U_ISOURCE type RSUPDINFO-ISOURCE, End of IT_RSUPDINFO.

types: Begin of IT_TADIR , T_OBJECT type TADIR-OBJECT, T_OBJ_NAME type TADIR-OBJ_NAME, End of IT_TADIR. types: Begin of IT_RSLDPIO, L_LOGDPID type RSLDPIO-LOGDPID, L_SOURCE type RSLDPIO-SOURCE, End of IT_RSLDPIO. types: Begin of IT_RSLDPIOT, LT_LANGU type RSLDPIOT-LANGU, LT_LOGDPID type RSLDPIOT-LOGDPID, LT_TEXT type RSLDPIOT-TEXT, End of IT_RSLDPIOT. types: Begin of IT_RSDCUBET, C_LANGU type RSDCUBET-LANGU, C_INFOCUBE type RSDCUBET-INFOCUBE, C_TXTLG type RSDCUBET-TXTLG, End of IT_RSDCUBET. types: Begin of IT_obj, OBJECT type TADIR-OBJECT, OBJ_NAME type TADIR-OBJ_NAME, ISOURCE type RSUPDINFO-ISOURCE, End of IT_obj. types: Begin of IT_pack1, OBJECT type TADIR-OBJECT, OBJ_NAME type TADIR-OBJ_NAME, ISOURCE type RSUPDINFO-ISOURCE, LOGDPID type RSLDPIO-LOGDPID, End of IT_pack1. types: Begin of IT_RSDODSOT, O_LANGU type RSDODSOT-LANGU, O_ODSOBJECT type RSDODSOT-ODSOBJECT, O_TXTLG type RSDODSOT-TXTLG, End of IT_RSDODSOT.

types:Begin of IT_RSMONICTAB, M_RNR type RSMONICTAB-RNR, M_INFOCUBE type RSMONICTAB-INFOCUBE, M_REQ_INSERT type RSMONICTAB-REQ_INSERT, End of IT_RSMONICTAB. types: Begin of t_IT_MON, I_OBJ_TYPE(4) type c, I_PROV_NM(40) type c, I_PROV_DESC(60) type c, I_ISOURCE(30) type c, I_IPACK_DESC(60) type c, I_RNR(30) type c, I_TR_RECS(11) type c, I_UPD_RECS(11) type c, I_RNR_STAT type RSREQDONE-TSTATUS, I_START_DATE(10) type c, I_START_TIME(8) type c, I_END_TIME(8) type c, End of t_IT_MON. data: it_request type standard table of it_request1, wa_request type it_request1, it_pack type standard table of it_pack1 , wa_pack type it_pack1, it_obj1 type standard table of it_obj," with header line, wa_obj1 type it_obj, * it_upd type standard table of it_rsupdinfo," with header line, wa_upd type it_rsupdinfo, it_odsot type standard table of it_rsdodsot," with header line, wa_odsot type it_rsdodsot, it_ldpio type standard table of it_rsldpio, wa_ldpio type it_rsldpio, * * it_dir type standard table of it_tadir, wa_dir type it_tadir, it_cubet type standard table of it_rsdcubet," with header line, wa_cubet type it_rsdcubet, it_ldpiot type standard table of it_rsldpiot," with header line, wa_ldpiot type it_rsldpiot,

it_reqdone type standard table of it_rsreqdone, wa_reqdone type it_rsreqdone, * it_rsiccont type standard table of rsiccont," with header line, wa_rsiccont type rsiccont, it_reqdone2 type standard table of it_rsreqdone," with header line, wa_reqdone2 type it_rsreqdone, it_reqdone1 type standard table of it_rsreqdone," with header line, wa_reqdone1 type it_rsreqdone, it_montab type standard table of it_rsmonictab," with header line, wa_montab type it_rsmonictab, it_ctext type standard table of it_ctext1," with header line, wa_ctext type it_ctext1, it_final type standard table of it_mon," with header line, wa_final type it_mon, wa_it_mon type t_it_mon, tb_it_mon type standard table of t_it_mon. Perform it_tadir. perform it_ldpio. Perform get_pack. Perform it_rsdcubet. Perform it_odsot. Perform it_ldpiot. Perform it_rsreqdone. perform get_request_no. Perform it_rsmonictab. Perform get_cubetext. Perform final_data. perform get_physical_filename using path1 changing work-filename. Perform download. ************************************************************************ * *SUBROUTINES * ***********************************************************************

*&---------------------------------------------------------------------* *& Form it_tadir *&---------------------------------------------------------------------* * Fetch InfoProvider type and Infosource *----------------------------------------------------------------------*

FORM it_tadir . Select a~object a~obj_name b~isource into table it_obj1 from tadir as a inner join RSUPDINFO as b on a~obj_name = b~infocube where a~obj_name in sel_cube and b~objvers = 'A' and a~object in ('CUBE','ODSO'). ENDFORM. " it_tadir

*&---------------------------------------------------------------------* *& Form it_rsdcubet *&---------------------------------------------------------------------* * Fetch InfoCube Texts *----------------------------------------------------------------------* FORM it_rsdcubet . select langu infocube txtlg from rsdcubet into table it_cubet where infocube in sel_cube and langu = 'EN' and OBJVERS = 'A'. ENDFORM. " it_rsdcubet

*&---------------------------------------------------------------------* *& Form it_odsot *&---------------------------------------------------------------------* * Fetch ODS Texts *----------------------------------------------------------------------* FORM it_odsot . select langu odsobject txtlg from rsdodsot into table it_odsot where odsobject in sel_cube and langu = 'EN' and OBJVERS = 'A'. ENDFORM. " it_odsot

*&---------------------------------------------------------------------* *& Form it_ldpio *&---------------------------------------------------------------------* * Fetch Z* Infopackages based on the Infosources

*----------------------------------------------------------------------* FORM it_ldpio . select logdpid source from rsldpio into table it_ldpio for all entries in it_upd where OBJVERS = 'A' and source = it_upd-u_isource and logdpid not like 'PRNR_%' group by source logdpid. ENDFORM. " it_ldpio

*&---------------------------------------------------------------------* *& Form it_ldpiot *&---------------------------------------------------------------------* * Fetch InfoPackage Descriptions *----------------------------------------------------------------------* FORM it_ldpiot . select langu logdpid text from rsldpiot into table it_ldpiot for all entries in it_ldpio where langu = 'EN' and logdpid = it_ldpio-l_logdpid. ENDFORM. " it_ldpiot

*&---------------------------------------------------------------------* *& Form it_rsreqdone *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * Fetch Updated Request Number Details for the InfoProviders based * * on Infopackages *----------------------------------------------------------------------* FORM it_rsreqdone . data :count like sy-tabix. select logdpid rnr tstatus datum uzeit qmstatus tdatum tuzeit rollup compressed

cods_activated timestampbegin timestampend records from rsreqdone into table it_reqdone for all entries in it_ldpio where logdpid = it_ldpio-l_logdpid and datum in s_datum . select rnr icube from rsiccont into table it_rsiccont where icube in sel_cube. sort it_reqdone by r_timestampbegin descending r_timestampbegin. * sort it_reqdone by r_logdpid descending r_timestampbegin. loop at it_reqdone into wa_reqdone. read table it_rsiccont with key rnr = wa_reqdone-r_rnr transporting no fields. if sy-subrc = 0. *loop at it_reqdone into wa_reqdone. *write:/ * wa_reqdone-R_LOGDPID , * wa_reqdone-R_RNR , * wa_reqdone-R_TSTATUS , * wa_reqdone-R_DATUM , * wa_reqdone-R_UZEIT , * wa_reqdone-R_TDATUM, * wa_reqdone-R_TUZEIT , * wa_reqdone-R_TIMESTAMPBEGIN , * wa_reqdone-R_TIMESTAMPEND , * wa_reqdone-R_RECORDS. * ** endloop. *skip 5. * * move wa_reqdone to it_reqdone2. append wa_reqdone to it_reqdone2. clear wa_reqdone. endif. endloop.

loop at it_reqdone2 into wa_reqdone2 . count = sy-tabix. * read table it_reqdone index sy-tabix. at new r_logdpid.

read table it_reqdone2 into wa_reqdone2 index count. if sy-subrc = 0. * * move it_reqdone2 to it_reqdone1. append wa_reqdone2 to it_reqdone1. clear it_reqdone2. endif. endat. endloop. ENDFORM. " it_rsreqdone

*&---------------------------------------------------------------------* *& Form it_rsmonictab *&---------------------------------------------------------------------* * Fetch Updated Records for a Request *----------------------------------------------------------------------* FORM it_rsmonictab . select rnr infocube req_insert from rsmonictab into table it_montab for all entries in it_reqdone where infocube in sel_cube and rnr = it_reqdone-r_rnr. ENDFORM. " it_rsmonictab

*&---------------------------------------------------------------------* *& Form get_pack *&---------------------------------------------------------------------* * Insert Infopackage details into internal table *----------------------------------------------------------------------* FORM get_pack . loop at it_ldpio into wa_ldpio. *loop at it_obj1 into wa_obj1. read table it_obj1 into wa_obj1 with key isource = wa_ldpio-l_source . if sy-subrc = 0. move: wa_obj1-obj_name to wa_pack-obj_name, wa_obj1-object to wa_pack-object, wa_obj1-isource to wa_pack-isource,

wa_ldpio-l_LOGDPID to wa_pack-LOGDPID. append wa_pack to it_pack. clear wa_pack. endif. *endloop. endloop. ENDFORM. " get_pack

*&---------------------------------------------------------------------* *& Form get_request_no *&---------------------------------------------------------------------* * Fetch InProvider details and Request details into internal table *----------------------------------------------------------------------* FORM get_request_no . loop at it_pack into wa_pack. read table it_reqdone1 into wa_reqdone1 with key r_LOGDPID = wa_pack-LOGDPID. if sy-subrc = 0.

move : wa_pack-object to wa_request-object, wa_pack-obj_name to wa_request-OBJ_NAME, wa_pack-ISOURCE to wa_request-ISOURCE, wa_pack-LOGDPID to wa_request-LOGDPID, wa_reqdone1-r_rnr to wa_request-r_rnr, wa_reqdone1-r_tstatus to wa_request-r_tstatus, wa_reqdone1-R_DATUM to wa_request-r_DATUM, wa_reqdone1-R_UZEIT to wa_request-r_UZEIT, wa_reqdone1-R_QMSTATUS to wa_request-r_QMSTATUS, wa_reqdone1-R_TDATUM to wa_request-r_TDATUM, wa_reqdone1-R_TUZEIT to wa_request-r_TUZEIT, wa_reqdone1-R_TIMESTAMPBEGIN to wa_request-r_TIMESTAMPBEGIN, wa_reqdone1-R_TIMESTAMPEND to wa_request-r_TIMESTAMPEND, wa_reqdone1-R_RECORDS to wa_request-r_RECORDS. append wa_request to it_request. clear wa_request. endif. endloop. sort it_request descending by r_datum . ENDFORM. " get_request_no

*&---------------------------------------------------------------------* *& Form get_cubetext

*&---------------------------------------------------------------------* * Fetch all the texts corresponding to the Infoproviders into * internal table. * *----------------------------------------------------------------------* FORM get_cubetext . loop at it_request into wa_request. move:

wa_request-object to wa_ctext-object, wa_request-obj_name to wa_ctext-OBJ_NAME, wa_request-ISOURCE to wa_ctext-ISOURCE, wa_request-LOGDPID to wa_ctext-LOGDPID, wa_request-r_rnr to wa_ctext-r_rnr, wa_request-r_tstatus to wa_ctext-r_tstatus, wa_request-R_DATUM to wa_ctext-r_DATUM, wa_request-R_UZEIT to wa_ctext-r_UZEIT, wa_request-R_QMSTATUS to wa_ctext-r_QMSTATUS, wa_request-R_TDATUM to wa_ctext-r_TDATUM, wa_request-R_TUZEIT to wa_ctext-r_TUZEIT, wa_request-R_TIMESTAMPBEGIN to wa_ctext-r_TIMESTAMPBEGIN, wa_request-R_TIMESTAMPEND to wa_ctext-r_TIMESTAMPEND, wa_request-R_RECORDS to wa_ctext-r_RECORDS.

read table it_cubet into wa_cubet with key c_infocube = wa_request-obj_name.

if sy-subrc = 0. move wa_cubet-c_txtlg to wa_ctext-txtlg. else. read table it_odsot into wa_odsot with key o_odsobject = wa_request-obj_name. if sy-subrc = 0. move wa_odsot-o_txtlg to wa_ctext-txtlg. endif. endif. read table it_ldpiot into wa_ldpiot with key LT_LOGDPID = wa_request-logdpid.

if sy-subrc = 0. move wa_ldpiot-lt_text to wa_ctext-lt_text. endif. read table it_montab into wa_montab with key m_rnr = wa_request-r_rnr.

if sy-subrc = 0. move wa_montab-m_req_insert to wa_ctext-u_records. endif. append wa_ctext to it_ctext. clear wa_ctext. endloop. ENDFORM. " get_cubetext

*&---------------------------------------------------------------------* *& Form final_data *&---------------------------------------------------------------------* * Fetch all the Data related to a Final table. *----------------------------------------------------------------------* FORM final_data . Data: Green(10) type c value 'C', Yellow(10) type c value 'P', Red(10) type c value 'F'. loop at it_ctext into wa_ctext. move: wa_ctext-object to wa_final-I_OBJ_TYPE, wa_ctext-OBJ_NAME to wa_final-I_PROV_NM , wa_ctext-txtlg to wa_final-I_PROV_DESC, wa_ctext-ISOURCE to wa_final-I_ISOURCE, wa_ctext-lt_text to wa_final-I_IPACK_DESC, wa_ctext-r_rnr to wa_final-I_RNR, wa_ctext-r_RECORDS to wa_final-I_TR_RECS, wa_ctext-u_records to wa_final-I_UPD_RECS, wa_ctext-r_DATUM to wa_final-I_START_DATE, wa_ctext-r_UZEIT to wa_final-I_START_TIME, wa_ctext-r_TUZEIT to wa_final-I_END_TIME, wa_ctext-r_tstatus to wa_final-I_RNR_STAT. if wa_ctext-r_tstatus = '@08@'. move green to wa_final-I_RNR_STAT. else. if wa_ctext-r_tstatus = '@09@'. move yellow to wa_final-I_RNR_STAT. else. if wa_ctext-r_tstatus = '@0A@'. move Red to wa_final-I_RNR_STAT. endif. endif. endif.

append wa_final to it_final. clear wa_final . endloop.

Write:'Daily Load Status ' color 6 . skip 2. loop at it_final into wa_final. write:wa_final-I_OBJ_TYPE , wa_final-I_PROV_NM , wa_final-I_PROV_DESC , wa_final-I_ISOURCE , wa_final-I_IPACK_DESC , wa_final-I_RNR, wa_final-I_TR_RECS, wa_final-I_UPD_RECS , wa_final-I_RNR_STAT , wa_final-I_START_DATE, wa_final-I_START_TIME, wa_final-I_END_TIME,/. endloop. ENDFORM. " final_data

*&---------------------------------------------------------------------* *& Form download *&---------------------------------------------------------------------* * Generate Column headings for the Excel File and Download File * * to Presentation Server * * or Application Server. * *----------------------------------------------------------------------* FORM download . types:Begin of it_fieldnames, Column type DD03D-DDTEXT, end of it_fieldnames. data:it_col type standard table of it_fieldnames." with header line. data:wa_col type it_fieldnames. wa_col-Column = 'InfoProvider Type'(001). append wa_col to it_col. clear wa_col. wa_col-column = 'InfoProvider Name'(002). append wa_col to it_col. clear wa_col.

wa_col-column = 'InfoProvider Desc.'(003). append wa_col to it_col. clear wa_col. wa_col-column = 'InfoSource'(004). append wa_col to it_col. clear wa_col. wa_col-column = 'InfoPackage Desc.'(005). append wa_col to it_col. clear wa_col. wa_col-column = 'Request'(006). append wa_col to it_col. clear wa_col. wa_col-column = 'Transferred Records'(007). append wa_col to it_col. clear wa_col. wa_col-column = 'Updated Records'(008). append wa_col to it_col. clear wa_col. wa_col-column = 'Req_Status'(009). append wa_col to it_col. clear wa_col. wa_col-column = 'Start Date'(010). append wa_col to it_col. clear wa_col. wa_col-column = 'Start Time'(011). append wa_col to it_col. clear wa_col. wa_col-column = 'End Time'(012). append wa_col to it_col. clear wa_col. data:file(100) type c. types:begin of w ,"occurs 0, file type string, end of w. data:wa type w. *Download to Presentation Server if p_phys = 'X' and path <> ' '. concatenate path '\Load Status'(013) '-'

sy-datum '.xls' into file. wa-file = file. * append w. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING FILENAME = wa-file FILETYPE = 'ASC' = 'X' = 'X' = 'X'

WRITE_FIELD_SEPARATOR TRUNC_TRAILING_BLANKS DAT_MODE * IMPORTING TABLES DATA_TAB FIELDNAMES . if sy-subrc = 0.

= it_final = it_col

MESSAGE S899(s1) with ' File Transferred'(014) '' '' ''. endif. *Download to Application Server elseif p_log = 'X' and path1 <> ' '. concatenate work-filename '-' sy-datum '.csv' into file. translate file to lower case." into p_file. clear work-filename. work-filename = file. open dataset work-filename for output in text mode encoding default. clear wa_it_mon. refresh tb_it_mon. if sy-subrc = 0. loop at it_final into wa_final.

wa_it_mon-i_obj_type = wa_final-i_obj_type. wa_it_mon-i_prov_nm = wa_final-i_prov_nm. wa_it_mon-i_prov_desc = wa_final-i_prov_desc. wa_it_mon-i_isource = wa_final-i_isource. wa_it_mon-i_ipack_desc = wa_final-i_ipack_desc. wa_it_mon-i_rnr = wa_final-i_rnr. wa_it_mon-i_tr_recs = wa_final-i_tr_recs. wa_it_mon-i_upd_recs = wa_final-i_upd_recs. wa_it_mon-i_rnr_stat = wa_final-i_rnr_stat. write wa_final-i_start_date to wa_it_mon-i_start_date. write wa_final-i_start_time to wa_it_mon-i_start_time. write wa_final-i_end_time to wa_it_mon-i_end_time. * * * wa_it_mon-i_start_date = wa_final-i_start_date. wa_it_mon-i_start_time = wa_final-i_start_time. wa_it_mon-i_end_time = wa_final-i_end_time. append wa_it_mon to tb_it_mon. endloop. loop at tb_it_mon into wa_it_mon. clear work-buffer. concatenate wa_it_mon-I_OBJ_TYPE wa_it_mon-I_PROV_NM wa_it_mon-I_PROV_DESC wa_it_mon-I_ISOURCE wa_it_mon-I_IPACK_DESC wa_it_mon-I_RNR wa_it_mon-I_TR_RECS wa_it_mon-I_UPD_RECS wa_it_mon-I_RNR_STAT wa_it_mon-I_START_DATE wa_it_mon-I_START_TIME wa_it_mon-I_END_TIME into work-buffer separated by p_sep. transfer work-buffer to work-filename. if sy-subrc = 0. MESSAGE S899(s1) with ' File Transferred'(014) '' '' ''. endif. endloop. endif. close dataset work-filename. endif.

* IF SY-SUBRC = 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. * ENDIF. ENDFORM. " download

************************************************************************ * End of Program Z_DAILY_LOAD_STATUS *

************************************************************************ INCLUDE Z_DAILY_LOAD_STATUS_GET_PHYF01. *&---------------------------------------------------------------------* *& Form get_physical_filename *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_PATH1 text * <--P_WORK_FILENAME text *----------------------------------------------------------------------* FORM get_physical_filename USING PATH1 type FILENAME-FILEEXTERN CHANGING P_FILENAME like WORK-FILENAME.

CALL FUNCTION 'FILE_GET_NAME' EXPORTING * CLIENT = SY-MANDT LOGICAL_FILENAME = path1 * OPERATING_SYSTEM = SY-OPSYS * PARAMETER_1 ='' * PARAMETER_2 ='' * PARAMETER_3 ='' * USE_PRESENTATION_SERVER ='' * WITH_FILE_EXTENSION ='' * USE_BUFFER ='' * ELEMINATE_BLANKS = 'X' IMPORTING * EMERGENCY_FLAG = * FILE_FORMAT = FILE_NAME = p_filename * EXCEPTIONS * FILE_NOT_FOUND =1 * OTHERS =2 . *IF SY-SUBRC <> 0. * * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. *ENDIF. *

ENDFORM.

" get_physical_filename

Anda mungkin juga menyukai