Removing leading spaces for type P variable
Hi,
I am declaring the 2 variables as type P. The below code was working fine, But our client, wants to remove the leading spaces for these variables,
v_lower(16) TYPE p DECIMALS 2,
v_upper(16) TYPE p DECIMALS 2.
v_lower = i_plmk-toleranzun.
v_upper = i_plmk-toleranzob.
i_output-toleranzun = v_lower.
i_output-toleranzob = v_upper.
Can any one suggest how can we achieve this. Is there any function module for achieving this.
Thanks In Advance,
Regards,
Ramana Trapatla.
Hi,
If your question was in the context of displaying data of type p without the leading space, then you can use left-justified addtion to your write statement.
data: val(10) type p decimals 2.
val = '0000000123.43'.
write: val LEFT-JUSTIFIED.
Regards,
Vikranth
Similar Messages
-
SAPSCRIPT - Symbol for removing leading spaces/zero's?
Hi,
How do you remove leading spaces/zeros in a variable that is sent from the print program?
Do you use symbols and if so, how (i've never worked with symbols, ever)?
Please help.
Thanks,
JohnI think the "Z" symbol will remove the zeros in the sapscript form. For example,......
/ &EKKO-EBELN(Z)&
Regards,
Rich Heilman -
Removing Leading Spaces in the field to be displayed
Hi,
Could you please tell me how to remove leading spaces in currency field in write statement?
the length of the field cannot be changed by writing fieldname(length).
is there any other method to do the same. the length should vary according to the amount in the field.
Ragards,
Krutikahi,
please use "SPLIT " or condense .
eg: SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
to better understand refer this code:
IF it_mhnd IS NOT INITIAL.
SELECT hzuon bukrs gjahr augdt augbl
FROM Bseg
INTO TABLE it_bseg
FOR ALL ENTRIES IN it_mhnd
WHERE belnr = it_mhnd-belnr
AND bukrs = it_mhnd-bukrs
AND gjahr = it_mhnd-gjahr
AND umskz = 'E'.
endif.
data: l_space type char6.
loop at it_bseg into wa_bseg.
SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
wa_bseg1-bukrs = wa_bseg-bukrs.
wa_bseg1-hzuon = wa_bseg-belnr.
wa_bseg1-hzuon = wa_bseg-gjahr.
wa_bseg1-hzuon = wa_bseg-umskz.
append wa_bseg1 to it_bseg1.
clear: l_space, wa_bseg1.
endloop.
IF it_bseg1 IS NOT INITIAL.
SELECT belnr bldat
FROM bsad into table it_bsad
FOR ALL ENTRIES IN it_bseg1
WHERE belnr = it_bseg1-hzuon
AND bukrs = it_bseg1-bukrs
AND augbl = it_bseg1-belnr.
endif.
regards
rahul
Edited by: RAHUL SHARMA on Jan 5, 2009 12:19 PM
Edited by: RAHUL SHARMA on Jan 5, 2009 12:20 PM -
How can I remove leading spaces on a field before it is saved to the database. I know that I need to use the LTrim function. However, I am unsure as to where.
thanks.though there are plenty of ways you could do this depending on your page's setup, a simple implementation of this in a wizard-generated form on a table would be to put a Computation on your page for that item that fires with a "Computation Point" of after submit. so if you had a form on the Emp table, and you wanted to ltrim your P1_JOB item, you could do it using an after submit computation with a "Type" of "SQL Expression" where the body of your computation would simply be...
ltrim(:P1_JOB)
...hope this helps,
raj -
Remove Leading zeros for Material in Transformation
Hi Experts,
I'm using DTP first time. I don't have much exp on DTP & Transformations.
I'm creating infocube with some objects. I want to remove leading zeros for zmaterial.
In 3.x writen update routines as fallows:
data: zmat(18) type c.
zmat = COMM_STRUCTURE-/BIC/ZMAT.
shift zmat left deleting leading '0'.
result value of the routine
RESULT = zmat.
I'm confusing in Transfermation where to write this routines.
I'm writing in Transformation as fallows:
data: zmat(18) type c.
zmat = SOURCE_FIELDS-/BIC/ZMAT.
shift zmat left deleting leading '0'.
RESULT = zmat.
But it's getting remove zero's.
Anybody suggest on this.
SiriDear Sir,
No confusion at all.
Just double click on the Target Infoobjct i,e Material object in Transformation, you will see a wizard popping up.
There you will see a option called "RULE TYPE" and the default value will be "Direct Assignment". In the same check box click on the drop down icon and select "Routine".
The moment you select the routine option, it will open up ABAP workspace where in you can write your routine and get the desired result.
Hope it helps. -
Condense the leading spaces for a particular field
hi
total_weight TYPE char10,
I need to condense the leading spaces.for a particular
how shd i do it.shift total_weight left deleting leading space.
Regards,
RIch Heilman -
How to remove leading zeros for an item number within quickviewer
how to remove leading zeros for an item number within quickviewer. Pls help
ask your abap guy to do it. not portal guys business.
-
Removing leading spaces in a decimal number
I have a decimal number field of length 28 with 9 spaces.I have to print it right justified and remove the leading spaces.I appreciate if anyone can let me the statement for this
Hi,
Try this..
DATA: V_P TYPE P DECIMALS 2.
V_P = '112.00'.
WRITE: / V_P.
DATA: STR TYPE STRING.
STR = V_P.
SHIFT STR LEFT DELETING LEADING SPACE.
WRITE: / STR.
Thanks,
Naren -
Removing leading spaces in smartforms
When I print numbers in smartforms, they usually have a bunch of leading spaces, which messes up the formatting. E.g. a CURR 15 field containing 5000 will print as " 5.000,00".
I saw the formatting options in the BC470 manual but there are only options to remove leading zeros, or to replace leading spaces with a Filler. What I need is to remove the leading spaces. Anyone know how?
For the moment I'm copying all the numbers I want to print to string fields and using CONDENSE on those, but then I don't get the right number formatting, e.g. I get "5000.00" while I need "5.000,00".Hi
The format of amount field depends on the currency key, the smartforms should write the amount in right format if it can understand which currency is to be used.
The link between these field is done in the dictionary.
If the samrtform can't understand it you can move the amount in the char field using WRITE statament and print this field instead of original one:
WRITE <AMOUNT> CURRENCY <CURRENCY> TO CHAR_AMOUNT.
Max -
Removing leading zeros for the quantity field
Hi all,
In my script form there is a quantity field, of 13 and 3 decimals , on the out put its taking that much space un neccesarily,and messing up.
how to make this adjustable in the provided space.
It always 3 digits and 2 decimal points in our case.
Please help me out,
Thanks,
PraveenHi,
For removing leading zeros
&V_VARIABLE(Z)&
Thanks,
Naren -
How can I remove leading spaces?
I have a 40 page PDF and I used the Form Wizard to generate fields for me. I noticed that some of the fields have leading spaces in the name. These fields cannot be used via the doc.getField(name) syntax. It simply returns null.
If I manually rename the field and remove the leading space it works, but this would take a long time. Is there any way to programmatically refer to a field with a leading space in the name? Perhaps some sort of escape character for the space? Or can I refer to a field by index instead of name? (For example, I can use doc.getNthFieldName(index) but this just returns the name (with leading space). If I could have something like doc.getNthField(index) that would work too)
Thanks in advance.A very good question! A leading space in generated form field names is a bug if it afterwards keeps you from getting the field by name (which is the only method?).
I have made an Action in Javascript to loop through all those generated form fields and delete all junk except the two signature fields that were intentional.
Afterwards, I have to manually delete all the fields that have a leading space in their generated name.
Please fix. -
Hi,
Can any tell me how to remove the leading spaces from the variable with sample code or any function module.
I have field which is of 40 characters. slpit that into two different variables first 4 and rest 36 characters.
But there is possibility that 5 character (which will be the first character out of 36) is a space.
I want to remove that space from that as i have to compare this after removing the space with another variable.
Pls tell me how to do this? is there any Function module or any other way.Hi Hema,
1. we can use
CONDENSE
REPLACE
2. Just see the documentation on this. F1
3. Both functionality is different
as the name suggests.
4. U can use as per ur requirement.
regards,
amit m. -
Remove leading space(blank) REGUH-RWBTR in script
hi,
i am now dealing with cheque priting in word issue.
the output format should be :
<b>USD 111,000 AND CENT 45 ONLY.</b>
the amount field i use is REGUH-RWBTR in script. but the output come with leading of space.
<b>which is as : USD 111,000 AND CENT 45 ONLY,</b>
which this is not i want. how am i going to remove the blank space leading and ending for REGUH-RWBTR?
below is my current code:
&'***RM'REGUH-RWBTR(.0)&&' AND SEN 'SPELL-DECIMAL(2)& ONLY ***
please any one can help me. either using this field, or any other way to do display it?can i see the exact o/p as how u r seeing it for comparision.
i hope u r using &rxxxx-rwbtr(C.0)&
did u check the second option also . ? confirm
Since the data type is currency format and here we are supressing the decimals so in order to supress the blank space at the end you can go for a variable declaration with type char
say gv_val(13) type c
and then move the rxxx-btr to this gv_val as
gv_val = rxxx-rwbtr.
now replace in the code display the amount filed as &&gv_val(C.0)&&
Im not logged onto sap now.
you have to confirm the result.
regards,
vijay. -
Remove leading zeros for invoice lists to allow auto lockbox processing
I have a change request for the following document at my job. but i am very new into it and do not know how to start and what to do exactly? can anyone please help me what to do in this matter.
SAP auto posting process for lockbox checks was created to post cash with minimal manual intervention.
Transaction FLB2 is used to import a lockbox file from Bank of America containing customer payment detail to auto match and clear invoices in the AR subledger. The auto post program tries to match an invoice number from the Reference field to the invoice # in the lockbox file which does not have any leading zeroes. In order to allow this match to happen a user exit was developed to remove any leading zeros from the Reference field in the invoices It works fine for regular invoices but not for the invoice lists u2013 invoice numbers in the 76xxxxxx range. The leading zeros are not removed there, so these invoices fall out of the auto posting process. It has been expressed that we need to improve our automated check posting hit rate for better efficiencies, and to do so we need to have these invoice list invoices fixed in the same way as the regular invoices are.
please advise
Vishalcan anybody please answer it?
-
Unable to takeout spaces for type STPO-MENGE
Hi to all,
i struck up with one problem, v_amount is populating value with spaces.
i am unable to get v_quantity value with out spaces.
i tried with SHIFT LEADING and Replace statements but it throws error message.
can any body help me regarding this
data : v_quantity type stpo-menge value ' 12345'.Hi ,
Try like below
data : v_quantity type stpo-menge value ' 123.45'.
data : v_qua(20).
write: v_quantity to v_qua left-justified.
write v_qua.
Regards,
Himanshu
Maybe you are looking for
-
What's the difference between using and 802.11a and 5GHz only?
What's the difference between using "802.11n (802.11a compatible)" and "802.11n only (5GHz)" modes on the Airport Extreme?
-
Hi, I have requirement like below Check issued for vendor for down payment Check was cashed on 01.01.2008 Check was voided on 15.05.2008 So how to reverse that and it should be normal check How to do this please help me i will assign points Thanks Ra
-
Video from ios7 photostream not seen in iPhoto 11
My husband and I both upgraded to ios 7 this week. When he shares videos taking from the camera app on his iPhone 5 onto a photostream my iPhone 4S can see it. But iPhoto 11 on my mac can only see the photos in that stream and not the video. I had th
-
Location Based Security application?
Hello everyone, I've been searching the App World for a 'Location Based' Security app, but can't seem to find what Im looking for. I like the security that is native to the Blackberry, but when I am at work or at home, I like to not to have to use th
-
Is there any mobile phone that supports *master/slave switching(bluetooth.master.switch) *simultaneous bluetooth connections