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

Module Pool

Former Member
0 Likes
725

I have created to text box ie empno & empname and also i have created a table zemp.

so when i click the save button it has to go & update in the zemp table .

on the click of save what is the code i have to write.

thanks

regards

Alfred

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
698

Just Assign the values to the Z Table field as ZTEMP-EMPNO = emp no from the screen

EMPNAME = from screen at the FORM INPUT UNDER THE OK_CODE for SAVE

MODIFY ZTEMP.

Message was edited by: Vara Prasad Kunathi

7 REPLIES 7
Read only

Former Member
0 Likes
699

Just Assign the values to the Z Table field as ZTEMP-EMPNO = emp no from the screen

EMPNAME = from screen at the FORM INPUT UNDER THE OK_CODE for SAVE

MODIFY ZTEMP.

Message was edited by: Vara Prasad Kunathi

Read only

Former Member
0 Likes
698

Hi on click on save button write the following code

When'SAVE'.

insert values of <itab> into zemp. "for insertingrecords

update zemp from itab "for update.

see the proper syntax and what fileds u want to update.

Regards

Manas Ranjan panda

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
698

I really depends on how your program is written and what the fields are that you are updating. Assuming that there is no relationship between your screen fields and the fields of your db, then I would suggest something like this.

data: wa_zemp type zemp.

wa_zemp-empno = empno.
wa_zemp-empname = empname.
insert zemp from wa_zemp.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
698

Hi Alfred,

Instead of text box, you can have normal input fields on your screens.

in your pai section.

module user_command.

case sy-ucomm.

zemp-empno = v_empno.

zemp-empname = V_emp_name.

modify zemp.

endcase.

endmodule.

Read only

Former Member
0 Likes
698

Fill the data to <workarea> from the screen fields.

and then use the INSERT command to update the database table from the workarea.

Thanks

eswar

Read only

Former Member
0 Likes
698

iit gives the error message as Field "V_EMPNO" is unknown. It is neither in one of the specified

tables nor defined by a "DATA" statement. "DATA" statement.

in the text box i have given the name as v_empno only

but still then it gives the error message , where would i have gone wrong.

thanks

alfred

Read only

0 Likes
698

hi

Along with the text field on the screen, you also need to declare a variable in module pool program like

data : v_empno type zemp-empno.

Regards,

Richa