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

it is not triggering

Former Member
0 Likes
928

Hi

&----


*& Report ZKALV_NEW_MENU *

*& *

&----


*& *

*& *

&----


REPORT ZKALV_NEW_MENU1 .

type-pools: slis.

TABLES: ZKTAB1.

data: repid type sy-repid.

data: itab like zktab1 occurs 0.

start-of-selection.

select * from zktab1 into table itab.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = repid

  • I_CALLBACK_PF_STATUS_SET = ' '

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = 'zktab1'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

  • IT_FIELDCAT =

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = itab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

form USER_COMMAND using ucomm like sy-ucomm selfield type slis_selfield.

CASE UCOMM.

WHEN '&IC1'.

IF SELFIELD-VALUE = 'ABC'.

WRITE:/ 'HI'.

ENDIF.

ENDCASE.

*break-point.

write:/ 'hi'.

endform.

form user_command is not trigggering y

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
899

hi,

i tried by pasting the same code given by you.

USER_COMMAND is getting triggered.

but observed that:-

1. Donot use write:/---you won't be able to see the statement.

try with

data: g_flag.

call function 'POPUP_TO_CONFIRM_STEP'

EXPORTING

defaultoption = 'Y'

textline1 = 'Selected item(s) to be deleted.'

textline2 = 'Do you wish to continue?'

titel = 'Delete'

start_column = 25

start_row = 6

cancel_display = ''

IMPORTING

answer = g_flag.

you will get popup.

2. while calling 'REUSE_ALV_GRID_DISPLAY'

you have used I_STRUCTURE_NAME = 'zktab1'

make ZTAB1 in uppercase.

8 REPLIES 8
Read only

Former Member
0 Likes
899

You should populate the field catalog internal table also.

search in se38 for search string BALV for sample alv programs.

Or do a where used list on the fm: 'REUSE_ALV_GRID_DISPLAY'

refer this example:

Regards,

Ravi

Read only

Former Member
0 Likes
899

assign repid = sy-repid.

that part was missing in ur code.

Reward if helpful...

Regards,

Sankar.

Read only

Former Member
0 Likes
899
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.

refer the above code.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm

Read only

Former Member
0 Likes
899

when u declared sy-repid

data: repid type sy-repid.

say

data: repid type sy-repid value sy-repid.

instead.(if this doesnt work).

repid = sy-repid.

santhosh

Read only

0 Likes
899

REPORT ZKALV_NEW_MENU1 .

type-pools: slis.

TABLES: ZKTAB1.

data: repid like sy-repid.

data: itab like zktab1 occurs 0.

data : t_fieldcat type slis_t_fieldcat_alv,

w_fieldcat type slis_fieldcat_alv.

start-of-selection.

select * from zktab1 into table itab.

w_fieldcat-col_pos = '1'.

w_fieldcat-fieldname = 'ROLLNO'.

w_fieldcat-tabname = 'ZKTAB1'.

w_fieldcat-emphasize = '&C1'.

w_fieldcat-seltext_l = 'material no'.

append w_fieldcat to t_fieldcat.

clear w_fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZKALV_NEW_MENU1'

  • I_CALLBACK_PF_STATUS_SET = ' '

I_CALLBACK_USER_COMMAND = 'USER'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = 'ZKTAB1'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = t_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = itab[]

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

form USER using ucomm like sy-ucomm selfield type slis_selfield.

CASE UCOMM.

WHEN '&IC1'.

IF SELFIELD-VALUE = 'ABC'.

ENDIF.

ENDCASE.

*break-point.

endform.

still it is not triggering

Read only

0 Likes
899

Try to give some selfieldname in teh CASE and see if it working.

U have to write some opertaion otherwise u cant understand what is happending after u choose the ABC.

Put a breakpoint and see the selfield value is picking up correcly or not?

Read only

0 Likes
899

try this,

REPORT ZKALV_NEW_MENU1 .

type-pools: slis.

TABLES: vbak.

data: repid like sy-repid.

data: itab like vbak occurs 0.

data : t_fieldcat type slis_t_fieldcat_alv,

w_fieldcat type slis_fieldcat_alv.

start-of-selection.

select * from vbak up to 10 rows into table itab.

w_fieldcat-col_pos = '1'.

w_fieldcat-fieldname = 'VBELN'.

w_fieldcat-tabname = 'VBAK'.

w_fieldcat-emphasize = '&C1'.

w_fieldcat-seltext_l = 'material no'.

append w_fieldcat to t_fieldcat.

clear w_fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZSK_TEXT'

  • I_CALLBACK_PF_STATUS_SET = ' '

I_CALLBACK_USER_COMMAND = 'USER'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = 'VBAK'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = t_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = itab[]

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

form USER using ucomm like sy-ucomm selfield type slis_selfield.

CASE UCOMM.

WHEN '&IC1'.

IF SELFIELD-VALUE = 'ABC'.

ENDIF.

ENDCASE.

*break-point.

endform.

i have set a break-point at CASE UCOMM. in user subroutine

and it works!

santhosh

Read only

Former Member
0 Likes
900

hi,

i tried by pasting the same code given by you.

USER_COMMAND is getting triggered.

but observed that:-

1. Donot use write:/---you won't be able to see the statement.

try with

data: g_flag.

call function 'POPUP_TO_CONFIRM_STEP'

EXPORTING

defaultoption = 'Y'

textline1 = 'Selected item(s) to be deleted.'

textline2 = 'Do you wish to continue?'

titel = 'Delete'

start_column = 25

start_row = 6

cancel_display = ''

IMPORTING

answer = g_flag.

you will get popup.

2. while calling 'REUSE_ALV_GRID_DISPLAY'

you have used I_STRUCTURE_NAME = 'zktab1'

make ZTAB1 in uppercase.