Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Screen painter

Former Member
0 Likes
2,608

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

33 REPLIES 33
Read only

Former Member
0 Likes
2,561

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

Read only

0 Likes
2,561

check the name of button ..

WHEN <b>'Save'.</b>

INSERT ZTDR.

WHEN <b>'Exit'</b>.

Read only

0 Likes
2,561

Tried, but no effect.

Any other suggestion.

Regards,

Read only

Former Member
0 Likes
2,561

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 INPUT

okcode should be in CAPS.

Regards

vijay

Read only

0 Likes
2,561

Tried, but no effect.

Any other suggestion.

Regards,

Read only

0 Likes
2,561

are u mention ok code in screen -->element list...

declared ok code in the element List of screen Painter.

Read only

0 Likes
2,561

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  OUTPUT

i really doubt, you are missing it.

Regards

vijay

Read only

Former Member
0 Likes
2,561

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

Read only

0 Likes
2,561

Tried, but no effect.

Any other suggestion.

Regards,

Read only

Former Member
0 Likes
2,561

Function COdes should always be in CAPS.

Enjoy Coding...

Thomas.

Read only

Former Member
0 Likes
2,561

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.

Read only

0 Likes
2,561

It is in active mode.

Regards.

Read only

0 Likes
2,561

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

Read only

0 Likes
2,561

Hi,

<b>ok_code = sy-ucomm.</b> <<<<<----"you missed it.

Regards

vijay

Read only

0 Likes
2,561

Atlease for Exit (leave program) should work. But it is not working .

Regards,

Read only

0 Likes
2,561

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

Read only

0 Likes
2,561

ok_code = sy-ucomm.

This line is added now. but not effect.

Regards.

Read only

0 Likes
2,561

Hi Mark

You don't need that line:

Insert a break-point before CASE statament and check the value of OK_CODE.

Max

Read only

0 Likes
2,561

declared ok code in the element List of screen Painter.

go to screen

go to element screen option.

rite ok_code and than

enter.

Read only

0 Likes
2,561

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.

Read only

0 Likes
2,561

Hi Friends,

I have tried all the suggestions given by u all. But still the same problem exits.

Pls some more suggestions.

Regards.

Read only

0 Likes
2,561

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

Read only

0 Likes
2,561

try one more thing...

go to screen painter.

open the properties of button .

check u write exit there..... ....

Read only

0 Likes
2,561

my mail id is vincent_as2004@yahoo.com.

Pls send your valuable guidelines.

Read only

0 Likes
2,561

hi mark,

check the function codes of 'Save' & 'exit' are they the same as u have written.

thanks,

priya.

Read only

0 Likes
2,561

Break point is not working. It directly takes to screen.

Regards.

Read only

0 Likes
2,561

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!!!

Read only

0 Likes
2,561

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.

Read only

Former Member
0 Likes
2,561

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.

Read only

0 Likes
2,561

Added the line 'ok_code = sy-ucomm.' But no effect.

Regards.

Read only

Former Member
0 Likes
2,561

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.

Read only

Former Member
0 Likes
2,561

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.

Read only

Former Member
0 Likes
2,561

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.