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

problem with alv report

Former Member
0 Likes
1,436

For the below alv report after sel screen it is displaying callback event user_command does not exist what is wrong with the below please suggest me.

REPORT ZALV.

TABLES:LFA1,EKKO,EKPO.

select-options:s_lifnr for lfa1-lifnr.

DATA:Begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-lifnr,

end of itab.

Data:begin of jtab occurs 0,

ebeln like ekko-ebeln,

aedat like ekko-aedat,

end of jtab.

Data:begin of ktab occurs 0,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

end of ktab.

type-pools:slis.

data:repid like sy-repid,

  • user_command like sy-ucomm,

  • user_command like slis_ev_user_command,

f_lfa11 type slis_t_fieldcat_alv,

f_lfa1 type slis_fieldcat_alv,

f_ekko1 type slis_t_fieldcat_alv,

f_ekko type slis_fieldcat_alv,

f_ekpo1 type slis_t_fieldcat_alv,

f_ekpo type slis_fieldcat_alv,

i_events type slis_t_event,

s_events type slis_alv_event.

REPID = SY-REPID.

PERFORM COL_HEAD.

START-OF-SELECTION.

select lifnr name1 from lfa1 into table itab where lifnr in s_lifnr.

set user-command 'user_command'.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_lfa11

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • 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 COL_HEAD.

f_lfa1-fieldname = 'lifnr'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'lifnr'.

append f_lfa1 to f_lfa11.

f_lfa1-fieldname = 'name1'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'name1'.

append f_lfa1 to f_lfa11.

f_ekko-fieldname = 'ebeln'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'ebeln'.

append f_ekko to f_ekko1.

f_ekko-fieldname = 'aedat'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'aedat'.

append f_ekko to f_ekko1.

f_ekpo-fieldname = 'ebelp'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'ebelp'.

append f_ekpo to f_ekpo1.

f_ekpo-fieldname = 'matnr'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'matnr'.

append f_ekpo to f_ekpo1.

s_events-name = 'user_command'.

s_events-form = 'val'.

append s_events to i_events.

endform.

form val using user_command like sy-ucomm

sel type slis_selfield.

DATA:v_lifnr(10) type N,

v_ebeln(10) type N,

v_matnr(10) type C.

if sel-fieldname = 'lifnr'.

v_lifnr = sel-value.

select ebeln aedat from ekko into table jtab where lifnr = v_lifnr.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_ekko1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = jtab.

  • 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.

endif.

if sel-fieldname = 'ebeln'.

v_ebeln = sel-value.

select ebelp matnr from ekpo into table ktab where ebeln = v_ebeln.

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'item details'

  • I_SELECTION = 'X'

  • I_ALLOW_NO_SELECTION =

  • I_ZEBRA = ' '

I_SCREEN_START_COLUMN = 10

I_SCREEN_START_LINE = 10

I_SCREEN_END_COLUMN = 27

I_SCREEN_END_LINE = 16

  • I_CHECKBOX_FIELDNAME =

  • I_LINEMARK_FIELDNAME =

  • I_SCROLL_TO_SEL_LINE = 'X'

I_TABNAME = 'ekpo'

  • I_STRUCTURE_NAME =

IT_FIELDCAT = f_ekpo1

  • IT_EXCLUDING =

  • I_CALLBACK_PROGRAM =

  • I_CALLBACK_USER_COMMAND =

  • IS_PRIVATE =

IMPORTING

ES_SELFIELD = sel

  • E_EXIT =

TABLES

T_OUTTAB = ktab.

  • 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.

endif.

if sel-fieldname = 'matnr'.

v_matnr = sel-value.

set parameter id 'mat' field v_matnr.

call transaction 'mm02' and skip first screen.

endif.

For the below alv report after sel screen it is displaying callback event user_command does not exist what is wrong with the below please suggest me.

REPORT ZALV.

TABLES:LFA1,EKKO,EKPO.

select-options:s_lifnr for lfa1-lifnr.

DATA:Begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-lifnr,

end of itab.

Data:begin of jtab occurs 0,

ebeln like ekko-ebeln,

aedat like ekko-aedat,

end of jtab.

Data:begin of ktab occurs 0,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

end of ktab.

type-pools:slis.

data:repid like sy-repid,

  • user_command like sy-ucomm,

  • user_command like slis_ev_user_command,

f_lfa11 type slis_t_fieldcat_alv,

f_lfa1 type slis_fieldcat_alv,

f_ekko1 type slis_t_fieldcat_alv,

f_ekko type slis_fieldcat_alv,

