‎2006 May 31 10:07 AM
Dear Friends,
I have designed a screen for inputting the data. The codes written in PAI is given below. The problem I am facing is that, the data entered in the screen is not getting inserted into the table as well as it is not getting exit, when the exit button is pressed.
I have created two buttons Save and Exit.
Please let me know what is the error.
--------------------------------
*& Module USER_COMMAND_1000 INPUT
--------------------------------
MODULE USER_COMMAND_1000 INPUT.
TABLES : ZTDR.
DATA OK_CODE LIKE SY-UCOMM.
CASE OK_CODE.
WHEN 'Save'.
INSERT ZTDR.
WHEN 'Exit'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
--------------------------------
Thanks in advance.
MARK
‎2006 May 31 10:11 AM
Hi,
Instead of LEAVE PROGRAM, write LEAVE TO SCREEN 0. or CALL TRANSACTION SE38.
For saving the work, give the statement COMMIT WORK in the end. Also make sure that the function code of yuor buttons are given correctly in your code. Check if they are 'Save' and 'Exit' only.
Regards,
Aswin
‎2006 May 31 10:14 AM
check the name of button ..
WHEN <b>'Save'.</b>
INSERT ZTDR.
WHEN <b>'Exit'</b>.
‎2006 May 31 10:34 AM
‎2006 May 31 10:15 AM
Hi,
small correction to your code..
MODULE USER_COMMAND_1000 INPUT.
TABLES : ZTDR.
DATA OK_CODE LIKE SY-UCOMM.
CASE OK_CODE.
<b>WHEN 'SAVE'.</b>
INSERT ZTDR.
<b>WHEN 'EXIT'.</b>
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUTokcode should be in CAPS.
Regards
vijay
‎2006 May 31 10:35 AM
‎2006 May 31 10:37 AM
are u mention ok code in screen -->element list...
declared ok code in the element List of screen Painter.
‎2006 May 31 12:31 PM
Hi,
i have a doubt did you activated the PF-sattus ?
module STATUS_0100 output.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUTi really doubt, you are missing it.
Regards
vijay
‎2006 May 31 10:17 AM
Make the following change..
CASE OK_CODE.
WHEN 'SAVE'. "wrote SAVE in capitals
INSERT ZTDR.
WHEN 'EXIT'. "wrote EXIT in capitals
LEAVE PROGRAM.
ENDCASE.
Also make sure that OK_CODE is declared in the Element List of the Screen 1000
‎2006 May 31 10:35 AM
‎2006 May 31 10:19 AM
Function COdes should always be in CAPS.
Enjoy Coding...
Thomas.
‎2006 May 31 10:30 AM
Hi Mark,
Have you activated the screen flow logic in the screen painter..? I think that may be the reason why the exit button is not working and for the data not getting updated...
Regards,
SP.
‎2006 May 31 10:36 AM
‎2006 May 31 10:42 AM
Hi Mark,
First assign OK_CODE = SY-UCOMM.
Also I hope the field's name is also related to the table...
For eg: if you have an element for entering <b>field1</b> of table <b>ZABC</b>, the screen field name should be <b>ZABC-field1</b>. Then only you can use the statement
INSERT ZABC.
<b>Also if you are using a variable for SY-UCOMM (say ok_code) that should be declared in the element List of screen Painter.. Have you done that??</b>
Anyway, give me the details of the table like the element , its type etc..
Let me also try it out...
Regards,
SP.
Message was edited by: Sylendra Prasad
‎2006 May 31 10:45 AM
Hi,
<b>ok_code = sy-ucomm.</b> <<<<<----"you missed it.
Regards
vijay
‎2006 May 31 10:54 AM
Atlease for Exit (leave program) should work. But it is not working .
Regards,
‎2006 May 31 11:02 AM
Hi Mark
I don't know how you have called the screen, anyway your code should be:
TOP (Include): here you should declare your data:
TABLES : ZTDR.
DATA OK_CODE LIKE SY-UCOMM.
Screen:
Insert OK_CODE in the elements list of the screen
MODULE USER_COMMAND_1000 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
INSERT ZTDR.
COMMIT WORK
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
It should be better to not use the 1000 as number for a screen, it's usually used for selection-screen.
Max
‎2006 May 31 11:02 AM
ok_code = sy-ucomm.
This line is added now. but not effect.
Regards.
‎2006 May 31 11:03 AM
Hi Mark
You don't need that line:
Insert a break-point before CASE statament and check the value of OK_CODE.
Max
‎2006 May 31 11:09 AM
declared ok code in the element List of screen Painter.
go to screen
go to element screen option.
rite ok_code and than
enter.
‎2006 May 31 11:32 AM
Hi Mark,
Any improvement in your problem...?
If not, just send a blank mail to
<b>sylendra.prasad@wipro.com.</b>
I will send u a document on how to solve such problems in Screen Painter....
Regards,
SP.
‎2006 May 31 12:15 PM
Hi Friends,
I have tried all the suggestions given by u all. But still the same problem exits.
Pls some more suggestions.
Regards.
‎2006 May 31 12:19 PM
Hi Mark,
Just give me your mail id.. I will send you the document on how to solve such problems..
Regards,
SP.
Message was edited by: Sylendra Prasad
‎2006 May 31 12:22 PM
try one more thing...
go to screen painter.
open the properties of button .
check u write exit there..... ....
‎2006 May 31 12:26 PM
my mail id is vincent_as2004@yahoo.com.
Pls send your valuable guidelines.
‎2006 May 31 12:27 PM
hi mark,
check the function codes of 'Save' & 'exit' are they the same as u have written.
thanks,
priya.
‎2006 May 31 12:34 PM
Break point is not working. It directly takes to screen.
Regards.
‎2006 May 31 12:55 PM
Declare OK_CODE in the main program and not in the Modules
DATA OK_CODE LIKE SY-UCOMM.
When you have declared OK_CODE in the element list of the screen, you do not have to assign SY-UCOMM to OK_CODE again!!!
‎2006 May 31 1:26 PM
Hi Mark,
What is the status of the query..?
<b>I have sent you the document on your mail id ..
Is your problem solved...?</b>
Regards,
SP.
‎2006 May 31 10:39 AM
hi mark,
u have forgot to assign ok_code u have just defined it.
give after
DATA OK_CODE LIKE SY-UCOMM.
<b>ok_code = sy-ucomm.</b>
and try.
hope this helps,
priya.
‎2006 May 31 10:53 AM
‎2006 May 31 11:02 AM
Hi Mark,
Can you just give the details of the table...?
What about the screen field names??
Suppose ZABC is the table and f1,f2...fn are the fields in the table, then the screen field names should be ZABC-f1,ZABC-f2,ZABC-fn...
Also for the exit button , is the Function type E..? Then it should be come under the module <b>AT EXIT-COMMAND</b>....
<b>Also, have you defined OK_CODE in the element list???</b>
Regards,
SP.
‎2006 May 31 12:31 PM
Hi Mark
Regarding the data reflection in the table...
In PAI
loop at itab.
MODULE MODIFY_CHANGES.
endloop.
MODULE MODIFY_CHANGES INPUT.
modify itab index tc-current_line.
ENDMODULE.
itab is the internal table
tc is the table control.
Regarding the EXIT.
Please check the fcode of the buttons.
Case sy-ucomm.
when 'SAVE'.
....
when 'EXIT'.
leave program.
endcase.
‎2006 Jun 01 6:55 AM
Hi Mark,
You told me you were using module pool program and not executable program. It doesn't matter.. It will work..All you have to do is create a transaction for the program using the transaction SE93 and execute.
Also you were using table of type C and not A. I tried to do with that table also.It was not apparently showing any problems..Data is getting inserted and exit button was working properly..
<b>Can you tell me the details of the table you are using..?</b>
Just check your mail. I have sent you another document regarding solving your problem.
Regards,
SP.