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 Help

Former Member
0 Likes
646

Hi

I have a list displaying using ALV grid.I need to call Standard Transaction transaction when I select Mateial.

another requirement is needs to add button to call antoher transaction which will take material from selection screen.

Please Help me

Alekhya

5 REPLIES 5
Read only

Former Member
0 Likes
612

Check the program given in the link:

http://www.sap-img.com/abap/alv-grid.htm

In the user command get the Sy-ucomm and from selfield get the index ( selfield-tabindex )in which the user clicked and read that line from final internal table, then call the transaction using that material.

Regards,

PRakash.

Read only

Former Member
0 Likes
612

hi,

I need to call Standard Transaction transaction when I select Mateial.

form user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

set parameter id 'AUN' field rs_selfield-value.

call transaction 'VA03' and skip first screen.

endcase.

endform. "USER_COMMAND

hope this helps,

do reward if it helps,

priya.

Read only

0 Likes
612

Thanks Priya,

One more doubt, Do I need to call this perform under At line selection?

Since I am using ALV grid

Read only

0 Likes
612

USe the below FM to call the USER_COMMAND

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

i_callback_program = lws_repid

i_callback_user_command = 'USER_COMMAND'.

&----


*& Form user_command

&----


  • Handle User Command

----


FORM user_command USING ws_ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

CASE ws_ucomm.

WHEN '&IC1'.

CASE selfield-tabname.

WHEN text-091.

ENDCASE.

ENDCASE.

Regrads,

Prakash.

ENDFORM. "user_command

Read only

anversha_s
Active Contributor
0 Likes
612

hi,

u can catch the user command like this.

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.

rgds

anver

if hlped mark points