Function module to convert an internal table to an tab delimited XL file
hi everyone
can anyone tell me the name of the function module which can convert the data in the internal table to an Excel file (Tab de-limited).
vamsi
Hello Vamsi
Just in case you need functions for the other way around (e.g. .csv-file -> internal table) SAP provides the following function modules:
- TEXT_CONVERT_CSV_TO_SAP
- SAP_CONVERT_TO_CSV_FORMAT
This function group <b>TRUX </b>contains some more interesting function modules.
Regards
Uwe
Similar Messages
-
Function Module for .xlsx to Internal table
Hi Gurus,
Please let me know if there is any function module for .xlsx to internal table.
Kind regards,
VarunHi,
try the below FM's
ALSM_EXCEL_TO_INTERNAL_TABLE
TEXT_CONVERT_XLS_TO_SAP
Thanks,
Vinayaka -
Convert an internal table from ABAP to an xml file on the Unix server
I'm trying to convert an internal table to an xml file. This file will be downloaded to a unix server. Can someone help?
Hello Linda,
You can combine the code given by Mahalakshmi with something like this:
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = 'YOUR_LOGICAL_FILE_NAME
parameter_1 = l_file_name_xml
IMPORTING
file_name = l_file_server
EXCEPTIONS
file_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
TRY.
OPEN DATASET l_file_server FOR OUTPUT. "<IN TEXT MODE> <ENCODING DEFAULT>.
ENDTRY.
IF sy-subrc = 0.
LOOP AT lt_xml INTO ls_xml.
TRANSFER ls_xml TO l_file_server.
ENDLOOP.
CLOSE DATASET l_file_server.
ENDIF.
ENDIF.
You need to have the server path defined (look at the paths with tcode AL11) and the file logical name with tcode FILE
Best regards,
Andri -
Function module for convert date as sap internal format ?
Hi All,
Is there any standard function module to convert the date filed as SAP internal date?
My problem is while uploading data from excel sheet date filed can be any format
for exp: dd/mm/yyyy or mm/dd/yyyy or yyyy/dd/mm or dd-mm-yyyy,mm-dd-yyyy
dd-mm-yyyy or dd.mm.yyyy or mm.dd.yyyy etc...
In our case there is no particular format in excel it can be differ for each user. I know we have few FM's in standard.
But those are not working for my req. pls help me if you have any idea.
Thanks in advance.
Regards,
Venkat Mote.Hi Venkatesh,
Can you please check with the following function module. For my case, it is working fine.
CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
EXPORTING
datum = p_gs_date
dtype = 'DATS'
IMPORTING
idate = p_gs_date
Hope it helps to you.
Regards
Rajkumar Narasimman -
How to Convert an internal table into Text File
Hello friends,
Can you help me to find out the way to convert an internal table data into a flat file.
the problem is that my internal table contains fields with data type INT also.please go through the code and the parameter passed to the finction module ... since you didn't show your coding i am giving you the sample code also ..
REPORT y_ss_test_ekko .
* To hold selection data
DATA: i_ekko TYPE STANDARD TABLE OF ekko.
* To hold converted text data
DATA: i_text(4096) TYPE c OCCURS 0.
* Selection Screen
PARAMETERS: p_ebeln LIKE ekko-ebeln.
* Select data into an ITAB based on the selection Criteria
SELECT * FROM ekko
INTO TABLE i_ekko
WHERE ebeln = p_ebeln.
* Process further only if found some data
IF NOT i_ekko[] IS INITIAL.
* Convert data in internal table to a delimited text data
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = '|'
TABLES
i_tab_sap_data = i_ekko
CHANGING
i_tab_converted_data = i_text
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE: / 'Program failed to Convert data.'.
ELSE.
* Download convert data to Presentation Server
CALL FUNCTION 'DOWNLOAD'
TABLES
data_tab = i_text
EXCEPTIONS
OTHERS = 8.
IF sy-subrc <> 0.
WRITE: / 'Program failed to download data.'.
ENDIF.
ENDIF.
ENDIF.
reward points if it is usefull ....
Girish -
How to convert an internal table to a PDF
Hello Experts,
Is there a way that an internal table can be converted into a PDF file?
The itab is:
data: i_data(100) type c occurs 0 with header line.
Thanks.Hai,
first convert ur internal table data to OTF.by usinf thid Function Module
data: t_otf LIKE itcoo OCCURS 100 WITH HEADER LINE,
t_pdf LIKE tline OCCURS 100 WITH HEADER LINE*.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = w_size
BIN_FILE =
TABLES
otf = t_otf
lines = t_pdf
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF sy-subrc <> 0.
RAISE error. " oops
ENDIF.
and then use gui_download function module.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = w_size
filename = 'C:\Documents and Settings\adc\Desktop\pdf123.pdf'
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = 'X'
COL_SELECT_MASK = 'XX X XX'
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
IMPORTING
FILELENGTH =
tables
data_tab = t_pdf
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
reward if helpful
raam -
Function Module to convert amount to amount in words
Dear Guru ,
I want to know is there any sap standard Function Module to convert amount value to amount in words
Thanks & RegardsHi..
Use FM SPELL_AMOUNT.
This function module converts an amount or number into words. It can be used as follows:
Convert a number into words
To do this, the transfer parameters LANGUAGE and AMOUNT have to be entered.
Convert an amount into words
To do this, the fields LANGUAGE, CURRENCY, and AMOUNT have to be entered.
Program RF_SPELL contains a sample call of the function module. You can use it for test purposes.
REPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT
I hope it helps.
Reward pts if helpful
Regards
- Rishika Bawa -
Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format
Can any one tell me Function module to convert date form yyyy/mm/dd to dd/mm/yyyy format?
have a look at the WIKI FAQs...they are very useful
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapDevelopmentand+Programming&
For this it says:
<i>How to convert a date to internal or external format?
Use the functions modules CONVERT_DATE_TO_EXTERNAL or CONVERT_DATE_TO_INTERNAL
to convert the date. When converting to external format, the date format from the user's user profile will be used. When converting to internal format, the result will be in YYYYMMDD format.</i> -
Is there any function module to convert the date format
Dear ABAPers,
Is there any function module to convert the date format from dd.mm.yyyy to dd-mmm-yyyy.
I want to convert the date format from dd.mm.yyy to dd.mmm.yyy Eg.from 10.03.2008 to 10-mar-2009.
Thanks & Regards,
Ashok.hi,
create custom function module or copy the below code in the report ..and use it
the out put for below is :----Convert a DATE field into a full format date eg. March 23, 2000
FUNCTION Z_CONVERT_DATE_INTO_FULL_DATE.
""Local interface:
*" IMPORTING
*" VALUE(DATE) LIKE SY-DATUM
*" EXPORTING
*" VALUE(FORMATTED_DATE)
*" EXCEPTIONS
*" INVALID_DATE
TABLES: TTDTG.
DATA: BEGIN OF T_DATE,
YYYY(4) TYPE C,
MM(2) TYPE C,
DD(2) TYPE C,
END OF T_DATE.
DATA: DAY(3) TYPE N.
DATA: VARNAME LIKE TTDTG-VARNAME.
IF DATE IS INITIAL.
CLEAR FORMATTED_DATE.
EXIT.
ENDIF.
check document date format
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1.
IF SY-SUBRC NE 0.
RAISE INVALID_DATE.
ENDIF.
MOVE DATE TO T_DATE.
CONCATENATE '%%SAPSCRIPT_MMM_' T_DATE-MM INTO VARNAME.
SELECT SINGLE * FROM TTDTG WHERE SPRAS = 'EN' AND VARNAME = VARNAME.
WRITE T_DATE-DD TO DAY.
CONCATENATE DAY ',' INTO DAY.
CONCATENATE TTDTG-VARVALUE DAY T_DATE-YYYY INTO FORMATTED_DATE
SEPARATED BY SPACE.
ENDFUNCTION.
the output is :--Convert a DATE field into a full format date eg. March 23, 2000
Regards,
Prabhudas -
Function module to convert currency to USD
Hi All,
I need the function module to convert the currency to USD and the mandatory fields to be passed to the function module.
Thanks & Regards
Sureshhi,
Working With LSMW:
Use TCODE LSMW
Objects of LSMW:
Project ID with max of 10 char to Name the data transfer project.
Subproject Used as further structuring attribute.
Object ID with max of 10 Characters, to name the Business object .
Project can have multiple sub projects and subprojects can have multiple objects.
Project documentation displays any documentation maintained for individual pop ups and processing steps
User Guide: Clicking on Enter leads to interactive user guide which displays the Project name, sub project name and object to be created.
Object type and import techniques:
Standard Batch / Direct input.
Batch Input Recording
o If no standard programs available
o To reduce number of target fields.
o Only for fixed screen sequence.
BAPI
IDOC
o Settings and preparations needed for each project
Preparations for IDOC inbound processing:
Choose settings -> IDOC inbound processing in LSMW
Set up File port for file transfer, create port using WE21.
Additionally set up RFC port for submitting data packages directly to function module IDoc_Inbound_Asynchronous, without creating a file during data conversion.
Setup partner type (SAP recommended US) using WE44.
Maintain partner number using WE20.
Activate IDOC inbound processing.
Verify workflow customizing.
Steps in creating LSMW Project:
1) Maintain attributes choose the import method.
2)Maintain source structure/s with or without hierarchical relations. (Header, Detail)
3) Maintain source fields for the source structures. Possible field types C,N,X, date, amount and packed filed with decimal places.
Fields can be maintained individually or in table form or copy from other sources using upload from a text file
4) Maintain relationship between source and target structures.
5) Maintain Field mapping and conversion rules
For each Target field the following information is displayed:
o Field description
o Assigned source fields (if any)
o Rule type (fixed value, translation etc.)
o Coding.
o Some fields are preset by the system & are marked with Default setting.
6) Maintain Fixed values, translations, user defined routines Here reusable rules can be processed like assigning fixed values, translation definition etc.
6) Specify Files
o Legacy data location on PC / application server
o File for read data ( extension .lsm.read)
o File for converted data (extension .lsm.conv)
7) Assign Files to defined source structures
8) Read data Can process all the data or part of data by specifying from / to transaction numbers.
9) Display read data To verify the input data being read
10) Convert Data Data conversion happens here, if data conversion program is not up to date, it gets regenerated automatically.
11) Display converted data To verify the converted data
Import Data Based on the object type selected
Standard Batch input or Recording
o Generate Batch input session
o Run Batch input session
Standard Direct input session
o Direct input program or direct input transaction is called
BAPI / IDOC Technique:
IDOC creation
o Information packages from the converted data are stored on R/3 Database.
o system assigns a number to every IDOC.
o The file of converted data is deleted.
IDOC processing
o IDOCS created are posted to the corresponding application program.
o Application program checks data and posts in the application database.
Finally Transport LSMW Projects:
R/3 Transport system
o Extras ->Create change request
o Change request can be exported/imported using CTS
Export Project
o Select / Deselect part / entire project & export to another R/3 system
Import Project
o Exported mapping / rules can be imported through PC file
o Existing Project data gets overwritten
o Prevent overwriting by using
Import under different name
for more information follow this link.
http://help.sap.com/saphelp_nw04s/helpdata/en/87/f3ae74e68111d1b3ff006094b944c8/content.htm -
Function module to convert EA(Eaches) to CS(Cases)
Hi,
Is their any function module to convert EA(Eaches) to CS(Cases),i tried UOM_SIMPLE_CONVRESION
but could not succed,may be i have to maitain entry for unit conversion in T006 table.
plz suggestHi,
Try as below.
call function 'MD_CONVERT_MATERIAL_UNIT'
exporting
i_matnr = i_matnr
i_in_me = i_meinh_in
i_out_me = i_meinh_out
i_menge = ld_menge_in
importing
e_menge = ld_menge_out
exceptions
others = 4.
Regards,
Raju. -
Need a function module to convert xstring to string in web dynpro applicati
hi,
need a function module to convert xstring to string in web dynpro application other than HR_KR_XSTRING_TO_STRING.
Moderator message: please (re)search yourself first.
Edited by: Thomas Zloch on Nov 17, 2010 5:31 PMHi,
Check the following link:
FM to convert XString to String
Regards,
Bhaskar -
Any1 aware of a function module to convert a number in exponential form
any1 aware of a function module to convert a number in exponential form to normal form...
eg... a no. like 8.00000000000004E-01
8.88888888888884E-01
and
a no. like 1.50000000000000E+00
9.44444444444442E-01I think you can just move from type F to type p.
p = f .
Regards,
Rich Heilman -
Function module for converting the foreign currency to words
hi,
can anybody tell me about the function module for converting the foreign currency to words format.
Like 25.50 USD
should be "Twenty Five Dollar & Fifty Sents."
foreign currency can be anyone like USD, JPY, EUR etc.
Regards
Nitin VarshneyHi,
Try using the FM SPELL_AMOUNT
Check this wiki
[SPELL_AMOUNT|https://wiki.sdn.sap.com/wiki/display/Snippets/SpelltheAmountenteredin+words]
Regards
Sarves -
I am trying to find a function module or BAPI for internal order change. I
I am trying to find a function module or BAPI for internal order change. I did come across a function module ALE_INTERNALORDER_DB_CHANGE which directly updates the internal order using insert statements. Can i use this for internal order change or this is any other Function module for updating the internal order.
I dont want to use BDC as a option. Please suggest.This is possible using the Rotator Component Widget from Infosemantics.com.au but it is only compatible with SWF output, not HTML5.
Go to this page and scroll down to the video tutorials about the Rotator Component widget:
http://www.infosemantics.com.au/adobe-captivate/youtube-video-tutorials
Maybe you are looking for
-
Hello, We have a scenario in which their exists a material ( finished trading goods ) having moving average price as price control indicator is V. Suppose stock of material is 1 now with moving average price as V, hence total stock value is 100. Now
-
How to use Labview to Send Commands to Excel on Analyzing Data
Hello, here is my situation: I have a Labview VI that reads in data from various sensors and uses the Report Generation Toolkit to send all the data values to Excel. Since every run is ~ 8-10 hrs long and there's tons of data, I don't bother to store
-
Hi, I have written the following trigger: create or replace trigger check_pilot_ff before insert or update on flight for each row declare ff_date_pilot DATE; ff_date_copilot DATE; deptdate DATE; begin select ff_test into ff_date_pilot from pi
-
App Store - forgot security questions. HELP!
I can't make a purchase on my iPad 2 because I don't remember ANY of my security questions and I can't reset them because I don't have a rescue email and the option is not located anywhere on my apple ID page. I've been making purchases with this sa
-
DB Utility (SE14) when adding new fields on standard dictionary table
Hi all, we're searching of an official SAP document (or OSS Note) that certifies the mandatory use of DB utility (SE14) when we add one or more custom fileds on an append structure of a standard table (i.e. like VBAP). Note: The custom append Structu