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: 

alv report edit

ahanadasgupta_23
Explorer
0 Kudos

Hello All,

I have an issue in ALV report. My requirement is to show two field data after given input in other fields in the output page then click 'save' button and that two fields data will come automatically in this. In debugging mode that value is showing but that values not showing in the output page. Below I mention the code which I write to populate the data after click the 'save' button. Please guide me in this .

Thank You in advance.

The code is given below:

MODULE user_command_9010 INPUT.
ok_code = sy-ucomm.
CASE ok_code.

WHEN 'SAVE'.
DELETE it_tabcon WHERE checkbox NE 'X'.

LOOP AT it_tabcon INTO wa_tabcon.

if wa_tabcon-baseamt is not INITIAL.
wa_tabcon-td_baamt = wa_tabcon-baseamt.
* WRITE wa_tabcon-td_baseamt to wa_tabcon-td_baamt.
endif.

IF wa_tabcon-wt_withcd IS NOT INITIAL .
SELECT land1,
waers,
witht,
wt_withcd,
wt_valid,
qsatz
FROM t059fb
INTO TABLE @DATA(lt_t059fb)
WHERE wt_withcd EQ @wa_tabcon-wt_withcd.

ENDIF.
SORT : lt_t059fb BY wt_valid DESCENDING.
READ TABLE lt_t059fb ASSIGNING FIELD-SYMBOL(<ls_t059fb>) INDEX 1.
IF sy-subrc = 0.
wa_tabcon-td_amt = ( wa_tabcon-td_baamt * <ls_t059fb>-qsatz ) / 100.
ENDIF.
CONDENSE wa_tabcon-td_amt .
CONDENSE wa_tabcon-td_baamt.

MODIFY it_tabcon FROM wa_tabcon TRANSPORTING td_amt td_baamt.

IF it_tabcon IS NOT INITIAL.
CALL SCREEN 9010.
ENDIF.
ENDLOOP.

td_amt and td_baamt are two new fields added and there the values should show after click save button.

1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor

Hi ahanadasgupta_23

You are updating the internal table of data that is already displayed. You need to refresh it after save.So call this function to refresh data.
DATA: e_grid TYPE REF TO cl_gui_alv_grid.
"update alv grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = e_grid.
  CALL METHOD e_grid->check_changed_data.
  CALL METHOD e_grid->refresh_table_display.
Regards,Venkat
6 REPLIES 6

venkateswaran_k
Active Contributor

Hi ahanadasgupta_23

You are updating the internal table of data that is already displayed. You need to refresh it after save.So call this function to refresh data.
DATA: e_grid TYPE REF TO cl_gui_alv_grid.
"update alv grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = e_grid.
  CALL METHOD e_grid->check_changed_data.
  CALL METHOD e_grid->refresh_table_display.
Regards,Venkat

0 Kudos

Hi Sir,

After adding this lines in my code should I need to add anything more or only adding this lines my problem is resolve?

0 Kudos

I beleive you are displaying the same it_tabcon in teh screen 9010.

So add those lines in PBO of that screen.

One question. Why you are calling

IF it_tabcon IS NOT INITIAL.
CALL SCREEN 9010.
ENDIF.

inside the it_tabcon loop itself.

Will it not be outside the loop?

0 Kudos

I removed that code. And thank you for advising me the solution. It worked.

Hi ahanadasgupta_23

If the question is resolved, kindly mark the answer as accepted and close the thread.

Regards,

Venkat

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!