Application Development and Automation 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: 
Read only

Fieldcat Options

Former Member
0 Likes
815

Hi All ;

I want to follow up monthly staff input and output clocks.When I select two dates,I want to see input output clocks

between two dates.The problem is that I can organize the fcat name but I have to list the input output clocks dynamically.

For ex. a staf name : Can Surname: SU Pers Number : 12001 . I want to input clocks between 18.05.2012 - 22.05.2012 .

(There are 3 entries between dates.)Now the ALV seems like below ;

But it has to be like below ;

The FCAT codes ;

BEGIN OF GT_DONEM OCCURS 0,

    BDATE like  ZHR_TABLO-BDATE,

    BTIME like  ZHR_TABLO-BTIME,

    CTIME like  ZHR_TABLO-CTIME,

  END OF GT_DONEM.

LOOP AT GT_DONEM.

     CHECK GT_DONEM-BDATE IS NOT INITIAL.

     CLEAR GS_FCAT.

   INTO GS_FCAT-REPTEXT.

     GS_FCAT-FIELDNAME = 'BTIME'.

     GS_FCAT-REF_FIELD = 'BTIME'.

     GS_FCAT-REF_TABLE = 'ZHR_TABLO'.

       CONCATENATE GT_DONEM-BDATE+6(2) '.'

                   GT_DONEM-BDATE+4(2) '.'

                   GT_DONEM-BDATE+0(4)

         INTO GS_FCAT-REPTEXT.

     GS_FCAT-COLTEXT = GS_FCAT-REPTEXT.

  APPEND GS_FCAT TO GT_FCAT.

ENDLOOP.


Im waiting for your answers.Thanks.


Regards.

Fırtına



Hi All ;

I want to follow up monthly staff input and output clocks.When I select two dates,I want to see input output clocks

between two dates.The problem is that I can organize the fcat name but I have to list the input output clocks dynamically.

For ex. a staf name : Can Surname: SU Pers Number : 12001 . I want to input clocks between 18.05.2012 - 22.05.2012 .

(There are 3 entries between dates.)Now the ALV seems like below ;

But it has to be like below ;

The FCAT codes ;

BEGIN OF GT_DONEM OCCURS 0,

    BDATE like  ZHR_TABLO-BDATE,

    BTIME like  ZHR_TABLO-BTIME,

    CTIME like  ZHR_TABLO-CTIME,

  END OF GT_DONEM.

LOOP AT GT_DONEM.

     CHECK GT_DONEM-BDATE IS NOT INITIAL.

     CLEAR GS_FCAT.

   INTO GS_FCAT-REPTEXT.

     GS_FCAT-FIELDNAME = 'BTIME'.

     GS_FCAT-REF_FIELD = 'BTIME'.

     GS_FCAT-REF_TABLE = 'ZHR_TABLO'.

       CONCATENATE GT_DONEM-BDATE+6(2) '.'

                   GT_DONEM-BDATE+4(2) '.'

                   GT_DONEM-BDATE+0(4)

         INTO GS_FCAT-REPTEXT.

     GS_FCAT-COLTEXT = GS_FCAT-REPTEXT.

  APPEND GS_FCAT TO GT_FCAT.

ENDLOOP.


Im waiting for your answers.Thanks.


Regards.

Fırtına



2 REPLIES 2
Read only

former_member192854
Active Participant
0 Likes
783

Hi Firtina,

I think you've a bit strange approach with using the dates as fieldcatalogue names (something which should be static), also wondering what should happen when you find an additional clock entry, should it then display 4 entries? Or what should happen when you select two persons with different clock dates, say pers 1 has 18.01, 19.01 and 20.01, since person 2 has 19.01, 20.1 and 22.1?

If that should be the case, I would recommend to use Run Time Types and usages of timestamps as fields (so the date and the time can be concatenated). But this will be quite a long answer to fully explain what I should tell you here.

But for a quick fix on your direct requirements and direct needs, you should delete two rows from the internal table you are displaying in the ALV (class, function module) and concatenate the data of one person.

Best,

Sander

Read only

Former Member
0 Likes
783

I think you should be using a dynamic internal table here.

Check this document.

Here first create your table, depending on the data in the table gt_donem.

Then populate the contents in this dynamic table, reading values from the table for each field in the dynamic table. 

Then pass it to the ALV.

Regards,

Susmitha