‎2008 Jan 04 11:01 AM
Hi,
I have text box in one screen. I am passing the Value to the text box through the Program. Then it should trigger the PAI according to the Value in the Text Box. For this purpose How can I pass the Ok_code ?
If i pass the ok_code through the Program will it trigger the PAI or NOT ?
Regards,
satya.
‎2008 Jan 04 11:11 AM
Hi,
PAI triggers after user input.
Assign a function code to the push button. then in program,
case sy-ucomm.
when 'SAVE'.
if wrk_text eq 'Something you want to give'.
<code for save.>
endif.
when 'CANCEL'.
<code for cancel> etc..
endcase.
In that way you can code.
Regards,
Renjith Michael.
‎2008 Jan 04 11:11 AM
hope this code helps u
DATA:
Global variable to store OK code
ok_code(4),
Temporary store the value of the OK code
save_ok_code(4).
Create code for the screen
PROCESS BEFORE OUTPUT.
MODULE status_0001.
PROCESS AFTER INPUT.
MODULE user_command_0001.
MODULE status_0001 OUTPUT.
SET PF-STATUS '0001'.
SET TITLEBAR '001'.
Example of how deactivate a field on the screen
ZCOSTAFSTM-ZAFSTEMNR is the name of the screen field we want to
deactivate.
LOOP AT SCREEN.
CHECK screen-name = 'ZCOSTAFSTM-ZAFSTEMNR'.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
MODULE user_command_0001 INPUT.
Here you can catch when user pushes a pushbutton*
Save the OK code in save_ok_code and clear it*
save_ok_code = ok_code.
CLEAR ok_code.
CASE save_ok_code.
WHEN '0010'.
Afstemninger*
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
PERFORM my_list.
WHEN '0020'.
CALL TRANSACTION 'ZCO1'.
WHEN 'RETU'.
LEAVE TO SCREEN '0000'.
ENDCASE.
ENDMODULE.AT USER-COMMAND.
Here you can catch when the user psuh a button on the menu bar or presses a function key
CASE sy-ucomm.
WHEN 'OPRT'.
PERFORM something.
ENDCASE.
‎2008 Jan 04 11:19 AM
Hi,
Here there is no user Input . We have to trigger the PAI by sending the Enterkey value.
Through program we have to press the enter key.
How is it possible ?
Regards,
Satya.
‎2008 Jan 04 11:31 AM
Hi,
Plase try using the command:
SET USER-COMMAND 'your user command'..
for example,
WRITE: 'List'... "Create a list
SET USER-COMMAND 'FUN'.
Processes the event AT USER-COMMAND immediately; the system field SY-UCOMM contains the function code FUN.
for ENTER key the default value is ' '. (space)
Regards,
Renjith Michael.
Edited by: Renjith Michael on Jan 4, 2008 5:02 PM