‎2006 Jun 26 10:09 AM
Hi friends ,
<b>1.</b> I want to add leading zero's to a field .
Wxample - LIFNR , if its value in a variable is 16987 then i want to convert it to standard format (0000016987).
<b>2.</b> I want to convert date format to system's format. In Dev server and quality server it is in different format and i'm facing problem while uploading data using BDC.Also how i'll identify that in which format it is in production.
How to get it
‎2006 Jun 26 10:11 AM
YOu can use the fm CONVERT_DATE_TO_INTERNAL for your 2nd problem.
YOu can use the fm CONVERSION_EXIT_ALPHA_INPUT
for your 1st problem
Regards,
ravi
‎2006 Jun 26 10:10 AM
Hi to add leading zeroes
then please use FM
CONVERSION_EXIT_ALPHA_INPUT
‎2006 Jun 26 10:11 AM
YOu can use the fm CONVERT_DATE_TO_INTERNAL for your 2nd problem.
YOu can use the fm CONVERSION_EXIT_ALPHA_INPUT
for your 1st problem
Regards,
ravi
‎2006 Jun 26 10:13 AM
data: k1(4) type c value '4567'.
data: k2(10) type n .
k2 = k1.
write: k2.
‎2006 Jun 26 10:16 AM
Hi sonal,
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = rp50m-pernr
IMPORTING
output = rp50m-pernr+0(8).
Reward points if it helps
Regards
Gunjan
‎2006 Jun 26 10:12 AM
Hi,
Use these function Modules for ur problems..
(1)For adding leading zeroes or in sap format internal..
<b>CONVERSION_EXIT_ALPHA_INPUT</b>
(2)For changing date into systems internal format..
<b>CONVERT_DATE_TO_INTERNAL</b>
Cheers,
Simha.
‎2006 Jun 26 10:13 AM
To add leading zeroes, use FM CONVERSION_EXIT_ALPHA_INPUT if passing values from user screen to SAP), and CONVERSION_EXIT_ALPHA_OUTPUT (if passing values from SAP to user screen - this will delete leading zeroes and return only the value).
Standard date format in all SAP systems is sy-datum. It is stored in the system as YYYYMMDD. When writing on the screen, it will come up as per the user's specification.
If you declare your field as type sy-datum or pass it in the above format, you should be ok.
Hope this helps.
Sudha
‎2006 Jun 26 10:14 AM
hi sonal,
1) Use the FM Conversion_exit_alpha_input.
2) use FM CONVERT_DATE_TO_INTERN_FORMAT or CONVERT_DATE_TO_INTERNAL
‎2006 Jun 26 10:14 AM
Hi Sonal,
data : l_val type lifnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_val
IMPORTING
OUTPUT = l_val.
write : l_val
‎2006 Jun 26 10:16 AM
Hi,
Use conversion exit function module to add zeros
CONVERSION_EXIT_ALPHA_INPUT
2. declare your variables as SY-DATUM.
regards,
Shashank
‎2006 Jun 26 10:16 AM
1. Use Functional module
'CONVERSION_EXIT_ALPHA_INPUT'
export
input = wa_lifnr
import
output = wa_lifnr
->wa_lifnr will converts.
2. system will take date format yyyymmdd
so convert ur(what ever ur date format) date to yyyymmdd.
*take a variable like d_date using 'WRITE X(what ever ur date format) TO d_date yyyymmdd.
Regards,
Ramesh.
‎2006 Jun 26 10:18 AM
Hi,
need to call the FM <b>CONVERSION_EXIT_ALPHA_INPUT</b>
Regards
Vijay
‎2006 Jun 26 10:24 AM
<b>data: v_lifnr(10) type c.</b>
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = Wxample - LIFNR
IMPORTING
OUTPUT = v_lifnr
.
If Wxample - LIFNR = '16987'.
O/p:
v_lifnr = '0000016987'
‎2006 Jun 26 10:25 AM
If i want to change the format of all the records present in my internal table at once then how can i ?
Sonal
‎2006 Jun 26 10:29 AM
loop at itab.
call to FM ....CONVERSION_EXIT_ALPHA_INPUT..
in the import parameter pass the itab-fieldname1 and pass the export parameter to itab-fielname1 (overwrite) and do the same for all the fields in ur itab.
endloop.
Reward points if it helps
Regards
Gunjan
‎2006 Jun 26 10:29 AM
don't change anything in the Internal Table. Whenever u r going to change to 10 characters(0000016987) before that u can use this FM.
Ex:
Loop at it.
. some process
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = it-lifnr
importing
output = v_lifnr.
u can use v_lifnr ......
Endloop.
‎2006 Jun 26 10:30 AM
‎2006 Jun 26 10:34 AM
Hi,
<u>Use these function Modules for ur problems..</u>
(1)For adding leading zeroes or in sap format internal..
CONVERSION_EXIT_XXXXX_INPUT
(2)For changing date into systems internal format..
CONVERSION_EXIT_XXXXX_INPUT.
u can find out conversion routines for each corresponding domain of that field in given below procedure.
Domain->Defintion->Output Characteristics-> Conversion routine.
Double click on that, it will show corresponding conversion routines.
Please add ur rewards.
With regards,
Rajesh