2007 Jun 04 4:40 PM
Hi Experts,
I am trying to write this program which will attach a file to the screen with the click of a button. I am using FM f4_filename. Whtever code I have written so far I am pasting it here can you please help me out to execute it successfully its really urgent and I am witing for your response. Thanks!
&----
*& Module Pool ZINDG
*&
&----
*&
*&
&----
PROGRAM ZINDG.
&----
*& Module USER_COMMAND_1010 INPUT
&----
text
----
MODULE USER_COMMAND_1010 INPUT.
*----
AT SELECTION SCREEN
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
data: file_name TYPE string.
PARAMETERS p_file LIKE rlgrap-filename.
OBLIGATORY.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'p_file '.
IMPORTING
FILE_NAME = i_path
p_file = i_path.
.
*----
START OF SELECTION
*----
START-OF-SELECTION.
PERFORM upload_file.
END-OF-SELECTION.
*----
FORM
*----
FORM upload_file.
file_name = p_file.
endform.
ENDMODULE. " USER_COMMAND_1010 INPUT
Hi Experts,
I am trying to write this program which will attach a file to the screen with the click of a button. I am using FM f4_filename. Whtever code I have written so far I am pasting it here can you please help me out to execute it successfully its really urgent and I am witing for your response. Thanks!
&----
*& Module Pool ZINDG
*&
&----
*&
*&
&----
PROGRAM ZINDG.
&----
*& Module USER_COMMAND_1010 INPUT
&----
text
----
MODULE USER_COMMAND_1010 INPUT.
*----
AT SELECTION SCREEN
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
data: file_name TYPE string.
PARAMETERS p_file LIKE rlgrap-filename.
OBLIGATORY.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'p_file '.
IMPORTING
FILE_NAME = i_path
p_file = i_path.
.
*----
START OF SELECTION
*----
START-OF-SELECTION.
PERFORM upload_file.
END-OF-SELECTION.
*----
FORM
*----
FORM upload_file.
file_name = p_file.
endform.
ENDMODULE. " USER_COMMAND_1010 INPUT
2007 Jun 04 4:46 PM
&----
*& Module Pool ZINDG
*&
&----
*&
*&
&----
PROGRAM ZINDG.
&----
*& Module USER_COMMAND_1010 INPUT
&----
text
----
MODULE USER_COMMAND_1010 INPUT.
*----
AT SELECTION SCREEN
*----
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
data : v_repid like sy-repid.
data: file_name TYPE string.
v_repid = sy-repid.
PARAMETERS p_file LIKE rlgrap-filename.
OBLIGATORY.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = v_repid
DYNPRO_NUMBER = SYST-DYNNR
*FIELD_NAME = 'p_file '.
IMPORTING
FILE_NAME = p_path
p_file = i_path.
.
*----
START OF SELECTION
*----
START-OF-SELECTION.
PERFORM upload_file.
END-OF-SELECTION.
*----
FORM
*----
FORM upload_file.
file_name = p_file.
endform.
ENDMODULE. " USER_COMMAND_1010 INPUT
See the code i modified
2007 Jun 04 4:48 PM
See the simple report program for f4 value to file
report x.
data : v_repid like sy-repid.
parameters p_file like rlgrap-filename obligatory.
initialization.
v_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = v_repid
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
.
2007 Jun 04 4:58 PM
Hi Seshu
I used the code modified by you but I am getting the following error:
Incorrect nesting: Before the statement "AT", the structure introduced
by "MODULE" must be concluded by "ENDMODULE"....
2007 Jun 04 5:06 PM
I do not understand what you need,you are writing diaglog program and no need to use start-of-selection,
can you please explian what you need ?
2007 Jun 04 5:26 PM
My question is I need to write a code acc to which if i click on a button ATTACH on a screen the pop up window should appear then we will specify the file location and file should get attached.. now can u tell me how to do this and send me some code accordingly . i need it urgent today
Thanks
2007 Jun 04 5:29 PM
Hello Saritha,
Please follow like this when you want to have F4 value on file in dialog program.
Create program in se38 with type M
let assume program name is ZFILE
goto se51 give ur program zfile and screen number like 9000 and click on create button.
now give description and save ,activate. click on layout and here click on push button ,maintain name like file ,and function code is FILE.
save it and activate it.
come to flow logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000. ( Uncomment ,double click on this ,create pf-status for back,cancel,exit(shoule be upper case)
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.( uncomment and double click).
PROGRAM ZFILE .
data : v_repid like sy-repid.
data p_file(128) type c.
&----
*& Module USER_COMMAND_9000 INPUT
&----
text
----
MODULE USER_COMMAND_9000 INPUT.
case sy-ucomm.
when 'FILE'.
v_repid = sy-repid.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = v_repid
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
.
when 'BACK'.
leave to screen 0.
when 'CANC'.
leave to screen 0.
when 'EXIT'.
leave to screen 0.
endcase.
ENDMODULE. " USER_COMMAND_9000 INPUT
&----
*& Module STATUS_9000 OUTPUT
&----
text
----
MODULE STATUS_9000 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
see the code and follow like this ,once you done ,you need activate .
create transaction in se93 select first radio button ,use program name and screen number.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |