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 automatically insert row in alv grid when pressing custom button

acetedi
Participant
0 Kudos
403

Hello expert!!

I have a requirement when I press custom button to create new data and insert new rows

this is the first screen.. when i press button create call screen 2 and the logic should get new row automatically

I have tried to create a subroutine for button 'CREATE'

  LOOP AT gs_fieldcatalog INTO gv_fcat.
gv_fcat-edit = 'X'.
MODIFY gs_fieldcatalog FROM gv_fcat.
ENDLOOP.
CLEAR: gt_drebate.
DO 100 TIMES.
APPEND wa_rebate TO gt_rebate.
ENDDO.

Any help or guide would be grateful

Thank You

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos
343

Do an ALV refresh.

acetedi
Participant
0 Kudos
343

The problem is i put the wrong screen

i should put subroutine in the screen two

FORM update_database .

CLEAR: gt_drebate.
DO 25 TIMES.
APPEND wa_drebate TO gt_drebate.
ENDDO.

ENDFORM.

Sandra_Rossi
Active Contributor
0 Kudos
343

I guess you are experiencing the issue of instantiating several GUI controls (i.e. several ALV grids in your case) in the same container: only the first one is shown, so you think that it doesn't work.

See abap - ALV refresh problem while navigating from user command - Stack Overflow.

acetedi
Participant
0 Kudos
343

Thank You so much Sandra Rossi...

yeah the problem is put the subroutine on the wrong screen

Sandra_Rossi
Active Contributor
0 Kudos
343

Okay. Next time, debug your program before posting the question 😉