Text file to Excel file
Hi Friends,
here am uploading text file from desktop into int tab using GUI_upload. then i want to down load that data from int tab into other file formate like Excel sheet.
how to do? what is the FM for that?
Thanks in advance,
murali.
hi,
check this code
REPORT zmm_basic_data .
Report to View Detail Of Material Master BASIC DATA.
Start Date 07.05.2007
Request No.-GR3K931783
TABLES: mara,marc,makt.
DATA: gi_mara LIKE mara OCCURS 1 WITH HEADER LINE,
gi_marc LIKE marc OCCURS 1 WITH HEADER LINE,
gi_makt LIKE makt OCCURS 1 WITH HEADER LINE.
DATA: BEGIN OF gi_download OCCURS 1,
matnr LIKE mara-matnr,"material no
maktx LIKE makt-maktx,"material description
matkl LIKE mara-matkl,"material group
werks LIKE marc-werks,"plant
ekgrp LIKE marc-ekgrp,"purchasing group
spart LIKE mara-spart,"division
meins LIKE mara-meins,"base uit of measure
bismt LIKE mara-bismt,"old material no.
prdha LIKE mara-prdha,"product hierarchy
brgew LIKE mara-brgew,"gross weight
ntgew LIKE mara-ntgew,"net weight
gewei LIKE mara-gewei,"weight unit
volum LIKE mara-volum,"volume
voleh LIKE mara-voleh,"volume unit
zeinr LIKE mara-zeinr,"document no.
zeiar LIKE mara-zeiar,"document type
zeivr LIKE mara-zeivr,"document version
zeifo LIKE mara-zeifo,"page format of document
blanz LIKE mara-blanz,"number of sheets
spras LIKE makt-spras,"language key
END OF gi_download.
<b>DATA: BEGIN OF gi_fieldnames OCCURS 1,
mandt(50),
END OF gi_fieldnames.</b>
*file path and file name data declaration.
DATA: stripped_name LIKE rlgrap-filename,
file_path LIKE rlgrap-filename.
DATA: inpath LIKE ltran-path01,
file LIKE ltran-file01,
outpath LIKE ltran-path02.
Field Symbols ************
FIELD-SYMBOLS <mara> LIKE gi_mara.
FIELD-SYMBOLS <marc> LIKE gi_marc.
FIELD-SYMBOLS <makt> LIKE gi_makt.
FIELD-SYMBOLS <download> LIKE gi_download.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN: SKIP.
SELECT-OPTIONS: s_werks FOR marc-werks.
SELECT-OPTIONS: s_ekgrp FOR marc-ekgrp.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_matkl FOR mara-matkl.
SELECT-OPTIONS: s_spart FOR mara-spart.
SELECTION-SCREEN: SKIP.
PARAMETER fnm TYPE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN: SKIP.
SELECTION-SCREEN: END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fnm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = fnm
EXCEPTIONS
mask_too_long = 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.
*For fetching the baisc data.
START-OF-SELECTION.
*Getting the general data based on material no,division and material
*group.
SELECT * FROM mara INTO TABLE gi_mara
WHERE matnr IN s_matnr
AND spart IN s_spart
AND matkl IN s_matkl.
*Getting the plant data based on material no,plant and purchasing
*group.
IF NOT gi_mara[] IS INITIAL.
SELECT * FROM marc INTO TABLE gi_marc
FOR ALL ENTRIES IN gi_mara
WHERE matnr EQ gi_mara-matnr
AND werks IN s_werks
AND ekgrp IN s_ekgrp.
ENDIF.
*Getting the material description based on material no
IF NOT gi_mara[] IS INITIAL.
SELECT * FROM makt INTO TABLE gi_makt
FOR ALL ENTRIES IN gi_mara
WHERE matnr = gi_mara-matnr.
ENDIF.
Fetching all data into single internal table ********
SORT gi_mara BY matnr.
SORT gi_makt BY matnr.
SORT gi_marc BY matnr.
*****Transfering the data into gi_download*******
IF s_werks[] IS INITIAL and s_ekgrp[] IS INITIAL.
LOOP AT gi_mara ASSIGNING <mara>.
MOVE-CORRESPONDING <mara> TO gi_download.
READ TABLE gi_marc ASSIGNING <marc>
WITH KEY matnr = <mara>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <marc>-werks TO gi_download-werks.
MOVE <marc>-ekgrp TO gi_download-ekgrp.
ENDIF.
READ TABLE gi_makt ASSIGNING <makt>
WITH KEY matnr = <mara>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <makt>-maktx TO gi_download-maktx.
MOVE <makt>-spras TO gi_download-spras.
ENDIF.
APPEND gi_download.
CLEAR gi_download.
ENDLOOP.
ELSE.
LOOP AT gi_marc ASSIGNING <marc>.
READ TABLE gi_mara ASSIGNING <mara>
WITH KEY matnr = <marc>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING <mara> TO gi_download.
ENDIF.
READ TABLE gi_makt ASSIGNING <makt>
WITH KEY matnr = <marc>-matnr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE <makt>-maktx TO gi_download-maktx.
MOVE <makt>-spras TO gi_download-spras.
ENDIF.
MOVE <marc>-werks TO gi_download-werks.
MOVE <marc>-ekgrp TO gi_download-ekgrp.
APPEND gi_download.
CLEAR gi_download.
ENDLOOP.
ENDIF.
IF gi_download[] IS INITIAL.
MESSAGE i001(sa) WITH 'Data not found'.
LEAVE LIST-PROCESSING.
ENDIF.
*******Downloading the basic data********
<b> gi_fieldnames-mandt = 'Material no'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Material description'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Material group'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Plant'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Purchasing group'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Division'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Base uit of measure'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Old material no.'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Product hierarchy'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Gross weight'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Net weight'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Weight unit'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Volume'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Volume unit'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document no.'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document type'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Document version'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Page format of document'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Number of sheets'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.
gi_fieldnames-mandt = 'Language key'.
APPEND gi_fieldnames.
CLEAR gi_fieldnames.</b> CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = fnm
IMPORTING
stripped_name = stripped_name
file_path = file_path
EXCEPTIONS
x_error = 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.
CLEAR fnm.
CONCATENATE file_path stripped_name INTO fnm.
CLEAR: inpath,file,stripped_name,file_path,outpath.
<b>CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = fnm
filetype = 'DAT'
TABLES
data_tab = gi_download
fieldnames = gi_fieldnames
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE i003(sa) WITH 'File downloaded successfuly' fnm.</b>
ENDIF.
REFRESH: gi_download,gi_mara,gi_marc,gi_makt.
CLEAR: gi_download,gi_mara,gi_marc,gi_makt.
regards
siva
Message was edited by:
siva prasad
Similar Messages
-
How to output strings to an text file and excel file
Hi guys,
I am writing a simple application taht process some string inputs from user using a simple GUI. The GUI consists of a series of
textfields which the user can enter names, age, addresses....etc
Once they complete filling up that GUI form, they click SUBMIT. All the values will then be read. These strings are then required to be output to 2 files
1. To a text file which I can open it and read it anytime I wish.
2. To an excel file which follows a specific format. That is, all names will be written to column B, all ages will be written to column C...etc
The programme is expected to keep running allow the user to enter details of multiple persons(some 300 sets of data of different persons) until he clicks on End program.
Please advise how I can output the strings to
1. Text file
2. Excel file.
Many many thanks. I need this for one of my project which is due so so soon...... :((
Regards
David1. Text file
See link to "Documentation - Tutorials" on the left
side of this page.
2. Excel file
Dont try to write the real excel format (if you want
to do it soon).
- write data to a plain text file.
- Use tab stops for separation of values.
- Name file as excel file. (*.xls)
If you double click this file, excel will import data
and insert it to a table in the right order by
itself.
Excel can save this as real .xls now.
Anyone here with a better idea? (Try to learn by
myself)good thing to know for the excel tip :)
thx -
Configuration of text file to excel file
How to post data from text file to excel file.
this means sender side i have text file here fields are separated by commas, that data take and put in the MS-Excel sheet format, here the pages are like boxes, how to put data in that boxes.Plz send me the sample code how to configure
Thanks and Regards
Ramesh -
How to export a ABAP Report as both a Text file and Excel file?
Hi Gurus,
I need to develop a report which can be exported as both Text file and Excel file.
Can you guys sugest me the FM's which I have to use? and parameters to be passed.
Post one example so that I can get better idea.
Standard ABAP editor directly have the options to save file as .xls or .txt file. User wants to export the report as required.
I know it is simple but need the efficient way.
So thanks to all of you.
Regards,
RaviHi,
Try in the below Example:
*& DATA DECLARATION *
TABLES: MARA, "GENERAL MASTER DATA
MARC, "PLANT DATA FOR MATERIAL
MARD, "STORAGE LOCATION DATA FOR MATERIAL
MBEW, "MATERIAL VALUATION
MVKE, "SALES DATA FOR MATERIAL
MAKT, "MATERIAL DESCRIPTION
EKKO, "PURCHASING DOCUMENT HEADER
EKPO, "PURCHASING DOCUMENT ITEM
VBAK, "SALES DOCUMENT HEADER DATA
VBAP. "SALES DOCUMENT ITEM DATA
TYPE-POOLS : SLIS.
DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
V_LAYOUT TYPE SLIS_LAYOUT_ALV,
BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR, "MATERIAL NUMBER
MBRSH LIKE MARA-MBRSH, "INDUSTRY SECTOR
MEINS LIKE MARA-MEINS, "BASE UNIT OF MEASURE
MATKL LIKE MARA-MATKL, "MATERIAL GROUP
END OF I_MARA,
BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR, "MATERIAL NUMBER
WERKS LIKE MARC-WERKS, "PLANT
LVORM LIKE MARC-LVORM, "FLAG MATERIAL FOR DELETION AT PLANT
"LEVEL
DISPO LIKE MARC-DISPO, "MRP CONTROLLER
END OF I_MARC,
BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR, "MATERIAL NUMBER
MAKTX LIKE MAKT-MAKTX, "MATERIAL DESCRIPTION
SPRAS LIKE MAKT-SPRAS, "LANGUAGE KEY
END OF I_MAKT,
BEGIN OF I_MVKE OCCURS 0,
MATNR LIKE MVKE-MATNR, "MATERIAL NUMBER
VKORG LIKE MVKE-VKORG, "SALES ORGANIZATION
VTWEG LIKE MVKE-VTWEG, "DISTRIBUTION CHANNEL
END OF I_MVKE,
BEGIN OF I_MARD OCCURS 0,
MATNR LIKE MARD-MATNR, "MATERIAL NUMBER
LGORT LIKE MARD-LGORT, "STORAGE LOCATION
LABST LIKE MARD-LABST, "VALUATED STOCK WITH UNRESTRICTED USE
END OF I_MARD,
BEGIN OF I_EKPO OCCURS 0,
EBELN LIKE EKPO-EBELN, "PURCHASING DOCUMENT NUMBER
EBELP LIKE EKPO-EBELP, "ITEM NUMBER OF PURCHASING DOCUMENT
MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
END OF I_EKPO,
BEGIN OF I_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF I_VBAP,
BEGIN OF I_OUT OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
LVORM LIKE MARC-LVORM,
DISPO LIKE MARC-DISPO,
MBRSH LIKE MARA-MBRSH,
MEINS LIKE MARA-MEINS,
MATKL LIKE MARA-MATKL,
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
LGORT LIKE MARD-LGORT,
LABST LIKE MARD-LABST,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
END OF I_OUT,
BEGIN OF I_HEADING OCCURS 0,
TEXT1(20),
TEXT2(20),
TEXT3(20),
TEXT4(20),
TEXT5(20),
TEXT6(20),
TEXT7(20),
TEXT8(20),
TEXT9(20),
TEXT10(20),
TEXT11(40),
TEXT12(20),
TEXT13(20),
TEXT14(20),
TEXT15(20),
TEXT16(20),
TEXT17(20),
END OF I_HEADING.
*& S E L E C T I O N - S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
S_DISPO FOR MARC-DISPO,
S_EBELN FOR EKPO-EBELN .
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
PARAMETERS : RB1 RADIOBUTTON GROUP G1,
RB2 RADIOBUTTON GROUP G1,
RB3 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
*& S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
SELECT MATNR WERKS LVORM DISPO FROM MARC
INTO CORRESPONDING FIELDS OF TABLE I_MARC
WHERE MATNR IN S_MATNR
AND DISPO IN S_DISPO
AND WERKS = P_WERKS.
IF I_MARC[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
EXIT.
ENDIF.
PERFORM PURCHASEDATA_VALIDATION.
PERFORM SALESDATA_VALIDATION.
SELECT MATNR LGORT LABST FROM MARD INTO TABLE I_MARD
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR
AND WERKS EQ P_WERKS
AND LGORT IN S_LGORT.
IF I_MARD[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
EXIT.
ENDIF.
SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
IF I_MVKE[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
EXIT.
ENDIF.
LOOP AT I_MARC.
MOVE-CORRESPONDING I_MARC TO I_OUT.
CLEAR MARC.
SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
INTO CORRESPONDING FIELDS OF MARA
WHERE MATNR = I_OUT-MATNR.
IF SY-SUBRC = 0.
MOVE: MARA-MBRSH TO I_OUT-MBRSH,
MARA-MEINS TO I_OUT-MEINS,
MARA-MATKL TO I_OUT-MATKL.
ELSE.
CONTINUE.
ENDIF.
SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
INTO CORRESPONDING FIELDS OF MAKT
WHERE MATNR = I_OUT-MATNR.
IF SY-SUBRC = 0.
MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
MAKT-SPRAS TO I_OUT-SPRAS.
ELSE.
CONTINUE.
ENDIF.
LOOP AT I_EKPO WHERE MATNR = I_MARC-MATNR.
MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
I_EKPO-EBELP TO I_OUT-EBELP.
ENDLOOP.
LOOP AT I_VBAP WHERE MATNR = I_MARC-MATNR.
MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
I_VBAP-POSNR TO I_OUT-POSNR.
ENDLOOP.
LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
MOVE: I_MARD-LABST TO I_OUT-LABST,
I_MARD-LGORT TO I_OUT-LGORT.
ENDLOOP.
LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
I_MVKE-VTWEG TO I_OUT-VTWEG.
APPEND I_OUT.
ENDLOOP.
CLEAR I_OUT.
ENDLOOP.
PERFORM OPTIONS.
FORM OPTIONS *
FORM OPTIONS.
IF RB2 = 'X'.
PERFORM FIELDCAT.
PERFORM OUTPUT.
ELSE.
IF RB1 = 'X'.
PERFORM HEADINGS.
PERFORM DLOAD.
ELSE.
IF RB3 = 'X'.
PERFORM HEADINGS.
PERFORM DLOAD.
PERFORM FIELDCAT.
PERFORM OUTPUT.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. "OPTIONS
FORM HEADINGS *
FORM HEADINGS.
I_HEADING-TEXT1 = 'MATNR'.
I_HEADING-TEXT2 = 'WERKS'.
I_HEADING-TEXT3 = 'LVORM'.
I_HEADING-TEXT4 = 'DISPO'.
I_HEADING-TEXT5 = 'MBRSH'.
I_HEADING-TEXT6 = 'MEINS'.
I_HEADING-TEXT7 = 'MATKL'.
I_HEADING-TEXT8 = 'VKORG'.
I_HEADING-TEXT9 = 'VTWEG'.
I_HEADING-TEXT10 = 'SPRAS'.
I_HEADING-TEXT11 = 'MAKTX'.
I_HEADING-TEXT12 = 'LGORT'.
I_HEADING-TEXT13 = 'LABST'.
I_HEADING-TEXT14 = 'EBELN'.
I_HEADING-TEXT15 = 'EBELP'.
I_HEADING-TEXT16 = 'VBELN'.
I_HEADING-TEXT17 = 'POSNR'.
APPEND I_HEADING.
ENDFORM. "HEADINGS
FORM DLOAD *
FORM DLOAD.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\MATSTK.XLS'
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_HEADING
EXCEPTIONS
FILE_WRITE_ERROR = 1.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\MATSTK.XLS'
FILETYPE = 'DAT'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_OUT.
ENDFORM. "DLOAD
FORM FIELDCAT *
FORM FIELDCAT.
V_FIELDCAT-COL_POS = '1'.
V_FIELDCAT-FIELDNAME = 'MATNR'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '2'.
V_FIELDCAT-FIELDNAME = 'WERKS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '3'.
V_FIELDCAT-FIELDNAME = 'LVORM'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '4'.
V_FIELDCAT-FIELDNAME = 'DISPO'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
V_FIELDCAT-REF_TABNAME = 'MARC'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '5'.
V_FIELDCAT-FIELDNAME = 'MBRSH'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '6'.
V_FIELDCAT-FIELDNAME = 'MEINS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '7'.
V_FIELDCAT-FIELDNAME = 'MATKL'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
V_FIELDCAT-REF_TABNAME = 'MARA'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '8'.
V_FIELDCAT-FIELDNAME = 'VKORG'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
V_FIELDCAT-REF_TABNAME = 'MVKE'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '9'.
V_FIELDCAT-FIELDNAME = 'VTWEG'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
V_FIELDCAT-REF_TABNAME = 'MVKE'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '10'.
V_FIELDCAT-FIELDNAME = 'SPRAS'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
V_FIELDCAT-REF_TABNAME = 'MAKT'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '11'.
V_FIELDCAT-FIELDNAME = 'MAKTX'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
V_FIELDCAT-REF_TABNAME = 'MAKT'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '12'.
V_FIELDCAT-FIELDNAME = 'LGORT'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
V_FIELDCAT-REF_TABNAME = 'MARD'.
V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
V_FIELDCAT-OUTPUTLEN = 10.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '13'.
V_FIELDCAT-FIELDNAME = 'LABST'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-SELTEXT_M = 'STOCK'.
V_FIELDCAT-OUTPUTLEN = 15.
V_FIELDCAT-REF_FIELDNAME = 'LABST'.
V_FIELDCAT-REF_TABNAME = 'MARD'.
V_FIELDCAT-DO_SUM = 'X'.
V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
V_FIELDCAT-HOTSPOT = 'X'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '14'.
V_FIELDCAT-FIELDNAME = 'EBELN'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
V_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '15'.
V_FIELDCAT-FIELDNAME = 'EBELP'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
V_FIELDCAT-REF_TABNAME = 'EKPO'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '16'.
V_FIELDCAT-FIELDNAME = 'VBELN'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-HOTSPOT = 'X'.
V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
V_FIELDCAT-REF_TABNAME = 'VBAP'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
V_FIELDCAT-COL_POS = '17'.
V_FIELDCAT-FIELDNAME = 'POSNR'.
V_FIELDCAT-TABNAME = 'I_OUT'.
V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
V_FIELDCAT-REF_TABNAME = 'VBAP'.
APPEND V_FIELDCAT TO VT_FIELDCAT1.
CLEAR V_FIELDCAT.
ENDFORM. "FIELDCAT
FORM OUTPUT *
FORM OUTPUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
IS_LAYOUT = V_LAYOUT
IT_FIELDCAT = VT_FIELDCAT1
TABLES
T_OUTTAB = I_OUT.
IF SY-SUBRC 0.
ENDIF.
ENDFORM. "OUTPUT
FORM TOP-OF-PAGE *
FORM TOP-OF-PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'REPORT FOR : '.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'MATERIAL DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = 'S'.
WA_HEADER-INFO = 'SALES ORDER DETAILS'.
APPEND WA_HEADER TO T_HEADER.
CLEAR WA_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'GEAR'
IT_LIST_COMMENTARY = T_HEADER.
ENDFORM. "TOP-OF-PAGE
*& FORM PURCHASEDATA_VALIDATION *
FORM PURCHASEDATA_VALIDATION.
SELECT EBELN EBELP MATNR
FROM EKPO
INTO TABLE I_EKPO
FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR
AND EBELN IN S_EBELN
AND WERKS EQ P_WERKS.
IF I_EKPO[] IS INITIAL.
WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
EXIT.
ENDIF.
DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
T_EKPO] = I_EKPO[.
REFRESH I_EKPO.
FREE I_EKPO.
LOOP AT T_EKPO.
SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
WHERE EBELN = T_EKPO-EBELN.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING T_EKPO TO I_EKPO.
APPEND I_EKPO.
CLEAR I_EKPO.
ELSE.
CONTINUE.
ENDIF.
ENDLOOP.
SORT I_EKPO.
ENDFORM. "PURCHASEDATA_VALIDATION
*& FORM SALESDATA_VALIDATION *
FORM SALESDATA_VALIDATION.
SELECT VBELN POSNR MATNR
FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE
I_VBAP FOR ALL ENTRIES IN I_MARC
WHERE MATNR = I_MARC-MATNR.
DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
T_VBAP] = I_VBAP[.
REFRESH I_VBAP.
FREE I_VBAP.
LOOP AT T_VBAP.
SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
WHERE VBELN = T_VBAP-VBELN.
IF SY-SUBRC = 0.
MOVE-CORRESPONDING T_VBAP TO I_VBAP.
APPEND I_VBAP.
CLEAR I_VBAP.
ELSE.
CONTINUE.
ENDIF.
ENDLOOP.
SORT I_VBAP.
ENDFORM. "SALESDATA_VALIDATION
Regards ,
Nishant -
Is this right way ro save html file as excel file
Hi all
Iam saving html page as excel page .Source code for this is
BufferedWriter out = new BufferedWriter(new FileWriter("c:/Excel/price.xls"));
BufferedReader in = new BufferedReader(new FileReader("C:/html/price.htm"));
String str;
while ((str = in.readLine()) != null)
out.write(str);
in.close();
out.close();
Is above procedure is right to save html page as excel page
IAm using JExcelAPI for re-writing excel sheet .
When iam accesing price.xls file iam getting following Exception
---------- Run Java ----------
jxl.read.biff.BiffException: Unable to recognize OLE stream
How to solve it?
Is any methods required to set EXCel sheet in java?
Can we use other API for solving it
IF any plz suggest me.
What is diff b/w Jexcel And Apache POI?
Reply me soon
MAdhuramThanks for ur reply
Basically that html file is Excel file only
For view purpose saved it as html b'coz it is using in site(This part is mainetainied By US )
I need to download that file from site(Iam from India)
extract some data from that For that pupose i tried with htmlparser but it is not sovling problem completely.For that purpose i moved towards JExcelAPI .
Manually i saved it as .excel file then it is accessible with JExcel API
If i follow procedural way ie above method then its saving as excel file and looking as Excel file but when iam accesing that file as Excel file then it is giving Exception isOLEException
If i access manually convereted file then it is accessible.
Iam sending source URL
Look at this ::http://www.sttpc.com/reseller/price.htm
Procedural Code As Follows:
BufferedWriter out = new BufferedWriter(new FileWriter("c:/Excel/price.xls"));
BufferedReader in = new BufferedReader(new FileReader("C:/html/price.htm"));
String str;int c=0,r=0;
while ((str = in.readLine()) != null)
out.write(str);
n.close();
out.close();
Sorry For my English -
How to convert XML file to excel file
To convert XML file to excel file. what are the jar files required. also tutorial to convert XML File to excel file
Gotta use your own imagination.
I'd have a root tag <excel-spreadsheet>. Under that I'd have a <worksheet> tag for each worksheet. Under that I'd have a <row> tag for each row. Each <row> tag would have <column> tags, with "name" attribute, and the spreadsheet entry as the value.
The problem is that you can't really map everything that will go into a spreadsheet into this stream (e.g., graphs, stray cells, etc.) It maps well to tables, but that's it. -
Converting html file to csv file or excel file
Any body help me to convert html file into csv file or excel file using java.
I have no idea how to proceed.
is there any third party API's available.
Please guide me.
Thanks in advance
Vivekdev_vivek wrote:
I have no idea how to proceed.That could be due to the fact that there is no generic way to transform a html file into a csv or excel file.
Could it be that you're really interested in extracting specific values from the html file and then you want to export these values to csv and/or excel? -
I tried to convert PDF file to Excel file and I got an error message no. 404
I tried to convert PDF file to Excel file and I got an error message no. 404
My question is related to Reader, which infrmation?
The version is 10.0 and was downloaded?
any other details? -
How can I buy the software to change the pdf file to excell file en costa rica
How can I buy the software to change the pdf file to excell file???
Not sure what you are expecting. Scale is just an abstract concept. The overall content and appearance of the drawing doesn't change. If you place the same drawing on teh same page and just change it's supposed scale, you have changed nothing effectively . As far as AI is concerned, all that matters is the size of the content in relation to the page its on. If you want things to appear at specific sizes, you must scale them accordingly on the page and also keep in mind that AI uses inches as its base unit. so essentialyl you need to define the DPI of the drawing.
Mylenium -
How do I pay for one month subscription to convert a ms word file to excel file?
How do I pay for one month subscription to convert a ms word file to excel file?
Hi,
I need to know do you want to convert word PDF file into Excel file or something else?
Please elaborate.
Regards,
Florence -
Save as PDF file as excel file or text file in vba excel
Hi all,
I am opening a PDF document fromm VBA excel. After opening document it should save the document as excel file or text file in one folder.
I am trying to do this with some code but not able to , pls help me thatnks.
Dim AcroApp As Acrobat.CAcroApp
Dim Part1Document As Acrobat.CAcroPDDoc
Set Part1Document = CreateObject("AcroExch.PDDoc")
Part1Document.Open ("Z:\EG MI Information\MIS\Requests\Req_156\NO.1.pdf")
Dim app As Object, avdoc As Object, pageview As Object
Set app = CreateObject("AcroExch.App")
Set avdoc = app.GetActiveDoc
app.MenuItemExecute ("SaveAs")
thanks
AbhijeetHi,
In the documentation for the saveAs function it has the following params
cPath The device-independent path in which to save the file.
cConvID (optional, Acrobat 6.0) A conversion ID string that specifies the conversion
file type.
cFS (optional, Acrobat 7.0) A string that specifies the source file system name.
bCopy (optional, Acrobat 7.0) A Boolean value which, if true, saves the PDF file
as a copy. The default is false.
bPromptToOverwrite (optional, Acrobat 7.0) A Boolean value which, if true, prompts the user if
the destination file already exists. The default is false.
In order to get a text file saved you need to specify the correct cConvID.
See the documentation for the valid convID's - http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJS.88.519.html
Please note the Acrobat SDK contains all the information and does not require much installing ( as it is a zip file(on windows) and a disc image (on Mac) it just needs extracted)
Regards
Malcolm -
Can you tie/bind text box from excel file?
Hello,
I have use Data Merge to enter data from excel. But my question is, is there a way to bind or tie the data with your excel sheet. For example, if you change something on your excel file, it will update your InDesign document too.
Please let us know. Thank you very much.Not directly to the Excel file with Data Merge, but if you put your field placeholders on a master page your merged data should update (when you reopen the file, or issue an update command) if you edit the text file you use as a data source. In other words, you'd need to update the spreadsheet, then resave a new version of the text file, and finally update the merged document.
Depending on what you are doing, it's also possible to simply place an Excel file and link it, but edits and formatting will be lost if the spreadsheet is changrd unless you use table styles or do the formatting in Excel. -
Converting Word Files n Excel Files To TIFF images using java
Can u plzz help me in finding out code for Conversion of word, excel files to TIFF..as soon as possible...i hope vl find some help from u people.
Thankx n Regards
Mr.ReddyMS keeps their formats secure, it's how they make money.
There was a project from Apache (sub-group anyway), that was doing some work on it, but documentation and results were very flaky.
However, TIFF has a format that people can use. Search the web for the format, get the details on the byte structure, then simply apply.
Now, to convert between text to image, you'd need a rendering engine that figures out how it would look on-screen, then take the resulting graphics context data and convert it into the TIFF format. -
Why do excel attachments get received by ipads as dat files yest excel file by mac pc's?
Question should have read: Why do excel attachments get received by ipads as dat files but received as excel files by mac pc's?
Are you using Outlook as your email client?
The problem is with Outlook and on the sending side of things. Have the sender change their Outlook text settings from RTF (rich text) to plain text and the attachment should arrive uncorrupted. -
Hi there,
In my SP 2010 document library - When I try to save an Excel file from File > Save As menu to the document library it always prompts me "File already exists. Do you want to replace it?" even though the file does not exist in that document library.
To the same document library - if I upload a file then it accepts it all fine.
Any clues why I cannot save files using File > Save As menu?
Thanks.Hi,
As I understand, the notification pops up when you save an excel file to SharePoint library, while when directly upload file to library, there is no wrong.
Please confirm if the issue occurs to other machines.
Please open Microsoft Office Upload Center on the issue machine, then click settings, clear cache via checking Delete files from the Office Document Cache when they are closed.
http://office.microsoft.com/en-in/excel-help/office-document-cache-settings-HA010388664.aspx
If the issue occurs to client, I’d recommend you also ask the question in Excel forum:
http://social.technet.microsoft.com/Forums/office/en-US/home?forum=excel
Regards,
Rebecca Tu
TechNet Community Support
Maybe you are looking for
-
Key Figure Aggregate in Bex Query based on Charactersitic
Hi Gurus I am using BI7.0; but 3.5x BEx tools I am loading 6 fields from a flat file. I am loading data for tickets. I have create an InfoObject that counts the number of tickets. No problem. Also I also have key figures that I am assigning the s
-
How to use recursion with images
Ok, for this program I'm trying to recursively repeat an image 3 times with varying widths and heights, and I don't know how to do that with images. With rectangles and other shape objects it's easy because all I had to do was override the draw metho
-
Airplay,Ipad not possible to stream in English (Only German)
I am exoeriencing the following issue: When streaming from Ipad, Iphone or Mac Pro to the Apple TV (Gen2) it is not possible to listen to a dual soundtrack film (German/English) in any other language than German. It is possible to select and listen t
-
Hi, Is it possible to just start the command prompt in a certain directory. ie. my java programs are in the file C:\Java\myprograms. Can I start the command prompt so that its already in that folder? Thanks, Cam
-
RHEL 4, 10g and OCFS2 Installation Error
Hello, I am working on the a Oracle RAC installation and I am getting an strange error while installing OCFS2. The error I am getting occurs while performing a mkfs.ocfs2 (See details below). This is the command and error I am getting: Command: # mkf