Cfieldname fieldcat not working [Question]
Closed this issue ยท 7 comments
Hi @fidley ,
currently i'm using falv for creating some report
i'm using IDR currency... but the amount still not reflected like using currency already referenced.. it should be times by 100 like JPY
please kindly assist.. is there something i missed?
it's also not working for quantity field
Hi @hervianzhou ,
I'll check it on my installation and I'll come back to you.
I have just quickly checked and seems this setting is applied. Just wondering if you have REF_TABLE and REF_FIELD fields in your field-catalog. Sometimes they mess up things
Hi @fidley ..
i just check the fieldcat before using falv->display..
REF_TABLE and REF_FIELD is blank... both quantity and currency field...
this is all the type i'm declared
kostl TYPE coep-kostl,
lstar TYPE coep-lstar,
wtgbtr TYPE coep-wtgbtr,
twaer TYPE coep-twaer,
mbgbtr TYPE coep-mbgbtr,
meinb TYPE coep-meinb.
I've played a little bit and I know how to make it work, but I don't know why it doesn't work from scratch....
I've compared the fieldcat of the demo program (which was giving me exactly the same results)
REPORT zdemo_falv24.
TYPES: BEGIN OF t_output,
price TYPE sflight-price,
currency TYPE sflight-currency,
END OF t_output.
DATA: output TYPE STANDARD TABLE OF t_output.
SELECT price, currency UP TO 10000 ROWS
INTO CORRESPONDING FIELDS OF TABLE @output
FROM sflight.
data(falv) = zcl_falv=>create(
CHANGING
ct_table = output
).
falv->column( 'PRICE' )->set_cfieldname( 'CURRENCY' ).
falv->display( ).
With demo fcat of program from ALV grid in nutshell, where it is working correctly
report zdemo_ain_cl09.
include zdemo_ain_include_screen.
initialization.
select * up to 10000 rows from sflight into table @data(flights).
data(grid) = new cl_gui_alv_grid(
i_parent = new cl_gui_custom_container( container_name = 'CC' )
).
data(fcat) = value lvc_t_fcat(
( fieldname = 'CARRID' )
( fieldname = 'CONNID' )
( fieldname = 'PRICE' cfieldname = 'CURRENCY' )
( fieldname = 'CURRENCY' )
).
grid->set_table_for_first_display(
changing
it_fieldcatalog = fcat
it_outtab = flights
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
).
if sy-subrc eq 0.
call screen 0100.
endif.
And the difference was field TECH_FORM.... in case of correct program it was set to 2, in FALV it was 1.
I have no idea where this field is set, as where used list is not working for it, but using method SET_TECH_FORM on that column with value 2, helps. Quite strange.
Hi @fidley.. thanks for your time and solution...
I will also add this in the next commit as automatic switch from 1 to 2 ;)