‎2005 Dec 02 2:52 PM
Hi Friends,
I want to suppress the sign of particular fields on my ALV Grid but i am not getting it.Below is my source code.Kindly advice..
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'ZMAT_DETAILS'
CHANGING
CT_FIELDCAT = gt_fcat[]
.
LOOP AT gt_fcat.
IF gt_fcat-fieldname = 'VARI1' OR
gt_fcat-fieldname = 'VARI2'.
gt_fcat-no_sign = 'X'.
MODIFY gt_fcat.
ENDIF.
ENDLOOP.
CREATE OBJECT doc EXPORTING extension = 3000.
CREATE OBJECT alv EXPORTING i_parent = doc.
CALL METHOD alv->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_VARIANT = gs_variant
I_SAVE = x_save
I_STRUCTURE_NAME = 'ZMAT_DETAILS'
CHANGING
IT_FIELDCATALOG = gt_fcat[]
IT_OUTTAB = int_final.
REgards,
Abdul
‎2005 Dec 02 3:04 PM
‎2005 Dec 02 2:57 PM
‎2005 Dec 02 2:59 PM
‎2005 Dec 02 3:00 PM
Can you Give the FIELDNAME.
and what is the type.
regards
vijay
‎2005 Dec 02 3:02 PM
Hi Vijay,
I am checking based on the FIELDNAME only..
LOOP AT gt_fcat.
IF gt_fcat-fieldname = 'VARI1' OR
gt_fcat-fieldname = 'VARI2'.
gt_fcat-no_sign = 'X'.
MODIFY gt_fcat.
ENDIF.
ENDLOOP.
Regards,
Abdul
‎2005 Dec 02 3:04 PM
‎2005 Dec 02 3:05 PM
‎2005 Dec 02 3:14 PM
can you give the code relevant , is it ZFIELD or STANDARD field plese let me know.;
regards
vijay
‎2005 Dec 02 3:16 PM
It is a ZFIELD belonging to the structure ZMAT_DETAILS..
Regards,
Abdul
‎2005 Dec 02 3:21 PM
please check the Domain of it, I don't think it is currency field, might be char field.
regards
vijay
‎2005 Dec 02 3:22 PM
If it is Non Numeric field then It will Not come.
then Try to assign the domain to currency related.
regards
vijay
‎2005 Dec 02 3:29 PM
‎2005 Dec 02 3:32 PM
‎2005 Dec 02 3:34 PM
<b> gt_fcat-no_sign = 'X'.</b> along with the no_sign use one of the below according to your requirement check...
this will work......
<b> gt_fcat-inttype = 'I' or
gt_fcat-inttype = 'P' or
gt_fcat-inttype = 'F'.</b>
‎2005 Dec 02 3:57 PM
Hi Abdul,
What Happened to your Program...
Is it working ....
Regards
vijay
‎2005 Dec 05 7:12 AM
Hi Rich,
Thanks a lot.
I have solved this problem through your idea...
Thanks again,
Abdul
‎2005 Dec 05 7:20 AM
Hi Abdul,
WIth out Currency fieldname it is not possible,
I mentioned that if you see my post.
regards
vijay
‎2005 Dec 05 7:37 AM
‎2005 Dec 02 3:21 PM
Hi,
If it is "CURR" type obviously you will get the signs, commas, decimal points. If you dont want them change the type to CHAR and try.
Thanks,
Suman
‎2005 Dec 02 3:27 PM
One solution would be to check if the values are less than 0, then multply by - 1.
Loop at int_final.
If int_final-vari1 < 0.
int_final-vari1 = int_final-vari1 * -1.
endif.
If int_final-vari2 < 0.
int_final-vari2 = int_final-vari1 * -2.
endif.
Modify int_final.
endloop.I know that you really want to handle this thru the catalog, I'm having trouble with it as well.
Regards,
Rich Heilman