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

ALV List

Former Member
0 Likes
1,945

hi frnd's,

Selection-screen had one submit button,when i click that an

Alv list is displayed.

When i click the back button in alvlist it comes back to the selection-screen,then when i change some datas and agin click the submit button means the prevoius dats in the list is also displayed.

what can i do for that.

can anybody help me.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,914

Hi Suganya,

Thanks for your esteemed reply...

I tried and made the neccessaryu changes...

Just clear gt_fieldcat[] in FORM BUILDPROJECT as follows...

<b>
FORM BUILDPROJECT.
* DATA FIELD CATALOG
* Explain Field Description to ALV
DATA: FIELDCAT_LN TYPE SLIS_FIELDCAT_ALV.
CLEAR GT_FIELDCAT[].</b>

It works now.

Regards,

Wenceslaus.

hi frnd's,

Selection-screen had one submit button,when i click that an

Alv list is displayed.

When i click the back button in alvlist it comes back to the selection-screen,then when i change some datas and agin click the submit button means the prevoius dats in the list is also displayed.

what can i do for that.

can anybody help me.

18 REPLIES 18
Read only

Former Member
0 Likes
1,914

Hi,

Did you clear the internal table?

Did you use APPENDING... table anywhere.

Read only

0 Likes
1,914

yes i am using the internal table and also the append query

Read only

0 Likes
1,914

Then clear the table each time in AT START OF SELECTION.

REFRESH itab.

Read only

0 Likes
1,914

Hi Suganya,

Refresh your Itab first..

in select statement are you using

select * into table or Appending table..

in either case use

REFRESH itab.

before..

regards

satesh

Read only

0 Likes
1,914

Now i am not getting the previous datas but,the table is displayed twice with new datas.

Read only

0 Likes
1,914

Hi Suganya,

Then try to clear all your fieldcatalogs...

Before building it...

Or can you display your code...

Read only

0 Likes
1,914

Hi Suganya,

Are you using Block_List_Append..or

if the table has duplicate entries..

just use

sort itab.

delete adjacent duplicates ..

before calling ALV

regards

satesh

Read only

0 Likes
1,914

The table structure is displayed twice and both sum is added and displayed.if it is 2 means it adds with other and diplaying the total 4.

Read only

0 Likes
1,914

y the alv is displayed twice when the submit button is pressed pls explain.

can this be changed.

Read only

0 Likes
1,914

I'm sure it can be changed!

But we can't make predictions unless your code is posted or sent...

Read only

0 Likes
1,914

*selection screen elements

SELECTION-SCREEN BEGIN OF SCREEN 100.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p1 RADIOBUTTON GROUP rad1 USER-COMMAND BB.

SELECTION-SCREEN:COMMENT 5(10) text-001 FOR FIELD p1.

PARAMETERS P2 like USR02-BNAME.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p3 RADIOBUTTON GROUP rad1.

SELECTION-SCREEN:COMMENT 5(10) text-002 FOR FIELD p3.

PARAMETERS P4 like zttime-zclient.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN PUSHBUTTON /20(18) report1 USER-COMMAND DISP_DATA.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN 'DISP_DATA'.

IF P1 EQ 'X'.

PERFORM BUILDPROJECT.

PERFORM DISP_USER.

SORT ITAB1.

PERFORM CALL_ALV.

ELSE P3 EQ 'X'.

PERFORM BUILDPROJECT.

PERFORM DISP_CLIENT.

SORT ITAB1.

PERFORM CALL_ALV.

ENDIF.

&----


*& Form BUILDPROJECT

&----


  • text

----


FORM BUILDPROJECT.

  • DATA FIELD CATALOG

  • Explain Field Description to ALV

DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.

FIELDCAT_LN-FIELDNAME = 'BNAME'. "username

FIELDCAT_LN-TABNAME = 'ITAB1'.

FIELDCAT_LN-REF_TABNAME = 'USR02'. "<- REF TABLE IN THE DICTIONNARY

APPEND FIELDCAT_LN TO GT_FIELDCAT.

CLEAR FIELDCAT_IN.

FIELDCAT_LN-FIELDNAME = 'ZPROJECT'.

FIELDCAT_LN-TABNAME = 'ITAB1'.

FIELDCAT_LN-REF_TABNAME = 'ZTTIME'. "<- REF TABLE IN THE DICTIONNARY

APPEND FIELDCAT_LN TO GT_FIELDCAT.

CLEAR FIELDCAT_IN.

ENDFORM.

FORM CALL_ALV.

  • ABAP List Viewer

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

I_STRUCTURE_NAME = 'ITAB1'

IS_LAYOUT = GS_LAYOUT

IT_FIELDCAT = GT_FIELDCAT[]

IT_SORT = GT_SORT[]

IT_EVENTS = GT_EVENTS[]

IS_PRINT = GS_PRINT

TABLES

T_OUTTAB = ITAB1

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

ENDFORM. "CALL_ALV

FORM DISP_USER.

REFRESH ITAB1.

SELECT DISTINCT * FROM ZTTIME WHERE UNAME = P2.

MOVE FIELD1 TO ITAB1-FIELD1.

MOVE FIELD2 TO ITAB1-FIELD2.

APPEND ITAB1.

ENDSELECT.

ENDFORM. "DISP_PROJECT

Read only

roland_spindler
Participant
0 Likes
1,914

Hi,

Try to free the container before you leave the screen.

g_container->free( ).

I hope this helps.

Roland

Read only

Former Member
0 Likes
1,914

hi suganya,

1. thats not bcos of alv problem.

2. its bcos your ITAB

may have not been cleared like this :

refresh itab.

regards,

amit m.

Read only

Former Member
0 Likes
1,914

Hi Suganya,

just refresh the itab...

REFRESH itab.

before using the select statement..

regards

satesh

Read only

Former Member
0 Likes
1,914

Hi ,

Clear and refresh the itab in the initilisation event.

Hope this solves it.

Thanks and Regards,

Sriranjani Chimakurthy.

Read only

Former Member
0 Likes
1,914

Hi,

you can refresh the ALV list by calling

REFRESH_TABLE_DISPLAY method of CL_GUI_ALV_GRID.

call this method in PBO.

syntax

DATA : WA_LVC_S_STBL TYPE LVC_S_STBL.

CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY

EXPORTING

IS_STABLE = WA_LVC_S_STBL

Hope this helps..

Regards,

Shashank

Read only

Former Member
0 Likes
1,915

Hi Suganya,

Thanks for your esteemed reply...

I tried and made the neccessaryu changes...

Just clear gt_fieldcat[] in FORM BUILDPROJECT as follows...

<b>
FORM BUILDPROJECT.
* DATA FIELD CATALOG
* Explain Field Description to ALV
DATA: FIELDCAT_LN TYPE SLIS_FIELDCAT_ALV.
CLEAR GT_FIELDCAT[].</b>

It works now.

Regards,

Wenceslaus.

Read only

0 Likes
1,914

Thanks Wenceslaus.,

for ur help.