User option in selection screen of report
In a report, want to give user an initial option of Calendar year/month OR calendar year/week...
Only the one the user wants should be displayed on the selection screen.
1 Is there a way to give user an option while running the query before the selection screen(variables - uesr input) of the report appears
OR
2 Is there a way to give user a toggle option on the selection screen which displays either calendar year/month or calendar year/week based on user choice but not both.
I am aware that user can easily toggle once the report has been executed, but the purpose is to give user this option initially.
As of now, in the report at the selection screen there are four periods based on calendar year/month. (to facilitate comparison of periods)
eg (m- cal year/month, w - cal year/week)
P1(m)
P2(m)
P3(m)
P4(m)
If we add four more for week
then user will have a cluttered selection screen (as there are many other selection options apart from time)
eg 8 time choices
P1(m)
P2(m)
P3(m)
P4(m)
P1(w)
P2(w)
P3(w)
P4(w)
What I need is a way for at any time, either cal year/month or cal year/week is visible based on user choice.
In a report, want to give user an initial option of Calendar year/month OR calendar year/week...
Only the one the user wants should be displayed on the selection screen.
1 Is there a way to give user an option while running the query before the selection screen(variables - uesr input) of the report appears
OR
2 Is there a way to give user a toggle option on the selection screen which displays either calendar year/month or calendar year/week based on user choice but not both.
I am aware that user can easily toggle once the report has been executed, but the purpose is to give user this option initially.
As of now, in the report at the selection screen there are four periods based on calendar year/month. (to facilitate comparison of periods)
eg (m- cal year/month, w - cal year/week)
P1(m)
P2(m)
P3(m)
P4(m)
If we add four more for week
then user will have a cluttered selection screen (as there are many other selection options apart from time)
eg 8 time choices
P1(m)
P2(m)
P3(m)
P4(m)
P1(w)
P2(w)
P3(w)
P4(w)
What I need is a way for at any time, either cal year/month or cal year/week is visible based on user choice.
Similar Messages
-
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 -
Layout Option on Selection Screen For Zreport
Hi All,
Plz explain how to do coding for using Layout option on selection screen of
report. Also i should be able to save and create new layout on selection screen.
Thnaks in advance.
Aniket Dayamahi,
creation of sub-screens.
selection-screen begin of tabbed block <name of the tab> for < height of the tab in no's> lines.
eg;
selection-screen tab(20) l1 <data element> user-comand <name of the funcion code>
selection-screen end of block <name of the tab strip>.
eg;
selection-screen begin of tabbed block mytab for 10 lines.
selection-screen tab(20) l1 user-command tab1.
selection-screen tab (20) l2 user-command tab2..
selection-screen end of block mytab.
Under initialization.
data element = text-01.
data element = text=02.
How to initialize the tab with default screen.
<name of the tab> - prog = sy-repid.
<name of the tab>- dynnr = '<subscreen no>'.
<nane of the tab>-activetab = '<user-command for the strip>
if this has solved ur problem then dont forget to reward with points.
with regards,
madhuri. -
PS:Copy of MBBS report with Date(GR) selection option in selection screen.
Hi,
We are developing a report, which is Copy of MBBS report, addition as Date(GR) selection option in selection screen to view historical data {i.e.Project Stock(Q) on back dates}.
MBBS is showing Project Stock w.r.t. WBS. So pls suggest Table, which can fulfill the requirement to show the Project Stock from GR w.r.t. Purchase and Production order in back date w.r.t. that WBS.
Pls do the needful.
Thanks,
Amit Jain.Hi Amit ,
The Project Stock Table is MSPR , and the Project stock history table is MSPRH .
Though not through with your actual requirement , There is a standard Report MB5B -- Stock on Posting Date . In the selection screen , we can have the Special Stock Q (Project Stock ) .
If you can develop copying this report instead of MBBS , it would take care of receipts as well as issues ,and from the material Document you can build a relation to the account assignment WBS/Network Activity through MSEG Table .
Hope it helps .
thanks and regards
Kish -
AT SELECTION-SCREEN stops report
Hello,
I run a report using the AT SELECTION-SCREEN stmt.
Below AT SELECTION-SCREEN is an IF ... ELSE block. Within that block the report checks, whether the user input (made in a SELECT-OPTIONS) complies some requirements.
I check for example, if that what the user types in matches a defined string...
But if i use an AT SELECTION-SCREEN, the report does not continue after execution after that!
It returns to the selction screen...
How can I achieve, that the report continues with execution...?
Thx,
holgerHi Holger,
1. This is the default behaviour.
2. For report purpose execution,
the event is
START-OF-SELECTION ( and not at selection-screen)
3. However u CAN ACHIEVE this by :
after all validations , use the syntax
LEAVE TO LIST-PROCESSING.
4. I tried the same at my end,
its working fine.
5. However, if u use step 3,
there will be a problem :
after the execution of report,
it wil get HANG. ie. it won't then
get back using the toolbar buttons.
U may try it for yourself.
6. Bottom line is:
use
START-OF-SELECTION (FOR FINAL EXECUTION OF THE REPORT)
Regards,
Amit M.
Message was edited by: Amit Mittal -
Side by side select options in selection screen
Hai Gurus,
In a report, I need to place Period From and Period To date select-options in selection screen.
In one line (i.e side by side).
Appreciate your immediate response.
Thanks and Regards,
Kiran.Thanks to all,
I got it.
my code here.
SELECTION-SCREEN: BEGIN OF BLOCK sel1 WITH FRAME TITLE text-sel.
PARAMETERS: SUMMARY AS CHECKBOX USER-COMMAND SUMMARY.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(13) text-pfr.
SELECT-OPTIONS: VALID_FR FOR ZZUTIL_RATE-VALID_FR MODIF ID RAM no intervals NO-EXTENSION. "changed
SELECTION-SCREEN COMMENT 30(13) text-pto.
SELECT-OPTIONS: VALID_TO FOR ZZUTIL_RATE-VALID_TO no intervals NO-EXTENSION. "changed
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN: END OF BLOCK SEL1. -
How to generage pop up screen on selection screen of report program?
Hi Guys,
I am having a requirement to generate the <b>pop up screen on the selection screen</b> of the report program.
Suggest me the best one with model programHi Chakradhar,
Refer this code :
SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-456.
PARAMETERS PO RADIOBUTTON GROUP RADI USER-COMMAND R.
SELECTION-SCREEN END OF BLOCK BL2.
AT SELECTION-SCREEN OUTPUT.
CALL SCREEN 100.
when user will click on this radio button , a pop up screen will appear dynamically.
Reward points if helpful.
Regards,
Hemant -
Folder or File path when f4 option on selection screen is clicked
can any one please let me know if there is a function module which can fetch folder name form the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requirment is like I have to select either folder name or the file name depending on user selection.
HI
use the following
FORM GETFILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = '.'
MASK = ' '
MODE = ' '
TITLE = ' '
IMPORTING
FILENAME = TXT_FILE
RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>TMP_GUI_DIRECTORY_LIST_FILES</b>
Retrieve all of the files and subdirectories on the Presentation Server (PC) for a given directory.
Example:
data: lc_directory like bdschko16-target_dir value 'C:\TEMP\',
lc_filter(20) type c default '.'.
li_file_count type i,
li_dir_count type i,
ltab_dir_table like sdokpath occurs 0 with header line,
ltab_file_file_table like sdokpath occurs 0 with header line.
call function 'TMP_GUI_DIRECTORY_LIST_FILES'
exporting
directory = lc_directory
filter = lc_filter importing
file_count = li_file_count
dir_count = li_dir_count
tables
file_table = ltab_file_table
dir_table = ltab_dir_table
exceptions
cntl_error = 1
others = 2.
regards vijay -
Creating Selection screen in Report Painter
Good day everyone,
Does anyone know how I could create a selection screen in Report Writer? Thanks!
>Christian<Hi,
Simple Parameters or Selec-options statements will suffice.
Eg : Parameters : p_matnr type mara-matnr.
select-options : s_matnr for mara-matnr.
In selection screen, you may have selec-options, parameters, check boxes, radio buttons etc.
Regards,
Sujatha. -
Modification on selection screen of report
Hello guys,
I have a requirement where in i need to modify the initial selection screen as per clients requirement. The scenario is as follows:
Suppose 'EMPLOYEE' and 'PORTFOLIO' are two of the fields of a cube on which the report will be run. Now suppose there are three employees as A, B and C and A handles portfolios X & Y, B handles portfolios W & Y while C handles portfolios X & Z.
The initial selection screen of report will have two selection fields first as the employee and second as the portfolio.
When we do F4 at employee it will display A, B and C. Now the requirement is if we F4 at portfolio it should display only the relevant one for that employee.
For example: if i give employee as A and when i do F4 at portfolio screen it should give me only X and Y and not all the portfolios viz. W, X, Y & Z
Is there a way to achieve the above scenario????Hi Chakradhar,
Refer this code :
SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-456.
PARAMETERS PO RADIOBUTTON GROUP RADI USER-COMMAND R.
SELECTION-SCREEN END OF BLOCK BL2.
AT SELECTION-SCREEN OUTPUT.
CALL SCREEN 100.
when user will click on this radio button , a pop up screen will appear dynamically.
Reward points if helpful.
Regards,
Hemant -
Calling the selection screen of report with data for the selection field
I have the selection screen with 2 fileds.
sales order and payment terms.
My requirement is to update the payment terms into the ztable for the given order.
Sometimes the payment terms will be there ie already maintained ,in that case i need to show to the user the existing payment term ,so that he can modify and save that one.If the payment term is not existing then simply i can go inside the program and update the payment term.
What I thought of doing is , writing a report program and then after the user inputs the selection screen ie order number , I Will check in the ztable and if the payment terms is found then i will use the key word leave list processing. But i dont know how to populate the payement term in the selection screen oncegaing from the programHi shiva,
when the user enters sales order number on screen, in parameter 1,
you want to show payment term, on selection screen itself, in parameter 2.
We can use the event
AT SELECTION-SCREEN.
Eg. PO Number <----
> User
Below is sample code for same.
If you enter PO Number, the system will show the corresponding user in parameter2.
Just copy paste.
REPORT YAM_TEMPA09.
PARAMETERS : EBELN LIKE EKKO-EBELN.
PARAMETERS : ERNAM LIKE EKKO-ERNAM.
AT SELECTION-SCREEN.
ERNAM = ''.
SELECT SINGLE ERNAM
FROM EKKO
INTO ERNAM
WHERE EBELN = EBELN.
regards,
amit m. -
To add Language selection option on Selection Screen
Hi All,
I have one Report Writer Report.
In that Report I have created Basic Sets, Single sets and Multi Sets for G/L Account.
I need to output this Report in two different language.
1) Engish
2) Chinese
But I need to put the option on Selection Screen for Language Selection (whether English or Chinese).
How to add this option on Selection Screen. Please Guide me soon.
Regards,
RishiHi Ashok,
But when I hev created the sets, I have given the description of G/L Accounts in English. But when I will run the Report using Cinese as Logon language, how output will come in Chinese.
1) Is there a need to maintain /L Accounts in Chinese language.
2) or Shall i create the sets by giving description for G/L Accounts in Chinese If Yes then how to hadndle at run time..
please guide I am new to Report writer.
Regards,
Rishi -
Printer option in selection screen (Input Parameter)
Hi All,
I want to give printer option in selection screen.
Please do needful help.
Regards.Hi,
in the PF-STATUS if u enable the Printer Icon on Application Tool Bar and in the PAI Event in the
User Command Module get the FCODE and apply the following FM ALINK_PRINT_FRONTEND
Hope this works ....
Best of luck!!
Thanks
Ravi -
How we can assign the customised selection screen to report category
hai
gurus
how we can assign the customised selection screen to report categoryHi Naresh,
You can do like this.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME.
SELECT-OPTIONS: S_FKART FOR VBRK-FKART.
SELECT-OPTIONS: S_FKDAT FOR VBRK-FKDAT OBLIGATORY.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
SELECT-OPTIONS: S_AUART FOR VBAK-AUART.
SELECTION-SCREEN END OF BLOCK SELECTION.
SELECTION-SCREEN END OF BLOCK B1.
if you give me brief i can help you out more.
Thank you .
Regards
Ram -
Adding gsber in selection screen of report painter
To gurus,
I have a small requirement, I have to get business area (GSBER) in selection screen of report.
I have developed the report using report painter FGI1 --FAGLFLEXT which is having gsber field.
In selection screen it self i want this GSBER FIELD .How to achieve it.
kindly guide me.
regards,
padmaja.Hi
What I understand from your question is you want bussiness area value on selection screen you can achive this by just using the by export/import parameter or by get/set parameter id.
Please elaborate what exactly you want.
Regards
Sagar.
Maybe you are looking for
-
No .Mac Web Gallery visible in iWeb
I published a gallery with 3 albums in it and can see them in Safari. However, when I try to use Insert/.Mac Web Gallery, there is noting available to insert. How do I make the Gallery visible to iWeb. Also the .jpg files are low quality. Is there so
-
I am using Firefox 5 in Ubuntu 11.04 Natty. When Firefox tries to sync it gives an error; "incorrect account name or password". I went to the "change password" link, followed the emailed link, changed my password and updated the password in Sync pref
-
I was reviewing audio books on my wish list and the list just became empty. I have stopped and restarted iTunes and I have manually re-logged into my apple account but the list keeps coming up empty. I have tried both the shortcut on the top right
-
No access to Enterprise Services via Visual Composer
Hi, I've configured the new landscape of EsWorkplace (HU2/800) in the Visual Administrator. After I start the Visual Composer and log in I get the list of Enterprise services normally, but when I click on the Enteprise Service to get the Data service
-
ThinkPad Twist S230u - Call using video doesn't work and the laptop make a lot of noise
Everytime I try to make any kind of call using video (through skype or any other software), the laptop just reset by itself. Also, everytime that I use the laptop it makes a lot of noite, it is uneareble!!! I would like to know what should I do, and