f_ekpo1 type slis_t_fieldcat_alv,

f_ekpo type slis_fieldcat_alv,

i_events type slis_t_event,

s_events type slis_alv_event.

REPID = SY-REPID.

PERFORM COL_HEAD.

START-OF-SELECTION.

select lifnr name1 from lfa1 into table itab where lifnr in s_lifnr.

set user-command 'user_command'.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_lfa11

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • 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 COL_HEAD.

f_lfa1-fieldname = 'lifnr'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'lifnr'.

append f_lfa1 to f_lfa11.

f_lfa1-fieldname = 'name1'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'name1'.

append f_lfa1 to f_lfa11.

f_ekko-fieldname = 'ebeln'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'ebeln'.

append f_ekko to f_ekko1.

f_ekko-fieldname = 'aedat'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'aedat'.

append f_ekko to f_ekko1.

f_ekpo-fieldname = 'ebelp'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'ebelp'.

append f_ekpo to f_ekpo1.

f_ekpo-fieldname = 'matnr'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'matnr'.

append f_ekpo to f_ekpo1.

s_events-name = 'user_command'.

s_events-form = 'val'.

append s_events to i_events.

endform.

form val using user_command like sy-ucomm

sel type slis_selfield.

DATA:v_lifnr(10) type N,

v_ebeln(10) type N,

v_matnr(10) type C.

if sel-fieldname = 'lifnr'.

v_lifnr = sel-value.

select ebeln aedat from ekko into table jtab where lifnr = v_lifnr.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_ekko1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = jtab.

  • 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.

endif.

if sel-fieldname = 'ebeln'.

v_ebeln = sel-value.

select ebelp matnr from ekpo into table ktab where ebeln = v_ebeln.

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'item details'

  • I_SELECTION = 'X'

  • I_ALLOW_NO_SELECTION =

  • I_ZEBRA = ' '

I_SCREEN_START_COLUMN = 10

I_SCREEN_START_LINE = 10

I_SCREEN_END_COLUMN = 27

I_SCREEN_END_LINE = 16

  • I_CHECKBOX_FIELDNAME =

  • I_LINEMARK_FIELDNAME =

  • I_SCROLL_TO_SEL_LINE = 'X'

I_TABNAME = 'ekpo'

  • I_STRUCTURE_NAME =

IT_FIELDCAT = f_ekpo1

  • IT_EXCLUDING =

  • I_CALLBACK_PROGRAM =

  • I_CALLBACK_USER_COMMAND =

  • IS_PRIVATE =

IMPORTING

ES_SELFIELD = sel

  • E_EXIT =

TABLES

T_OUTTAB = ktab.

  • 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.

endif.

if sel-fieldname = 'matnr'.

v_matnr = sel-value.

set parameter id 'mat' field v_matnr.

call transaction 'mm02' and skip first screen.

endif.

13 REPLIES 13
Read only

gopi_narendra
Active Contributor
0 Likes
1,413

Comment the IT_EVENTS = i_events in ur FM.

Since that you are not handling any events this is not necessary

Regards

Gopi

Read only

Former Member
0 Likes
1,413

Hi,

You are getting this error because of statment

" <b>SET USER-COMMAND 'user_command'.</b> " Remove this statement.

You can use command SET USER-COMMAND with list output only.

Regards,

RS

Read only

Former Member
0 Likes
1,413

HI

I_CALLBACK_USER_COMMAND = 'user_command' --> make it in full caps (USER_COMMAND) and in your form user_command

if helpful, reward

Sathish. R

Read only

0 Likes
1,413

still iam not getting same problem

Read only

0 Likes
1,413

problem is after execution of sel screen it is displaying 'callback event user_command does not exist'.

regards

Read only

dev_parbutteea
Active Contributor
0 Likes
1,413

comment the first :

I_CALLBACK_USER_COMMAND = user_command

line in your FM 'REUSE_ALV_LIST_DISPLAY'

Read only

0 Likes
1,413

Thanku

still same prob

regards

Read only

0 Likes
1,413

Hi ravi,

can u say what is the actual error message ur getting

Regards

Pavan

Read only

0 Likes
1,413

problem is after execution of sel screen it is displaying 'callback event user_command does not exist'.

Read only

Former Member
0 Likes
1,413

Hi ,

Try doing these steps.

1. Comment 'set user-command ....' line.

2. Comment 'call back user-command in reuse_alv_list_display'.

3.change 's_events-name = 'USER_COMMAND'.The name in ' ' should be in caps.

i have placed the entire code here.

