‎2008 May 06 10:31 AM
Hi,
Can anybody guide me to find a solution of the following problem
I have a push button and i want to call a function to transfer a file from one folder to another .
The problem is how to call that function on the click of the button.
Thanks in advance.
‎2008 May 06 11:43 AM
Hi,
Check the below code.
type-pools icon.
data: v_flag type c.
tables: sscrfields.
selection-screen begin of block file with frame.
selection-screen skip.
selection-screen pushbutton 1(30) xdatatxt user-command selx.
selection-screen skip.
selection-screen end of block file .
initialization.
xdatatxt+5 = 'Physical file'.
xdatatxt+0(5) = icon_address.
at selection-screen.
if sscrfields-ucomm = 'SELX'.
v_flag = 'X'.
endif.
start-of-selection.
if v_flag = 'X'.
write:/ 'selected'.
do what ever you want here
else.
write:/ 'No'.
endif.
‎2008 May 06 10:34 AM
well in the PAI section of your dynpro you either already have some staement like:
case sy-ucomm.
when 'xxxx'.
when others.
endcase.
there insert a when with your funtion code and the do your coding.
e-G- call function.
‎2008 May 06 10:35 AM
Hi,
When you click on the pushbutton.
you have assigned any function code to that or if it a selection screen you have assigned any user-command to that pushbutton.
Write the code for the same
case sy-ucomm.
when 'PUSH'.
Perform your action here.( YOUR FUNCTION MODULE CALL )
Encase.
Regards,
Madan.
‎2008 May 06 10:47 AM
Hi,
I actually created a user defined function in that i am calling a function module .
But when i write a perform statement in CASE-ENDCASE block it do not executes.
‎2008 May 06 11:43 AM
Hi,
Check the below code.
type-pools icon.
data: v_flag type c.
tables: sscrfields.
selection-screen begin of block file with frame.
selection-screen skip.
selection-screen pushbutton 1(30) xdatatxt user-command selx.
selection-screen skip.
selection-screen end of block file .
initialization.
xdatatxt+5 = 'Physical file'.
xdatatxt+0(5) = icon_address.
at selection-screen.
if sscrfields-ucomm = 'SELX'.
v_flag = 'X'.
endif.
start-of-selection.
if v_flag = 'X'.
write:/ 'selected'.
do what ever you want here
else.
write:/ 'No'.
endif.