‎2006 Feb 21 2:17 PM
Hi,
I am having problem in displaying the table contents in the ALV report. Particularly, I figured out that a pack(P) data type is not matching with the ALV catalogue.
I have defined internal table fields cr_amt and dr_amt as pack datatype.
BEGIN OF t_tab10,
slacc(9) type N,
slaccd(30),
dr_amt type p decimals 2,
cr_amt type p decimals 2,
vend(10),
vend_name(50), "Vend. name
reason(50), "reason
modified,
END OF t_tab10.
The values from database table of type( 15 DEC 2 decimals) are placed in these fields. Operation can be carried out successfully in the internal table fields. when I am trying to put the contents of these fields into ALV its produce a short dump into screen. If I clear these fields before sending it to ALV, it generates ALV output with initial values of these fields otherwise it produce shot-dump.
I used the following catalogue for these fields.
clear wa_fieldcat.
wa_FIELDCAT-fieldname = 'DR_AMT'.
wa_FIELDCAT-inttype = 'P'.
wa_FIELDCAT-outputlen = 15.
wa_FIELDCAT-decimals = 2.
wa_FIELDCAT-coltext = 'Dr. Amount'.
wa_FIELDCAT-TOOLTIP = 'Montant dépôt'.
append wa_fieldcat to pt_fieldcat.
clear wa_fieldcat.
wa_FIELDCAT-fieldname = 'CR_AMT'.
wa_FIELDCAT-inttype = 'P'.
wa_FIELDCAT-outputlen = 17. "15
wa_FIELDCAT-decimals = 2.
wa_FIELDCAT-coltext = 'Cr. Amount'.
wa_FIELDCAT-TOOLTIP = 'Montant Crédit'.
append wa_fieldcat to pt_fieldcat.
Thanks
Lokman
‎2006 Feb 21 2:19 PM
Hi,
use the function module : LVC_FIELDCATALOG_MERGE
you will see how SAP set data into fieldcatalog.
(that could be maybe the currency)
Rgd
Frédéric
‎2006 Feb 21 2:24 PM
Please adjust as the following.
clear wa_fieldcat.
wa_FIELDCAT-fieldname = 'DR_AMT'.
<b>wa_FIELDCAT-datatype = 'QUAN'.</b>
wa_FIELDCAT-outputlen = 15.
wa_FIELDCAT-decimals = 2.
wa_FIELDCAT-coltext = 'Dr. Amount'.
wa_FIELDCAT-TOOLTIP = 'Montant dépôt'.
append wa_fieldcat to pt_fieldcat.
clear wa_fieldcat.
wa_FIELDCAT-fieldname = 'CR_AMT'.
<b>wa_FIELDCAT-datatype = 'QUAN'.</b>
wa_FIELDCAT-outputlen = 17. "15
wa_FIELDCAT-decimals = 2.
wa_FIELDCAT-coltext = 'Cr. Amount'.
wa_FIELDCAT-TOOLTIP = 'Montant Crédit'.
append wa_fieldcat to pt_fieldcat.
Regards,
Rich Heilman
‎2006 Feb 21 2:33 PM
Heilman,
I tried with datatype "QUAN but it seems the same result. I don't know is there any mismatch of length?
Lokman
‎2006 Feb 21 2:35 PM
‎2006 Feb 21 2:37 PM
Hi,
try giving this also.....
<b>fieldcat-ref_fieldname = "REFFIELD'.
fieldcat-ref_tabname = 'REFTAB'.</b>
regards
vijay
‎2006 Feb 21 2:38 PM
Can you please include the name of your internal table.
clear wa_fieldcat.
wa_FIELDCAT-fieldname = 'DR_AMT'.
<b>wa_FIELDCAT-tabname = 'ITAB'.
wa_FIELDCAT-datatype = 'QUAN'.</b>
wa_FIELDCAT-outputlen = 15.
wa_FIELDCAT-decimals = 2.
wa_FIELDCAT-coltext = 'Dr. Amount'.
wa_FIELDCAT-TOOLTIP = 'Montant dépôt'.
append wa_fieldcat to pt_fieldcat.
REgards,
RIch Heilman
‎2006 Feb 21 2:40 PM
Hi ,
Try by adding reference field and table:
For your Qty field:
WA_fieldcat-ref_fieldname = Reference Field. Ex: MENGE
WA_fieldcat-ref_tabname = Reference table. Ex: EKPO
Lanka
‎2006 Feb 21 2:25 PM
Hi,
Frédéric is correct for Qty and currency you have to maintain data in the reference tables.
Lanka
Check field Catalog:
currency(5) type c,
cfieldname type slis_fieldname, " field with currency unit
ctabname type slis_tabname, " and table
ifieldname type slis_fieldname, " initial column
quantity(3) type c,
qfieldname type slis_fieldname, " field with quantity unit
qtabname type slis_tabname, " and table
Regards,
Lanka
‎2006 Feb 21 2:39 PM