&----


*& Report ZTRCH_HE_SDN *

*& *

&----


*& *

*& *

&----


REPORT ZALV.

TABLES:LFA1,EKKO,EKPO.

select-options:s_lifnr for lfa1-lifnr.

DATA:Begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-lifnr,

end of itab.

Data:begin of jtab occurs 0,

ebeln like ekko-ebeln,

aedat like ekko-aedat,

end of jtab.

Data:begin of ktab occurs 0,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

end of ktab.

type-pools:slis.

data:repid like sy-repid,

  • user_command like sy-ucomm,

  • user_command like slis_ev_user_command,

f_lfa11 type slis_t_fieldcat_alv,

f_lfa1 type slis_fieldcat_alv,

f_ekko1 type slis_t_fieldcat_alv,

f_ekko type slis_fieldcat_alv,

f_ekpo1 type slis_t_fieldcat_alv,

f_ekpo type slis_fieldcat_alv,

i_events type slis_t_event,

s_events type slis_alv_event.

REPID = SY-REPID.

PERFORM COL_HEAD.

START-OF-SELECTION.

select lifnr name1 from lfa1 into table itab where lifnr in s_lifnr.

set user-command 'user_command'.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_lfa11

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • 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 COL_HEAD.

f_lfa1-fieldname = 'lifnr'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'lifnr'.

append f_lfa1 to f_lfa11.

f_lfa1-fieldname = 'name1'.

f_lfa1-ref_tabname = 'lfa1'.

f_lfa1-ref_fieldname = 'name1'.

append f_lfa1 to f_lfa11.

f_ekko-fieldname = 'ebeln'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'ebeln'.

append f_ekko to f_ekko1.

f_ekko-fieldname = 'aedat'.

f_ekko-ref_tabname = 'ekko'.

f_ekko-ref_fieldname = 'aedat'.

append f_ekko to f_ekko1.

f_ekpo-fieldname = 'ebelp'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'ebelp'.

append f_ekpo to f_ekpo1.

f_ekpo-fieldname = 'matnr'.

f_ekpo-ref_tabname = 'ekpo'.

f_ekpo-ref_fieldname = 'matnr'.

append f_ekpo to f_ekpo1.

s_events-name = 'USER_COMMAND'.

s_events-form = 'val'.

append s_events to i_events.

endform.

*form val using user_command like sy-ucomm

form val using user_command like sy-ucomm

sel type slis_selfield.

DATA:v_lifnr(10) type N,

v_ebeln(10) type N,

v_matnr(10) type C.

if sel-fieldname = 'lifnr'.

v_lifnr = sel-value.

select ebeln aedat from ekko into table jtab where lifnr = v_lifnr.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = f_ekko1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = i_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

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = jtab.

  • 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.

endif.

if sel-fieldname = 'ebeln'.

v_ebeln = sel-value.

select ebelp matnr from ekpo into table ktab where ebeln = v_ebeln.

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'item details'

  • I_SELECTION = 'X'

  • I_ALLOW_NO_SELECTION =

  • I_ZEBRA = ' '

I_SCREEN_START_COLUMN = 10

I_SCREEN_START_LINE = 10

I_SCREEN_END_COLUMN = 27

I_SCREEN_END_LINE = 16

  • I_CHECKBOX_FIELDNAME =

  • I_LINEMARK_FIELDNAME =

  • I_SCROLL_TO_SEL_LINE = 'X'

I_TABNAME = 'ekpo'

  • I_STRUCTURE_NAME =

IT_FIELDCAT = f_ekpo1

  • IT_EXCLUDING =

  • I_CALLBACK_PROGRAM =

  • I_CALLBACK_USER_COMMAND =

  • IS_PRIVATE =

IMPORTING

ES_SELFIELD = sel

  • E_EXIT =

TABLES

T_OUTTAB = ktab.

  • 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.

endif.

if sel-fieldname = 'matnr'.

v_matnr = sel-value.

set parameter id 'mat' field v_matnr.

call transaction 'mm02' and skip first screen.

endif.

endform.

Plz.....reward if this was useful.....

regards,

hema.

Read only

Former Member
0 Likes
1,413

Hi ravi,

This program will execute gurantly try this even if u r getting any error then plzz reply me

*&---------------------------------------------------------------------*
*& Report  Z                                                           *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  Z                                       .
TABLES:LFA1,EKKO,EKPO.

select-options:s_lifnr for lfa1-lifnr.

DATA:Begin of itab occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-lifnr,
end of itab.

