Skip to Content
0
Former Member
Jan 24, 2007 at 08:47 AM

Screen Fields Not getting Updated with DYNP_VALUES_UPDATE

1877 Views

Hi All,

I am using FM DYNP_VALUES_READ to read the screen field values and then modifying those values and passing the modified table to DYNP_VALUES_UPDATE. But the problem is screen fields are not populated with these values . The values I wish to populate are footer values . I am using OO ALV for this wherein I am handling an event for filter of records and accordingly I need to modify my footer. Any Suggestions??

&----


*& Form footer

&----


  • Caslculate Total items, number of hits/Miss and percent MSP

----


  • --> p1 text

  • <-- p2 text

----


FORM footer .

CLEAR : io_totitems,

io_tothit,

io_totmiss,

io_permiss.

  • IF NOT l_flag EQ 1.

  • Get total items

DESCRIBE TABLE i_outdata LINES io_totitems.

LOOP AT i_outdata INTO wa_outdata.

  • calculate number of hits

IF wa_outdata-hit_miss = 'HIT'.

io_tothit = io_tothit + 1.

ENDIF.

  • calculate number of Miss

IF wa_outdata-hit_miss = 'MISS'.

io_totmiss = io_totmiss + 1.

ENDIF.

CLEAR wa_outdata.

ENDLOOP.

  • calculate percent MSP

io_permiss = ( ( io_totitems - io_totmiss ) / io_totitems ) * 100 .

IF l_flag EQ 1.

wa_dynpread-fieldname = 'IO_TOTITEMS'.

APPEND wa_dynpread TO t_dynpread.

wa_dynpread-fieldname = 'IO_TOTHIT'.

APPEND wa_dynpread TO t_dynpread.

wa_dynpread-fieldname = 'IO_TOTMISS'.

APPEND wa_dynpread TO t_dynpread.

wa_dynpread-fieldname = 'IO_PERMISS'.

APPEND wa_dynpread TO t_dynpread.

CLEAR wa_dynpread.

d020s-prog = sy-repid.

d020s-dnum = sy-dynnr.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = d020s-prog

dynumb = d020s-dnum

translate_to_upper = 'X'

  • REQUEST = ' '

TABLES

dynpfields = t_dynpread.

MOVE io_totitems TO io_totitem.

CONDENSE io_totitem NO-GAPS.

MOVE io_tothit TO io_tothits.

CONDENSE io_tothits NO-GAPS.

MOVE io_totmiss TO io_totmis.

CONDENSE io_totmis NO-GAPS.

MOVE io_permiss TO io_permis.

CONDENSE io_permis NO-GAPS.

LOOP AT t_dynpread INTO wa_dynpread.

CASE: wa_dynpread-fieldname.

WHEN 'IO_TOTITEMS'.

wa_dynpread-fieldvalue = io_totitem .

MODIFY t_dynpread FROM wa_dynpread.

WHEN 'IO_TOTHIT'.

wa_dynpread-fieldvalue = io_tothits.

MODIFY t_dynpread FROM wa_dynpread.

WHEN 'IO_TOTMISS'.

wa_dynpread-fieldvalue = io_totmis.

MODIFY t_dynpread FROM wa_dynpread.

WHEN 'IO_PERMISS'.

wa_dynpread-fieldvalue = io_permis .

MODIFY t_dynpread FROM wa_dynpread.

ENDCASE.

CLEAR wa_dynpread.

ENDLOOP.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = d020s-prog

dynumb = d020s-dnum

TABLES

dynpfields = t_dynpread

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

*

  • Get all fotter details in a internal table

  • this is used to download footer in Excel

wa_footer-fldname = 'Total Items '.

wa_footer-value = io_totitems.

APPEND wa_footer TO i_footer.

wa_footer-fldname = 'Number of HIT'.

wa_footer-value = io_tothit.

APPEND wa_footer TO i_footer.

wa_footer-fldname = 'Number of MISS'.

wa_footer-value = io_totmiss.

APPEND wa_footer TO i_footer.

wa_footer-fldname = 'Percentage MISS '.

wa_footer-value = io_permiss.

APPEND wa_footer TO i_footer.

CLEAR wa_footer.

ENDFORM. " footer