Application Development 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: 

Entering data to a database table

Former Member
0 Kudos

Hello,

I am trying to code a program using the the ABAP/4 Editor. I want a program that reads input from a user and updates a table in the database. Can you please assist me with the correct coding that I am suppose to use.

5 REPLIES 5

Former Member
0 Kudos

hi,

do this way ...


tables : mara.

 parameters : p_matnr like mara-matnr,
                    

 start-of-selection.
 select  single * from mara into mara 
     where matnr = p_matnr.             
 if sy-subrc = 0.
   wa_mara-lvorm = 'X'. 
   modify mara from wa_mara transporting lvorm. 
 endif.
 

Regards,

Santosh

0 Kudos

Hello,

I am not sure, maybe my question wasnt clear enough, let me elaborate:-

Lets say I have a table called ZPMS_PARTNERS, the table doesn't contain any data and I want to have a program that allows the user to insert the partner's name, the partner's address and the partner's contact details. After the user has entered this data, I want the program to take the data entered by the user and then modify the table ZPMS_PARTNERS.

Please help.

0 Kudos

Hi,

First your question is not in a transparanet way. As per my under stand that you can mention that Update statement in the user exit then that table can be updated when ever realted information will be change.

Regards,

Kumar..

0 Kudos

Hi,

To insert the data into the table ZPMS_PARTNERS,

You need to create module pool program.

where you will have all the table fields has input fields.

think there are 3 fields .

field1 input filed(give the name gt_tab-field1)

field2 input field(give the name gt_tab-field2)

field3 input field(give the name gt_tab-field3)

save exit

make save and exit as pushbuttons .

after entering the data into the input fields ,press save button.

PAI

module after 100.

Process after input.

case sy-ucomm.

when 'SAVE'.

Insert ztable from table gt_tab

endcase.

Former Member
0 Kudos

Create a Function Module?Program with input parameters that you need and update the Ztable (sample coding as Santosh gave).