Data:begin of jtab occurs 0,
ebeln like ekko-ebeln,
aedat like ekko-aedat,
end of jtab.

Data:begin of ktab occurs 0,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
end of ktab.


type-pools:slis.
data:repid like sy-repid,
* user_command like sy-ucomm,
* user_command like slis_ev_user_command,
f_lfa11 type slis_t_fieldcat_alv,
f_lfa1 type slis_fieldcat_alv,
f_ekko1 type slis_t_fieldcat_alv,
f_ekko type slis_fieldcat_alv,
f_ekpo1 type slis_t_fieldcat_alv,
f_ekpo type slis_fieldcat_alv,
i_events type slis_t_event,
s_events type slis_alv_event.

REPID = SY-REPID.

PERFORM COL_HEAD.

START-OF-SELECTION.

select lifnr name1 from lfa1 into table itab where lifnr in s_lifnr.

set user-command 'user_command'.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =
* IS_LAYOUT =
IT_FIELDCAT = f_lfa11
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = i_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
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* 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 COL_HEAD.
f_lfa1-fieldname = 'lifnr'.
f_lfa1-ref_tabname = 'lfa1'.
f_lfa1-ref_fieldname = 'lifnr'.
append f_lfa1 to f_lfa11.

f_lfa1-fieldname = 'name1'.
f_lfa1-ref_tabname = 'lfa1'.
f_lfa1-ref_fieldname = 'name1'.
append f_lfa1 to f_lfa11.

f_ekko-fieldname = 'ebeln'.
f_ekko-ref_tabname = 'ekko'.
f_ekko-ref_fieldname = 'ebeln'.
append f_ekko to f_ekko1.

f_ekko-fieldname = 'aedat'.
f_ekko-ref_tabname = 'ekko'.
f_ekko-ref_fieldname = 'aedat'.
append f_ekko to f_ekko1.

f_ekpo-fieldname = 'ebelp'.
f_ekpo-ref_tabname = 'ekpo'.
f_ekpo-ref_fieldname = 'ebelp'.
append f_ekpo to f_ekpo1.

f_ekpo-fieldname = 'matnr'.
f_ekpo-ref_tabname = 'ekpo'.
f_ekpo-ref_fieldname = 'matnr'.
append f_ekpo to f_ekpo1.

s_events-name = 'USER_COMMAND'.
s_events-form = 'val'.
append s_events to i_events.
endform.


*form val using user_command like sy-ucomm
form val using user_command like sy-ucomm
sel type slis_selfield.

DATA:v_lifnr(10) type N,
v_ebeln(10) type N,
v_matnr(10) type C.

if sel-fieldname = 'lifnr'.
v_lifnr = sel-value.

select ebeln aedat from ekko into table jtab where lifnr = v_lifnr.

CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME =
* IS_LAYOUT =
IT_FIELDCAT = f_ekko1
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = i_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
* IR_SALV_LIST_ADAPTER =
* IT_EXCEPT_QINFO =
* I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = jtab.
* 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.

endif.

if sel-fieldname = 'ebeln'.
v_ebeln = sel-value.

select ebelp matnr from ekpo into table ktab where ebeln = v_ebeln.

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'item details'
* I_SELECTION = 'X'
* I_ALLOW_NO_SELECTION =
* I_ZEBRA = ' '
I_SCREEN_START_COLUMN = 10
I_SCREEN_START_LINE = 10
I_SCREEN_END_COLUMN = 27
I_SCREEN_END_LINE = 16
* I_CHECKBOX_FIELDNAME =
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = 'ekpo'
* I_STRUCTURE_NAME =
IT_FIELDCAT = f_ekpo1
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE =
IMPORTING
ES_SELFIELD = sel
* E_EXIT =
TABLES
T_OUTTAB = ktab.
* 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.

endif.

if sel-fieldname = 'matnr'.
v_matnr = sel-value.


set parameter id 'mat' field v_matnr.
call transaction 'mm02' and skip first screen.
endif.
endform.

Rewards if helpfull

Regards

Pavan

Read only

0 Likes
1,413

Dear pavan,

thanx for taking it is giving short dump ,

Sorry i for got to mention the version iam working is ECC 6.0

is there any differance

Regards

Read only

Former Member
0 Likes
1,413

HI Ravi,

Write form name user command in capitals

I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'..

Even If you are using events write in caps

l_wa_events-name = 'USER_COMMAND'.

l_wa_events-form = 'F_USER_COMMAND'.

APPEND l_wa_events TO fp_it_events

Hope this solves your problem..

reward if useful

regards,

nazeer