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

Former Member
0 Likes
551

Hi Group,

Here i am sending a doubt on ALV. Any kind of help will be appreciated.

I am trying an ALV in which when i will click on a particular record, then it should take me to a transaction.

e g i am having an ALV in which i am displaying sales order no, customer no etc . When i ll click on some sales order no it should go to VA03 transaction and similarly on clicking customer it should go to XD03 . Same we are doing for interactive reporting with CALL TRANSACTION ' ' statement by defining SET PARAMETER ID ' ' ......

and How to know the field name i have clicked on??

If possible send me some codes.

Thanks.

Hi Group,

Here i am sending a doubt on ALV. Any kind of help will be appreciated.

I am trying an ALV in which when i will click on a particular record, then it should take me to a transaction.

e g i am having an ALV in which i am displaying sales order no, customer no etc . When i ll click on some sales order no it should go to VA03 transaction and similarly on clicking customer it should go to XD03 . Same we are doing for interactive reporting with CALL TRANSACTION ' ' statement by defining SET PARAMETER ID ' ' ......

and How to know the field name i have clicked on??

If possible send me some codes.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
514

Hi, samir sap abap.

You could use parameter <b>'ps_selfield'</b>.

refer this code^^

FORM user-command USING p_ucomm LIKE sy-ucomm

ps_selfield TYPE slis_selfield.

CASE p_ucomm.

WHEN '&IC1'. "double click

CLEAR : sy-ucomm.

IF ps_selfield-tabindex = 0.

MESSAGE e005.

ENDIF.

CLEAR: itab.

IF <b>ps_selfield-fieldname </b> = 'BELNR'

OR <b>ps_selfield-fieldname</b> = 'STBLG'.

CHECK NOT ps_selfield-value IS INITIAL.

SET PARAMETER ID 'BLN' FIELD ps_selfield-value.

SET PARAMETER ID 'BUK' FIELD 'FS00'.

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.

ENDIF.

ENDFORM. " USER-COMMAND

I wish I could help you.

Best regards

Kyung Woo, Nam

Read only

Former Member
0 Likes
514

Hi..,,

u need to double click.. not a single click..

<b>

In the function module REUSE_ALV_LIST_DISPLAY or REUSE_ALV_GRID_DISPLAY

give the Form name <NAME> to the parameter I_CALLBACK_USERCOMMAND = <NAME>,

and SY-REPID to the parameter I_CALLBACK_PROGRAM.</b>

Now in your program write a form

form <NAME> USING lw_ucomm LIKE sy-ucomm fs_selfield TYPE slis_selfield.

<i>(*** here the field string fs_selfield contains all the details about the Selected record in the list ***)</i>

<b>Observe the structure of slis_selfield in ABAP dictionary.. It gives the details like sy-tabix, field name , field value etc...</b>

<i>Now in this form u can do whatever u want with those values..... </i>

case lw_ucomm.

when .......

endcase.

endform.

reward points if it helps u...

sai ramesh

Read only

Former Member
0 Likes
514

In FM 'REUSE_ALV_GRID_DISPLAY',

u have an option for this,

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

where USER_COMMAND is your form name.

Use this & in this form write ur coding for double-click.

eg:

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN 'KUNNR'.

READ TABLE HEADER INDEX RS_SELFIELD-TABINDEX.

IF SY-SUBRC EQ 0.

SET PARAMETER ID 'KUN' FIELD HEADER-KUNNR.

CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.

endif.

endcase.

ENDFORM

Read only

Former Member
0 Likes
514

Check the following code:

FORM create_fin_tr USING

u_wa_output_result TYPE fti_int_instr_output_fields .

DATA: bdcdata_wa TYPE bdcdata,

bdcdata_tab TYPE TABLE OF bdcdata.

*DATA opt TYPE ctu_params.

    • Using call transaction

CLEAR bdcdata_wa.

bdcdata_wa-program = 'FTR_ENTRY'.

bdcdata_wa-dynpro = '2000'.

bdcdata_wa-dynbegin = 'X'.

APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.

bdcdata_wa-fnam = 'FTR_ENTRY-BUKRS'.

bdcdata_wa-fval = u_wa_output_result-bukrs.

APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.

bdcdata_wa-fnam = 'FTR_ENTRY-SGSART'.

bdcdata_wa-fval = u_wa_output_result-gsart.

APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.

bdcdata_wa-fnam = 'FTR_ENTRY-RANL'.

bdcdata_wa-fval = u_wa_output_result-security_id.

APPEND bdcdata_wa TO bdcdata_tab.

CALL TRANSACTION 'FTR_CREATE' USING bdcdata_tab.

ENDFORM. " create_fin_tr