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

Inserting into table

Former Member
0 Likes
932

I have a 3 custom tables and a custom tab strip application linking to that table created in spwizard. I need to add the functionality of insert, delete, modify to the application. I created the icons already, just need the functionality. Were can I go to get some help or examples will be great.

thanks in advance!

7 REPLIES 7
Read only

Former Member
0 Likes
904

Assign a FCode for the button. Write the code in PAI module of the screen.

PROCESS AFTER INPUT.

MODULE user_command_0100.

MODULE user_command_0100 INPUT.

CLEAR okcode.

MOVE sy-ucomm TO okcode.

WHEN 'MPAD'.

CLEAR okcode.

APPEND INITIAL LINE TO i_mprn .

ws_devloc_add = c_x.

WHEN 'MPSB'.

CLEAR okcode.

DELETE i_mprn WHERE select = c_x.

WHEN 'MPRN'.

CLEAR okcode.

PERFORM validate_mprn.

ENDMODULE. " USER_COMMAND_0100 INPUT

Regards,

Prakash.

Read only

0 Likes
904

i_mprn? is it an internal table or structure. In your perform validate_mprn, what are you validating? not sure your code. please elaborate!

Read only

Former Member
0 Likes
904

Ervin,

I just copied the sample program.

You don't want to do the same thing.

Ofcoure i_mprn is an internal table. Also I have my own validation for the program which I added there.

WHEN 'MPAD'. This will insert a new row to the table control.

CLEAR okcode.

APPEND INITIAL LINE TO i_mprn .

ws_devloc_add = c_x.

WHEN 'MPSB'. This will delete the specified row from table control.

CLEAR okcode.

DELETE i_mprn WHERE select = c_x.

For deleting the specified row, first u want to declare a varibale in the table control exmple SEL type c. You have to give that field in the properties of the table control example I_MPRN-SEL. So whenever u select a line in table it will marked with 'X'. so this statement (DELETE i_mprn WHERE select = c_x. ) will delete the row whichever is selected.

Regards,

Prakash.

Read only

0 Likes
904

do you know if there is any sap programs that have tab strips with the functionality to add, delete, and modify the table so that I can have a good understanding of it.

Read only

0 Likes
904

Goto <b>ABAPDOCU</b> transaction.

In that ABAP User Dialogs -> Screens -> Processing screens & Complex screen Elements, have lot of programs on screens.

Regards,

Prakash.

Read only

0 Likes
904

I'm looking at the codes and there isn't any codes to add into the table. do you have a complete sample program so that i can look at!

Read only

Former Member
0 Likes
904

so do any one out there have a full codes tab strip program where they are adding to a custom table?