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: 

How to change ALV TOP of Page Data dynamically

Former Member
0 Kudos

Hi All,

   I need to change ALV header data. In selection screen i have given some amount and the same amount i have passed to ALV header for user Review. That amount have to adjust for ALV output. In ALV output one editable field is there. If suppose there are 10 line items in ALV output and the input amount is 10000 then I have to adjust this amount for 5 line items. If suppose in first line item editable field i enter 2000 then in ALV header data the remaining amount have to 8000 only.  Because that 2000 have to decrease for input amount. How should we do this?

Regards

Nageswar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

do the code for your calculation

1. start-of-selection

    PERFORM HEADING TABLES head USING 'HEADING'.


    FORM HEADING  TABLES   P_HEAD TYPE SLIS_T_LISTHEADER

               CHANGING    TABLENAME.

     CASE TABLENAME.

      WHEN 'HEADING'.

       data: amount type i.    " here you do your calculation

       amount = 100.            "do calculation

        P_HEAD-TYP = 'H'.

       P_HEAD-INFO = amount.   "pass the variable

       APPEND P_HEAD.


FORM TOP-OF-PAGE.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

       IT_LIST_COMMENTARY       = HEAD[]

      I_LOGO                   = 'LOGO_M'

      I_END_OF_LIST_GRID       = 'X'

*     I_ALV_FORM               =

             .

   clear head[].

ENDFORM.



1 REPLY 1

Former Member
0 Kudos

hi,

do the code for your calculation

1. start-of-selection

    PERFORM HEADING TABLES head USING 'HEADING'.


    FORM HEADING  TABLES   P_HEAD TYPE SLIS_T_LISTHEADER

               CHANGING    TABLENAME.

     CASE TABLENAME.

      WHEN 'HEADING'.

       data: amount type i.    " here you do your calculation

       amount = 100.            "do calculation

        P_HEAD-TYP = 'H'.

       P_HEAD-INFO = amount.   "pass the variable

       APPEND P_HEAD.


FORM TOP-OF-PAGE.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

       IT_LIST_COMMENTARY       = HEAD[]

      I_LOGO                   = 'LOGO_M'

      I_END_OF_LIST_GRID       = 'X'

*     I_ALV_FORM               =

             .

   clear head[].

ENDFORM.