Choose one item in selection screen
hallow i doing a selection screen and i wont that in field c_course u can <b>mark</b> just <b>one course</b>.(when u do f4 in c_course u have catalog of lot of courses )
becouse i have a problem that if u choose more then one course the program is run to alv but not bring any data .how can change this maybe in popup(with warnning) or disabled this option but i dont now how .
thanks
this my declertion
SELECT-OPTIONS c_course FOR z_course_table-objid with no intervals no-extension
REFRESH: c_course.
CLEAR: c_course.
PERFORM get_objid USING 'D'
CHANGING c_course-low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR c_course-high.
*======================================================
REFRESH: c_course.
CLEAR: c_course.
PERFORM get_objid USING 'D'
CHANGING c_course-high.
FORM get_objid
USING p_otype
CHANGING p_c_course.
*p_so_orgeh_low
CALL FUNCTION 'RH_OBJID_REQUEST'
EXPORTING
plvar = '01'
otype = p_otype
seark = '*'
seark_begda = so_date-low
seark_endda = so_date-high
set_mode = 'X'
DYNPRO_REPID = ' '
DYNPRO_DYNNR = ' '
DYNPRO_PLVARFIELD = ' '
DYNPRO_OTYPEFIELD = ' '
DYNPRO_SEARKFIELD = ' '
CALLBACK_PROG = ' '
CALLBACK_FORM = ' '
RESTRICT_FB = ' '
RESTRICT_DATA = ' '
WITHOUT_RSIGN =
WITHOUT_RELAT =
WITHOUT_SCLAS =
ORGBEG = SY-DATUM
ORGEND = SY-DATUM
WIN_TITLE =
APP_DATA =
IMPORTING
sel_plvar = wa_plvar
sel_otype = wa_otype
sel_object = wa_objid
TABLES
OTYPE_TABLE =
CONDITION =
BASE_OBJECTS =
MARKED_OBJECTS =
sel_objects = itab_object
SEL_HROBJECT_TAB =
SEL_HRSOBID_TAB =
EXCEPTIONS
cancelled = 1
wrong_condition = 2
nothing_found = 3
internal_error = 4
illegal_mode = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF wa_otype = 'D' .
OR wa_otype = 'DC' OR wa_otype = 'L'.
REFRESH: c_course.
CLEAR: c_course.
LOOP AT itab_object.
CLEAR c_course.
c_course-low = itab_object-objid.
c_course-option = 'EQ'.
c_course-sign = 'I'.
APPEND c_course.
ENDLOOP.
CLEAR: itab_object.
REFRESH: itab_object.
ENDIF.
HI Antonio,
make the SET_MODE = ' ' or comment the value.
SET_MODE = 'X' for multiple selection.
then u can choose only 1 course at a time.
Regards
CNU
Similar Messages
-
How to do choose one record in alv screen from dyn_table ?
Experts: How to do choose one record in alv screen from <dyn_table> ?
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: V_COUNT TYPE I.
CLEAR: V_COUNT,<dyn_wa>.
LOOP AT <dyn_table> INTO <dyn_wa>. "WHERE <?????> = 'X'. I should how to do write ?
V_COUNT = V_COUNT + 1.
ENDLOOP.
if not rs_selfield-tabindex eq 0 AND V_COUNT NE 0.
IF R_UCOMM = '&CHANGE'.
IF sy-subrc = 0.
IF V_COUNT = 1.
CALL SCREEN 100.
perform dny_field_value_update.
rs_selfield-refresh = 'X'.
ENDIF.
ENDIF.
endif.
endif.
ENDFORM. "USER_COMMANDAnyways which version of SAP are you using ? As of SAPNW 7.0 Release 2 you can specify dynamic tokens with LOOP ... WHERE statement.
My sap product is ecc5.0. Still thanks!
Now I have solved it.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: V_COUNT TYPE I.
CLEAR: V_COUNT,<dyn_wa>,IT_TOTAL.
SY-INDEX = rs_selfield-tabindex.
READ TABLE <dyn_table> INTO <dyn_wa> INDEX SY-INDEX.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <DYN_WA> TO <dyn_field>.
CONDENSE <DYN_FIELD> NO-GAPS.
IT_TOTAL-KUNNR = <DYN_FIELD>.
ASSIGN COMPONENT 'PLANTNO' OF STRUCTURE <DYN_WA> TO <dyn_field>.
CONDENSE <DYN_FIELD> NO-GAPS.
IT_TOTAL-MATNR = <DYN_FIELD>.
ASSIGN COMPONENT 'CUSTOMERNO' OF STRUCTURE <DYN_WA> TO <dyn_field>.
CONDENSE <DYN_FIELD> NO-GAPS.
IT_TOTAL-CUSTOMERNO = <DYN_FIELD>.
ASSIGN COMPONENT 'ZPERSON' OF STRUCTURE <DYN_WA> TO <dyn_field>.
CONDENSE <DYN_FIELD> NO-GAPS.
IT_TOTAL-ZPERSON = <DYN_FIELD>.
IF SY-SUBRC = 0.
"CHECK <dyn_field> = 'X'.
V_COUNT = V_COUNT + 1.
ENDIF.
if not rs_selfield-tabindex eq 0 AND V_COUNT NE 0.
IF R_UCOMM = '&CHANGE'.
IF sy-subrc = 0.
IF V_COUNT = 1.
CALL SCREEN 100.
perform dny_field_value_update.
rs_selfield-refresh = 'X'.
"exit.
ENDIF.
ENDIF.
endif.
endif.
Edited by: andy1982999 on Apr 2, 2010 8:42 AM -
Choose fields option in Selection Screen of report program.
Hi Experts,
Actually In my requirement , the user wants to display the output fields in ALV Grid and also in Block ALV format.They need 10 fields to be displayed by default and the additional fields has to be displayed based on the choose fields option
( i.e like SE11 choose fields option ) provided in the selection screen of this report program.So based on this the output has to be displayed.
Pls suggest ur ideas.....
Thanks in advance.
Regards,
Srinivas.Hi ,
The following code will be helpful for your requirement...
REPORT ypm_hist_dyn.
* T Y P E - P O O L S *
TYPE-POOLS: slis.
* T Y P E S *
TYPES : BEGIN OF t_equz,
datbi TYPE datbi, " Valid To Date
equnr TYPE equnr, " Equipment Number
erdat TYPE erdat, " Date on Which Record Was Created
aedat TYPE aedat, " Changed On
iloan TYPE iloan, " Location and account assignment for technical object
gewrk TYPE lgwid, " Object ID of the Work Center
ingrp TYPE ingrp, " Planner Group for Customer Service and Plant Maintenance
END OF t_equz,
BEGIN OF t_equz1,
datbi TYPE datbi, " Valid To Date
equnr TYPE equnr, " Equipment Number
erdat TYPE erdat, " Date on Which Record Was Created
aedat TYPE aedat, " Changed On
END OF t_equz1,
BEGIN OF t_iloa,
iloan TYPE iloan, "Location and account assignment for technical object
tplnr TYPE tplnr, " Functional Location
msgrp TYPE raumnr, " Room
END OF t_iloa,
BEGIN OF t_iflotx,
tplnr TYPE tplnr, "Functional Location
pltxt TYPE pltxt, " Description of functional location
END OF t_iflotx,
BEGIN OF t_equi,
equnr TYPE equnr, " Equipment Number
eqart TYPE eqart, "Type of Technical Object
END OF t_equi,
BEGIN OF t_crhd,
objid TYPE cr_objid, "Object ID of the resource
arbpl TYPE arbpl, "Work center
END OF t_crhd,
BEGIN OF t_eqkt,
equnr TYPE equnr, "Equipment Number
eqktx TYPE ktx01, "Description of technical object
END OF t_eqkt,
BEGIN OF t_t370k_t,
eqart TYPE eqart, "Type of Technical Object
eartx TYPE eartx, "Text for Object Type
END OF t_t370k_t,
BEGIN OF t_t024i,
ingrp TYPE ingrp, "Planner Group for Customer Service and Plant Maintenance
innam TYPE innam, "Name of the Maintenance Planner Group
END OF t_t024i,
BEGIN OF t_viqmel,
equnr TYPE equnr, "Equipment Number
qmnum TYPE qmnum, "Notification No
qmdat TYPE qmdat, "Date of Notification
bequi TYPE bequi, "Equipment Affected
iloan TYPE iloan, "Location and account assignment for technical object
END OF t_viqmel,
BEGIN OF t_final,
equnr TYPE equz-equnr,
eqktx TYPE eqkt-eqktx,
tplnr TYPE iloa-tplnr,
pltxt TYPE iflotx-pltxt,
iloan TYPE iloan,
datbi TYPE equz-datbi,
ingrp TYPE t024i-ingrp,
erdat TYPE equz-erdat,
enddt1 TYPE char10,
aedat TYPE equz-aedat,
innam TYPE t024i-innam,
equart TYPE equi-eqart,
eartx TYPE t370k_t-eartx,
qmnum TYPE viqmel-qmnum,
arbpl TYPE crhd-arbpl,
msgrp TYPE iloa-msgrp,
dat_diff TYPE char10,
END OF t_final,
BEGIN OF t_final1,
equnr TYPE equz-equnr,
eqktx TYPE eqkt-eqktx,
tplnr TYPE iloa-tplnr,
pltxt TYPE iflotx-pltxt,
END OF t_final1.
DATA: it_equz TYPE STANDARD TABLE OF t_equz,
it_iloa TYPE STANDARD TABLE OF t_iloa,
it_iflotx TYPE STANDARD TABLE OF t_iflotx,
it_equi TYPE STANDARD TABLE OF t_equi,
it_crhd TYPE STANDARD TABLE OF t_crhd,
it_eqkt TYPE STANDARD TABLE OF t_eqkt,
it_t370k_t TYPE STANDARD TABLE OF t_t370k_t,
it_t024i TYPE STANDARD TABLE OF t_t024i,
it_viqmel TYPE STANDARD TABLE OF t_viqmel,
it_final TYPE STANDARD TABLE OF t_final,
it_final1 TYPE STANDARD TABLE OF t_final1,
it_equz1 TYPE STANDARD TABLE OF t_equz1.
DATA: wa_equz TYPE t_equz,
wa_iloa TYPE t_iloa,
wa_iflotx TYPE t_iflotx,
wa_equi TYPE t_equi,
wa_crhd TYPE t_crhd,
wa_eqkt TYPE t_eqkt,
wa_t370k_t TYPE t_t370k_t,
wa_t024i TYPE t_t024i,
wa_viqmel TYPE t_viqmel,
wa_final TYPE t_final,
wa_final1 TYPE t_final1,
wa_equz1 TYPE t_equz.
DATA: t_equnr TYPE equz-equnr, "EQUZ-EQUNR
t_tplnr TYPE iloa-tplnr, "Functional Location
t_datbi TYPE equz-datbi, "Date
t_ingrp TYPE equz-ingrp, "Planner Group
t_eqart TYPE equi-eqart, "Technical Object
w_diff TYPE p,
w_time TYPE t.
* ALV DATA DECLARATION *
* Field Catalog
TYPES: BEGIN OF t_fldnam,
fld TYPE fieldname,
desc TYPE char30,
END OF t_fldnam.
DATA: is_layout TYPE slis_layout_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
is_fieldcat TYPE slis_fieldcat_alv,
it_fldnam TYPE STANDARD TABLE OF t_fldnam,
wa_fldnam TYPE t_fldnam,
it_sort TYPE STANDARD TABLE OF slis_t_sortinfo_alv,
wa_sort LIKE LINE OF it_sort.
DATA: i_events TYPE slis_t_event,
ls_line TYPE slis_listheader,
gt_list_top_of_page TYPE slis_t_listheader, "FOR TOP OF PAGE
gt_list_end_of_page TYPE slis_t_listheader. "FOR END OF PAGE
DATA : formname_top_of_page TYPE slis_formname VALUE
'GENERATE_TOP_OF_PAGE',
formname_end_of_page TYPE slis_formname VALUE
'GENERATE_END_OF_PAGE',
formname_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
* C O N S T A N T S *
*CONSTANTS: c_top TYPE slis_formname VALUE 'TOP_OF_PAGE',
* c_final(40) TYPE c VALUE 'IT_FINAL',
* c_detail(15) TYPE c VALUE 'IT_FINAL1'.
DATA : g_save(1) TYPE c,
g_exit(1) TYPE c,
g_variant LIKE disvariant,
gx_variant LIKE disvariant.
* S E L E C T I O N S C R E E N *
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_equnr FOR t_equnr,
s_tplnr FOR t_tplnr,
s_datbi FOR t_datbi ,
s_ingrp FOR t_ingrp,
s_eqart FOR t_eqart.
SELECTION-SCREEN: END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(16) text-007.
SELECTION-SCREEN POSITION 22.
PARAMETERS : 11_flds RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND g1.
SELECTION-SCREEN COMMENT 39(13) text-009.
SELECTION-SCREEN POSITION 54.
PARAMETERS : 6_flds RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : END OF BLOCK blk2.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
PARAMETERS: alv_list RADIOBUTTON GROUP gp1 DEFAULT 'X'.
PARAMETERS: alv_grid RADIOBUTTON GROUP gp1.
SELECTION-SCREEN:END OF BLOCK b2.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.
PARAMETERS : p_vari LIKE disvariant-variant.
SELECTION-SCREEN: END OF BLOCK b3.
AT SELECTION-SCREEN.
PERFORM date_range.
IF s_datbi[] IS INITIAL.
MESSAGE e398(00) WITH 'ENTER A VALUE FOR DATE'(012).
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
START-OF-SELECTION.
IF 11_flds EQ 'X'.
PERFORM fill_equz.
PERFORM fill_iloa.
PERFORM fill_iflotx.
PERFORM fill_equi.
PERFORM fill_t370k_t.
PERFORM fill_t024i.
PERFORM fill_crhd.
PERFORM fill_eqkt.
PERFORM fill_viqmel.
ELSE.
PERFORM fill_equz.
PERFORM fill_iloa.
PERFORM fill_iflotx.
PERFORM haha_final.
PERFORM dyn_tab.
ENDIF.
PERFORM fill_final.
PERFORM get_day_diff.
* END-OF-SELECTION *
END-OF-SELECTION.
*Display Output in ALV Format
* PERFORM populate_layout.
PERFORM populate_fcat.
PERFORM populate_events .
* PERFORM gen_top.
PERFORM display_alv .
*& Form FILL_EQUZ
* text
* --> p1 text
* <-- p2 text
FORM fill_equz .
IF s_datbi-high IS INITIAL.
s_datbi-high = '99990701'.
ENDIF.
* IF s_datbi-LOW IS INITIAL.
* s_datbi-LOW = '20071201'.
* ENDIF.
SELECT datbi
equnr
erdat
aedat
iloan
gewrk
ingrp
FROM equz
INTO CORRESPONDING FIELDS OF TABLE it_equz
* WHERE datbi IN s_datbi AND equnr IN s_equnr.
WHERE equnr IN s_equnr
AND ingrp IN s_ingrp
AND datbi LE s_datbi-high
AND datbi GE s_datbi-low.
ENDFORM. " FILL_EQUZ
*& Form FILL_ILOA
* text
* --> p1 text
* <-- p2 text
FORM fill_iloa .
SELECT iloan
tplnr
msgrp
INTO CORRESPONDING FIELDS OF TABLE it_iloa
FROM iloa
FOR ALL ENTRIES IN it_equz
WHERE iloan = it_equz-iloan.
ENDFORM. " FILL_ILOA
*& Form FILL_IFLOTX
* text
* --> p1 text
* <-- p2 text
FORM fill_iflotx .
SELECT tplnr
pltxt
INTO CORRESPONDING FIELDS OF TABLE it_iflotx
FROM iflotx
FOR ALL ENTRIES IN it_iloa
WHERE tplnr = it_iloa-tplnr.
ENDFORM. " FILL_IFLOTX
*& Form FILL_EQUI
* text
* --> p1 text
* <-- p2 text
FORM fill_equi .
SELECT equnr
eqart
INTO CORRESPONDING FIELDS OF TABLE it_equi
FROM equi
FOR ALL ENTRIES IN it_equz
WHERE equnr = it_equz-equnr.
ENDFORM. " FILL_EQUI
*& Form FILL_T370K_T
* text
* --> p1 text
* <-- p2 text
FORM fill_t370k_t .
SELECT eqart
eartx
INTO CORRESPONDING FIELDS OF TABLE it_t370k_t
FROM t370k_t
FOR ALL ENTRIES IN it_equi
WHERE eqart = it_equi-eqart.
ENDFORM. " FILL_T370K_T
*& Form FILL_T024I
* text
* --> p1 text
* <-- p2 text
FORM fill_t024i .
SELECT ingrp
innam
INTO CORRESPONDING FIELDS OF TABLE it_t024i
FROM t024i
FOR ALL ENTRIES IN it_equz
WHERE ingrp = it_equz-ingrp.
ENDFORM. " FILL_T024I
*& Form FILL_CRHD
* text
* --> p1 text
* <-- p2 text
FORM fill_crhd .
SELECT objid
arbpl
INTO CORRESPONDING FIELDS OF TABLE it_crhd
FROM crhd
FOR ALL ENTRIES IN it_equz
WHERE objid = it_equz-gewrk.
ENDFORM. " FILL_CRHD
*& Form FILL_EQKT
* text
* --> p1 text
* <-- p2 text
FORM fill_eqkt .
SELECT equnr
eqktx
INTO CORRESPONDING FIELDS OF TABLE it_eqkt
FROM eqkt
FOR ALL ENTRIES IN it_equz
WHERE equnr = it_equz-equnr.
ENDFORM. " FILL_EQKT
*& Form FILL_VIQMEL
* text
* --> p1 text
* <-- p2 text
FORM fill_viqmel .
ENDFORM. " FILL_VIQMEL
*& Form SHW_DATA
* text
* --> p1 text
* <-- p2 text
FORM shw_data .
LOOP AT it_final1 INTO wa_final1.
WRITE : wa_final1-equnr , wa_final1-eqktx , wa_final1-tplnr , wa_final1-pltxt.
CLEAR wa_final1.
ENDLOOP.
ENDFORM. " SHW_DATA
*& Form POPULATE_LAYOUT
* text
* --> p1 text
* <-- p2 text
*FORM populate_layout .
* is_layout-zebra = 'X'.
* is_layout-colwidth_optimize = 'X'.
* APPEND is_layout.
*ENDFORM. " POPULATE_LAYOUT
*& Form POPULATE_FCAT
* text
* --> p1 text
* <-- p2 text
FORM populate_fcat .
IF 11_flds EQ 'X'.
APPEND 'EQUNR EQUIP NUMBER ' TO it_fldnam.
APPEND 'EQKTX DESC OF EQUIP ' TO it_fldnam.
APPEND 'ERDAT START DATE ' TO it_fldnam.
APPEND 'DATBI END DATE ' TO it_fldnam.
APPEND 'AEDAT CHND ON ' TO it_fldnam.
APPEND 'ILOAN LOC ON ACCOUNT ' TO it_fldnam.
APPEND 'TPLNR FUNC LOC ' TO it_fldnam.
APPEND 'PLTXT DESC FUNC LOC ' TO it_fldnam.
APPEND 'INGRP PLANNER GRP ' TO it_fldnam.
APPEND 'INNAM MAINT PLN GRP ' TO it_fldnam.
APPEND 'DAT_DIFF DATE DIFF ' TO it_fldnam.
ENDIF.
IF 6_flds EQ 'X'.
APPEND 'TPLNR FUNC LOCATION ' TO it_fldnam.
APPEND 'PLTXT DESC OF FUC LOC ' TO it_fldnam.
APPEND 'DATBI END DATE ' TO it_fldnam.
APPEND 'EQUNR EQUIP NUMBER ' TO it_fldnam.
APPEND 'ERDAT START DATE ' TO it_fldnam.
APPEND 'AEDAT CHND ON ' TO it_fldnam.
ENDIF.
ENDFORM. " POPULATE_FCAT
*& Form DISPLAY_ALV
* text
* --> p1 text
* <-- p2 text
FORM display_alv .
*--------------------------------------------------Preparing the Layout*
is_layout-colwidth_optimize = 'X'.
is_layout-zebra = 'X'.
*-------------------------------------------Preparing the Field Catalog*
BREAK-POINT.
LOOP AT it_fldnam INTO wa_fldnam.
is_fieldcat-tabname = 'IT_FINAL'.
is_fieldcat-fieldname = wa_fldnam-fld.
is_fieldcat-seltext_l = wa_fldnam-desc.
is_fieldcat-col_pos = sy-tabix.
IF wa_fldnam-fld = 'EQKTX'.
is_fieldcat-lowercase = ' '.
ENDIF.
APPEND is_fieldcat TO it_fieldcat.
CLEAR : is_fieldcat, wa_fldnam.
ENDLOOP.
*-------------------------------------------------------Calling Display*
IF alv_list = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = is_layout
it_fieldcat = it_fieldcat
it_events = i_events[]
i_default = 'X'
TABLES
t_outtab = it_final
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.
ELSE.
* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
* EXPORTING
* i_callback_program = sy-repid
* i_callback_top_of_page = 'GEN_TOP'
* is_layout = is_layout
* it_fieldcat = it_fieldcat
* it_events = i_events[]
* i_save = g_save
* is_variant = g_variant
* i_default = 'A'
* TABLES
* t_outtab = it_final
* 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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'GEN_TOP'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = is_layout
it_fieldcat = it_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
i_save = 'A'
* IS_VARIANT = g_variant
* IT_EVENTS = i_events[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 20
* I_SCREEN_START_LINE = 30
* I_SCREEN_END_COLUMN = 100
* I_SCREEN_END_LINE = 40
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final
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.
ENDFORM. " DISPLAY_ALV
*& Form GET_DAY_DIFF
* text
* --> p1 text
* <-- p2 text
FORM get_day_diff .
w_time = '00:00:00'.
FIELD-SYMBOLS: <deb> LIKE LINE OF it_final.
LOOP AT it_final ASSIGNING <deb>.
CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
EXPORTING
date1 = <deb>-datbi
time1 = w_time
date2 = <deb>-erdat
time2 = w_time
IMPORTING
datediff = w_diff
* TIMEDIFF =
* EARLIEST =
* EXCEPTIONS
* INVALID_DATETIME = 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.
ELSEIF sy-subrc = 0.
<deb>-dat_diff = w_diff.
* MODIFY it_final FROM WA_FINAL TRANSPORTING dat_diff.
ENDIF.
ENDLOOP.
ENDFORM. " GET_DAY_DIFF
*& Form HAHA_FINAL
* text
* --> p1 text
* <-- p2 text
FORM haha_final .
* FIELD-SYMBOLS: <deb> LIKE LINE OF it_final.
LOOP AT it_iflotx INTO wa_iflotx.
* wa_final1-equnr = wa_iflotx-equnr.
* wa_final1-eqktx = wa_iflotx-eqktx.
wa_final1-tplnr = wa_iflotx-tplnr.
wa_final1-pltxt = wa_iflotx-pltxt.
APPEND wa_final1 TO it_final1.
ENDLOOP.
ENDFORM. " HAHA_FINAL
*& Form DYN_TAB
* text
* --> p1 text
* <-- p2 text
FORM dyn_tab .
LOOP AT it_equz INTO wa_equz.
wa_equz1-datbi = wa_equz-datbi.
wa_equz1-equnr = wa_equz-equnr.
wa_equz1-erdat = wa_equz-erdat.
wa_equz1-aedat = wa_equz-aedat.
APPEND wa_equz1 TO it_equz1.
ENDLOOP.
ENDFORM. " DYN_TAB
*& Form FILL_FINAL1
* text
* --> p1 text
* <-- p2 text
FORM fill_final.
IF 11_flds EQ 'X'.
FIELD-SYMBOLS: <deb> LIKE LINE OF it_equz,
<deb1> LIKE LINE OF it_final.
CLEAR wa_equz.
REFRESH : it_final[].
LOOP AT it_equz ASSIGNING <deb>.
wa_final-equnr = <deb>-equnr.
wa_final-datbi = <deb>-datbi.
wa_final-erdat = <deb>-erdat.
wa_final-aedat = <deb>-aedat.
wa_final-iloan = <deb>-iloan.
wa_final-ingrp = <deb>-ingrp.
APPEND wa_final TO it_final.
CLEAR wa_final.
ENDLOOP.
LOOP AT it_final ASSIGNING <deb1>.
READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = <deb1>-iloan.
<deb1>-tplnr = wa_iloa-tplnr.
ENDLOOP.
LOOP AT it_final ASSIGNING <deb1>.
READ TABLE it_iflotx INTO wa_iflotx WITH KEY tplnr = <deb1>-tplnr.
<deb1>-pltxt = wa_iflotx-pltxt.
ENDLOOP.
LOOP AT it_final ASSIGNING <deb1>.
READ TABLE it_eqkt INTO wa_eqkt WITH KEY equnr = <deb1>-equnr.
<deb1>-eqktx = wa_eqkt-eqktx.
ENDLOOP.
LOOP AT it_final ASSIGNING <deb1>.
READ TABLE it_t024i INTO wa_t024i WITH KEY ingrp = <deb1>-ingrp.
<deb1>-innam = wa_t024i-innam.
ENDLOOP.
ELSE.
REFRESH : it_final[].
LOOP AT it_equz INTO wa_equz.
wa_final-datbi = wa_equz-datbi.
wa_final-equnr = wa_equz-equnr.
wa_final-erdat = wa_equz-erdat.
wa_final-aedat = wa_equz-aedat.
wa_final-iloan = wa_equz-iloan.
APPEND wa_final TO it_final.
CLEAR wa_final.
ENDLOOP.
FIELD-SYMBOLS: <deb2> LIKE LINE OF it_final.
LOOP AT it_final ASSIGNING <deb2>.
READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = <deb2>-iloan.
<deb2>-tplnr = wa_iloa-tplnr.
ENDLOOP.
LOOP AT it_final ASSIGNING <deb2>.
READ TABLE it_iflotx INTO wa_iflotx WITH KEY tplnr = <deb2>-tplnr.
<deb2>-pltxt = wa_iflotx-pltxt.
ENDLOOP.
ENDIF.
ENDFORM. " FILL_FINAL
*& Form DATE_RANGE
* text
* --> p1 text
* <-- p2 text
FORM date_range .
DATA :l_dat TYPE i.
IF s_datbi-high IS NOT INITIAL.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = s_datbi-high
i_datum_von = s_datbi-low
IMPORTING
e_tage = l_dat
EXCEPTIONS
days_method_not_defined = 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.
IF l_dat GT '31'.
MESSAGE e398(00) WITH 'Split Your Planning for a range of 31 Days'(012).
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " DATE_RANGE
*& Form GEN_TOP
* text
* --> p1 text
* <-- p2 text
FORM gen_top .
DATA: info(60),
w_dt TYPE d.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = 'ALV DISPLAY'.
APPEND ls_line TO gt_list_top_of_page.
CONCATENATE 'Date :' s_datbi-low ' TO ' s_datbi-high INTO info SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = info.
APPEND ls_line TO gt_list_top_of_page.
CLEAR ls_line.
ls_line-typ = 'A'.
ls_line-info = 'By Debarshi Roy'.
APPEND ls_line TO gt_list_top_of_page.
* Generate the End of Page
* CLEAR ls_line.
* ls_line-typ = 'H'.
* ls_line-info = 'ECL'.
* APPEND ls_line TO gt_list_end_of_page.
CLEAR: ls_line.
* PERFORM generate_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page
i_logo = 'DEB'.
ENDFORM. " GEN_TOP
*& Form POPULATE_EVENTS
* text
* --> p1 text
* <-- p2 text
FORM populate_events .
DATA: l_i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = i_events[].
*----- Pass top-of-page
READ TABLE i_events WITH KEY name = slis_ev_top_of_page
INTO l_i_event.
IF sy-subrc = 0.
MOVE formname_top_of_page TO l_i_event-form.
APPEND l_i_event TO i_events.
ENDIF.
CLEAR l_i_event.
*----- Pass end-of-page
READ TABLE i_events WITH KEY name = slis_ev_end_of_page
INTO l_i_event.
IF sy-subrc = 0.
MOVE formname_end_of_page TO l_i_event-form.
APPEND l_i_event TO i_events.
ENDIF.
CLEAR l_i_event.
*----- Pass user-command
READ TABLE i_events WITH KEY name = slis_ev_user_command
INTO l_i_event.
IF sy-subrc = 0.
MOVE formname_user_command TO l_i_event-form.
APPEND l_i_event TO i_events.
ENDIF.
ENDFORM. " POPULATE_EVENTS
*& Form generate_top_of_page
* text
*FORM generate_top_of_page.
* CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
* EXPORTING
* it_list_commentary = gt_list_top_of_page
* i_logo = 'DEB'.
*ENDFORM. "generate_top_of_page
*& Form generate_end_of_page
* text
FORM generate_end_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_end_of_page
* I_LOGO =
ENDFORM. "generate_end_of_page
*& Form F4_FOR_VARIANT
* text
* --> p1 text
* <-- p2 text
FORM f4_for_variant .
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
IMPORTING
e_exit = g_exit
es_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF g_exit = space.
p_vari = gx_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " F4_FOR_VARIANT -
Adding one field in selection-screen in rfitemar
hi experts
1) I am converting the rfitemar to z or y program after that i have to add one field wbs element(projk) in selection screen.
2) The WBS Element values should be displayed in the output report ie one column which contain wbs element values .
Plz help me as soon as possibleHi,
In this report,
1. find out the final table for display.
2. add ur custom fields in that table using appending structure.
3. find out correct enchance spot or BADI,...etc...before diaply(befor calling FM REUSE_GRID_DISPLAY or method SET_TABLE_for_display or..etc).
4. in that enchance spot or badi u can write ur logic.
Regards,
Ramesh. -
One question about Selection screen
Hi experts,
I am writing a report, on the selection screen, I need to input the file path and then do the file upload.
My question is about how to check the file path I put is correct or not? If it is incorrect, I want to get a message and the cursor still in the field and don't jump to the next page.
How can I do like that?
Any one has any suggestion, please help me.
Thanks in advance.
Regards,
Chris GuHi Chris,
do it this way: check my code after calling gui_upload what condition i am using.
parameters:
p_file type rlgrap-filename. " File name
* AT SELECTION-SCREEN ON VALUE-REQUEST EVENT
at selection-screen on value-request for p_file.
perform get_file_name.
* AT SELECTION-SCREEN EVENT
at selection-screen on p_file.
perform validate_upload_file.
* Form GET_FILE_NAME
form get_file_name.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
importing
file_name = p_file.
endform. " GET_FILE_NAME
* Form VALIDATE_UPLOAD_FILE
form validate_upload_file.
data:
lw_file type string. " File Path
lw_file = p_file.
call function 'GUI_UPLOAD'
exporting
filename = lw_file
filetype = 'ASC'
has_field_separator = 'X'
dat_mode = 'X'
tables
data_tab = t_final_data.
IF sy-subrc ne 0 and t_final_data is initial. " here message if file path is wrong
Message 'File not found' type 'E'.
ELSEIF sy-subrc eq 0 and t_final_data is initial.
Message 'File empty' type 'E'.
ENDIF.
endform. " VALIDATE_UPLOAD_FILE
With luck,
Pritam.
Edited by: Pritam Ghosh on May 8, 2009 8:57 AM -
Some items of selection-screen not showing after migration to QA
Hi Folks,
I'm trying to help a colleague with something rather weird:
After migrating code-changes from our DEV- to our QA-environment (SAP_BASIS 620, SAP_APPL 470), a newly added block of the selection-screen doesn't show up. We already spent quite some time debugging and tracing in both DEV and QA but cannot really spot a difference. The new block (B2) and field (S_DATE) show up in the selection-screen internal table SCREEN and the content looks to be identical. In addition to the complete block B2 missing, the frame-title for B3 has also gone AWOL.
This is happening for a rather straighforward selection-screen definition:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
PARAMETERS : p_eaddr LIKE somlreci1-receiver OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t27.
SELECT-OPTIONS :
s_date FOR hrp1001-endda NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t23.
PARAMETERS : p_tstrun AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b3.
During debugging I already single stepped through programs like RSDBRUNT, SAPLSVAR and RSDBSPBL but nothing jumped out at me which could explain the difference between development and QA.
Do you have an idea where (else) we could look?
Thanks much and Cheers
BaerbelHi Vikranth!
Thanks for your quick reply and suggestion which I immediately followed and - guess what? - it worked! The selection-screen now looks like it should.
As we never before had this type of issue it never occurred to us to just regenerate the program in QA - next time we'll know and first try this simple fix.
Thanks again!
Cheers
Baerbel -
The Calendar seems to show on the notifications screen, with room for 3 entries, regardless of settings. Any way to limit it to one, or get it off the notifications screen?
You're talking about two different things: notifications and widgets. The lock screen will only show notifications that you've enabled to show there. When you open notification center, there are two views: "Today" and "Notifications." Today shows widgets. That is where you see the calendar with room for events. It is basically a preview of your upcoming calendar. Under notifications is where you will get notifications if upcoming appointments that have reminders. The settings for each screen are different.
To control your calendar notifications, go to settings--notifications--calendar.
To control the widget, pull down notification center and select edit.
You can turn off the widget but still receive notifications in notification center and on your lock screen or vice versa. -
For a give sd-document type and a give item category group, the system now automatically picks up a certain item category. We are able to manually change this based on settings in the allocation for the item categories. Is it possible to have the system for certain materials of the same type (LEIS) set the item category automatic to the one which we manually can change?
Today in our allocation we have this:
ZAB1 LEIS ZA1 ZAB1 ZL2N
I would for some materials be able to have this set:
ZAB1 LEIS ZA1 ZL2NHi Simen,
No you cannot do that. The item category is determined based on the following
1) Document Type
2) Item Category Group
3) Usage
4) Higher Level Item Category
In your case the document type as well as the item category group are the relevant fields and they happen to be the same.
Regards
Nadarajah Pratheb -
Dear all,
I wonder how to add a selection screen in order to display all the open item I selected for a given vendor in a different view mode. Currently if I choose from FBL1N (after having executed a select on open items for a given vendor for instance) "Environment" and then "Display document" I have in term of result one document per screeen and per item while I would like to have when choosing "Display document" a selection screen and then in term of result a list in one screen with item and details that I would have selected.
Do I have to work on the "PAI module" and "Screens" of the SAPMSSY0 program?
Regards.
Nozome.I think the 'filter' option already provides the functionality you want. Click on the filter icon and then choose the document number and after that enter the document numbers you want to operate on. This will reduce your list to these documents. Then when you use environment->display document it will limit you to the documents you have filtered on.
I think the option of modifying the standard program is a bit extreme. The program to change would be RFITEMAP but if you realy wanted to do this I believe you should at least clone it rather than change a sap standard abap. -
Print Selection Screen Parameters in ALV report only once
Does anyone know how to print the selection screen within a ALV report.
I've tried everything. I have the code to capture the selection parameters into a internal table. I can use top_of_page but I only want it printed once.Hi,
If you have captured the selection screen entries in an internal table, then you could display it once by using the BLOCK LIST ALV.
Check the function module.
REUSE_ALV_BLOCK_LIST_DISPLAY
Using this function module more than 1 alv could be display in the report.
In our case ..there will be two alvs ...one for the selection screen n other for the main report output.
Check the following example on the block List ALV....
<b>BALVBT01</b>.
Regards,
Vara -
How to display a screen in selection-screen?
hi friends,
I have a requirement. I have one PNP database SELECTION-SCREEN in my report program. And i have created one more screen using screen painter.
Now i hae to display that screen which i created using screen painter under PNP SELECTION-SCREEN.
For ex:
PNP SELECTION-SCREE.
Pernr Number _______________
Employe Name _______________
Company Code _______________
Payroll Area ________________
Now after this i have to display my screen which i designed using screen painter.
As shown below.
O In rupees
O In Percentage
Variance______
Here i specified some fields only. some more fields also there.
For this i did as....
I created a BUTTON in SELECTION-SCREEN. And when the user clicked on this then screen will appear as window.
It's working fine.
It's look like this.
|More Selections...| -
> Button
But,my client required that screen also wants to display directly under PNP SELECTION-SCREEN but not as window and clicking button.
If Any Help.. Plz....
Thanks & Regards,
Shree.hi prakash,
thanks for ur solution.
but it's not working properly. while changing 1000 screen and activating, it's showing syntax error like this.
while changing:
==> Element PNPS$MCD touches or overlaps other element
==> Selection screen: Report generation makes screen changes ineffective
==> Element PNPS$MCD touches or overlaps other element
While Activating:
Syntax Error in Screen.
Program <myprogram name>
Screen 1000
Position Flow Logic Line 95
The include block has been used twice.
But, Here i clicked the button "Activate".
Then It's showing messages as this.
==> Selection screen: Report generation makes screen changes ineffective
==> Element PNPS$MCD touches or overlaps other element.
I checked out that Line 95.
There i am specifying my suscreen as this.
CALL SUBSCREEN subscreen1 INCLUDING sy-repid 106.
at end of PBO.
And in PAI.
CALL SUBSCREEN subscreen1.
Finally when i tried to execute it's giving DUMP.
Any solutions..
Thanks & Regards,
Shree. -
ABAP Query - Selection Screen Values Usage
Hi,
I have created an ABAP Query. For one of the selection-screen fields (CAUFV-FTRMI)
which is select-options, I want to use the values during coding (in the where clause of a select query)
in Extras section under the event "record processing". Please suggest how to make the the selection-screen values
available during record processing event. Thanks in advance.
Regards,
Tejas SavlaHi Kartik,
I need to fetch data from some table KEKO depending on the values entered on the selection-screen for the field CAUFV-FTRMI. So, I need to find a way by which the selection-screen input values are available in the record processing event. The values are available in some variable SP$00002 of the automatically generated report program. But, this variable cannot be used in the Coding section of the ABAP QUERY. Please advise.
Thanks & Regards,
Tejas Savla -
Dynamic text in selection screen
Hi all,
I have one requirement in selection screen. I have a parameter and one pushbutton in selection screen .
To the right side of the parameter, i need to display the text based on some manipulation in a internal in the program.
If I click on the pushbutton in selection screen , manipulations will be done in the program in a internal table. if the result is ok i need to display the text in the right side of the parameter otherwise no need to display.
How can I achieve this.
Urgent
Thanks
SaravanaHi
Write the code in the
AT selection-screen ON PARAMETER of the Button.
So when pressed on button, that code will do some process and the result will be displayed.
check it, whether it displays the text or not on selection screen.
see the doc
AT SELECTION-SCREEN - selscreen_event
Syntax
| { ON {para|selcrit} }
| { ON END OF selcrit }
| { ON BLOCK block }
| { ON RADIOBUTTON GROUP radi }
| { }
| { ON {HELP-REQUEST|VALUE-REQUEST}
| FOR {para|selcrit-low|selcrit-high} }
| { ON EXIT-COMMAND }.
Alternatives:
1. ... OUTPUT
2. ... ON {para|selcrit}
3. ... ON END OF selcrit
4. ... ON BLOCK block
5. ... ON RADIOBUTTON GROUP radi
6. ... { }
7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
{para|selcrit-low|selcrit-high} }
8. ... ON EXIT-COMMAND
Effect
These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr.
Alternative 1
... OUTPUT
Effect
This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.
Note
The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
Alternative 2
... ON {para|selcrit}
Effect
This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
Note
If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
Alternative 3
... ON END OF selcrit
Effect
This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked.
Alternative 4
... ON BLOCK block
Effect
This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again.
Alternative 5
... ON RADIOBUTTON GROUP radi
Effect
This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again.
Note
The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
Alternative 6
Effect
The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again.
Alternative 7
... ON { HELP-REQUEST | VALUE-REQUEST } FOR
{para|selcrit-low|selcrit-high} }
Effect
The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.
In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
Notes
These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database.
With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
Alternative 8
... ON EXIT-COMMAND
Effect
This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.
Example
In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr.
REPORT demo_at_selection_screen.
Global data
DATA: sflight_tab TYPE TABLE OF sflight,
sflight_wa LIKE LINE OF sflight_tab.
Selection screens
PARAMETERS p_carrid TYPE spfli-carrid.
SELECTION-SCREEN BEGIN OF SCREEN 500.
SELECT-OPTIONS s_conn FOR sflight_wa-connid.
DATA s_conn_wa LIKE LINE OF s_conn.
SELECTION-SCREEN END OF SCREEN 500.
Handling selection screen events
AT SELECTION-SCREEN ON p_carrid.
IF p_carrid IS INITIAL.
MESSAGE 'Please enter a value' TYPE 'E'.
ENDIF.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD p_carrid
ID 'ACTVT' FIELD '03'.
IF sy-subrc = 4.
MESSAGE 'No authorization for carrier' TYPE 'E'.
ELSEIF sy-subrc <> 0.
MESSAGE 'Error in authority check' TYPE 'A'.
ELSE.
IF sy-ucomm = 'ONLI'.
CALL SELECTION-SCREEN '0500'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN.
IF sy-dynnr = '0500'.
IF s_conn IS INITIAL.
MESSAGE 'Please enter values' TYPE 'W'.
ELSE.
SELECT *
FROM sflight
INTO TABLE sflight_tab
WHERE carrid = p_carrid AND
connid IN s_conn.
IF sy-subrc <> 0.
MESSAGE 'No flights found' TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
Main program
START-OF-SELECTION.
Reward points if useful
Regards
Anji
Message was edited by:
Anji Reddy Vangala -
Hide Save Button and also there should be no parmeters on Selection screen.
I want to Hide the execute button as well i don't want any input parameteres on Selection screen.But i m not able to do so..since there needs to be atleast one parameter in SELECTION ScREEN.
I need to execute this program in BackGround. And the Input file i m getting throuhg DIRECTORY in AL11 Tcode.
So i don't want any Buttons in selection screen.....USER WILL 'EXECUTE IN BACKGROUND' .
But after executing my code Execute button is hidden but i also need to specify a parameter in SEL.Screen.
following is the code i wrote :
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS : p_file LIKE rlgrap-filename .
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
APPEND 'ONLI' to itab.
*CLEAR itab.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = '%_00'
p_program = sy-repid
TABLES
p_exclude = itab.DATA: itab type TABLE OF string." WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECTION-SCREEN begin of line.
PARAMETERS: p1.
SELECTION-SCREEN COMMENT 3(50) text .
SELECTION-SCREEN end of LINE.
SELECTION-SCREEN END OF BLOCK b2.
INITIALIZATION.
text = 'This report can only excute in background'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
if screen-name = 'P1'.
screen-input = 0.
screen-ACTIVE = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
APPEND 'ONLI' to itab.
*CLEAR itab.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = '%_00'
p_program = sy-repid
TABLES
p_exclude = itab. -
Setting default date range in selection screen when executing as batch job.
Hi Guys,
I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
Lower value = today date
higher value= next week run date.
How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
<REMOVED BY MODERATOR>
Thanks in advance,
Vinod.
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PMHi Vinod,
Would suggest you to this.
Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
Now goto create a variant from SE38 for the report.
While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
Select the option "D: Dynamic date calculation" for both the date fields.
For p_start_date - select the option "Current Date"
For p_end_date - select the option "Current date +/- ??? days" and put 7 in the pop up.
Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
Now, in the program, first step after START-OF-SELECTION code the following:
RANGES: r_date FOR sy-datum.
start-of-selection.
refresh r_date.
r_date-sign = 'I'. r_date-option = 'BT'.
r_date-low = p_start_date. r_date-high = p_end_date.
append r_date.
Hence this way, you would have built your range and use it as needed.
Cheers,
Aditya
Maybe you are looking for
-
How do I delete an email account on ipad
I have switched internet providers and cannot seem to delete my former email address which is associated with my former acct. id. I have changed my email address and account info in itunes and for my apple account but this is not translating to my
-
Hello Experts, We are actually consolidating 2 Legal Entities into a single one - I guess the account balances of the 2 will be rolled up into a single or multiple accounts of the new legal enitity.However these are my 2 questions : 1. What happens t
-
I create a mobile game. How to get the signing key?
I create a mobile game. How to get the signing key? Is the certificate is payable? Sorry if the topic is in the wrong section.
-
Cannot install latest updates for Bridge and Photoshop CC. I get the following message: "Update Failed. The download appears corrupted. U43M1D207." I have tried to install at different times over three different days with the same result each time.
-
Have a user that has PAB Distribution List outlook 2003 xp and migrated to win7 Outlook 2010 looses all addresses in the Group/Distro List group imports, just will not show addresses in the distro or it removes them. I opened the same PAB and distro