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: 

Data Entry into customized table

Former Member
0 Kudos

Hi All,

I have created a z-table and selection screen with four fields. Whenever I enter the data into these four fields, the data should go to the z-table through my report.

Will you please send me how to do this?

Thanks in Advance,

Ramana

1 ACCEPTED SOLUTION

former_member188829
Active Contributor
0 Kudos

Hi KCR,

Check this Example..

I did this For MARA Database Table..

Same u Can do For your Ztable...

TABLES:MARA.

PARAMETERS:P_MATNR LIKE MARA-MATNR,

P_MBRSH LIKE MARA-MBRSH,

P_MTART LIKE MARA-MTART,

P_MEINS LIKE MARA-MEINS.

DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

ITAB-MATNR = P_MATNR .

ITAB-MBRSH = P_MBRSH .

ITAB-MTART = P_MTART .

ITAB-MEINS = p_MEINS .

APPEND ITAB.

INSERT MARA FROM ITAB.

MODIFY MARA .

IF SY-SUBRC EQ 0.

WRITE: 'record updated to database table'.

ENDIF.

Regards,

Vishnu.

4 REPLIES 4

Former Member
0 Kudos

Hi,

us e the insert command in that report.

r goto sm30 and give multiple entrie records to insert the data into the custom table.

regards,

satish.

0 Kudos

Hi Satish,

Thanks for the reply, Shall I use Insert command in the report? The entries should be able to go to the table through report only, will you please let me know how to do this?

Thanks,

Ramana

former_member188829
Active Contributor
0 Kudos

Hi KCR,

Check this Example..

I did this For MARA Database Table..

Same u Can do For your Ztable...

TABLES:MARA.

PARAMETERS:P_MATNR LIKE MARA-MATNR,

P_MBRSH LIKE MARA-MBRSH,

P_MTART LIKE MARA-MTART,

P_MEINS LIKE MARA-MEINS.

DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

ITAB-MATNR = P_MATNR .

ITAB-MBRSH = P_MBRSH .

ITAB-MTART = P_MTART .

ITAB-MEINS = p_MEINS .

APPEND ITAB.

INSERT MARA FROM ITAB.

MODIFY MARA .

IF SY-SUBRC EQ 0.

WRITE: 'record updated to database table'.

ENDIF.

Regards,

Vishnu.

KalC
Active Participant
0 Kudos

Hi KCR,

You can do this by program or by generating a table maintanence generator using SM30.

IF you want to do this through program declare internal table with the same structure as that of your table and populate it with details as per the selection screen data and use "INSERT INTO <table name> FROM TABLE ITAB".

OR

Goto se11 give your table name change, in the attributes tab select display and maintanence allowed and then select menu path UTILITIES > Table maintanence generator . IN the next screen displayed

give Authorization groups as &NC& (if you dont want any auth check) Function group as your table name( you can give any name starting with Z), select maintanence type one step and give single screen as 100 ( you can give any number you want) and then select create button(located left top corner). this will generate a table maintanence for you.

After doing above steps go to sm30 and give your table name and select maintain which will display a nice table control with the table fields where you can maintain as many records as you want and click on save.

Thats it.

Reward if helpful.

Regards,

Kalyan.