DATA: BEGIN OF I_VEND OCCURS 0,
NAME1 LIKE LFA1-NAME1,
LIFNR LIKE MSEG-LIFNR,
MATKL LIKE MARA-MATKL,
MATNR LIKE MSEG-MATNR,
MAKTX LIKE MAKT-MAKTX,
WERKS LIKE MSEG-WERKS,
SOBKZ LIKE MSEG-SOBKZ,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
DMBTR LIKE MSEG-DMBTR,
COUNT TYPE I,
END OF I_VEND.
DATA: BEGIN OF FIELDNAMES OCCURS 1,
NAME(60),
END OF FIELDNAMES.
" CHECK_UNITS
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_VENDOR
*&---------------------------------------------------------------------*
FORM DOWNLOAD_VENDOR.
PERFORM VEND_FIELDNAMES.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
* BIN_FILESIZE = ' '
* CODEPAGE = ' '
FILENAME = FILENAME
FILETYPE = 'DAT'
* MODE = ' '
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* COL_SELECT = ' '
* COL_SELECTMASK = ' '
* importing
* filelength =
TABLES
DATA_TAB = I_VEND
FIELDNAMES = FIELDNAMES
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC NE 0.
MESSAGE I004(YM) WITH FILENAME SY-SUBRC.
ENDIF.
ENDFORM. " DOWNLOAD_VENDOR
*&---------------------------------------------------------------------*
*& Form FIELDNAMES
*&---------------------------------------------------------------------*
FORM VEND_FIELDNAMES.
FIELDNAMES-NAME = 'Vendor name'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Vendor No'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Mat. Group'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Material No'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Material Desc.'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Plant'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'SSI'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Total Qty'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'UOM'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Total value received'.
APPEND FIELDNAMES.
FIELDNAMES-NAME = 'Number'.
APPEND FIELDNAMES.
ENDFORM.
*
ABAP/4,ABAP report,Interactive Report Example,ALV grid Example,ALV list,IDOC,User Exit,RFC,Smartform,sapscript,ABAP Performance,Remote Function Module( RFC ),Function Module,ABAP Sample Code,ABAP tools,ALV report Generator,ABAP Interview Questions,BDC,BAPI,ALE,BADI,EDI,InternalTable,Data Structure,LSMW,Domain,DataElement,Basis and Administration,ABAP HR development,ABAPDebugger,BW,Exception Handling,Download FI, CO, MM, PP, SD, PM, PS, QM, SM, HR, BW, APO,ABAP Tutorial
Thursday, October 18, 2007
Subscribe to:
Post Comments (Atom)
Sample ABAP Code
- Sample ABAP Program to Upload table using new function GUI_UPLOAD
- Sample ABAP Program for Submitting report with selection table
- Sample ABAP Program for Sending SAP Mail
- Sample ABAP Program for Search Layout sets for given String
- Sample ABAP Program for Sapscript PerForm Module
- Sample ABAP Program for Create IDOC
- Sample ABAP Program for Output file to application server then send mail with Download details
- Sample ABAP Program for Module Pool Skeleton
- Sample ABAP Program for Module Pool containing screen loop processing
- Sample ABAP Program for MB1B Call Transaction
- Sample ABAP Program of Function Module to Convert Work Center into Personnel Number
- Sample ABAP Program of FTP Function Module
- Sample ABAP Program to EXPORT LIST TO MEMORY
- Sample ABAP Program to Execute Unix command from within SAP
- Sample ABAP Program to Get Output in EXCEL
- Sample ABAP Program to Implement EDI
- Sample Program to dynamically change upload/download program for any Table
- Sample ABAP Program to download table using new function GUI_DOWNLOAD
- Sample ABAP Program to Download file to Presentation Server
- Sample ABAP Program to display pop message to avoid abort
- Sample ABAP Program of ALV Grid
- Sample ABAP Program of Dialogue Module Pool
- Sample ABAP Program to DIALOGUE FLOW LOGIC
- Sample ABAP Program to Delete a file from the application server
- Sample ABAP Program to Compare to Unix or PC files and print differences
- Sample ABAP Program to Colour cells in ALV
- Sample ABAP Program to Calculate difference between date/times in hours
- Sample ABAP Program of BW User Exit
- Sample ABAP Program of ALV Grid control using OO methods
- Browse a file on the application server
No comments:
Post a Comment