11-10-2010 6:39 AM
Friends,
I need to display my data in alv popup window from there I have to select a row and display the data in new popup window. For this purpose I had written this fuction. It's working fine But I don't know how to select row from this and display data in new popup window. when I am displaying data in alv grid ,then I am able to display data in POPUP window after selecting a row from grid but dont know how to jump from one pop up window to another.
form output_alv.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'SALES ORDER INFO'
I_ZEBRA = 'X'
I_TABNAME = 1
I_STRUCTURE_NAME = 'VBAK'
TABLES
T_OUTTAB = it_vbak
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
endform.
11-15-2010 10:53 AM
The following code may be of some help:
DATA: BEGIN OF it_prmhlp OCCURS 0.
INCLUDE STRUCTURE zaltab_param.
DATA: flg(1) TYPE c,
END OF it_prmhlp.
DATA: wreturn LIKE ddshretval OCCURS 0 WITH HEADER LINE,
wstep LIKE sy-stepl.
DATA wsel1 VALUE 'X'. wsel1 = 'X'.
TYPE-POOLS : slis.
DATA : listtitle(30),
l_lines LIKE sy-tabix,
ls_fldcat TYPE slis_fieldcat_alv,
lt_fldcat TYPE slis_t_fieldcat_alv,
ls_selfield TYPE slis_selfield.
progname = sy-repid.
dynnum = sy-dynnr.
DEFINE fldcat_add1.
ls_fldcat-fieldname = &1.
ls_fldcat-ref_tabname = &2.
ls_fldcat-ref_fieldname = &3.
ls_fldcat-reptext_ddic = &4.
ls_fldcat-outputlen = &5.
append ls_fldcat to lt_fldcat.
END-OF-DEFINITION.
REFRESH : lt_fldcat.
fldcat_add1 'AUREL' 'ZALTAB_PARAM' 'AUREL' 'Alloc Table Relevancy' '25'.
fldcat_add1 'PDESC' 'ZALTAB_PARAM' 'PDESC' 'Process Description' '40'.
*
REFRESH it_prmhlp. CLEAR it_prmhlp.
SELECT * FROM zaltab_param
INTO TABLE it_prmhlp
WHERE tcode = sy-tcode.
SORT it_prmhlp BY aurel pdesc.
listtitle = 'Allocaction Table Relvancy Selection'.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = listtitle
i_selection = wsel1
i_zebra = ' '
i_checkbox_fieldname = 'FLG'
i_tabname = 'IT_PRMHLP'
it_fieldcat = lt_fldcat
TABLES
t_outtab = it_prmhlp
EXCEPTIONS
program_error = 1
OTHERS = 2
.
DATA wfl1. CLEAR wfl1.
LOOP AT it_prmhlp.
IF it_prmhlp-flg = 'X'.
IF wfl1 = 'X'.
CLEAR it_prmhlp. REFRESH it_prmhlp.
MESSAGE i000(yw) WITH 'Only 1 entry can be selected...'.
EXIT.
ENDIF.
wfl1 = 'X'.
ENDIF.
ENDLOOP.
*
IF wsel1 = 'X'.
READ TABLE it_prmhlp WITH KEY flg = 'X'.
IF sy-subrc EQ 0.
paurel = it_prmhlp-aurel.
paureltx = it_prmhlp-pdesc.
wvariant = it_prmhlp-zvariant.
PERFORM update_screen.
ELSE.
CLEAR it_prmhlp. REFRESH it_prmhlp.
ENDIF.
ENDIF.
The trick lies in using the box fieldname which is 'FLG' in this case and the wsel1 param passed to the fm to know whether any row is selected or not.
11-15-2010 10:53 AM
The following code may be of some help:
DATA: BEGIN OF it_prmhlp OCCURS 0.
INCLUDE STRUCTURE zaltab_param.
DATA: flg(1) TYPE c,
END OF it_prmhlp.
DATA: wreturn LIKE ddshretval OCCURS 0 WITH HEADER LINE,
wstep LIKE sy-stepl.
DATA wsel1 VALUE 'X'. wsel1 = 'X'.
TYPE-POOLS : slis.
DATA : listtitle(30),
l_lines LIKE sy-tabix,
ls_fldcat TYPE slis_fieldcat_alv,
lt_fldcat TYPE slis_t_fieldcat_alv,
ls_selfield TYPE slis_selfield.
progname = sy-repid.
dynnum = sy-dynnr.
DEFINE fldcat_add1.
ls_fldcat-fieldname = &1.
ls_fldcat-ref_tabname = &2.
ls_fldcat-ref_fieldname = &3.
ls_fldcat-reptext_ddic = &4.
ls_fldcat-outputlen = &5.
append ls_fldcat to lt_fldcat.
END-OF-DEFINITION.
REFRESH : lt_fldcat.
fldcat_add1 'AUREL' 'ZALTAB_PARAM' 'AUREL' 'Alloc Table Relevancy' '25'.
fldcat_add1 'PDESC' 'ZALTAB_PARAM' 'PDESC' 'Process Description' '40'.
*
REFRESH it_prmhlp. CLEAR it_prmhlp.
SELECT * FROM zaltab_param
INTO TABLE it_prmhlp
WHERE tcode = sy-tcode.
SORT it_prmhlp BY aurel pdesc.
listtitle = 'Allocaction Table Relvancy Selection'.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = listtitle
i_selection = wsel1
i_zebra = ' '
i_checkbox_fieldname = 'FLG'
i_tabname = 'IT_PRMHLP'
it_fieldcat = lt_fldcat
TABLES
t_outtab = it_prmhlp
EXCEPTIONS
program_error = 1
OTHERS = 2
.
DATA wfl1. CLEAR wfl1.
LOOP AT it_prmhlp.
IF it_prmhlp-flg = 'X'.
IF wfl1 = 'X'.
CLEAR it_prmhlp. REFRESH it_prmhlp.
MESSAGE i000(yw) WITH 'Only 1 entry can be selected...'.
EXIT.
ENDIF.
wfl1 = 'X'.
ENDIF.
ENDLOOP.
*
IF wsel1 = 'X'.
READ TABLE it_prmhlp WITH KEY flg = 'X'.
IF sy-subrc EQ 0.
paurel = it_prmhlp-aurel.
paureltx = it_prmhlp-pdesc.
wvariant = it_prmhlp-zvariant.
PERFORM update_screen.
ELSE.
CLEAR it_prmhlp. REFRESH it_prmhlp.
ENDIF.
ENDIF.
The trick lies in using the box fieldname which is 'FLG' in this case and the wsel1 param passed to the fm to know whether any row is selected or not.
08-18-2014 5:36 AM
11-23-2011 9:40 AM
01-28-2012 10:26 AM
04-18-2012 1:55 PM
Hello All,
Giving the solution I had implemented.
Field 'TABINDEX' of work area 'WSELFLD' contains the index of selected row from pop up.
based on this index value we can design our logic accordingly.
For reference I am writing following code:
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'Select Order'
I_SELECTION = 'X'
I_ZEBRA = 'X'
I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = 'ORDER'
IT_FIELDCAT = itfldcat
IMPORTING
ES_SELFIELD = wselfld
E_EXIT = e_exit
TABLES
T_OUTTAB = order[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE E001(00) WITH 'ERROR IN POP UP'.
elseif sy-subrc = 0.
IF E_EXIT = 'X'.
MESSAGE S001(00) WITH 'NO ROWS SELECTED'.
ELSE.
IF WSELFLD-TABINDEX IS INITIAL.
MESSAGE E001(00) WITH 'SELECT VALUES FROM POP UP'.
ENDIF.
endif.
endif.