Skip to Content
0
Former Member
Jan 14, 2008 at 03:09 AM

PAI

29 Views

hi experts,

can anyone tell me how to solve this?

Create a screen which will update a z- table.

fields are: name

id

salary

designation

SAVE(push button)

Create a Z-table, Tcode

Do not use standard data elements. Create all z objects.

When you enter the data then a pop box has to display with 3 buttons ‘Yes’, ‘No’ and ‘Cancel’ options.

If you click ‘Yes’ then it has to save the data in z – table and exit the screen.

If you click ‘No’ then it should not save the data in z – table and exit the screen.

If you click ‘Cancel’ then it has to be on the screen itself .just stay on the screen as usual.

i have done table creation and screen creation.

please help me in my PAI code.....i got a pop-up screen .but i am not able to write code if i select YES,NO and CANCEL.please help mw eith this.....

DATA :answer TYPE c.

TYPES:BEGIN OF t_struct,

name TYPE zdialog-name,

id TYPE zdialog-id,

salary TYPE zdialog-salary,

designation TYPE zdialog-designation,

END OF t_struct.

DATA:itab TYPE STANDARD TABLE OF t_struct,

wa TYPE t_struct.

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


MODULE user_command_1000 INPUT.

CASE sy-ucomm.

WHEN 'SAVE'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

  • TITLEBAR = ' '

  • DIAGNOSE_OBJECT = ' '

text_question = 'would u like to save data?'

text_button_1 = 'YES'(001)

  • ICON_BUTTON_1 = ' '

text_button_2 = 'NO'(002)

  • ICON_BUTTON_2 = ' '

  • DEFAULT_BUTTON = '1'

display_cancel_button = 'X'

  • USERDEFINED_F1_HELP = ' '

  • START_COLUMN = 25

  • START_ROW = 6

  • POPUP_TYPE =

IMPORTING

answer = answer

  • TABLES

  • PARAMETER =

EXCEPTIONS

text_not_found = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*if 'no' is selected then leave the program

IF answer = 'NO'.

LEAVE TO SCREEN 0.

*if 'yes' is selected then update ztable

ELSEIF answer = 'YES'.

SELECT name

id

salary

designation FROM zdialog

INTO TABLE itab.

LOOP AT itab INTO wa.

UPDATE zdialog SET name = wa-name WHERE

id = wa-id AND

salary = wa-salary AND

designation = wa-designation.

ENDLOOP.

IF sy-subrc = 0.

MESSAGE s000(0) WITH 'data saved successfully'.

ENDIF.

ENDIF.

*if 'cancel' is selected

WHEN 'CANCEL'.

LEAVE PROGRAM.

  • SET HOLD DATA ON.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

points will be rewarded............