‎2009 Apr 14 9:20 AM
Try this code
PARAMETERS: p_fpath1 TYPE string LOWER CASE MEMORY ID rofile,
p_fpath2 TYPE string LOWER CASE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath1.
PERFORM get_filepath CHANGING p_fpath1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath2.
PERFORM get_filepath CHANGING p_fpath2.
*---------Forms
FORM get_filepath CHANGING x_filepath TYPE string.
DATA: l_filepath TYPE string.
cl_gui_frontend_services=>directory_browse( CHANGING selected_folder = l_filepath ).
* If no filepath selected, leave the filepath unchanged
IF l_filepath IS NOT INITIAL.
x_filepath = l_filepath.
ENDIF.
ENDFORM.Run the program, and use F4 to choose a file path for p_fpath1 and another for p_fpath2.
Hit execute
Leave the program.
Run the program again.
Use F4 to choose the filepaths for the two parameters.
For me, it's fine for p_fpath2, but for p_fpath1, I get no directory selector. In fact, to get it working again, I have to log off and log back on.
I'd like to know if anyone else gets the same problem, and also if anyone knows how to fix it!
thanks
matt
‎2009 Apr 14 9:43 AM
PARAMETERS: p_fpath1 TYPE string LOWER CASE MEMORY ID rofile,
p_fpath2 TYPE string LOWER CASE.
statement memory id rofile is creating this problem
because program saves the last value of variable p_fpath1 into sap memoryand retrives it back in next execution so try clearing this memory.
hope this will help you
regards
raghu
‎2009 Apr 14 9:29 AM
Hi matt,
I tried your piece of code and it works perfectly fine for me .
Rgds,
Sandeep
‎2009 Apr 14 9:32 AM
Ok - looks like a gui error then.
Can you confirm your gui version and ABAP stack version?
I'm on 7100.3.12.3123, build 1046700, patch 12 for SAPGui, and
SAP_ABA 700 0016 SAPKA70016 Cross-Application Component
SAP_BASIS 700 0016 SAPKB70016 SAP Basis Component
For the app. server.
Please note, you have to follow the exact steps to get the behaviour. If you don't hit execute it works fine! ( which isn't much use for a report program )
matt
‎2009 Apr 14 9:34 AM
Tried it out and it is indeed not working.
Haven't got an idea why this is happening and how to solve it though.
edit:
And i'm on:
7100.2.8.3083 build 983952 SP level 8
SAP_ABA 700 0014 SAPKA70014
SAP_BASIS 700 0014 SAPKB70014
‎2009 Apr 14 9:40 AM
Hello Matt,
I also feel it's a GUI problem. May be other SDNers will have a better answer to this. Anyways can use the method cl_gui_cfw=>flush after the cl_gui_frontend_services=>directory_browse.
cl_gui_frontend_services=>directory_browse( CHANGING selected_folder = l_filepath ).
CALL METHOD cl_gui_cfw=>flush.Hope this helps.
BR,
SUhas
‎2009 Apr 14 2:18 PM
>
> Hello Matt,
>
> I also feel it's a GUI problem. May be other SDNers will have a better answer to this. Anyways can use the method cl_gui_cfw=>flush after the cl_gui_frontend_services=>directory_browse.
>
>
cl_gui_frontend_services=>directory_browse( CHANGING selected_folder = l_filepath ). > CALL METHOD cl_gui_cfw=>flush.>
> Hope this helps.
>
> BR,
> SUhas
Great bit of thinking there! But didn't work...
‎2009 Apr 14 9:43 AM
PARAMETERS: p_fpath1 TYPE string LOWER CASE MEMORY ID rofile,
p_fpath2 TYPE string LOWER CASE.
statement memory id rofile is creating this problem
because program saves the last value of variable p_fpath1 into sap memoryand retrives it back in next execution so try clearing this memory.
hope this will help you
regards
raghu
‎2009 Apr 14 2:19 PM
>
> PARAMETERS: p_fpath1 TYPE string LOWER CASE MEMORY ID rofile,
> p_fpath2 TYPE string LOWER CASE.
> statement memory id rofile is creating this problem
> because program saves the last value of variable p_fpath1 into sap memoryand retrives it back in next execution so try clearing this memory.
> hope this will help you
> regards
> raghu
...and Gurpreet Singh...
The behaviour I want is for the user to get the same path when they re-run the tranasaction. So clearing the memory isn't going to help, is it? Think about it...
matt
‎2009 Apr 14 2:43 PM
Funny thing is: when you enter a SPACE or any other character and then hit F4, it seems to work again (at least in my case).
But i don't think you can expect a user to enter a space or other character before hitting F4.
‎2009 Apr 14 2:45 PM
The issue was with the STRING VARIABLE in parameters decelaration.I just changed it to RLGRAP-FILENAME it worked.
Try these codes.
PARAMETERS: p_fpath1 TYPE rlgrap-filename LOWER CASE MEMORY ID rofile,
p_fpath2 TYPE rlgrap-filename LOWER CASE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath1.
PERFORM get_filepath CHANGING p_fpath1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath2.
PERFORM get_filepath CHANGING p_fpath2.
START-OF-SELECTION.
WRITE : p_fpath1,p_fpath2.
*---------Forms
FORM get_filepath CHANGING x_filepath TYPE rlgrap-filename.
*CALL METHOD cl_gui_cfw=>flush.
DATA: l_filepath TYPE string.
CLEAR :l_filepath,x_filepath.
cl_gui_frontend_services=>directory_browse( CHANGING selected_folder = l_filepath ).
* If no filepath selected, leave the filepath unchanged
IF l_filepath IS NOT INITIAL.
x_filepath = l_filepath.
ENDIF.
ENDFORM. "get_filepathLAST ENTERED VALUE WILL ALSO DISPLAY
These codes work.
Regards,
Gurpreet
‎2009 Apr 14 3:02 PM
I changed it to CHAR255, which should be sufficient. It seems that parameter ids and strings don't get on very well. As was point out, with a string, the F4 event wasn't even being processed.
Anyway - thanks for your help.
matt
‎2009 Apr 14 9:44 AM
I tried to replicate the Same scenario.I faced the same issue but when i set a break point and tried Debugging event AT selection-screen on Value request is not trigerring at all.
I think its the issue with the Memory Id of the Parameter i just tried to remove the memory Id from the Path1 the F4 help was displayed.
Try to clear the Memory Id.
You need to clear the session memory.
Regards,
Gurpreet
Edited by: Gurpreet Singh on Apr 14, 2009 11:02 AM
‎2009 Apr 14 3:03 PM
MEMORY ID is causing the problem..
Addition 4
... MEMORY ID pid
Effect
This addition links the input field of the parameter with a SPA/GPA parameter in the SAP Memory. The name of the SPA/GPA parameter must be specified directly and with a maximum of 20 characters
The input.field is filled - when the selection screen is called - with the current value of the SAP/GPA parameter in the SAP memory, provided the data object para is initial after processing of the event AT SELECTION-SCREEN OUTPUT. Otherwise, the value of para is displayed. If there is a user action on the selection screen, the content of the input field is assigned to the SPA/GPA parameter in the SAP memory. If no SPA/GPA parameter exists for the specified name, it will be created.
Regards,
Naimesh Patel
‎2009 Apr 14 5:24 PM
No, it isn't. Read the answers above. It's having string parameter that causes it.