2006 Oct 06 6:11 AM
Hi All,
I have noe table control in the second screen.
in that i am displaying the item details along with the serial number.
the serial number is the char of 18 lenth.
it should not show the leading zeros .
but it it is showing the leading zeros.
how to delete the leading zeros.
Can any one help me .
Thnaks&Regards.
Ramu.
2006 Oct 06 6:39 AM
Hi,
before passing the Internal table data to table control write your logic,
Loop at ITAB.
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = ITAB-FIELD
IMPORTING
output = ITAB-FIELD.
MODIFY ITAB index SY_TABIX.
ENDLOOP.
Regards
Sudheer
Hi,
before passing the Internal table data to table control write your logic,
Loop at ITAB.
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = ITAB-FIELD
IMPORTING
output = ITAB-FIELD.
MODIFY ITAB index SY_TABIX.
ENDLOOP.
Regards
Sudheer
2006 Oct 06 6:15 AM
if it a char field follow thsi way -
U can either use this function module also
CONVERSION_EXIT_ALPHA_OUTPUT
or
SHIFT <yourField> LEFT DELETING LEADING '0'
or
try NO-ZERO option of WRITE statement
or
Another way is to create another variable of type I and assign the value into it
example:
DATA: L_NUMC(08) TYPE N.
DATA: L_INT TYPE I.
L_NUMC = '00000018'.
L_INT = L_NUMC.
Result will be = 18.
-
<b>if not change the data type to number and then it will not show the leading zeros.</b>
Hope this helps
Regards
- Gopi
2006 Oct 06 6:16 AM
Hi,
u can use the function module for removing leading zeros
CONVERSION_EXIT_ALPHA_INPUT (adding zeros)
CONVERSION_EXIT_ALPHA_OUTPUT (removing zeros)
Regards
Sudheer
2006 Oct 06 6:16 AM
Hi Ramu,
You can suppress Zero's using String operation command SHIFT. If it comes even after that declare the same table again with serial number doesnot refer to the data element or the transparent table but should be CHAR18. Then suppress all zero's and update the new table and use this table to display the contents in table control.
Regards,
Sathish
Note : Reward useful answers
2006 Oct 06 6:32 AM
Hi,
Field SERNR is a character domain GERNR 18 characters so should not show leading zeros
I am getting the serial number into internaltable t_item along with some more information.
thie internal table linked to table control.
when i am going to display in tablecontrol before that i need to delete the zeros.
where i need to write the logic.
Thanks&Regards.
Ramu.
2006 Oct 06 6:40 AM
Hi,
Here is the sample code.You need to write before you populate the values in table control.
data s1 type sernr value '045'.
pack s1 to s1.
write s1.
2006 Oct 06 6:43 AM
Hi Ramu,
in the PBO Module of Table control
flow logic
PBO.
loop with tab ctrl.
module read_tab_ctrl.
endloop.
module read_tab_ctrl.
read table itab.
if sy-subrc = 0.
shift <itab-field> left deleting leading '0'.
....
....
endif.
endmodule.
<b>IF YOU CAN NOT UNDERSTAND PASTE UR PBO TABLE CONTROL MODULE HERE.</b>
Regards
- Gopi
2006 Oct 06 6:39 AM
Hi,
before passing the Internal table data to table control write your logic,
Loop at ITAB.
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = ITAB-FIELD
IMPORTING
output = ITAB-FIELD.
MODIFY ITAB index SY_TABIX.
ENDLOOP.
Regards
Sudheer
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |