2014 May 28 6:56 AM
Hi All,
I am trying to print AUFNR field value in a smartform. My requirement is to have preceeding zeros to be printed. Currently it prints like 1234, but i want it to be printed like 0000001234. I have used the formatting option (F0), but it is not working. Any other suggestions would be helpful.
Thanks,
Ravi
2014 May 28 7:04 AM
Hi Ravi,
R u sure that the field that you used to print process order is AUFNR itself. Put a break point before printing this field in a program line and check whether the field is containing value with preceding zeros. If not use the FM CONVERSION_EXIT_ALPHA_OUTPUT to get the field with the order no. with preceding zeros.
Regards,
Abijith
Hi Ravi,
R u sure that the field that you used to print process order is AUFNR itself. Put a break point before printing this field in a program line and check whether the field is containing value with preceding zeros. If not use the FM CONVERSION_EXIT_ALPHA_OUTPUT to get the field with the order no. with preceding zeros.
Regards,
Abijith
2014 May 28 7:00 AM
Hi Ravi,
In Smartform when displaying variable:
Use &var(Z)& " Z for supressing leading zeros
Hope this helps.
Regards,
Naveen
2014 May 28 7:02 AM
Hi Nvaeen,
Did you read my question? I want to have leading zeroes, not supressing.
Thanks,
Ravi
2014 May 28 7:07 AM
Hi Ravi,
Sorry i misunderstood.
You can you can use unpack statement in driver program like
unpack <var> to <var>.
Try it.
Regards,
Naveen
2014 May 28 7:02 AM
Hi Ravi
Add a abap process in your smartform loop, call this FM 'CONVERSION_EXIT_ALPHA_INPUT'.
regards,
Archer
2014 May 28 7:03 AM
2014 May 28 7:05 AM
2014 May 28 7:04 AM
Hi Ravi,
R u sure that the field that you used to print process order is AUFNR itself. Put a break point before printing this field in a program line and check whether the field is containing value with preceding zeros. If not use the FM CONVERSION_EXIT_ALPHA_OUTPUT to get the field with the order no. with preceding zeros.
Regards,
Abijith
2014 May 28 7:05 AM
Hi Abhijith,
Yes, the field is of type AUFNR. I have used conversion exits, but it is not working.
Thanks,
Ravi Varma
2014 May 28 7:09 AM
Use &aufnr(K)&, (*) that will deactivate the conversion-exit ALPHA attached to AUFNR, this ALPHA conversion-exit will remove leading zeroes as soon as the field contains only numeric characters (**).
NB: Of course, that supposes that the field value is already correct and contains the leading zero, if, by accident, misfortune or mistake, the leading zero were previously removed, you should first regenerate correct value by reversing the conversion-exit with FM CONVERSION_EXIT_ALPHA_INPUT.
Regards,
Raymond
(*) Can be found in help.sap.com at Output Options for Field Contents.
2014 May 28 7:11 AM
Hi Abhijith,
Use FM 'CONVERSION_EXIT_ALPHA_OUTPUT' for removing Leading Zero's in ABAP Code.
Thanks&Regards
Mahesh R
2016 Feb 04 8:48 AM
Nice Raymond!
An easy workaround could also be:
creating a global field type C
data: G_AUFNR(10).
then create an easy program line in routine before printing:
G_AUFNR = AUFNR.
and then in text box:
&G_AUFNR&
2014 May 28 7:12 AM
Hi Ravi,
Have you checked that the field is containing values with preceding zeros. If so, then check the text field where you are printing it.
Regards,
Abijith
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |