on 08-06-2007 10:50 AM
Is there a way to add zeros to the beginning of a variable?
CONCATENATE
doesn't seem to be allowed...
Thanks.
Hi,
Either
CONVERSION_EXIT_ALPHA_INPUT or
CONVERSION_EXIT_ALPHA_output will work for u .
You can call a function module in a smartform in the program lines .
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it is possible to call function module, but you have to call external sub-routines from your form...
Go through this example
Ex.
/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &<field name>&
/:CHANGING &<field name1&
/:ENDPERFORM
Then create subroutine pool program and you have to write the code.
FORM ><subroutine name> tables int_cond structure itcsy
outt_cond structure itcsy.
data : value(20), value1(20). "do your own declarations
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
Just rough idea given above.
Gonzalez, my advice is to close the thread and open a new thread I guess your question related to CONCATENATE has been answered.. you will get quick responses.. Also note reward to all useful answers.
Regards,
SaiRam
I haven't still managed to get a variable with two extra zeros that will work in the include.
The suggestion you make is exactly the solution I've got so far, but I don't like it because that way I need to create an extra report and it seems to be a bit messy.
So far, my problem is exactly the one I started with. I can't transform the variable I get into the variable I need inside the sapscript form.
Thanks for all your help.
So far, I agree that, being ORIGINAL_VAR = 87654321,
DEFINE &NEW_BAR& = '00&ORIGINAL_VAR&'.
will produce, when printed,
&NEW_VAR&
<b>0087654321</b>.
Curiously enough, &NEW_VAR& won't work in:
INCLUDE &NEW_VAR& OBJECT VBBK ID 0002 NEW-PARAGRAPH A1.
whereas
INCLUDE 0087654321 OBJECT VBBK ID 0002 NEW-PARAGRAPH A1.
does.
Anyway,
DEFINE &NEW_VAR&.
returns an error, and so does
DEFINE &NEW_BAR& = 00&ORIGINAL_VAR&.
Any hint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this, for pre-fixing zero's &SYMBOL(Ff)& f=fill character.
Ex: &variable(F0)&
Note: here leading spaces in value can be replaced with fill characters.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
/:DEFINE &NEWSYMBOL&.
NEWSYMBOL = YOUR CURRENT VALUE
DISPLAY NEWSYMBOL
&NEWSYMBOL(<b>10</b>F0)& <b>"Here you are restricting your output to 10 characters</b>
I always advice to open a new thread for new questions so other can also answers. pls close this thread if your current question is answered.
Regards,
SaiRam
Use the FM :CONVERSION_EXIT_ALPHA_INPUT
Regards
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.