*&---------------------------------------------------------------------*
*& Report Z_SD_BDC_CIN_CONDITIONS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_SD_BDC_CIN_CONDITIONS NO STANDARD PAGE HEADING
MESSAGE-ID ZSAS_MSGCLASS
LINE-SIZE 132
LINE-COUNT 65.
************************************************************************
* Program Name : Z_SD_BDC_CIN_CONDITIONS *
* Description : BDC for CIN conditions *
* Functional : Srinivas *
* Developer : Vijaya Lakshmi *
* Development class : zsas_dev *
* Description : *
**
* 1. Read input file *
* 2. Check the mandatory fields and if any one of them is missing *
* move the record to error file. *
* 3. Fill the bdcdata and call VK11 transaction *
* 4. If any errors format the message and send it for reporting *
* 5. If any errors, it downloads the error file *
* 6. Based on user input, this programs does the follwoing *
* a).Call transaction and in case of errors add to a session *
* B).Create session *
* 7. Display the Audit report *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Request No. Created Date Developer name *
*----------------------------------------------------------------------*
* SMDK900449 24/04/2009 Vijaya Lakshmi.T
*----------------------------------------------------------------------*
* TABLES *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* FLAGS *
*----------------------------------------------------------------------*
DATA: FG_STOP TYPE C, " Flag used to stop processing
FG_COLOR TYPE C, " Flag to set Background color
FG_OPENSESSION TYPE C. " Flag for Open Sesssion
*----------------------------------------------------------------------*
* INTERNAL TABLE DECLARATIONS *
*----------------------------------------------------------------------*
*--- Internal table for input file for ascii data load
DATA: BEGIN OF I_INFILE_ASC OCCURS 0,
STRING(1500) TYPE C,
END OF I_INFILE_ASC.
*--- Internal table to store messages from Call Transaction.
DATA : I_BDCMSGCOLL TYPE STANDARD TABLE OF BDCMSGCOLL WITH HEADER LINE,
*--- Internal table for BDC data
IT_BDCTAB TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
*----- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 0,
KSCHL(4), " Condition type
SELKZ(1), " Selection indicator for list screens
VKORG(4), " Sales Organization
VTWEG(2), " Distribution Channel
MATNR(18), " Material Number
DATAB(10), " Validity start date of the condition record
DATBI(10), " Validity end date of the condition record
END OF IT_DATA.
*--- Internal table to hold the error records.
DATA : BEGIN OF IT_ERROR OCCURS 0.
INCLUDE STRUCTURE IT_DATA.
DATA : MESSAGE(80) TYPE C,
END OF IT_ERROR.
*--- Internal table for session names
DATA : BEGIN OF IT_SESSION OCCURS 0,
NAME(12),
END OF IT_SESSION.
*--- Internal table to hold Collecting messages in the SAP System
DATA : IT_MSG LIKE BDCMSGCOLL OCCURS 10 WITH HEADER LINE.
*--- Internal table to hold error records to be downloaded
DATA : BEGIN OF I_FINAL OCCURS 0,
STRING(1000),
END OF I_FINAL.
*--- Internal table for session names
DATA : BEGIN OF I_SESSION OCCURS 0,
NAME(12),
END OF I_SESSION.
*--- Internal table to hold data from Excel
FG_STOP = 'X'.
STOP.
ENDIF.
ENDIF.
*----------------------------------------------------------------------*
* END OF SELECTION. *
*----------------------------------------------------------------------*
END-OF-SELECTION.
IF FG_STOP = SPACE.
*--- Perform to display the selection screen of the rep`ort
PERFORM DISPLAY_SEL_SCR_REPORT.
*--- Perform to display the session report
PERFORM SESSION_REPORT.
*--- Perform to display the no.of records,success and error records
PERFORM DISPLAY_SUMMARY_REPORT.
*--- Downloading error records.
PERFORM DOWNLOAD_ERROR_FILES.
*---- Perform to display the error records
PERFORM DISPLAY_ERROR_RECORDS.
ENDIF.
*----------------------------------------------------------------------*
* Form : validate_input_file
*----------------------------------------------------------------------*
* Description : To provide F4 help for file if read from PC
*----------------------------------------------------------------------*
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
*--- Call function to get the File (user specified)
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
*--- Display message if error occurs in getting file
G_MESG = 'Error in getting the Filename'(002).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " Error in getting filename.
ENDIF.
ENDFORM. " validate_input_file
*----------------------------------------------------------------------*
* Form : Read_inputfile
*----------------------------------------------------------------------*
* Description : To upload the data into internal table
*----------------------------------------------------------------------*
FORM READ_INPUTFILE TABLES F_INFILE
USING F_FILE TYPE RLGRAP-FILENAME
F_FILTYP TYPE RLGRAP-FILETYPE.
*--- Local variable declarations
DATA : LV_DEL TYPE CHAR01,
LV_FILE TYPE STRING.
*--- Clear and initialize variables
CLEAR F_INFILE.
REFRESH F_INFILE.
LV_FILE = F_FILE.
*--- Function module to upload the input file
IF F_FILTYP = 'DAT'.
LV_DEL = '|'.
ENDIF.
*--- Call function GUI_UPLOAD to upload data from flat file to internal table
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = LV_DEL
TABLES
DATA_TAB = F_INFILE
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
*--- Display message if error occurs in uploading data from file
G_MESG = 'Error in uploading the file'(003).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " 'Error in uploading the file'.
CLEAR G_MESG.
FG_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. "Read_inputfile
*&---------------------------------------------------------------------*
*& Form FORMAT_ASC_DATA
*&---------------------------------------------------------------------*
* To format the ASCII data
*----------------------------------------------------------------------*
FORM FORMAT_ASC_DATA.
*--- Loop to format ASCII data
LOOP AT I_INFILE_ASC.
IT_DATA-KSCHL = I_INFILE_ASC-STRING+0(4).
IT_DATA-SELKZ = I_INFILE_ASC-STRING+4(1).
IT_DATA-VKORG = I_INFILE_ASC-STRING+5(4).
IT_DATA-VTWEG = I_INFILE_ASC-STRING+9(2).
IT_DATA-MATNR = I_INFILE_ASC-STRING+11(18).
IT_DATA-DATAB = I_INFILE_ASC-STRING+29(10).
IT_DATA-DATBI = I_INFILE_ASC-STRING+39(10).
ENDLOOP.
ENDFORM. " FORMAT_ASC_DATA
*&---------------------------------------------------------------------*
*& Form error_processing
*&---------------------------------------------------------------------*
* To process the error records
*----------------------------------------------------------------------*
FORM ERROR_PROCESSING USING F_IT_DATA
F_MESG.
G_ERROR = G_ERROR + 1.
IT_ERROR = F_IT_DATA.
IT_ERROR-MESSAGE = F_MESG.
APPEND IT_ERROR.
CLEAR IT_ERROR.
ENDFORM. " ERROR_PROCESSING
*---------------------------------------------------------------------*
* Form : process_data *
*---------------------------------------------------------------------*
* --- Populating the BDC Data *
*---------------------------------------------------------------------*
FORM PROCESS_DATA .
LOOP AT IT_DATA.
CLEAR :IT_BDCTAB,
I_BDCMSGCOLL.
REFRESH:IT_BDCTAB,
I_BDCMSGCOLL.
*--- To fill the data from the text file
PERFORM FILL_BDCDATA.
IF P_CT EQ 'X'.
*--- Posts data using call transaction method.
PERFORM CALL_TRANSACTION.
ELSE.
*--- Posts data using session method.
PERFORM CALL_SESSION USING C_TCODE P_MAX P_SESS1.
ENDIF.
ENDLOOP.
IF FG_OPENSESSION = 'X'.
*--- Perform to close BDC session
PERFORM CLOSE_SESSION.
ENDIF.
ENDFORM. " PROCESS_DATA
*&---------------------------------------------------------------------*
*& Form FILL_BDCDATA
*&---------------------------------------------------------------------*
* To populate the data
*----------------------------------------------------------------------*
FORM FILL_BDCDATA.
*---- Perform to fill the fields in the
PERFORM FILL_SCREEN_0100.
*---- Perform to fill the fields in the
PERFORM FILL_SCREEN1_0100.
*---- Perform to fill the fields in the
PERFORM FILL_SCREEN_1004.
*---- Perform to fill the fields in the
PERFORM FILL_SCREEN_1004_1.
screen 0100
screen 0100
screen 1004
screen 1004
FORM FILL_SCREEN_0100 .
PERFORM
PERFORM
PERFORM
PERFORM
PERFORM FORMAT_MESSAGE.
*--- Perform to process error processing
PERFORM ERROR_PROCESSING USING IT_DATA G_MESG.
PERFORM CALL_SESSION USING C_TCODE P_MAX P_SESS1.
ELSE. "If call transaction is successful.
G_SUCCESS = G_SUCCESS + 1.
ENDIF.
ENDFORM. " CALL_TRANSACTION
*&---------------------------------------------------------------------*
*& Form format_message
*&---------------------------------------------------------------------*
* Reading messages
*----------------------------------------------------------------------*
FORM FORMAT_MESSAGE.
CLEAR G_MESG.
*--- Function module to get the message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_BDCMSGCOLL-MSGID
LANG = SY-LANGU
NO = I_BDCMSGCOLL-MSGNR
V1 = I_BDCMSGCOLL-MSGV1
V2 = I_BDCMSGCOLL-MSGV2
V3 = I_BDCMSGCOLL-MSGV3
V4 = I_BDCMSGCOLL-MSGV4
IMPORTING
MSG = G_MESG.
ENDFORM. " FORMAT_MESSAGE
*----------------------------------------------------------------------*
* Form : call_session
*----------------------------------------------------------------------*
* To call the session either for FSP0 or FSP2
*----------------------------------------------------------------------*
FORM CALL_SESSION USING FP_TCODE TYPE ANY
F_MAX TYPE ANY
F_SESS1 TYPE ANY.
* To open the session
PERFORM OPEN_SESSION USING F_MAX F_SESS1.
* Perform Insert BDC Session
PERFORM BDC_INSERT USING FP_TCODE.
* To close the session
IF G_INSERT = F_MAX .
PERFORM CLOSE_SESSION.
ENDIF.
ENDFORM. " call_session
*----------------------------------------------------------------------*
* Form : open_session
*----------------------------------------------------------------------*
* To open BDC open group.
*----------------------------------------------------------------------*
FORM OPEN_SESSION USING F_MAX TYPE ANY
F_SESS1 TYPE ANY.
IF G_INSERT = F_MAX OR FG_OPENSESSION = SPACE.
G_COUNTER = G_COUNTER + 1.
CLEAR G_SESSION.
CONCATENATE F_SESS1 '_' G_COUNTER INTO G_SESSION.
* Opening the BDC Session
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = G_SESSION
KEEP = 'X'
USER = SY-UNAME
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
IF SY-SUBRC <> 0.
G_MESG = 'Error in Opening the Session'(004) .
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " 'Error in Opening the
Session'.
EXIT.
ELSE.
CLEAR G_INSERT.
FG_OPENSESSION = 'X'.
ENDIF.
ENDIF.
ENDFORM. " OPEN_SESSION
*----------------------------------------------------------------------*
* Form : bdc_insert
*----------------------------------------------------------------------*
* To Insert data.
*----------------------------------------------------------------------*
FORM BDC_INSERT USING FP_TCODE TYPE ANY.
* Inserting BDC
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = FP_TCODE
TABLES
DYNPROTAB = IT_BDCTAB
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
G_MESG = 'Error in inserting the record'(005).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " 'Error in inserting the record'.
CLEAR G_MESG.
ELSE.
G_INSERT = G_INSERT + 1.
ENDIF.
ENDFORM. " BDC_INSERT
*----------------------------------------------------------------------*
* Form : close_session
*----------------------------------------------------------------------*
* To close the session
*----------------------------------------------------------------------*
FORM CLOSE_SESSION.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
G_MESG = 'Session cannot be closed'(006).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " 'Session cannot be closed'.
CLEAR G_MESG.
ELSE.
I_SESSION-NAME = G_SESSION.
APPEND I_SESSION.
CLEAR I_SESSION.
CLEAR FG_OPENSESSION.
ENDIF.
ENDFORM. " CLOSE_SESSION
*---------------------------------------------------------------------*
* Form DOWNLOAD_ERROR_FILES
*---------------------------------------------------------------------*
* Downloading the error records to error file
*----------------------------------------------------------------------*
FORM DOWNLOAD_ERROR_FILES.
DATA : LV_DEL TYPE CHAR01,
LV_FILE TYPE STRING.
IF NOT IT_ERROR[] IS INITIAL.
IF P_FTYPE = 'DAT'.
LOOP AT IT_ERROR.
CONCATENATE IT_ERROR-KSCHL
IT_ERROR-SELKZ
IT_ERROR-VKORG
IT_ERROR-VTWEG
IT_ERROR-MATNR
IT_ERROR-DATAB
IT_ERROR-DATBI
INTO I_FINAL-STRING SEPARATED BY G_DEL.
APPEND I_FINAL.
CLEAR I_FINAL.
ENDLOOP.
CLEAR I_FINAL.
ELSEIF P_FTYPE = 'ASC'.
LOOP AT IT_ERROR.
I_FINAL-STRING+0(4) = IT_ERROR-KSCHL.
I_FINAL-STRING+4(1) = IT_ERROR-SELKZ.
I_FINAL-STRING+5(4) = IT_ERROR-VKORG.
I_FINAL-STRING+9(2) = IT_ERROR-VTWEG.
I_FINAL-STRING+11(18) = IT_ERROR-MATNR.
I_FINAL-STRING+29(10) = IT_ERROR-DATAB.
I_FINAL-STRING+39(10) = IT_ERROR-DATBI.
APPEND I_FINAL.
CLEAR I_FINAL.
ENDLOOP.
ENDIF. "IF P_FTYPE = 'DAT'.
LV_FILE = P_ERR.
IF P_FTYPE = 'DAT'.
LV_DEL = '|'.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = LV_FILE
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = LV_DEL
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = I_FINAL
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
G_MESG = 'Error in downloading the file'(007).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " Error in downloading the
file.
CLEAR G_MESG.
ENDIF.
ENDIF. "IF NOT I_FILE_ERROR[] IS INITIAL.
ENDFORM. " DOWNLOAD_ERROR_FILES
*&---------------------------------------------------------------------*
*& Form READ_INPUT_DATA
*&---------------------------------------------------------------------*
* To Read the input file data
*----------------------------------------------------------------------*
FORM READ_INPUT_FILE_DATA.
*--- Splitting the filename and its extension
PERFORM SPLIT_FILENAME_EXT.
CASE G_FILEEXT.
WHEN 'XLS'.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
WHEN 'TXT'.
IF P_FTYPE = 'ASC'.
*--- Uploading the data from server
PERFORM READ_INPUTFILE TABLES I_INFILE_ASC
USING P_FILE P_FTYPE.
*--- Perform Formating ASC type data
PERFORM FORMAT_ASC_DATA.
ELSEIF P_FTYPE = 'DAT'.
*--- Uploading the data from server
PERFORM READ_INPUTFILE TABLES IT_DATA
USING P_FILE P_FTYPE.
ENDIF.
WHEN OTHERS.
G_MESG = 'Invalid Operation'(029).
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO .
IF SY-SUBRC = 0.
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO .
ENDIF.
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*&---------------------------------------------------------------------*
*& Form CONVER_XLS_ITAB
*&---------------------------------------------------------------------*
* To convert the excel data into an internal table
*----------------------------------------------------------------------*
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN
* EXCEPTIONS
* INCONSISTENT_PARAMETERS = 1
* UPLOAD_OLE = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0. "#EC *
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT IT_INTERN[] IS INITIAL.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ELSE.
G_MESG = 'No values found'(008).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG.
CLEAR G_MESG.
FG_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " CONVERT_XLS_ITAB
*&---------------------------------------------------------------------*
*& Form DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
* To delete the Header and empty records
*----------------------------------------------------------------------*
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX. " Table Index
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
G_EMPTY = G_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES G_TOTAL.
IF G_TOTAL = 0.
G_MESG = 'No records in the file'(009).
MESSAGE I000(ZSAS_MSGCLASS) WITH G_MESG. " No records in the file
CLEAR G_MESG.
FG_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
*& Form DISPLAY_SELECTION_SCR
*&---------------------------------------------------------------------*
* To display the selection screen input
*----------------------------------------------------------------------*
FORM DISPLAY_SEL_SCR_REPORT.
WRITE :/1(132) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE :/1(1) SY-VLINE,
65(65) 'SELECTION SCREEN DATA'(010),
132(1) SY-VLINE.
WRITE :/1(132) SY-ULINE.
FORMAT INTENSIFIED OFF.
*--- Input file name
PERFORM FILL_COLOR.
WRITE :/1(1) SY-VLINE,
2(24) 'Input File name'(011),
27(2) ' : ',
30(100) P_FILE,
132(1) SY-VLINE.
IF NOT IT_ERROR[] IS INITIAL.
*--- Setting the Error file name to .CSV
PERFORM FILL_COLOR.
IF G_FILEEXT = 'XLS'.
IF NOT P_ERR CS '.XLS'.
IF P_ERR CA '.'.
P_ERR = P_ERR(SY-FDPOS).
CONCATENATE P_ERR '.CSV' INTO P_ERR.
ENDIF.
ENDIF.
P_FTYPE = 'DAT'.
G_DEL = '2C'. " Hexadecimal value for ','
ENDIF.
*--- Error File name
PERFORM FILL_COLOR.
WRITE :/1(1) SY-VLINE,
2(24) 'Error File name'(012),
27(2) ' : ',
30(100) P_ERR,
132(1) SY-VLINE.
ENDIF.
*--- File type
PERFORM FILL_COLOR.
WRITE :/1(1) SY-VLINE,
2(24) 'File Type'(013),
ENDIF.
ENDFORM.
*******************Recording************************
0000 T VK11 BS AA X F
SAPMV13A 0100 X
0000 BDC_CURSOR RV13A-KSCHL
0000 BDC_OKCODE /00
0000 RV13A-KSCHL JEXP
SAPLV14A 0100 X
0000 BDC_CURSOR RV130-SELKZ(03)
0000 BDC_OKCODE =WEIT
0000 RV130-SELKZ(01)
0000 RV130-SELKZ(03) X
SAPMV13A 1004 X
0000 BDC_CURSOR RV13A-DATBI(01)
0000 BDC_OKCODE /00
0000 KOMG-VKORG SAS
0000 KOMG-VTWEG 02
0000 KOMG-MATNR(01) t103
0000 RV13A-DATAB(01) 01.01.2009
0000 RV13A-DATBI(01) 01.04.2010
SAPMV13A 1004 X
0000 BDC_CURSOR KOMG-MATNR(01)
0000 BDC_OKCODE =SICH
****************** Flat File****************
JEXP X SAS 02 test12345 01.01.2009 01.04.2010
JEXP X SAS 02 test23456 01.01.2009 01.04.2010