Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in alv secondary list

sandeep_gvv2
Participant
0 Kudos

I am working with alv secondary list when i enter amount and click on save it should save in table as .00 at the end.like for example if i enter amount as 100 it should save as 100.00? How can i acheive it??

15 REPLIES 15

Chintu6august
Contributor
0 Kudos

hi,

use refer that input field to data element NETWR.

thanks!!

sandeep_gvv2
Participant
0 Kudos

when i use NETWR data element it is throwing a bug like

0 Kudos

Hi Sandeep,

Pass domain and reference table information for NETWR field in fieldcatalog.

Regards,

Praveer.

0 Kudos

Hi,

populate yhe fieldcatalog table.

  wa_fieldcat_alv-fieldname = 'NETWR'.

  wa_fieldcat_alv-tabname   = 'IT_ITEM'.

  wa_fieldcat_alv-outputlen  = 20.

  wa_fieldcat_alv-seltext_l  = 'Net Price in Doc Curr'.

  APPEND wa_fieldcat_alv TO it_fieldcat_alv.

  CLEAR wa_fieldcat_alv.

thanks!!

0 Kudos

i have done the same now another bug is coming like

0 Kudos

Hi Sandeep,

You have to pass reference table information when you are trying to enter any quantity or amount related field in ALV.

Regards,

Praveer.

sandeep_gvv2
Participant
0 Kudos

i have passed it but by keeping data type as netwr i am facing above bugs

0 Kudos

Hi Sandeep,

Pass the NETWR field catalog information as below and try.

ls_fcat--fieldname = 'NETWR'

ls_fcat-ref_field = 'NETWR'. 

ls_fcat-ref_table = 'VBAP'. 

ls_fcat-currency  = 'EUR'. 

ls_fcat-edit      = 'X'. 

Regards,

Praveer.

0 Kudos

No you are not passing them: from the screenshot you are declaring those fields as currency.

Declare as NETWR and fill fields

  • currency(5)    type cif fix

or fields

  • cfieldname     type slis_fieldname, " field with currency unit
  •   ctabname       type slis_tabname,   " and table
    if you got in your table the currency

0 Kudos

Hi.

I think something is wrong in your Field-Catalog. Every Amount-field needs a reference-field with a currency-Type. It looks like your 'check Amount'-Filed is defines as a currency field but is holding a value.

It is much easier, if you define a structure in the dictionary and then using the Structure for the ALV, instead of building the field-catalog manually.

Peer.

0 Kudos

Here i have declared netwr as data element for that i have provided ref field as waerk and ref table as vbak in custom table.in my report i have declared field catalogue as above is it right??

  wa_fieldcat-fieldname = 'INVAMT'.

  wa_fieldcat-seltext_l = text-006.

  wa_fieldcat-col_pos     = 6.

  wa_fieldcat-ref_fieldname = 'WAERK'.

  wa_fieldcat-ref_tabname = 'VBAK'.

  wa_fieldcat-outputlen = 20.

  APPEND wa_fieldcat TO it_fieldcat.

  CLEAR wa_fieldcat.

0 Kudos

Declare your currency field name based upon a field in your field catalogue.

0 Kudos

i didn't get you what you are saying

0 Kudos

Hi.

The Currency-Field should be a field in your alv-table  not in an other table (e.g. VBAK), then it should work.

Regards,

Peer

raymond_giuseppi
Active Contributor
0 Kudos

Either every amount column of your internal table is associated to a single currency or it depends on item, in first case put the currency code "value" in CURRENCY field of field catalog, in second case add a currency field to your internal table fill it and pass its "name" to field CFIELDNAME of field catalog.

Regards,

Raymond