How to declare a parameter
hi all,
i want to declare a parameter which takes given input as
'c:\mydoucmnets\jfjfjfjfffsdkhhhhh' for that what and f4 help should be attached to it.
if any function module for this type give me that also
Hi Suresh ,,
<b>Declare like this ..</b>
<b><b>PARAMETERS: p_fname TYPE rlgrap-filename.</b></b>
<b>For F4 Help...</b>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
To get the Input file name and path from presentation server
PERFORM f_get_filename_pre USING p_fname.
*& Form f_get_filename_pre
This subroutine will Open the file path
FORM f_get_filename_pre USING p_fname TYPE rlgrap-filename.
DATA: lt_files TYPE filetable, " File table
lv_title TYPE string, " Window table
lv_file TYPE file_table, " File name
lv_subrc TYPE sy-subrc, " Output value
lv_file1 TYPE string. " File name
To open the file dialog box
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = lv_title
CHANGING
file_table = lt_files
rc = lv_subrc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
OTHERS = 4.
IF sy-subrc = 0.
Get the file name.
LOOP AT lt_files INTO lv_file.
lv_file1 = lv_file.
MOVE lv_file1 TO p_fname.
EXIT.
ENDLOOP.
ENDIF.
ENDFORM. " f_get_filename_pre
Regards,
Peter
Similar Messages
-
How to declare a string parameter
Hi all,
I declared a parameter of type string in parameters declaration part. System giving me a error as 'deep data type "string" is not allowed'.
My requirement is to declare a parameter of type string for file name in GUI_DOWNLOAD FM. If I declare any other type its goin for a short dump. How to do it. Please give relevant code for it if possible.Hi,
Please check, For file download,, and declaring file as parameters, all scenarios are covered,
Please go through code.Hope it work well for your requirement.
Reward all helpful answers.
Thanks.
REPORT Zxyx NO STANDARD PAGE HEADING MESSAGE-ID zf.
*Table Declarations
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : cb_box1 TYPE c AS CHECKBOX.
PARAMETERS : p_wsfile LIKE rlgrap-filename.
PARAMETERS : cb_box2 TYPE c AS CHECKBOX.
PARAMETERS : p_lpfile LIKE rlgrap-filename DEFAULT c_lpat.
SELECTION-SCREEN END OF BLOCK b2.
INITIALIZATION
INITIALIZATION.
AT SELECTION-SCREEN
AT SELECTION-SCREEN OUTPUT.
Change to Display Mode for Logical Path
PERFORM lpdisplay.
AT SELECTION-SCREEN.
Validate Input At Selection Screen
PERFORM screen_validation.
Authority Check
PERFORM authority_check.
Assist file Path for Download
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_wsfile.
PERFORM get_path.
START-OF-SELECTION.
START-OF-SELECTION.
Get all Accounting Document Details
PERFORM get_bkpf.
END-OF-SELECTION.
END-OF-SELECTION.
IF i_bkpf IS INITIAL.
MESSAGE s001(zf) WITH 'No Records Found for the Selection'(003).
ELSE.
Prepare Download Table
PERFORM fill_download.
Submit to gui_download.
IF NOT cb_box1 IS INITIAL.
PERFORM download_csv USING p_wsfile.
ENDIF.
Download to Logical Path.
IF NOT cb_box2 IS INITIAL.
PERFORM logicalpath_download.
ENDIF.
ENDIF.
*& Form screen_validation
At Selection Screen Validation for Inputs.
FORM screen_validation.
*Validation for company code
IF NOT p_bukrs IS INITIAL.
SELECT COUNT(*) FROM t001 WHERE bukrs = p_bukrs.
IF sy-subrc NE 0.
MESSAGE e001(zf) WITH 'Company Code(s) not found'(004).
ENDIF.
ENDIF.
ENDFORM. " screen_validation
*& Form authority_check
Authority Check
FORM authority_check.
ENDFORM. " authority_check
*& Form get_bkpf
Get Document Details
FORM get_bkpf.
SELECT
bukrs "Company Code
IF sy-subrc = 0.
SORT i_kna1 BY kunnr.
ENDIF.
ENDIF.
ENDFORM. " get_bkpf
*& Form fill_download
Prepare Download Table
FORM fill_download.
DATA : v_flag TYPE c.
v_taxsum = 0.
SORT i_bseg BY belnr buzei.
ENDFORM. " summary_build
*& Form download_csv
Download To Pipe CSV File
FORM download_csv USING v_p_wsfile LIKE rlgrap-filename.
DATA : v_time LIKE sy-uzeit,
v_date LIKE sy-datum,
v_fname TYPE string.
v_time = sy-uzeit.
v_date = sy-datum.
IF p_bukrs = '2000'.
CONCATENATE v_p_wsfile c_csg v_date v_time c_2000
'.TXT' INTO v_p_wsfile.
v_fname = v_p_wsfile.
ELSEIF p_bukrs = '3110'.
CONCATENATE v_p_wsfile c_ams v_date v_time c_2000
'.TXT' INTO v_p_wsfile.
v_fname = v_p_wsfile.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_fname
filetype = 'ASC'
TABLES
data_tab = i_csv[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE e001(zf) WITH v_fname
'Sorry, File download Unsucessful'(008).
ELSE.
MESSAGE s001(zf) WITH v_fname 'Download Sucessful'(009).
ENDIF.
ENDFORM. " download_csv
*& Form get_path
Get The File Path for Download.
FORM get_path.
Provide F4 Help for Download Path Selection
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = 'ZFIPDRDGCSV'
dynpro_number = sy-dynnr
field_name = p_wsfile
CHANGING
file_name = p_wsfile
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE s001(zf) WITH 'Given Path Unsucessful'(010).
ENDIF.
ENDFORM. " get_path
*& Form lpdisplay
Diaply the Logical path In NON EDIT MOde
FORM lpdisplay.
LOOP AT SCREEN.
IF screen-name = 'P_LPFILE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDFORM. " lpdisplay -
How to declare Dynamic table in Tables Parameters of a Function Module...
Hi Gurus,
I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
so that it should be able to hold any table data ....
I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....Hi,
If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
just declare it with a name under Parameter name with out specifying the type.
A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
Regards,
Sharath Panuganti -
How to give the parameter in a single line
hi,
i am working on reports, i have declared the parameter as radio button, how to have the radio button in a single line.
somethink like this
radiobutton1, radiobutton2, ....Hi Anitha,
1. Comments
u will also need to give comments/captions
(on the left of the radio button)
2. try this (just copy paste)
REPORT abc.
selection-screen begin of line.
selection-screen comment 10(20) text-001 for field b.
parameters : b radiobutton group g1.
selection-screen comment 40(10) text-002 for field d.
parameters : d radiobutton group g1.
selection-screen end of line.
regards,
amit m. -
How to create a parameter id on screen element
How to create a parameter id on screen element
reply urgentHi Madan,
Check this info.
Parametere Id is the one which holds the memory for the particular field. when we need to pass the the field from one screen to another use the parameter Id.
The SAP Memory is a user-specific memory area of the application server, which is accessed by all main sessions of a user session at once. ABAP programs have access to SPA/GPA parameters stored in the SAP Memory (also called SET/GET parameters).
Eg. Of how to use Set parameter
you can give value of variable (dobj) to parameter ID 'pid'. This will store value in SAP memory
SET PARAMETER ID pid FIELD dobj.
When you want to use that value stored in SAP memory
you can use GET parameter.
GET PARAMETER ID pid FIELD dobj.
To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
To fill one, use:
SET PARAMETER ID <pid> FIELD <f>.
This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
To read an SPA/GPA parameter, use:
GET PARAMETER ID <pid> FIELD <f>.
This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.
The relevant fields must each be linked to an SPA/GPA parameter.
On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
Check this link.
http://help.sap.com/saphelp_47x200/helpdata/en/f5/6a853c61c5140ee10000000a11405a/frameset.htm
Hope this resolves your query.
Reward all the helpful answers.
Regards -
How to declare class variable with generic parameters?
I've got a class that declares a type parameter T. I know how to declare a static method, but this doesn't work for a static variable:
public class Test< T >
* Map of String to instances of T.
* error: '(' expected (pointing to =)
* <identifier> expected (pointing to () )
private final static < T > Map< String, T > MAP = new HashMap< String, T >();
* Get instance of type T associated with the given key.
public final static < T > T getType( String key )
return MAP.get( key );
}Edited by: 845859 on Mar 20, 2011 11:46 AMjveritas wrote:
I'm trying to create a generic polymorphic Factory class that contains boilerplate code.
I don't want to have to rewrite the registration code every time I have a different return type and parameter.I haven't seen a case yet where that is reasonable.
If you have hundreds of factories then something is wrong with your code, design and architecture.
If you have a factory which requires large number of a varying input types (producing different types) then something is probably wrong with your code and design.
A reasonable factory usage is one where you have say 20 classes to be created and you need to add a new class every 3 months. Along with additional functionality represented by the class itself and perhaps variances in usage. Thus adding about 3 lines of code to one class is trivial. Conversely if you have hundreds of classes to be created by the factory and you are adding them daily then it is likely that
1. Something is wrong with the architecture which requires a new class every day.
2. You should be using a dynamic mechanism for creation rather than static because you can't roll out a static update that often.
More than that the idiom that leads to factory creation is different for each factory. A factory that creates a database connection is substantially different than the one used in dynamic rules logic processing. A generic version will not be suitable for both.
Actualy the only case I know of where such a factory might be seem to be a 'good' idea is where someone has gotten it into their head that every class should be represented by an interface and every class created by a factory (its own factory.) And of course that is flawed. -
How to execute the parametered stored procedure in sql *plus ?
how to execute the parametered stored procedure in sql *plus ?
my storedprocedure format
CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
(empDOB out date, empEmpName out varchar2)
thanks & regards
mk_murOh, sorry... making many reading-too-fast mistakes today...
You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
2 d date := sysdate;
3 e varchar2(10) := 'bob';
4 begin
5 empdob := d;
6 empempname := e;
7 end;
8 /
Procedure created.
TEST> var d varchar2(30)
TEST> var n varchar2(30)
TEST> call SMS_SELECTMPLOYEE(:d,:n);
Call completed.
TEST> print d n
D
11/07/06
N
bobYoann. -
Declaring input parameter for flag in procedure!!!!!
hi,
can anyone tell how to declare the flag i,e true or false as an input parameter in the procedure.
here is the code wat i have
create or replace procedure test
cur_out out sys_refcursor
as
begin
open cur_out for
select field1
from Test
where REPORTING_FLG = 'y' --(here i want the user to select 'Y' or 'N' )
ORDER BY field1;
end TEST;
In the where condition i want the user to select the 'y' or 'N'. So i have to give input parameter i guess. So could anyone let me know how to give input parameter for flag.
Urgent PLZ!!!
Thank u in Advance.May be this way:
Create or Replace procedure test (cur_out out sys_refcursor,flg in varchar2)
as
begin
open cur_out for select field1 from Test
where REPORTING_FLG = flg
ORDER BY field1;
end TEST;
We can only pass Input parameters! -
How to declare installed language
Hello people,
I have installed in the system the french,portuguese and spanish languages. How to declare them in the parameter ZCSA/installed_languages?
More thanksHello Sergio,
Change Installed languages to include (The default value will be DE where D- stands for German and E stands for English)
Change the value by zcsa/installed_languages = DEFPS
Now this means that D- stands for German, E- stands for English and , F French, P stands for portugese, S Spanish.
The users while logging in will have to give in the logon language field "PT"
Change to desired language for logon screen (like French)
zcsa/system_language = F
you must restart SAP to activate these settings
Regards,
AK -
How to declare normal java array in fx
How can we declare normal java array in fx. lets say I extend an abstract java class and it has a method which takes String array as parameter: abstract public void met(String[] users) ;How can i declare String[] parameter while overriding this abstract method in javafx. This does not work: override public function met(s:String[]){ ... }
Hi,
The code below works for me:
public function run(args:String[]){
var s:String[] = ["Hi", "Hello", "Love", "Peace"];
var t:Test2 = Test2{};
t.met(s);
public abstract class Test{
public abstract function met(s:String[]):Void;
class Test2 extends Test{
public override function met(s:String[]):Void{
for(x in s){
println(x);
}[]'s -
How to make selection parameter gray out, not changeble mode
Hi Experts,
Selection screen having parameters, I am putting default values in that parametrs.
How to make this parameter gray out, not changeable mode.
Thanks in advance
mahahe.
See comments below
Edited by: Rob Burbank on Jul 1, 2009 12:43 PMHi,
For the parameters required, while declaring them use the MODIF ID, lets say you have choosen the modif id as SC1.
i.e. parametes: p_mat type matnr DEFAULT '100' MODIF ID SC1.
Then in the initialization event, code as below.
LOOP AT SCREEN.
IF screen-group1 = 'SC1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
It will work.
Regards,
Nangunoori. -
How to make a parameter(text box) uneditable by enduser.
Hhi,
SELECTION-SCREEN COMMENT [/]pos(len) comm [FOR FIELD f]
[MODIF ID key].
This statement writes the comm comment on the selection screen. For comm, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length len. The field must be filled before the selection screen is called. You must always specify the pos(len) addition. Only if there are several elements in one line can you omit pos.
The text comm will be displayed, starting in column pos, for a length of len. If you do not use a slash (/), the comment is written into the current line; otherwise a new line is created.
You use FOR FIELD f to assign a field label to the comment. f can be the name of a parameter or a selection criterion. As a result, if the user requests help on the comment on the selection screen, the help text for the assigned field f is displayed.
Regards
Sudheer -
How to declare a workarea of type index table
Hi Experts,
I am getting error as CT_RESULT is a generic type.Use of this type is only possible for typing field symbols and formal parameters when using the below code. Please help me and let me know how to declare it.
TYPES:BEGIN OF ty_guid,
guid TYPE guid,
END OF ty_guid.
DATA:it_guid TYPE STANDARD TABLE OF ty_guid INITIAL SIZE 0,
it_item TYPE STANDARD TABLE OF bbp_pds_sc_item_d INITIAL SIZE 0.
DATA:wa_guid TYPE ty_guid,
wa_item TYPE bbp_pds_sc_item_d.
FIELD-SYMBOLS: <fs_result> like LINE OF ct_result.
SELECT guid FROM crmd_orderadm_h INTO TABLE it_guid
WHERE object_id IN ct_result.
IF sy-subrc = 0.
LOOP AT it_guid INTO wa_guid.
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
i_guid = wa_guid
* I_OBJECT_ID =
* I_ATTACH_WITH_DOC = ' '
i_with_itemdata = 'X'
* I_ITEM_SORTED_BY_HIERARCHY =
* I_WITHOUT_HEADER_TOTALS =
* I_READ_FROM_ARCHIVE = ' '
* IMPORTING
* E_HEADER =
* EV_IS_PD =
* ET_ATTACH =
TABLES
e_item = it_item
* E_ACCOUNT =
* E_PARTNER =
* E_CONFIRM =
* E_LONGTEXT =
* E_LIMIT =
* E_ORGDATA =
* E_TAX =
* E_PRIDOC =
* E_HCF =
* E_ICF =
* E_MESSAGES =
* E_ACTVAL =
* E_ACC_ACTVAL =
* E_HEADER_REL =
* E_ITMLIM_REL =
* E_STATUS =
ENDLOOP.
ENDIF.
IF it_item[] IS NOT INITIAL.
LOOP AT it_item INTO wa_item.
LOOP AT ct_result ASSIGNING <fs_result>.
<fs_result>-zzpurchase_cat = wa_item-be_tracking_no.
* MODIFY ct_result FROM wa_result.
CLEAR wa_result.
ENDLOOP.
CLEAR wa_item.
ENDLOOP.
ENDIF.Hi,
i'm not quite sure where ct_result is first introduced. There seems to be no declaration?
Judging by the name-prefix, it would be a changing parameter of which form?
Where is it populated, since you intend to loop it?
And then, from which hat do you draw wa_result? it neither seems to be declared nor is there an assignment of values.
On the other hand, you're trying to change table ct_result directly by altering a field of an assigned field-symbol. Why do you feel it necessary to follow up with a modify statement?
After so many question-marks i have lost the point of your initial question.
Maybe, you can start with a short description of your intention and a more accurate code-snippet.
Best regards - Jörg -
How to declare a param. of type RANGE OF in a method (or function module)?
Hello,
I've got a following problem.
I want to pass a value of type RANGE OF to a method declared in
an interface (the interface is built using Class Builder). I don't know
how to do that and I did not manage to find a solution using both
SAP help and google.
Did anybody have the same problem before?
Best regards
PawelOk, I find a workaround. Maybe it will be useful for somebody in the future.
Declare the parameter type as ANY TABLE and then cast it to the expected type
in the body of the method.
So for example.
Parameter Type Typing Method Associated Type
I_RNG_DATUM Importing Type ANY TABLE
In the body of the method.
TYPES:
erdat_range TYPE RANGE OF erdat.
FIELD-SYMBOLS:
<l_fs_rng_erdat> TYPE erdat_range.
DATA:
l_ref_to_range TYPE REF TO data.
GET REFERENCE OF i_rng_datum INTO l_ref_to_range.
ASSIGN l_ref_to_range->* TO <l_fs_rng_erdat> CASTING.
However, if somebody know how to pass type RANGE OF
explicitely, the right answer is still welcome.
Best regards
Pawel -
How to get the parameter from Java Script into the Parameter crystal Report
Hi All,
Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
FYI.
Java script sends the right parameter value.There is no issue in java script.
This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
Please clarify?
Maybe you are looking for
-
When my MBP boots it stays at the following state: The mouse works, the keyboard works, i can change the volume and brightness. But it won't continue to the desktop, it should auto-login. Before this happend i've shutdown my MBP by holding the powerb
-
Unique identification of LibraryObjects (persistent objects)
We're working on an application where we need to create references between iFS objects (documents, folders) and external objects. 1) Are there any identifiers which are stable over an object lifetime, even when the object is migrated to another iFS i
-
Hello, We have an in house enterprise app that can no longer update. We have taken the steps outlined here. These steps include installing a SSL certificate on the server from a trusted CA (GeoTrust) that shows as valid in Safari on OSX. Also the
-
Sometimes a single click is unresponsive with JButton
I'm working on a simulator that can run pretty slow at times due to it's massive size. There have been complaints made that sometimes when a user presses a button on the hmi, nothing seems to happen and they have to press it again. Do you guys have a
-
Mozoot and whella "Premium" service fees
I recently notice on my Verizon paper statement charges for $9.99 listed under "PREMIUM MESSAGING". Upon further research I found I was being changed by mozoot.com and whella.com. WHen I called Verizon, they said these were "third party' billings an