on 12-15-2010 1:35 PM
Dear Guru / experts,
I have created a Structure in SE11, where MATNR is CHAR 18. Now when I am printing this field (MATNR) on smart form, it show value 000000000030000670 instead of 30000670.
I want to print 30000670. please suggest.
Thanks in Advance.
DSC
Hi,
Use condense statement in smartforms in program lines node or write your code in initialization.
Regards
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mr. Brad,
For clearing my doubts. Now it is working fine. But, only one issue is there: the Space / Gap. system is printing -
MAT. COD: <GAP of 10 Digits> 30000670 instead of MAT. Cod: 30000670
It means system still considering the space of zeros. How can we remove that space. please tell me.
DSC
Edited by: Devendra Singh Chauhan on Dec 16, 2010 8:09 AM
Space compression is done with the 'C' option. You should Google the 'SAPScript Made Easy' guide and review the formatting options in chapter 7.
Don't use the CONVERSION_EXIT_ALPHA_INPUT or SHIFT as the subsequent others suggested - those are other wrong approaches (unnecessary hacks) for form development.
Hi,
Add program lines just before you print the MATNR.
Put code as follows:
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = lv_matnr
IMPORTING
OUTPUT = lv_matnr
and now print it.
It will work.
Hope, you know how to add program lines and specify input parameters and output paramaeters.
Regards,
Antim
Edited by: Antim Parmar on Dec 17, 2010 12:54 PM
@Antim: It may 'work', but as I've already pointed-out to the other inexperienced posters here, it's not the correct approach. Why use a code hack when SAP has already provided formatting options for this? You also used the wrong conversion exit for materials...
@DSC: You should not need the space compression format option - '(Z)' by itself works fine for me but try using '(ZC)' instead
This is why moderators get grey. When I first saw this, I thought about sending it to the Test and Playground forum, but for some reason didn't.
And now it's too late.
Rob
;-((
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Dev,
You can use the Function "CONVERSION_EXIT_ALPHA_OUTPUT" to truncate the zeros and then you can use it in th smartform to print.
Regards,
Ejas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
&MATNR(Z)& or &MATNR(K)&
Edited by: Florian Kemmer on Dec 15, 2010 2:37 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.