Creation of function module to convert the mean value to charecterformat
hi every body
i have one doubt regarding convertion of meanvalue to integer value.
first of all i took all related values to internal table but inthat internal table the value of MITTELWERT feild is mean value.inthat the feild value tobe stored is 9.9000000000000000E+01 but the actual value is 99.
in that field i stored even a date and charecter data also .so i need to convert that format to charecter format.
please help me out in this context
thank you & regards
reward points also if the answer help ful to me .
Message was edited by:
vaidehi yedlapalli
?? Are you asking about the logic for mean value of numbers, dates and character data?
Pls. evaluate further givin example.
Regards,
Clemens
Similar Messages
-
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 -
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 -
Creation of function module for updating the ztable
Hi,
I am sending the requirement for ceation of function module for updating the ztable.
Requirement----
Table Updation rule (New record)
While creating a new record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO-------> Sales Delivery no in case of sales orderShipment no in case of transfer order
UNAME----
> User ID
ZORDTYPE----
> SALEOR in case of sales orderTRANSF in case of transfer order
ZREFDOCNO----
>Sales Order no in case of sales orderPurchase Order no in case of transfer order
ZREFDOCNO1----
>Delivery no in case of transfer order
The table handling function will calculate the following fields
Table field Probable Values
ZREQNO----
>Running serial number (incremented by 1 for each new record)
ZREQDAT -
>System date
ZREQTIME----
> System time
ZSTATUS----
>OPEN (for all new records)
Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
Table Updation rule (Status Update)
While updating a record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO----
>Sales order no in case of sales orderShipment no in case of transfer order
ZSTATUS----
>CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
The table handling function will calculate the following fields
Table field Probable Values
ZSTATDAT----
>System date
ZSTATTIME----
> System timeDo you have to create/update new record in Ztable through Function Module ?
or you need to write FM only for validation?
Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
Let me know clearly what exactly u need ?
Regards,
Kiran -
Call an executable program inside function module and pass the table values
Hi,
i'm pretty new to HR Abap programming. I have a requirement like "calling an executable program within a function module and the output of the program data(Stored in internal tables) should be passed to the function module tables".
I've some idea about SUBMIT keyword and i used it in the function module..
Please do the needful to solve this.
Regards,
Selvi.Hi,
Thanks for all your reply.
I've used Option 3 as per dsouzajovito suggestion. Now i'm getting data in function module tables using import/ export table to memory concept.
Again a small issue arises, while i'm executing function module it fetches all pernr available in the server and displays the details of last pernr. GET pernr statement is used in the Z report and submit statement is used like this as follows.
SUBMIT ZHR_RFC_PAYSLIP WITH PERNR-PERNR EQ EMPCODE
WITH PYBEGDA EQ FDATE
WITH PYENDDA EQ LDATE
AND RETURN.
Pls suggest if there is any corrections in the code.
If i give a pernr as input in the function module, then it should fetch the details related only to that pernr.
FYI, No selection screen is used here as per requirement.
Regards,
Selvi. -
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 date format to yyyymmdd
Hi All,
Would like to seek for your advice. Is there any function module to convert the date format from mm/dd/yyyy to yyyy/mm/dd? Thanks in advance.
Regards,
Shawn
Moderator Message: Basic date question. Thread locked.
Edited by: Suhas Saha on Dec 30, 2011 12:44 PMHi,
Use the FM CONVERT_DATE_TO_EXTERNAL.
Edited by: emax nagu on Dec 30, 2011 7:53 AM -
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 -
Function Module for Posting the Delivery Doument
Dear Experts,
Could you please send me the Function Module for Posting the Delivery Doument.
Thanks & Regards,
Ashok.Hi,
What do you mean by POSTING the delivery document?
Are you mentioning the creation of Goods Issue? -
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 -
Error with quantity field:Datasource Creation Using Function Module method
Problem with DATASOURCE Creation using Function Module method :
I have created a datasource ZSTANDARD_COST_PRICE using Function Module method . The datasource creation is successfull when I remove the quantity field from the Z table . If I dont remove the quantity field from my Z table it gives an error as "Units Field WAERS for field STPRS of datasource ZSTANDARD_COST_PRICE is hidden". I am not able to remove this error . Please someone guide.
Let me know if my explanation is not clear enough.
Thanks in advance,
Neha.
Z table definition is as below :
MATNR MATNR CHAR 18 0 Material Number
BWKEY BWKEY CHAR 4 0 Valuation area
LFGJA LFGJA NUMC 4 0 Fiscal Year of Current Period
STPRS STPRS CURR 11 2 Standard Price " Here the currency field is WAERS and table T001
PEINH PEINH DEC 5 0 Price Unit
VJSTP VJSTP CURR 11 2 Standard price in previous year
VJPEI VJPEI DEC 5 0 Price unit of previous year.
Edited by: Neha Rathi on Jan 30, 2009 3:03 PMHi,
You should add it as one of the main fields as you have added other fields and not as the currency fields...that is..it should be part of the data source and you should be able to see it in RSO2...
Also if added as i said then it will come as new field in the data source...you can either let it be there...or hide it..
also if you want to populate it then you will have to write the code for this fields as well.
Thanks
Ajeet -
Function module to determine the credit balance or if there is an open ite
Hi All ,
Can anyone please let me is there any function module to determine the credit balance orr if there is an open standing request / open standing request /paid but not yet refunded security deposit .
Requirement :
Purpose -This report shows a list of u201Cinactiveu201D contract accounts and the amounts to be refunded (credit balance, paid security deposit) to customers. This report also shows any open standing requests in customersu2019 contract accounts.
Note: SAP does not have a concept of u201Cinactiveu201D contract accounts. All contract accounts are active in SAP.
We do have customers who pay several months in advance (when they are out of town and donu2019t want to have their services disconnected).
Logic to retrieve the u201Cinactiveu201D accounts:
The inactive accounts can be identified by the Move-In/Out dunning procedure. If the mov-in/out dunning procedure is not empty, that means this account has moved out and the account is inactive.
Business Logic and Flow
For each contract account
Go through each installation and check if it is disconnected
If (one is active)
move to the next contract account
else (all is disconnected)
check to see if there is a credit balance or if there is an open standing request
If (credit balance)
{Display contract account, customer number and information, and credit balance for refund}
If (open standing request)
{Display contract account, customer number and information, standing request number to be closed}
If (paid but not yet refunded security deposit)
{Display contract account, customer number and information, current balance and security deposit amount}
Thanks in advance
RahulHi Rahul,
To find out the credit balance relating to security deposits you can use BAPI_ACCOUNT_GETBALANCES. On execution of this BAPI with BP and Contract Account Number, it will return the net balance with different segments like open, due, credit and likewise security deposit amount.
To find out if there is any open standing request standing against the customer you can use BAPI_CTRACCONTRACTACCOUNT_GOI. You have to execute this BAPI by providing BP or Contract Account number in Main Selections table and Main and Sub Transaction of Security Deposit Request transaction in Value Selection table. This BAPI will fetch all open items with the main and sub transactions specified and display.
Thanks
Ganesh -
Function Module to determine the number of pages in a pdf file
Hi All,
Is there any standard function module to determine the number of pages in a pdf file?
Thanks,
SaiHi unk2,
There's no functionality in the Acrobat.com online services to do a character count. But, you could use ExportPDF to convert your PDF file to Word format, and then do your character count in Word.
Please let us know if you need additional assistance.
Best,
Sara -
Function module to convert date and time
Hi ,
Requirment is i want to create a file in the application server.So the file name should be in the following format.
0XX-XXXX-YYYYMMDDHH.format.
in this HH-hours.I need to take current date and time.so is there any function module to convert into this format.If it is not there how to create file name in this format.
Thanks,
MRREPORT ZTEST_CONV.
data: time_stamp TYPE timestampl.
GET TIME STAMP FIELD time_stamp.
You can try with GET TIME STAMP
But it will be in Different format. -
Function module for converting weight unit to another unit.
What is the function module for converting weight unit to another unit.
I want to convert LB to KG.
Tried with fm UNIT_CONVERSION_SIMPLE.
INPUT 100
NO_TYPE_CHECK
ROUND_SIGN X
UNIT_IN LB
UNIT_OUT KG
But there is no output.
Can some one help.The trick here is we need decalre input output with non-character data type like VBPLK-BRGEW.
We can test using normal SE37.
I tested and this program worked fine:
data: UNIT_IN LIKE T006-MSEHI,
UNIT_OUT LIKE T006-MSEHI,
output LIKE VBPLK-BRGEW,
input LIKE VBPLK-BRGEW.
input = 10.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = INPUT
UNIT_IN = 'LB' "UNIT_IN
UNIT_OUT = 'KG' "UNIT_OUT
IMPORTING
OUTPUT = OUTPUT.
write: output.
Maybe you are looking for
-
Hi Folks, is there any report to display the POlis t for which the GR has been done and invoice notposted. Thanks for your reply and points will be rwarded Best Regards Srinivas
-
My macbook pro is about 1 1/2 year old and i started having problems with permissions and likely also the library. I want to start from scratch, how do i reformat the HD and reinstall the software?
-
hi, can any tellme.. how can i use database function ' LIKE ' in the obiee. thanks in advance
-
Adobe Combine Feature - Sorts numbered files incorrectly
At my company we use a scanning software called Kofax. We also have copies of Adobe Acrobat Standard 6-9 depending on how old the work station is. Lets say I scan a batch of 120 pages. It will scan each page as an individual .tif file and put them al
-
I am attempting to move an existing OWB repository from a DB on a server running 9.2.0.6 to a DB on a server running 10.1.0.2. The Target and source servers are running Windows 2000 Advanced Server. All OWB components are 9.2. Until now all DB compon