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

SAVE BUTTON

Former Member
0 Likes
859

HELLO,

when i am clicking save button its not saving my data. please let me know what i have to do.

also i my table i am having various name of the data. when i am clicking display it have to show all the names one by one what to do, also when i have click inst its not loading the data please let me know what to do at your earliest and oblige.

i have written the mentioned codes.

&----


*& Report ZGOM1

*&

&----


*&

*&

&----


REPORT ZGOM1.

CALL SCREEN 200.

&----


*& Module USER_COMMAND_0200 INPUT

&----


  • text

----


MODULE USER_COMMAND_0200 INPUT.

tables : ZPERSONAL.

data : begin of itab occurs 0,

NAME LIKE ZPERSONAL-NAME,

ADDRESS LIKE ZPERSONAL-ADDRESS,

TELNO LIKE ZPERSONAL-TELNO,

MOBILENO LIKE ZPERSONAL-MOBILENO,

COUNTRY LIKE ZPERSONAL-COUNTRY,

end of itab.

case sy-ucomm.

when 'DISP'.

select * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

ENDSELECT.

when 'NEXT'.

SELECT SINGLE * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

when 'EXIT'.

LEAVE PROGRAM.

when 'CLEAR'.

CLEAR ITAB.

WHEN 'DELETE'.

DELETE ZPERSONAL.

*ENDCASE.

CLEAR ITAB.

WHEN 'SAVE'.

SAVE ZPERSONAL.

ENDSELECT.

*when 'INST'.

*ZPERSONAL-NAME = ITAB-NAME.

*ZPERSONAL-ADDRESS = ITAB-ADDRESS.

*ZPERSONAL-MOBILENO = ITAB-MOBILENO.

*ZPERSONAL-TELNO = ITAB-TELNO.

*ZPERSONAL-COUNTRY = ITAB-COUNTRY.

*INSERT INTO ZPERSONAL VALUES ITAB.

*

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT.

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


MODULE STATUS_0200 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

move-corresponding itab to ZPERSONAL.

ENDMODULE. " STATUS_0200 OUTPUT

thanks,

sujatha

8 REPLIES 8
Read only

Former Member
0 Likes
834

Hi Sujatha,

to use insert it will work,

insert database table from workarea.

Thanks

mahi

Read only

Former Member
0 Likes
834

hi sujata,

in u'r prog for SAVE what u want to save , u want to save any modifications to the table data use modify are append ,

i don't un'stnad u'r second requiement .

in insert u insert data ti itab what is the exact require ment to insert it to internal table, i think u use that like append/insert to u'r data base table,

regards,

chandu.

Read only

vladimir_golovtchiner
Participant
0 Likes
834

Hi,

It seems to me that there are some errors.

....

WHEN 'SAVE'.

SAVE Z...

END Select. -


???????

Do you have a macro SAVE ?

Please more details.

Regards

Vladimir

Read only

Former Member
0 Likes
834

hello,

when i am clicking save button my have to save in my table what to write in the coding, i already tried the following code.

also when i am clicking display it shows first record and alternate record it not showing the condinitous record, pls let me know in details.

also when i am modifying it not saving in my record pls let me know in details as soon as possible .

&----


*& Report ZGOM1

*&

&----


*&

*&

&----


REPORT ZGOM1.

CALL SCREEN 200.

&----


*& Module USER_COMMAND_0200 INPUT

&----


  • text

----


MODULE USER_COMMAND_0200 INPUT.

tables : ZPERSONAL.

data : begin of itab occurs 0,

NAME LIKE ZPERSONAL-NAME,

ADDRESS LIKE ZPERSONAL-ADDRESS,

TELNO LIKE ZPERSONAL-TELNO,

MOBILENO LIKE ZPERSONAL-MOBILENO,

COUNTRY LIKE ZPERSONAL-COUNTRY,

end of itab.

case sy-ucomm.

when 'DISP'.

select * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

ENDSELECT.

*append itab.

when 'NEXT'.

SELECT SINGLE * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

when 'EXIT'.

LEAVE PROGRAM.

when 'CLEAR'.

CLEAR ITAB.

WHEN 'DELETE'.

DELETE ZPERSONAL.

*ENDCASE.

CLEAR ITAB.

WHEN 'SAVE'.

append itab.

  • * SAVE ZPERSONAL.

  • ENDSELECT.

when 'MODIFY'.

ZPERSONAL-NAME = ITAB-NAME.

ZPERSONAL-ADDRESS = ITAB-ADDRESS.

ZPERSONAL-MOBILENO = ITAB-MOBILENO.

ZPERSONAL-TELNO = ITAB-TELNO.

ZPERSONAL-COUNTRY = ITAB-COUNTRY.

MODIFY ZPERSONAL.

INSERT INTO ZPERSONAL VALUES ITAB.

*

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT.

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


MODULE STATUS_0200 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

move-corresponding itab to ZPERSONAL.

ENDMODULE. " STATUS_0200 OUTPUT

thanks

sujatha

Read only

0 Likes
834

Hi,

Try....


WHEN 'SAVE'.

INSERT ZPERSONAL.

Reward points if useful....

Regards

AK

Read only

0 Likes
834

HELLO,

thanks i tried its working, also let me know that when clicking modify it not happening pls let me know what to do more at your earliest and oblige.

the mentioned codes i already tried, pls help me.

&----


*& Report ZGOM1

*&

&----


*&

*&

&----


REPORT ZGOM1.

CALL SCREEN 200.

&----


*& Module USER_COMMAND_0200 INPUT

&----


  • text

----


MODULE USER_COMMAND_0200 INPUT.

tables : ZPERSONAL.

data : begin of itab occurs 0,

NAME LIKE ZPERSONAL-NAME,

ADDRESS LIKE ZPERSONAL-ADDRESS,

TELNO LIKE ZPERSONAL-TELNO,

MOBILENO LIKE ZPERSONAL-MOBILENO,

COUNTRY LIKE ZPERSONAL-COUNTRY,

end of itab.

case sy-ucomm.

when 'DISP'.

select * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

ENDSELECT.

*append itab.

when 'NEXT'.

SELECT SINGLE * FROM ZPERSONAL INTO CORRESPONDING FIELDS OF ITAB.

when 'EXIT'.

LEAVE PROGRAM.

when 'CLEAR'.

CLEAR ITAB.

WHEN 'DELETE'.

DELETE ZPERSONAL.

*ENDCASE.

CLEAR ITAB.

WHEN 'SAVE'.

INSERT ZPERSONAL.

  • * SAVE ZPERSONAL.

  • ENDSELECT.

when 'MODIFY'.

ZPERSONAL-NAME = ITAB-NAME.

ZPERSONAL-ADDRESS = ITAB-ADDRESS.

ZPERSONAL-MOBILENO = ITAB-MOBILENO.

ZPERSONAL-TELNO = ITAB-TELNO.

ZPERSONAL-COUNTRY = ITAB-COUNTRY.

MODIFY ZPERSONAL.

INSERT INTO ZPERSONAL VALUES ITAB.

*

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT.

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


MODULE STATUS_0200 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

move-corresponding itab to ZPERSONAL.

ENDMODULE. " STATUS_0200 OUTPUT

thanks,

sujatha

Read only

0 Likes
834

MODIFY ZPERSONAL. <== This will do the modify (update)

INSERT INTO ZPERSONAL VALUES ITAB. <== get rid of this. This is only to add a new record.

*

Read only

0 Likes
834

Hi,

Try....


WHEN 'MODIFY'.

MODIFY ZPERSONAL.

Reward points if useful.... (Don't Forget Please)

Regards

AK