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

interactive HSEQ display

Former Member
0 Likes
701

Hi,

i have a hierarchical sequential list display.if i press on any of the item s it has to show the corresponding transaction.

in case of list and grid displays there is an event called user_command.

how can i approach with HSEQ display.

please somebody give any suggestion.

correct answers will be surely rewarded.

rgds,

Hi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
644

hi,

are u talking about hierarchical ALV?

6 REPLIES 6
Read only

Former Member
0 Likes
645

hi,

are u talking about hierarchical ALV?

Read only

0 Likes
644

yaaa

Read only

0 Likes
644

hi,

try like this

TYPE-POOLS : slis.

TABLES : mseg.

DATA : BEGIN OF itab_head OCCURS 0,

mat LIKE mseg-matnr,

  • matnr LIKE mseg-matnr,

werks LIKE mseg-werks,

END OF itab_head.

DATA : BEGIN OF itab_item OCCURS 0,

  • mat LIKE mseg-matnr,

matnr LIKE mseg-matnr,

werks LIKE mseg-werks,

mblnr LIKE mseg-mblnr,

menge LIKE mseg-menge,

END OF itab_item.

DATA : t_fcat TYPE slis_t_fieldcat_alv,

key_info TYPE slis_keyinfo_alv,

t_eve TYPE slis_t_event,

gt_subtot TYPE slis_t_sortinfo_alv,

subtot LIKE LINE OF gt_subtot,

t_listhead TYPE slis_t_listheader,

st_line TYPE slis_listheader.

DATA : lin_no TYPE i.

DATA : t_mtdoc LIKE mseg-mblnr.

SELECT-OPTIONS : mat FOR mseg-matnr.

INITIALIZATION.

PERFORM build_cat USING t_fcat.

PERFORM build_eve.

START-OF-SELECTION.

PERFORM get_data.

PERFORM dis_data.

&----


*& Form build_cat

&----


  • text

----


  • -->TEMP_FCAT text

----


FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.

DATA : wa_fcat TYPE slis_fieldcat_alv.

wa_fcat-tabname = 'ITAB_HEAD'.

wa_fcat-fieldname = 'MAT'.

wa_fcat-seltext_m = 'Material'.

APPEND wa_fcat TO temp_fcat.

CLEAR wa_fcat.

wa_fcat-tabname = 'ITAB_HEAD'.

wa_fcat-fieldname = 'WERKS'.

wa_fcat-seltext_m = 'Plant'.

APPEND wa_fcat TO temp_fcat.

CLEAR wa_fcat.

wa_fcat-tabname = 'ITAB_ITEM'.

wa_fcat-fieldname = 'MBLNR'.

wa_fcat-seltext_m = 'Material Doc.'.

APPEND wa_fcat TO temp_fcat.

CLEAR wa_fcat.

wa_fcat-tabname = 'ITAB_ITEM'.

wa_fcat-fieldname = 'MENGE'.

wa_fcat-seltext_m = 'Quantity'.

  • wa_fcat-edit = 'X'.

  • wa_fcat-input = 'X'.

wa_fcat-do_sum = 'Y'.

APPEND wa_fcat TO temp_fcat.

CLEAR wa_fcat.

subtot-spos = 1.

subtot-fieldname = 'MAT'.

subtot-tabname = 'ITAB_HEAD'.

subtot-up = 'X'.

subtot-group = 'X'.

subtot-subtot = 'X'.

subtot-expa = 'X'.

APPEND subtot TO gt_subtot.

ENDFORM. "build_cat

&----


*& Form build_eve

&----


  • text

----


FORM build_eve.

DATA : wa_eve TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = t_eve

  • EXCEPTIONS

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

READ TABLE t_eve INTO wa_eve WITH KEY name = 'TOP_OF_PAGE'.

IF sy-subrc = 0.

wa_eve-form = 'TOP_OF_PAGE'.

MODIFY t_eve FROM wa_eve INDEX sy-tabix.

ENDIF.

ENDFORM. "build_eve

&----


*& Form get_data

&----


  • text

----


FORM get_data.

SELECT matnr werks mblnr menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab_item

WHERE matnr IN mat.

ENDFORM. "get_data

&----


*& Form dis_data

&----


  • text

----


FORM dis_data.

key_info-header01 = 'MAT'.

key_info-item01 = 'MATNR'.

key_info-header02 = 'WERKS'.

key_info-item02 = 'WERKS'.

REFRESH itab_head.

LOOP AT itab_item.

ON CHANGE OF itab_item-matnr OR itab_item-werks.

MOVE-CORRESPONDING itab_item TO itab_head.

itab_head-mat = itab_item-matnr.

APPEND itab_head.

ENDON.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

i_callback_program = 'ZALV_PRDS'

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = t_fcat

it_sort = gt_subtot

it_events = t_eve[]

i_tabname_header = 'ITAB_HEAD'

i_tabname_item = 'ITAB_ITEM'

is_keyinfo = key_info

TABLES

t_outtab_header = itab_head

t_outtab_item = itab_item

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

ENDFORM. "dis_data

&----


*& Form user_Command

&----


  • text

----


  • -->U_COMM text

  • -->SELFIELD text

----


FORM user_command USING u_comm TYPE sy-ucomm selfield TYPE slis_selfield.

CASE u_comm.

WHEN '&IC1'.

IF selfield-fieldname = 'MENGE'.

GET CURSOR LINE lin_no.

ELSE.

READ TABLE itab_item INDEX selfield-tabindex.

t_mtdoc = itab_item-mblnr.

SET PARAMETER ID 'MBN' FIELD t_mtdoc.

CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM. "user_Command

&----


*& Form top_of_page

&----


  • text

----


FORM top_of_page.

CLEAR st_line.

st_line-typ = 'H'.

st_line-info = 'Dhwani Shah'.

APPEND st_line TO t_listhead.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_listhead

  • I_LOGO =

  • I_END_OF_LIST_GRID =

  • I_ALV_FORM =

.

ENDFORM. "top_of_page

reward if usefull....

Read only

0 Likes
644

Hi,

thanks for ur help.it is working.

rgds,

hi

Read only

0 Likes
644

hi,

if it is usefull then please reward points

Read only

Former Member
0 Likes
644