File upload....How to find the user entered any file or not
Hi Team,
I am working on with file upload UI.
Some times without clicking on browse button, I mean without entering any file they are cliking on upload button, which is giving the exception.
I know there is no action for UI element, Then how to resolve this?
I just control the user, not to press the upload button without entering any file name there?
How to resolve this?
regards,
Bala
Hi,
This code will solve ur problem.
public void onActionUploadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUploadFile(ServerEvent)
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateFileUploadDownloadView.IContextElement.FILE_RESOURCE);
IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)attributeInfo.getModifiableSimpleType();
IPrivateFileUploadDownloadView.IContextElement element = wdContext.currentContextElement();
if(element.getFileResource() !=null)
try
String mimeType = binaryType.getMimeType().toString();
byte[] file = element.getFileResource();
//element.s
wdComponentAPI.getMessageManager().reportMessage(IMessageFileUploadDownloadComp.SF__UPLOAD,new Object[] {binaryType.getFileName()},false);
catch(Exception e)
throw new WDRuntimeException(e);
else
wdComponentAPI.getMessageManager().reportMessage(IMessageFileUploadDownloadComp.NO__FILE,new Object[] {" "},true);
//@@end
Here "fileresource" is context attribute name
Regards,
Sunaina Reddy T
Similar Messages
-
How to find the user entered value is Integer or not?
hi,
i want to find, whether the user entered value is Integer or not. If it is Integer, i wanna continue the program. otherwise send an error message. i tried to find for function in API. But i couldn't. can somebody help me with sample code. very urgent.Do a Integer.parseInt(<string value>) in a try catch block If a NumberFormatException is thrown, the entered number is not an integer.
-
How to find the user exits and BADIS from SPRO
Hi all,
please let us know how to find the User exits or BADIS for an application from SPRO.
Regards,
MadhaviHi Varisetty,
Finding user exits and BAdis from SPRO can be cumbsersome. In most instances you know the standard SAP program and want to check (find) an exit called in the flow of the transaction. You can do this as follows:
For User Exit:
Put "/h" in the command box (to start debugging)
Execute your transaction
When you enter debugging - put a breakpoint at statement
CALL CUSTOMER-FUNCTION
the control will stop at all calls to User Exits
For BAdi (it's simpler)
Go to class CL_EXITHANDLER in SE24
Enter method GET_INSTANCE
Put a breakpoint in this method
Run your standard transaction - control will stop at all BAdis called within the flow since this method is used to check BAdi implementations before invoking them
Also, if you want to find enhancements by package - go to SE80, enter the package and check function groups starting with X - those contain function exits (conventional user exits). For BAdis in a package, there is normally a separate tree node (under the package) for Enhancements hence clearly identifiable.
Cheers,
Adi -
How to find the user menu of a user
Hi,
I have a request to change the description of a custom transaction in the user menu of a user. Im not sure
How to find the user's user menu...
Can we add any small documentation or comments to each object in user menu...
Thanks in advance
search before posting , it is a warning to you
Edited by: Vijay Babu Dudla on Dec 31, 2008 5:00 AM
Edited by: Vijay Babu Dudla on Dec 31, 2008 5:05 AMWelcome to SCN.
Just refer: [Area Menu Maintenance |http://help.sap.com/saphelp_nw2004s/helpdata/en/00/783b377bfdcf61e10000009b38f936/frameset.htm] -
How to find the user exit for a screen..
Hi,
plz help me how to find the user exit for a screen..?
Regards
AnbuHi,
check this program this will give you the list of user-exit and BADI for the perticular Tcode.
REPORT zuserexit_badi.
TABLES : tstc,
tadir,
modsapt,
modact,
trdir,
tfdir,
enlfdir,
sxs_attrt ,
tstct.
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
PARAMETERS : p_tcode LIKE tstc-tcode,
p_pgmna LIKE tstc-pgmna .
DATA wa_tadir TYPE tadir.
START-OF-SELECTION.
IF NOT p_tcode IS INITIAL.
SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
ELSEIF NOT p_pgmna IS INITIAL.
tstc-pgmna = p_pgmna.
ENDIF.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.
IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name EQ enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
SELECT * FROM tadir INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object IN ('SMOD', 'SXSD')
AND devclass = v_devclass.
SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/(105) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
SORT jtab BY object.
DATA : wf_txt(60) TYPE c,
wf_smod TYPE i ,
wf_badi TYPE i ,
wf_object2(30) TYPE c.
CLEAR : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT jtab INTO wa_tadir.
AT FIRST.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Enhancement/ Business Add-in',
41 sy-vline ,
42 'Description',
105 sy-vline.
WRITE:/(105) sy-uline.
ENDAT.
CLEAR wf_txt.
AT NEW object.
IF wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
ELSEIF wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
ENDIF.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 sy-vline,
2 wf_object2,
105 sy-vline.
ENDAT.
CASE wa_tadir-object.
WHEN 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE modtext INTO wf_txt
FROM modsapt
WHERE sprsl = sy-langu
AND name = wa_tadir-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WHEN 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
SELECT SINGLE text INTO wf_txt
FROM sxs_attrt
WHERE sprsl = sy-langu
AND exit_name = wa_tadir-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
ENDCASE.
WRITE:/1 sy-vline,
2 wa_tadir-obj_name HOTSPOT ON,
41 sy-vline ,
42 wf_txt,
105 sy-vline.
AT END OF object.
WRITE : /(105) sy-uline.
ENDAT.
ENDLOOP.
WRITE:/(105) sy-uline.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
DATA : wf_object TYPE tadir-object.
CLEAR wf_object.
GET CURSOR FIELD field1.
CHECK field1(8) EQ 'WA_TADIR'.
READ TABLE jtab WITH KEY obj_name = sy-lisel+1(20).
MOVE jtab-object TO wf_object.
CASE wf_object.
WHEN 'SMOD'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
WHEN 'SXSD'.
SET PARAMETER ID 'EXN' FIELD sy-lisel+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE.
Reagards,
Bharat. -
How to find the user exit for infotype 2013 ?
Hi All,
How to find the user exit in infotype 2013? i want to change the drop down list default value in infotype 2013.
Thanks,
Srikanth Preward points if useful
User exit name is PBAS0001.
code should be written in ZXPADU01 for PBO
ZXPADU02 for PAI. -
How to find the user who deleted the contents of DSO.
Dear friends,
Can u please tell me ,how to find the user who deleted the contents of the DSO.
The user has deleted the complete contents of the DSO. We need to find the user ,date and time.
regards,
VijaiHi,
If the user has used the manage option to delete the contents of the DSO then the changed by field will be updated by the users name. In case a program is used for the deletion then it wont be the case.
Regards
Govind. -
How to get the user entered data?
Hi all,
I have created an HTMLB DynPage component.
In That i have created my input screen with textboxes using response.write method.
i have added one onConfirm event on which the data whould validate.
so onConfirm method im trying to get the data with request.getParameter method which returns null...
how to do...how to get the user entered data to do my validations...can anyone plz advice.
Thanks,
ViswesHi
inputfield or textbox component entered directly using response.write(...) are not htmlb , but html.
to create portal input field (ie HTMLB), you should do something like
this in the doProcessBeforeOutput member function
InputField field1 = new InputField("Id1");
field1.setSize(8); // 8 characters
this.getForm().addComponent(field1);
and in doProcessAfterInput member function
InputField field1 =
(InputField) this.getComponentByName("Id1");
you can then manipulate the content of the field.
Hope this help,
Guillaume -
How to find the users who r assigned to profile sap_all through su01
how to find the users who r assigned to profile sap_all through su01
you can get into SUIM-->where used lists, check for users with profile SAP_ALL you can get a list of users who have
it. and you can get into SUIM through SU01 from user information system link.
you can execute RSUSR002 from SA38/SE38.
RSUSR002 is the report which gets you the whereused list for profiles within roles, users.
you can get it from transaction SECR ofcourse you are executing the same report.
you can get from UST04 table and obviously USR04 also because sometimes you miss some details from UST04 because of sync problems. -
How to find the user exits called at the time of posting the IDOC?
Hi,
Could anyone please how to find the user exits while posting a idoc?Hi,
One way to ahive this is by, be ready with IDOC postiong,
then go to ST05 transaction and activate the trace after checking Table Buffer Trace.
Now post the IDOC then deactivate the trace.
Now come back to ST05 and display trace and search for calls starts with EXIT_.
Regards,
Manoj Kumar P -
How to Find the Runtime for any workitem.
Hi,
Could you please tell how to find the runtime for any workitem.
Thanks,
Bhanu Gattu.Hi,
I think, your query is pertaining to Workflow.
Please explain your requirement little more.
If you need Runtime Analysis: Then the transaction Code: SE30 must be used.
Thanks.
RamaniN
Edited by: Ramani Nagarajan on May 21, 2009 12:33 PM -
I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
import java.io.File;
import java.io.FileNotFoundException;
import java.util.InputMismatchException;
import java.util.Scanner;
public class FileRead {
public static void main(String args[]) {
Scanner scan = null;
File file = new File("Results.txt");
String number;
try {
scan = new Scanner(file);
while (scan.hasNext()){
number = scan.next();
System.out.println(number);}
catch (FileNotFoundException ex1){
System.out.println("No such file");
catch (IllegalStateException ex2){
System.out.println("Did you close the read by mistake");
catch (InputMismatchException ex){
System.out.println("File structure incorrect");
finally{
scan.close();}
}Any hints would be greatly appreciated. Thank you in advanceI have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
This code compiles but at run time it comes up with this error
run-single:
java.lang.NoClassDefFoundError: NamedFile
Exception in thread "main"
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)
import java.util.Scanner;
import java.io.*;
class NamedFileInput
public static void main (String[] args) throws IOException
int num, square;
// this Scanner is used to read what the user enters
Scanner user = new Scanner( System.in );
String fileName;
System.out.print("File Name: ");
fileName = user.nextLine().trim();
File file = new File( fileName ); // create a File object
// this Scanner is used to read from the file
Scanner scan = new Scanner( file );
while( scan.hasNextInt() ) // is there more data to process?
num = scan.nextInt();
square = num * num ;
System.out.println("The square of " + num + " is " + square);
}his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!! -
How to find the user exit for the T-code 'RECN'
Hi friends,
I have a requirement as-
In 'General Data with Fast Entry' tab of tcode 'RECN' there are 2 fields as contract conclusion date and contract end date.
Now, the requirement is as if entered contract end date is less than contract conclusion date then we have to display a warning message as "contract end date cannot be less than contract conclusion date".
So, how to find the right user exit to enter the code.
Plz help me.I will surely reward points.
Thanks,
RishiHi Rishi,
If User exits and BAdi's are not provided, then you will for Enhancement points.
Procedure:
When you are in a particular transaction, Go to System--> status and you find the standard program of that particular screen. Go to SE38 and give that program name, display mode.
After that you click on the spiral icon there onthe top. Then,
You go to menu bar, Edit> Enhancement opitons> show implicit enhancement options.
You will be shown the points where you need to write the code.
For creating it you will go to Edit > Enhancement opitons> Create.
By this you will add some code in the standard programs.
Reward points if it helps you.
Cheers,
Swamy Kunche -
How to find the user who has changed a field in a table
Hello
Someone has changed a field cost center in my table so i need to find the user who hav changed it.Can anyone tel me how to find it.
RegardsHI ,
Create a Z test program using the particular table and filed .
Now goto SE38 and execute the program " RSDEPEND "
give the ur test program and then execute . u will get the list of the last change of ur program
( table and fields used inthis program)
Another way :
for data element :
refer table
DD04L and get the user name
for domain
DD01L
Edited by: shambhu sharan pandey on Nov 13, 2009 5:49 AM -
How to find the user-exit for transaction fpp2
Hi experts,
could you help me how can I find the user-exit for transaction fpp2. I tried to after the package, but I did not find it.Hi,
Use the following program to find user exits of specified code.
*& Tables
TABLES : tstc, "SAP® Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP® Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
IF sy-subrc EQ 0.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna.
MOVE : tadir-devclass TO v_devclass.
IF sy-subrc NE 0.
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna.
IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna.
SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname.
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP® Modifications
SELECT * FROM tadir
INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object = 'SMOD'
AND devclass = v_devclass.
SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/(95) sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
WRITE:/(95) sy-uline.
LOOP AT jtab.
SELECT SINGLE * FROM modsapt
WHERE sprsl = sy-langu AND
name = jtab-obj_name.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WRITE:/1 sy-vline,
2 jtab-obj_name HOTSPOT ON,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
ENDLOOP.
WRITE:/(95) sy-uline.
DESCRIBE TABLE jtab.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No of Exits:' , sy-tfill.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'No User Exit exists'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(95) 'Transaction Code Does Not Exist'.
ENDIF.
Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
GET CURSOR FIELD field1.
CHECK field1(4) EQ 'JTAB'.
SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
I executed the above program but there are no user exits for the specified Transaction.
Thanks,
Naveen Kumar.
Maybe you are looking for
-
Downloading file from ftp server
hii how do i download the file from ftp server. plz suggest wat are the function modules for tht.. and plz do give the values of the parameters used in the fn modules points guranteed:-)
-
I am trying to submit a book via iTunes Producer (Ver 3.0) but I keep getting the below errors. Can you someone help me figure out what I need to change in my epub file to resolve these errors. I would be SO apprciative of any help you give us. Th
-
When I updated my iphone 4S to iOS 6.0, I lost all of my phone contacts. How can I retrieve them?
-
Why does iTunes 11 keep reopening after I quit?
This is moving from the bizarre to the absurd. I recently updated to iTunes 11 on my MacBook Pro (OSX 10.7.5), and now iTunes keeps reopening after I quit. I have checked the support forum for similar issues from previous versions. I do not have "
-
Save variable value and locking the code
Hi, I want to save some values of indicator on front panel in place of typing them each time. e.g, maximum velocity 1 mm/sec maximum accel ..... Each time, while opening I want the values used in last experiment as default. I do not want to set a fix