Difficulty in adding new parameter in selection screen of GR55 report
Hi Gurus,
I have a requirement to add an extra field in Cost center:Act/Plan/Comm CC Cur report.This is otherwise a Z report in report painter with 0% code (T-code : GR55-> Report group->Report).But,when we go to technical information of this report,it has four standard sap programs,which contains code for this selection screen.It does not even have a modification scope.
Selection screen of this report contains following parameters:
Selection values:
Controlling Ar
Fiscal Year
From Period
To Period
Plan Version
Selection Groups:
Cost Center Group
Or value(s)
Cost Element Group
Or value(s)
My requirement is to add one more parameter : Purchase oeder in new block:
Is there any way to achieve it.
Note: Copying the standard progs into custom prog is not working,i already tried that.
Please let me know your suggestions,if any one of you came across such requirement before.it is very impoertant for me.
Thanks in advance,
Meenakshi
Hi meenakshi239,
you can always use implicit enhancement spots.
Regards,
Clemens
Similar Messages
-
Adding new modules to Selection-screen
Hi everyone,
I created 3 selection-screens for my report, but I needed to control better their jump between screens, so I added PAI modules on each screen.
The thing is that when I make a change on one of the screens the calling of the module disapears, so I just kept on placing the calls and avoided the change in the screens.
No the problem is, when I transported my report to the quality system, everything was fine, with my modules in my code. Now I transported a change and in the quality system, the calls where lost.
Any ideas how to transport everything?!
ThanksYou must not modify the screen (add PAI or PBO) with a program type 1 (report).
If you want to modify screen, you change your program type module pool and create the screens.
Salu2. -
Adding new table dynamic selection screen of transaction FBL5N (LDB DDF).
Hi,
I have a requirement to add SEGMENT (CEPC-SEGMENT) field on the dynamic selection screen of transaction FBL5N (LDB DDF).
Please let me know how can I meet this requirement
ThanksI did not find any screen exits for this Tcode, may be you need to use enhancement spots.
-
How can I add a new field in selection screen for this report
*& Report ZGS_BARKODLA_HIZLI_GIRIS
report zgs_barkodla_hizli_giris.
tables: mara,
mseg,
mch1,
*mch1,
mkpf,
mchb ,
makt.
type-pools: esp1.
data: i_message_tab type esp1_message_tab_type,
wa_message_tab type esp1_message_wa_type ,
sc_count type i.
ALV
type-pools: slis, kkblo.
data: gs_layout type slis_layout_alv ,
gt_fldcat type slis_t_fieldcat_alv with header line,
gt_header type slis_t_listheader with header line,
gt_sortin type slis_t_sortinfo_alv with header line,
g_repid like sy-repid .
define add-fieldcat.
gt_fldcat-fieldname = &1.
gt_fldcat-ref_tabname = &2.
gt_fldcat-seltext_s = &3.
gt_fldcat-seltext_m = &3.
gt_fldcat-seltext_l = &3.
gt_fldcat-reptext_ddic = &3.
gt_fldcat-ddictxt = 'M'.
append gt_fldcat.
clear gt_fldcat.
end-of-definition.
types: begin of titab,
sel type xfeld,
matnr type matnr,
maktx type maktx,
charg type charg_d,
menge type menge_d,
erfmg type erfmg,
end of titab.
data : witab type titab.
data : itab type table of titab.
data : ok_code type sy-ucomm.
controls: tc_itab type tableview using screen 0100.
data: gv_header like bapi2017_gm_head_01,
gv_code like bapi2017_gm_code.
BAPI export parameters
data: gv_headret type bapi2017_gm_head_ret,
gv_matdoc type bapi2017_gm_head_ret-mat_doc,
gv_matyear type bapi2017_gm_head_ret-doc_year.
data : lv_objek like inob-objek .
data : ls_inob like inob .
data : imseg type ty_t_mseg.
data : wmseg type mseg.
data : answer.
data : count type i.
data : v_atinn type atinn.
BAPI movement details
data: i_goodsmvt_items type bapi2017_gm_item_create occurs 0
with header line.
data: i_return type bapiret2 occurs 0 with header line.
start-of-selection.
call function 'CONVERSION_EXIT_ATINN_INPUT'
exporting
input = 'Z_ORAN'
importing
output = v_atinn.
call screen 100.
*& Module status_0100 OUTPUT
module status_0100 output.
set pf-status '100'.
set titlebar '100'.
mseg-werks = 1000.
mseg-umwrk = 1000.
**added
sc_count = sc_count + 1.
if sc_count eq 1.
mseg-bwart = 313.
endif.
mkpf-budat = sy-datum.
**added
describe table itab lines tc_itab-lines.
endmodule. " status_0100 OUTPUT
*& Module user_command_0100 INPUT
module user_command_0100 input.
data field(20).
data: line_t like sy-index.
data: lines like sy-index.
data line_count like sy-loopc.
data: begin of cols,
screen like screen,
index type i,
selected(1) type c,
vislength like icon-oleng,
invisible(1) type c,
end of cols.
case ok_code.
when 'DELE'.
delete itab where sel eq 'X'.
when 'ENTE'.
check *mch1-charg is not initial.
read table itab into witab with key charg = *mch1-charg.
if not sy-subrc is initial.
witab-charg = *mch1-charg.
select single matnr from mch1 into witab-matnr
where charg eq witab-charg.
if not syst-subrc is initial.
set cursor field '*MCH1-CHARG'.
message e115(12) with *mch1-charg.
endif.
select single maktx from makt into witab-maktx
where matnr eq witab-matnr
and spras eq syst-langu.
witab-erfmg = 1.
concatenate witab-matnr witab-charg into lv_objek .
clear ls_inob .
select single * into ls_inob
from inob
where objek = lv_objek and
klart = '023' and
obtab = 'MCH1' .
select single atflv from ausp into witab-menge
where objek = ls_inob-cuobj and
klart = '023' .
append witab to itab.
**added
clear *mch1-charg.
**added
endif.
when 'SAVE'.
if mkpf-budat is initial.
set cursor field 'MKPF-BUDAT'.
message e055(00).
endif.
if mseg-lgort is initial.
set cursor field 'MSEG-LGORT'.
message e055(00).
endif.
if mseg-umlgo is initial.
set cursor field 'MSEG-UMLGO'.
message e055(00).
endif.
if mseg-bwart is initial.
set cursor field 'MSEG-BWART'.
message e055(00).
endif.
refresh imseg.
loop at itab into witab.
move-corresponding witab to wmseg.
append wmseg to imseg.
endloop.
call function 'ZMM_POPUP_WITH_DATA'
exporting
imseg = imseg
importing
answer = answer.
if answer eq 'Y'.
perform create_goods_movement.
endif.
when 'P--'.
clear ok_code.
perform paging using 'P--'.
set cursor field 'MARA-MATNR' line 1.
when 'P-'.
clear ok_code.
perform paging using 'P-'.
set cursor field 'MARA-MATNR' line 1.
when 'P+'.
clear ok_code.
clear lines.
perform paging using 'P+'.
set cursor field 'MARA-MATNR' line 1.
when 'P++'.
clear ok_code.
perform paging using 'P++'.
set cursor field 'MARA-MATNR' line 1.
when 'SORA'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab ascending by (field).
endif.
when 'SORZ'.
read table tc_itab-cols into cols with key selected = 'X'.
if sy-subrc is initial.
field = cols-screen.
field = field+5(10).
sort itab descending by (field).
endif.
when 'PRNT'.
perform write_alv.
endcase.
endmodule. " user_command_0100 INPUT
*& Module read_table OUTPUT
module read_table output.
mara-matnr = witab-matnr.
makt-maktx = witab-maktx.
mch1-charg = witab-charg.
mseg-menge = witab-menge.
mseg-erfmg = witab-erfmg.
line_count = sy-loopc.
endmodule. " read_table OUTPUT
*& Module write_table INPUT
module write_table input.
witab-matnr = mara-matnr.
witab-maktx = makt-maktx.
witab-charg = mch1-charg.
witab-menge = mseg-menge.
witab-erfmg = mseg-erfmg.
modify itab from witab index tc_itab-current_line.
endmodule. " write_table INPUT
*& Module exit INPUT
module exit input.
leave to screen 0 .
endmodule. " exit INPUT
*& Form create_goods_movement
form create_goods_movement .
clear : gv_header, i_return[], i_goodsmvt_items[].
gv_header-doc_date = gv_header-pstng_date = mkpf-budat.
gv_header-pr_uname = sy-uname.
GM with reference to reservation
loop at itab into witab.
i_goodsmvt_items-material = witab-matnr.
i_goodsmvt_items-entry_qnt = witab-erfmg.
i_goodsmvt_items-entry_uom = 'ST'.
i_goodsmvt_items-move_type = mseg-bwart.
i_goodsmvt_items-plant = mseg-werks.
i_goodsmvt_items-stge_loc = mseg-lgort.
i_goodsmvt_items-move_plant = mseg-umwrk.
i_goodsmvt_items-move_stloc = mseg-umlgo.
i_goodsmvt_items-batch = witab-charg.
append i_goodsmvt_items.
endloop.
find BAPI processing transaction
if gv_code is initial.
perform determine_bapi_code using mseg-bwart
changing gv_code.
endif.
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gv_header
goodsmvt_code = gv_code
importing
goodsmvt_headret = gv_headret
materialdocument = gv_matdoc
matdocumentyear = gv_matyear
tables
goodsmvt_item = i_goodsmvt_items
return = i_return[].
cancel blocking process
loop at i_return where type eq 'E' or type eq 'A' or type eq 'X'.
exit.
endloop.
if sy-subrc ne 0.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
wa_message_tab-msgid = 'M7'..
wa_message_tab-msgty = 'S'.
wa_message_tab-msgno = '060'.
wa_message_tab-msgv1 = gv_matdoc.
wa_message_tab-msgv2 = ''.
wa_message_tab-msgv3 = ''.
wa_message_tab-msgv4 = ''.
append wa_message_tab to i_message_tab.
else.
refresh i_message_tab.
call function 'BAPI_TRANSACTION_ROLLBACK'.
write a message as there is an unexpected error.
loop at i_return.
wa_message_tab-msgid = i_return-id.
wa_message_tab-msgty = i_return-type.
wa_message_tab-msgno = i_return-number.
wa_message_tab-msgv1 = i_return-message_v1.
wa_message_tab-msgv2 = i_return-message_v2.
wa_message_tab-msgv3 = i_return-message_v3.
wa_message_tab-msgv4 = i_return-message_v4.
append wa_message_tab to i_message_tab.
endloop.
endif.
call function 'C14Z_MESSAGES_SHOW_AS_POPUP'
tables
i_message_tab = i_message_tab.
endform. " create_goods_movement
*& Form determine_bapi_code
form determine_bapi_code using p_bwart type bwart
changing p_code type bapi2017_gm_code.
data: lt_t158b type table of t158b with header line.
clear p_code.
select tcode from t158b into corresponding fields of table lt_t158b
where bwart eq p_bwart.
loop at lt_t158b.
select single gmcode from t158g into p_code
where tcode eq lt_t158b-tcode.
if sy-subrc is initial.
exit.
endif.
endloop.
endform. " determine_bapi_code
*& Form paging
form paging using code.
data: i type i,
j type i.
case code.
when 'P--'. tc_itab-top_line = 1.
when 'P-'.
tc_itab-top_line = tc_itab-top_line - line_count.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
when 'P+'.
i = tc_itab-top_line + line_count.
j = tc_itab-lines - line_count + 1.
if j le 0.
j = 1.
endif.
if i le j.
tc_itab-top_line = i.
else.
tc_itab-top_line = j.
endif.
when 'P++'.
tc_itab-top_line = tc_itab-lines - line_count + 1.
if tc_itab-top_line le 0.
tc_itab-top_line = 1.
endif.
endcase.
endform. " paging
*& Form write_alv
form write_alv .
perform find_list_header.
perform fill_field_cat.
perform fill_sortinfo.
g_repid = sy-repid.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
answer = 'Y'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_buffer_active = ''
i_callback_program = g_repid
i_save = 'A'
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = gs_layout
it_fieldcat = gt_fldcat[]
it_sort = gt_sortin[]
tables
t_outtab = itab[].
endform. " write_alv
Form find_list_header
form find_list_header.
data : v_datum(10),
v_datlo(10),
v_dathi(10),
v_uzeit(8).
clear: gt_header, gt_header[].
gt_header-typ = 'H'.
gt_header-info = sy-title.
append gt_header.
clear gt_header.
gt_header-typ = 'S'.
gt_header-key = 'Çalıştırma Zamanı : '.
write syst-datum to v_datum.
write syst-uzeit to v_uzeit.
concatenate v_datum '/' v_uzeit into gt_header-info.
append gt_header.
endform. " find_list_header
Form fill_field_cat
form fill_field_cat.
refresh gt_fldcat.
clear gt_fldcat.
gt_fldcat-key = 'X'.
add-fieldcat 'MATNR' 'MARA' ''.
add-fieldcat 'MAKTX' 'MAKT' ''.
add-fieldcat 'CHARG' 'MSEG' ''.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'MEINS' 'MARA' 'Olcu Birimi '.
gt_fldcat-do_sum = 'X'.
add-fieldcat 'ERFMG' 'MSEG' 'Adet'.
endform. " fill_field_cat
Form fill_sortinfo
form fill_sortinfo.
gt_sortin-up = 'X'.
gt_sortin-fieldname = 'MATNR'. append gt_sortin.
endform. " fill_sortinfo
Form top_of_page *
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'ZKUTAS'
it_list_commentary = gt_header[].
endform. " top_of_pageHI,
if it is a normal report program then you can directly create a Selection screen field.
After the Type-pool you can use Parameters or Select-options to create the selection screen field..
If it is a Modulpool program then you can create a selection scren field like
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
PARAMETERS: p1(10) TYPE c.
SELECTION-SCREEN END OF SCREEN 1100.
defines a selection screens 1100 as subscreens.
The next screen number of screen 100 is 100 (statically-defined).
PROCESS BEFORE OUTPUT.
MODULE status_0100.
CALL SUBSCREEN area INCLUDING sy-repid number.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
CALL SUBSCREEN area.
MODULE user_command_0100.
look at the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
Regards
Sudheer -
Passing parameter from selection screen to corresponding report program.
Hi all,
I am developing a report in which there is a selection screen containing 2 list boxes having month 'from' and 'to' ;ie the month range for which the report is to be run and a parameter for year.below it i have 2 radio button options which will lead to the report that the user clicks on.
I have done the following in the code.
selection-screen begin of block b1 with frame title text-001.
parameters: month1(10) as listbox visible length 10 obligatory.
parameters: month2(10) as listbox visible length 10.
parameters: year(4) obligatory.
selection-screen : end of block b1.
selection-screen: begin of block b2 with frame title text-002.
parameters: rb1 radiobutton group g1,
rb2 radiobutton group g1.
selection-screen : end of block b2.
if rb1 = 'X'.
submit ZMIS1.
ENDIF.
if rb2 = 'X'.
submit ZMIS2.
endif.
Now i want the values selected in the listbox and the year to be passed in the report that will be selected in the radiobutton (ie ZMIS1 or ZMIS2) so that the corresponding report output will be displayed directly with the inputs given in the selection screen .
Please tell me how to do this.Thanks in advance.You also have to pass Selection-screen data for called program the way it has been shown down.
REPORT ZVENKAT_ALV_LIST.
DATA:
IT_RSPARAMS TYPE STANDARD TABLE OF RSPARAMS,
WA_RSPARAMS LIKE LINE OF IT_RSPARAMS.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: MONTH1(10) AS LISTBOX VISIBLE LENGTH 10 OBLIGATORY.
PARAMETERS: MONTH2(10) AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: YEAR(4) OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK B1.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: RB1 RADIOBUTTON GROUP G1 USER-COMMAND UC1,
RB2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN : END OF BLOCK B2.
IF RB1 = 'X'.
WA_RSPARAMS-SELNAME = 'P_MATNR'. "PARAMETER or SELECT-OPTION of the called program
WA_RSPARAMS-KIND = 'P'. "S=Select-options P=Parameters
WA_RSPARAMS-SIGN = 'I'.
WA_RSPARAMS-OPTION = 'EQ'.
WA_RSPARAMS-LOW = '11010'.
WA_RSPARAMS-HIGH = SPACE.
SUBMIT ZMIS1 WITH SELECTION-TABLE RSPARAMS AND RETURN.
ENDIF.
IF RB2 = 'X'.
WA_RSPARAMS-SELNAME = 'P_MATNR'. "PARAMETER or SELECT-OPTION of the called program
WA_RSPARAMS-KIND = 'P'. "S=Select-options P=Parameters
WA_RSPARAMS-SIGN = 'I'.
WA_RSPARAMS-OPTION = 'EQ'.
WA_RSPARAMS-LOW = '11010'.
WA_RSPARAMS-HIGH = SPACE.
SUBMIT ZMIS2 WITH SELECTION-TABLE RSPARAMS AND RETURN.
ENDIF.
Thanks
Venkat.O -
Adding layout variant to selection screen
Hi all,
Currently I am working on report program, where I have to allow user to select his own output pattern. i.e layout variant is to be added to selection screen. The report uses object oriented ALV for display purpose. [set_table_for_first_display]
I made following steps,
1. Declared one parameter of type disvariant.
2. At selection-screen on value-request I called function REUSE_ALV_VARIANT_F4.
3. Passed internal table to method set_table_for_first_display.
Now I am able to create save new variant, on selection screen I can select the variant that I have created, but output shows the all the fields though
Only few are selected. Please tell me any modification so as to reflect the changes in output.
I am searching for a function which maintains fieldcat according to user defined variant.
Regards,
Nilesh kulkarni.U have to use REUSE_ALV_VARIANT_EXISTENCE inorder to use the layout u have selected
After ur code of REUSE_ALV_VARIANT_F4.
try this way
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
G_REPID = SY-REPID.
G_SAVE = 'A'.
FORM PAI_OF_SELECTION_SCREEN .
IF NOT P_LAYOUT IS INITIAL.
MOVE G_VARIANT TO GX_VARIANT.
MOVE P_LAYOUT TO GX_VARIANT-VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT.
G_VARIANT = GX_VARIANT.
ELSE.
PERFORM VARIANT_INIT.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
FORM variant_init .
CLEAR G_VARIANT.
G_VARIANT-REPORT = G_REPID.
ENDFORM. " variant_init
Then when u call ALV for display, pass ur display variant, in this case = g_variant
Reward if useful
Cheers
~Arun
Message was edited by:
Arun Shekhar -
Added new parameter but it doesn't worl properly.
here is the code that i used.
added new parameter date_where, but after that the mark_all and clear_all is not working.
someone please help me.
/* PROJECT DATE INITIALS DESCRIPTION */
/* W_O_9130 07/11/2006 FJK ADDED A PARAMETER P_ORDER_DATE */
PACKAGE BODY SignAgenda IS
/* Marks all the records in the ORDERS_VIEW_LIST datablock. Marking the records allows only */
/* the marked records to be printed from the list. */
PROCEDURE MarkAll IS
MarkLoop BOOLEAN := TRUE;
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
IF (:SYSTEM.CURSOR_BLOCK != 'ORDERS_VIEW_LIST') THEN
GO_BLOCK('ORDERS_VIEW_LIST');
END IF;
FIRST_RECORD;
WHILE (MarkLoop) LOOP
:ORDERS_VIEW_LIST.G_PICK_FIELD := 'x';
IF (:SYSTEM.LAST_RECORD = 'TRUE') THEN
MarkLoop := FALSE;
ELSE
NEXT_RECORD;
END IF;
END LOOP;
FIRST_RECORD;
IsMarked := TRUE;
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
END;
/* UnMarks all the records in the ORDERS_VIEW_LIST datablock. */
PROCEDURE ClearAll IS
MarkLoop BOOLEAN := TRUE;
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
IF (:SYSTEM.CURSOR_BLOCK != 'ORDERS_VIEW_LIST') THEN
GO_BLOCK('ORDERS_VIEW_LIST');
END IF;
FIRST_RECORD;
WHILE (MarkLoop) LOOP
:ORDERS_VIEW_LIST.G_PICK_FIELD := NULL;
IF (:SYSTEM.LAST_RECORD = 'TRUE') THEN
MarkLoop := FALSE;
ELSE
NEXT_RECORD;
END IF;
END LOOP;
FIRST_RECORD;
IsMarked := FALSE;
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
END;
/* Prints the regular and 24 hour signing agendas. */
PROCEDURE PrintReport(ReportName IN VARCHAR2) IS
MaxSize NUMBER(5) := 2000;
Where1 VARCHAR2(2000):=NULL;
Where2 VARCHAR2(2000):=NULL;
Where3 VARCHAR2(2000):=NULL;
DefWhere VARCHAR2(32767):=NULL;
DefWhere2 VARCHAR2(2000):=NULL;
RecsMarked BOOLEAN;
MarkLoop BOOLEAN := TRUE;
DblQuote VARCHAR2(1) := '"';
RepParam PARAMLIST;
TooMany EXCEPTION;
AlId ALERT;
AlBtn NUMBER(10);
ExcMsg VARCHAR2(130);
Report_Id REPORT_OBJECT;
Report_Status VARCHAR2(30);
/*** W_O_9130 07/11/2006 FJK START *** */
date_where varchar2(30);
/*** W_O_9130 07/11/2006 FJK END *** */
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
RepParam := BuildParamList;
/*** W_O_9130 07/11/2006 FJK START *** */
date_where := replace(:ORDERS_VIEW_QUERY.dd_order_date,':',' to ');
/*** W_O_9130 07/11/2006 FJK END *** */
DefWhere := GET_BLOCK_PROPERTY('ORDERS_VIEW_LIST', DEFAULT_WHERE);
IF (LENGTH(DefWhere) <= 2000) THEN
DefWhere2 := DblQuote || DefWhere || DblQuote;
ELSE
DefWhere2 := 'DD_ORDER_DATE IS NOT NULL';
END IF;
IF NOT(IsMarked) THEN
Where1 := DblQuote || DefWhere || DblQuote;
ADD_PARAMETER(RepParam, 'P_WHERE', TEXT_PARAMETER, Where1);
ADD_PARAMETER(RepParam, 'P_DEF_WHERE', TEXT_PARAMETER, DefWhere2);
/*** W_O_9130 07/11/2006 FJK START *** */
ADD_PARAMETER(RepParam, 'P_order_date', TEXT_PARAMETER, Date_Where);
/*** W_O_9130 07/11/2006 FJK END *** */
ELSE
IsMarked := FALSE;
GO_BLOCK('ORDERS_VIEW_LIST');
FIRST_RECORD;
WHILE (MarkLoop) LOOP
IF (:ORDERS_VIEW_LIST.G_PICK_FIELD IS NOT NULL) THEN
:ORDERS_VIEW_LIST.G_PICK_FIELD := NULL;
ELSIF
(Where1 IS NULL) THEN
Where1 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where1) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where1 := Where1 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (Where2 IS NULL) THEN
Where2 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where2) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where2 := Where2 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (Where3 IS NULL) THEN
Where3 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where3) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where3 := Where3 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSE
RAISE TooMany;
END IF;
IF (:SYSTEM.LAST_RECORD = 'TRUE') THEN
MarkLoop := FALSE;
ELSE
NEXT_RECORD;
END IF;
MarkLoop := false ;
END LOOP;
FIRST_RECORD;
Where1 := Where1 || ')';
IF (LENGTH(Where2) > 0) THEN
Where2 := Where2 || ')';
ELSE
Where2 := 'DD_ORDER_RSN IS NULL';
END IF;
IF (LENGTH(Where3) > 0) THEN
Where3 := Where3 || ')';
ELSE
Where3 := 'DD_ORDER_RSN IS NULL';
END IF;
ADD_PARAMETER(RepParam, 'P_WHERE', TEXT_PARAMETER, Where1);
ADD_PARAMETER(RepParam, 'P_WHERE2', TEXT_PARAMETER, Where2);
ADD_PARAMETER(RepParam, 'P_WHERE3', TEXT_PARAMETER, Where3);
ADD_PARAMETER(RepParam, 'P_DEF_WHERE', TEXT_PARAMETER, DefWhere2);
/*** W_O_9130 07/11/2006 FJK START *** */
add_parameter(RepParam, 'P_order_date', TEXT_PARAMETER, Date_Where);
/*** W_O_9130 07/11/2006 FJK END *** */
END IF;
HOST('..\..\STANDARD\VBExe\SetLegal', NO_SCREEN);
Report_Id := FIND_REPORT_OBJECT(ReportName);
Report_Status := RUN_REPORT_OBJECT(Report_Id, RepParam);
HOST('..\..\STANDARD\VBExe\ResetOrigPaper', NO_SCREEN);
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
EXCEPTION
WHEN TooMany THEN
AlId := FIND_ALERT('ERR_ALERT');
IF ID_NULL(AlId) THEN
ExcMsg := 'Error occurred in the SignAgenda.PrintReport package';
ExcMsg := ExcMsg || ' - ERR_ALERT doesn' || '''' || 't exist.';
:LIST__SIGN_AGENDA.G_MESSAGE_FIELD := ExcMsg;
MESSAGE(ExcMsg);
RAISE FORM_TRIGGER_FAILURE;
ELSE
ExcMsg := 'The maximum number of records that can be selected has been exceeded.';
ExcMsg := ExcMsg || CHR(10) || 'Please select a smaller number of records.';
SET_ALERT_PROPERTY(AlId, ALERT_MESSAGE_TEXT, ExcMsg);
SET_ALERT_PROPERTY(AlId, TITLE, 'Unable to complete the requested task!');
AlBtn := SHOW_ALERT(AlId);
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;
/* Creates and returns a parameter list. This is used by the PrintReport procedure. */
FUNCTION BuildParamList RETURN PARAMLIST IS
RepParam PARAMLIST;
BEGIN
IF ID_NULL(GET_PARAMETER_LIST('SIGNING_AGENDA')) THEN
RepParam := CREATE_PARAMETER_LIST('SIGNING_AGENDA');
ELSE
DESTROY_PARAMETER_LIST('SIGNING_AGENDA');
RepParam := CREATE_PARAMETER_LIST('SIGNING_AGENDA');
END IF;
RETURN RepParam;
END;
END;i have problem some where here.please help out.
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
RepParam := BuildParamList;
/*** W_O_9130 07/11/2006 FJK START *** */
date_where := replace(:ORDERS_VIEW_QUERY.dd_order_date,':',' to ');
/*** W_O_9130 07/11/2006 FJK END *** */
DefWhere := GET_BLOCK_PROPERTY('ORDERS_VIEW_LIST', DEFAULT_WHERE);
IF (LENGTH(DefWhere) <= 2000) THEN
DefWhere2 := DblQuote || DefWhere || DblQuote;
ELSE
DefWhere2 := 'DD_ORDER_DATE IS NOT NULL';
END IF;
IF NOT(IsMarked) THEN
Where1 := DblQuote || DefWhere || DblQuote;
ADD_PARAMETER(RepParam, 'P_WHERE', TEXT_PARAMETER, Where1);
ADD_PARAMETER(RepParam, 'P_DEF_WHERE', TEXT_PARAMETER, DefWhere2);
/*** W_O_9130 07/11/2006 FJK START *** */
ADD_PARAMETER(RepParam, 'P_order_date', TEXT_PARAMETER, Date_Where);
/*** W_O_9130 07/11/2006 FJK END *** */
ELSE
IsMarked := FALSE;
GO_BLOCK('ORDERS_VIEW_LIST');
FIRST_RECORD;
WHILE (MarkLoop) LOOP
IF (:ORDERS_VIEW_LIST.G_PICK_FIELD IS NOT NULL) THEN
:ORDERS_VIEW_LIST.G_PICK_FIELD := NULL;
ELSIF
(Where1 IS NULL) THEN
Where1 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where1) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where1 := Where1 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (Where2 IS NULL) THEN
Where2 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where2) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where2 := Where2 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (Where3 IS NULL) THEN
Where3 := 'DD_ORDER_RSN IN (''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSIF (LENGTH(Where3) + LENGTH(:ORDERS_VIEW_LIST.DD_ORDER_RSN) + 5 <= MaxSize) THEN
Where3 := Where3 || ', ''' || :ORDERS_VIEW_LIST.DD_ORDER_RSN || '''';
ELSE
RAISE TooMany;
END IF;
IF (:SYSTEM.LAST_RECORD = 'TRUE') THEN
MarkLoop := FALSE;
ELSE
NEXT_RECORD;
END IF;
MarkLoop := false ;
END LOOP;
FIRST_RECORD;
Where1 := Where1 || ')';
IF (LENGTH(Where2) > 0) THEN
Where2 := Where2 || ')';
ELSE
Where2 := 'DD_ORDER_RSN IS NULL';
END IF;
IF (LENGTH(Where3) > 0) THEN
Where3 := Where3 || ')';
ELSE
Where3 := 'DD_ORDER_RSN IS NULL';
END IF; -
Requirement to add new parameter in selection in report painter report
Hi Gurus,
I have a requirement to add an extra field in Cost center:Act/Plan/Comm CC Cur report.This is otherwise a Z report in report painter with 0% code (T-code : GR55-> Report group->Report).But,when we go to technical information of this report,it has four standard sap programs,which contains code for this selection screen.It does not even have a modification scope.
Selection screen of this report contains following parameters:
Selection values:
Controlling Ar
Fiscal Year
From Period
To Period
Plan Version
Selection Groups:
Cost Center Group
Or value(s)
Cost Element Group
Or value(s)
My requirement is to add one more parameter : Purchase oeder in new block:
Is there any way to achieve it.
Note: Copying the standard progs into custom prog is not working,i already tried that.
Please let me know your suggestions,if any one of you came across such requirement before.it is very impoertant for me.
Thanks in advance,
MeenakshiHi,
This report (and all generic reports which are based on the same library) looks on CCSS structure. This structure extracts data from totals tables. Therefore, it's not possible to add the parameter of purchase order, as it's a detail line attribute.
Regards,
Eli -
Hi Gurus,
What I need to do is to put the default value for parameter on selection screen. It should be the email address of the person who run this program (from user profile).To get this value I called BAPI_USER_GET_DETAIL . How to pass the value to the parameter on selection screen now?
Thank you in advance.
Regards,
LenaTry this:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
PARAMETERS e_mail TYPE bapiadsmtp-e_mail.
DATA: return TYPE TABLE OF bapiret2,
email TYPE TABLE OF bapiadsmtp WITH HEADER LINE.
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = sy-uname
TABLES
return = return
addsmtp = email.
LOOP AT email.
e_mail = email-e_mail.
EXIT.
ENDLOOP.
Rob -
How can we place a F4 help in a parameter in selection screen
Hi,
How can we place a F4 help in a parameter in selection screen. Can we do add a Process 0n Value request similar to a module pool prg in stadard report program.
sajiHello Saji,
Try below attached report.
Regards,
Naimesh.
Reward, if it is useful..!
REPORT ZTEST_NP_1.
DATA: HELPVAL1 LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE .
DATA: VALUE_TAB LIKE PDTASK-OTEXT OCCURS 2 WITH HEADER LINE.
DATA: VALUE LIKE FEBMKA-BANKN,
GIVEN_VALUE LIKE HELP_INFO-FLDVALUE.
DATA: IT_T005T LIKE T005T OCCURS 0 WITH HEADER LINE,
IT_T002T LIKE T002T OCCURS 0 WITH HEADER LINE.
SELECTION-SCREEN: BEGIN OF BLOCK BLK1 WITH FRAME TITLE ABC.
PARAMETERS: P_SPRAS LIKE T002T-SPRAS,
P_LAND1 LIKE T005T-LAND1.
SELECTION-SCREEN: END OF BLOCK BLK1.
INITIALIZATION.
ABC = 'Selection Criteria:'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAND1.
PERFORM VALUE_REQUEST_LAND1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SPRAS.
PERFORM VALUE_REQUEST_SPRAS.
*& Form VALUE_REQUEST_land1
FORM VALUE_REQUEST_LAND1.
*---- Reading the Screen values.
DATA: LT_DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
LV_DYNAME LIKE D020S-PROG,
LV_DYNUMB LIKE D020S-DNUM.
*-------Append field which you want to read from the screen
LV_DYNAME = SY-REPID.
LV_DYNUMB = SY-DYNNR.
LT_DYNPFIELDS-FIELDNAME = 'P_SPRAS'.
APPEND LT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = LV_DYNAME
DYNUMB = LV_DYNUMB
TABLES
DYNPFIELDS = LT_DYNPFIELDS.
SELECT * FROM T005T
INTO TABLE IT_T005T
WHERE SPRAS = P_SPRAS.
REFRESH: HELPVAL1, VALUE_TAB.
CLEAR: HELPVAL1, VALUE_TAB, GIVEN_VALUE, VALUE.
*---- Append field name for the columns in the help popup
HELPVAL1-TABNAME = 'T005T' .
HELPVAL1-FIELDNAME = 'LAND1' .
HELPVAL1-SELECTFLAG = 'X' . " will return the value on the screen
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
HELPVAL1-TABNAME = 'T005T' .
HELPVAL1-FIELDNAME = 'LANDX' .
HELPVAL1-SELECTFLAG = ' ' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
LOOP AT IT_T005T.
VALUE_TAB = IT_T005T-LAND1.
APPEND VALUE_TAB.
VALUE_TAB = IT_T005T-LANDX.
APPEND VALUE_TAB.
ENDLOOP.
GIVEN_VALUE = P_LAND1.
CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
EXPORTING
DISPLAY = SPACE
GIVEN_VALUE = GIVEN_VALUE
IMPORTING
SELECT_VALUE = VALUE
TABLES
FIELDS = HELPVAL1
VALUETAB = VALUE_TAB.
IF NOT VALUE IS INITIAL.
P_LAND1 = VALUE. " Assing value to the parameter
ENDIF.
ENDFORM. " VALUE_REQUEST_land1
*& Form VALUE_REQUEST_SPRAS
FORM VALUE_REQUEST_SPRAS.
REFRESH: HELPVAL1, VALUE_TAB.
CLEAR: HELPVAL1, VALUE_TAB, GIVEN_VALUE, VALUE.
HELPVAL1-TABNAME = 'T002T' .
HELPVAL1-FIELDNAME = 'SPRSL' .
HELPVAL1-SELECTFLAG = 'X' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
HELPVAL1-TABNAME = 'T002T' .
HELPVAL1-FIELDNAME = 'SPTXT' .
HELPVAL1-SELECTFLAG = ' ' .
APPEND HELPVAL1 .
CLEAR HELPVAL1 .
SELECT * FROM T002T
INTO TABLE IT_T002T
WHERE SPRAS = SY-LANGU.
LOOP AT IT_T002T.
VALUE_TAB = IT_T002T-SPRSL.
APPEND VALUE_TAB.
VALUE_TAB = IT_T002T-SPTXT.
APPEND VALUE_TAB.
ENDLOOP.
GIVEN_VALUE = P_SPRAS.
CALL FUNCTION 'HELP_VALUES_GET_WITH_VALUE'
EXPORTING
DISPLAY = SPACE
GIVEN_VALUE = GIVEN_VALUE
IMPORTING
SELECT_VALUE = VALUE
TABLES
FIELDS = HELPVAL1
VALUETAB = VALUE_TAB.
IF NOT VALUE IS INITIAL.
P_SPRAS = VALUE.
ENDIF.
ENDFORM. " VALUE_REQUEST_SPRAS -
Adding a button in selection screen of report ?
Hi,
My requirement is to add a Push Button to the selection screen of a report program.
The button has to be position near the 'Variant' button which is already present.
How to do this.
Regards.First of all, in initialization event, declare your own status like:
INITIALIZATION.
SET PF-STATUS '0100'. "for example - nº doesn't matter
After that, declare the function codes, in at selection screen event, like:
AT SELECTION-SCREEN.
CASE sy-ucomm.
*** When user press your button
WHEN 'YOUR_BUTTON_OK_CODE'. "use a small name
* ... since you respect other okcodes, don't need to code them
*** When user press those standard buttons
WHEN 'BACK' OR 'CANCEL' OR 'RETURN'.
LEAVE PROGRAM.
ENDCASE.
And for your report that's it!!! (again, if in your status you respect all the other status names like F8, PRINT, etc etc ...)
Now, just need to create the status:
1 - double click '0100' of PF-STATUS instruction
2 - in the status, button bar, insert your button (write it's ok_code - 'YOUR_BUTTON_OK_CODE', choose a icon) and F8 button too (don't forget this!), ok_code ONLI and icon ICON_EXECUTE_OBJECT.
3 - In the function keys, insert BACK, RETURN, CANCEL and PRINT in respective icon places.
It's simpler than it looks!
Regards,
Valter Oliveira. -
Problem in selection screen of y-report.
Hi ALL,
I have modify a y-report and add one parameter to selection screen. Earlier there was only two parameter, now it becomes three. In developement and quality servers it is showing all three parameters and report is running perfectly OK. But when I traport it into production server, third parameter which I added later is not showing, only old one is showing. But when I see the code in production server then in code it is showing that third parameter but when I execute report then only two are showing. Wht shd I do? Kindly suggest.
Regards,
Rajesh VasudevaHi Rajesh,
You are saying that new selection parameter has been added while you add the parameter in the report at that time when you are saving the request number to which you have assign has to be transported then only it works.
And it is showing in the QAS since the previous request which is been created for 2 parameters might be present in the QAS and the same transported to PRO check back the transport request will resolve your issue.
Cheers!!
VEnk@ -
How to display the sort value in the selection screen in the report title
Dear All,
How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
Good day,
Thanks and regards
Arun SHi Arun,
Try this.
1, Set one dynamic parameter,
2, Drag and drop that parameter into your report title.
3, Pass the value(sort value) dynamically from your application,
4, Cheers..
Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then set the data source from CR designer. and darg and drop that data column into the report.
Hope this will work,
Regards,
Salah
Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM -
Functional area(FKBER field in the selection screen of the report painter))
Hi,
I have a requirement to add functional area field in the selection screen for a report painter report. This report using library 1VK and table 'CCSS'. I added functional area field in the general data selection . After the execution of report with functional area field filled with value. report not giving any output. do i need to maintain any setting to achieve?
Regards,
Palani1. Call GR22 and click "Characteristics".
2. Check FKBER and assign a position number to it.
3. Save and close the library.
4. Call your report in GRR2 and you should now see FKBER as an available characteristic.
5. Use it in the General Data Selection or as a Lead Column, as per requirement.
Or,
1. Call GR21 and create a custom library. Provide a name and description and also provide a library you can copy from (scan for the best-fit library).
2. Now follow the steps 2 through 5 above to achieve your result.
Hope this helps.
Cheers. -
Passing values to a dynamic selection screen via a report
Hi,
I have the following problem and need to seek your expertise urgently.
In my program, I need to call another report by passing in parameters to the selection screen of other report. However, I could not pass values into a dynamic selection screen. I tried to use submit (report) with free selection but do not know how it works.
Currently, I tried calling the function RS_REFRESH_FROM_DYNAMICAL_SEL and FREE_SELECTIONS_RANGE_2_EX. Using the object the first function has returned to me, I tried to append values such as fieldname etc to it. However, I realised the field names of a dynamic selection screen keeps changing. So I would not know how to pass a particular value to a selection field.
Appreciate any help given.
Thanks,
CKHello CK,
Are you using logical database in your selection screen program attributes? If it is, look at include file DBxxxSEL for parameter named xxxDYNSE where xxx = logical database. Debug the program that has that dynamic selection, and look at field xxxDYNSE. This should give you a hint on how to populate the parameter when you submit the program.
Maybe you are looking for
-
We have the requirement of mass update Purchase Orders in SNC. We noticed that some of the POs are created with blank Means of Transport in SNC for some reasons and it is breaking the subsequent processes. We have corrected the Master data -Transport
-
Need ABAP Code to enhance the 0PRODORDER_ATTR?
I want to enhance the datasource 0PRODORDER_ATTR with the below JCDS Table fields like UDATE,STAT,OBJNR,INACT,CHGNR. Can anyone please let me know the ABAP Code need to be written in the CMOD to populate the data for the above fields in the 0PRODORDE
-
This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7ec9.w.h tml
-
Hi , I have two version of oracle in my computer : 9i,10g, but i have my db only in 10g. others use 9i. the problem is that when i want to launch a batch on 10g , the DOS launch 9i , and i don't know what to do . exemple I want to execute this script
-
Manually cloning db after shutting down
hello trying to clone a db my oracle location is e:\ the new db i am trying to create is in d:\ first of all is this kind of location change possible during cloning?? i shutdown the db in e: copied the datafiles and logfiles to D:\oraclone\data and d