REPORT ZVVSC001 LINE-SIZE 80 LINE-COUNT 66 NOSTANDARDPAGEHEADING.
************************************************************************
* Description : Upload data from tabs delimited text file
* and perform =something= automatically
* with 'CALL TRANSACTION USING...' technique.
* All the lines with '=something=' or '=to be customized='
* words are empty template only and need to be filled with
* real data. Transactions XX01, XX02, XX03 are templates
* as well and should be changed with real ones.
* For demo reasons the LIBS transaction is used for call
* (LIBS is SAP guide for Lists Design).
* Inputs : PC Input File Name
* Outputs : '=something= statistics & errors' report
* : (error input data lines are printed,
* : for successfully processed - total count only)
* Error/Return Codes : None
* External References: WS_FILENAME_GET, WS_UPLOAD,
* : MESSAGE_PREPARE,
* : transactions LIBS, XX01, XX02, XX03, ... .
************************************************************************
********* TABLES *******************************************************
********* CONSTANS ***************************************************** CONSTANTS: C_MODE(1) TYPE C VALUE 'N', "Call Transaction display mode
* A - display all;
* E - display only error;
* N - No display.
C_UPDATE(1) TYPE C VALUE 'S', "Call Transaction update type
* S - continue processing when update is completed (synchronous);
* A - continue procwssing immediately;
* L - local update.
C_X(1) TYPE C VALUE 'X',
C_Q(1) TYPE C VALUE '?'.
********* DATA: VARIABLES ********************************************** DATA: W_MSG(50) TYPE C, "Message string by Input File Proc.
W_N LIKE SY-TABIX, "Counter
W_N1 LIKE SY-TABIX, "Counter of selected
W_NS LIKE SY-TABIX, "Counter of successfully processed
W_MSGTXT(273) TYPE C. "Formatted message text
********* DATA: INTERNAL TABLES, RANGES ********************************
*-------- BDC table ---------------------------------------------------- DATA: IT_BDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*-------- BDC messages tables ------------------------------------------ DATA: IT_BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE, BEGINOF IT_BDCMSGLIN OCCURS 0, LINELIKE SY-TABIX, "Input file #
MSG LIKE BDCMSGCOLL, "All BDC messages for the line # ENDOF IT_BDCMSGLIN.
*-------- Input file --------------------------------------------------- DATA: BEGINOF IT_FILE OCCURS 0,
* =something= data field(s), "Input file fields LINELIKE SY-TABIX, "Input file line #
"(not present in the Input File) ENDOF IT_FILE.
********* FIELD GROUPS *************************************************
********* FIELD SYMBOLS ************************************************
********* SELECT-OPTIONS AND PARAMETERS ******************************** PARAMETERS: P_FNAME LIKE RLGRAP-FILENAME OBLIGATORY. "filename prefix
***************
* initialization.
***************
*************************
**** at selection-screen.
*************************
*--------- F4 for PC Input file ---------------------------------------- ATSELECTION-SCREENONVALUE-REQUESTFOR P_FNAME. PERFORM SELECT_FILE.
*--------- PC Input file ----------------------------------------------- ATSELECTION-SCREENON P_FNAME. PERFORM TRY_UPLOAD_FILE.