Giter Site home page Giter Site logo

Comments (7)

fidley avatar fidley commented on August 19, 2024 1

Hi @hervianzhou ,

I'll check it on my installation and I'll come back to you.

from falv.

fidley avatar fidley commented on August 19, 2024 1

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....

image

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.

from falv.

hervianzhou avatar hervianzhou commented on August 19, 2024 1

Hi @fidley.. thanks for your time and solution...

from falv.

fidley avatar fidley commented on August 19, 2024 1

I will also add this in the next commit as automatic switch from 1 to 2 ;)

from falv.

hervianzhou avatar hervianzhou commented on August 19, 2024

i'm expecting result like this..

code using salv
image

image

from falv.

fidley avatar fidley commented on August 19, 2024

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

from falv.

hervianzhou avatar hervianzhou commented on August 19, 2024

Hi @fidley ..

i just check the fieldcat before using falv->display..
REF_TABLE and REF_FIELD is blank... both quantity and currency field...
image

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.

from falv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.