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

Operation on a DDIC using ALV

Former Member
0 Likes
659

hi abaper's

i have to make ALV report in which i have to display custom table data using ALV and all operation what we can do on DDIC ztable(like delete save change etc) these operation we can do only on UI screen. so please help me how to do this

points will be rewaded

thnks n regard

pardeep kumar

1 ACCEPTED SOLUTION
Read only

former_member745780
Active Participant
0 Likes
517

Hi,

plz go for this link hope it will help you......

http://www.erpgenie.com/sap/abap/controls/alvgrid.htm

cheers

Anirudh

hi abaper's

i have to make ALV report in which i have to display custom table data using ALV and all operation what we can do on DDIC ztable(like delete save change etc) these operation we can do only on UI screen. so please help me how to do this

points will be rewaded

thnks n regard

pardeep kumar

2 REPLIES 2
Read only

Former Member
0 Likes
517

Hi by adding extra button on alv output tool bar like SAVE , DELETE , MODIFY

like this

In order to add user command functioality to the ALV grid you need to perform the following steps:

1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'USER_COMMAND' FORM

2. Create 'USER_COMMAND' FORM

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

I_callback_user_command = 'USER_COMMAND' "see FORM

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

i_save = 'X'

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

----


  • FORM USER_COMMAND *

----


  • --> R_UCOMM *

  • --> RS_SELFIELD *

----


FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • Check function code

CASE r_ucomm.

WHEN '&IC1'.

  • Check field clicked on within ALVgrid report

IF rs_selfield-fieldname = 'EBELN'.

  • Read data table, using index of row user clicked on

READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.

  • Sxecute transaction ME23N, and skip initial data entry screen

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

we can define our own screen by doing like thsi

In order modify PF_STATUS of ALV grid report you need to perform the following steps:

1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:

i_callback_pf_status_set = 'SET_PF_STATUS' statement.

2. Create 'SET_PF_STATUS' FORM

3. Create pf_status (i.e. 'ZNEWSTATUS').

- It is recommend that you copy standard status'STANDARD' from function group SALV

and modify it accordingly. ALV standard function codes always start with '&'.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

i_save = 'X'

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

----


  • FORM SET_PF_STATUS *

----


FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZNEWSTATUS'.

"Copy of 'STANDARD' pf_status from fgroup SALV

ENDFORM.

double clik on the bold one and design what ever screen u want

Read only

former_member745780
Active Participant
0 Likes
518

Hi,

plz go for this link hope it will help you......

http://www.erpgenie.com/sap/abap/controls/alvgrid.htm

cheers

Anirudh