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

saving a module pool screen

Former Member
0 Likes
362

after all my operations , if i click save button the screen has to save in my datebase table / document how could it possible will u plz give an hint

1 REPLY 1
Read only

Former Member
0 Likes
344

hi ,

U can save the values enterd on the screen by pressing the save button,

u need to assign a ok_code for the save button.

define a work area

move all the data to the work area and then move the work area data one by one to the db table.

u can also have an optino of having confirming the entered data by having a pop up.

u can refer...

write the condition to move the data to db.

IF SY-SUBRC = 0.

*

  • CLEAR OK_CODE1.

  • CALL FUNCTION 'POPUP_TO_CONFIRM'

  • EXPORTING

  • TITLEBAR = 'please confirm'

  • TEXT_QUESTION = 'Do you want to save the changes?'

  • TEXT_BUTTON_1 = 'YES'

  • TEXT_BUTTON_2 = 'NO'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • IMPORTING

  • ANSWER = ANS

  • 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.

**

  • IF ANS = '1'.

  • CLEAR : ANS.

  • PERFORM SAVE.

  • MESSAGE 'Record Created' TYPE 'I'.

  • LEAVE TO SCREEN '0'.

*

  • ELSEIF ANS = '2'.

  • CLEAR : ANS.

  • MESSAGE 'no record created' TYPE 'I'.

  • LEAVE TO SCREEN '0'.

  • ELSEIF ANS = 'A'.

  • CLEAR : ANS.

  • EXIT.

  • ENDIF.

*

    • endif.

  • ELSE.

  • SET SCREEN 0.

  • LEAVE SCREEN.

  • ENDIF.

  • ENDIF.

*.ENDIF.

SET SCREEN 0.

LEAVE SCREEN .

hope this helps u.