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

Insert Records

Former Member
0 Likes
854

Hi

I added one field to standard internal table using append structure.

How enter data to that fields?

Please tell me.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
835

you need to write small update program for this.

Amit.

10 REPLIES 10
Read only

Former Member
0 Likes
835

Hi,

Is it Standard Table or INternal table?

Thanks,

Sriram POnna.

Read only

0 Likes
835

Hi Sriram,

Thanks for your answer.

Here insert records into standard table.

Please tell me.

Thanks.

Read only

Former Member
0 Likes
835

You don't add fields using APPEND, you update the internal table adding the current line you issued the APPEND command, with the given table structure/fields.

If you want to add a field, one way to do it is through TABLE MAINTENANCE.

Now, if you meant you want to modify data in your internal table, let's say, for a specific field, you have to use the MODIFY command, like the following:

MODIFY [internal_table] INDEX sy-tabix (in case you are in a loop - that is going to modify the current line being looped) FROM [work_area_variable] TRANSPORTING [list of specific fields you want to modify].

If you want to update the given line with all the work area's contents, you can omit the TRANSPORTING clause.

Hope this helps.

Avraham

Read only

Former Member
0 Likes
836

you need to write small update program for this.

Amit.

Read only

0 Likes
835

Hi Amit

Thanks for your answer.

SCARR table in am inserted PHONE field using append structure.

After i wrote Program like this.

SCARR-CARRID = 'AA'.

SCARR-PHONE = '2233865'.

INSERT SCARR.

But its not adding the records to standard table.

Please tell me.

Thanks.

Read only

0 Likes
835

Hi Sri,

If ur phone number field is same for all records then just one statement will do the trick.

UPDATE scarr SET phone = 'ur phone number'.

If the number is different then u have to follow this logic.

SELECT * INTO TABLE i_scarr FROm scarr.

LOOP AT i_scarr INTO wa_scarr.

Get the phone number based on ur conditions.

wa_scarr-phone = 'Ur phone no.'

MODIFY i_scarr FROM wa_scarr TRANSPORTING phone.

ENDLOOP.

MODIFY scarr FROM TABLE i_scarr.

This will modify the whole table with the respective phone number.

Thanks,

Vinod.

Read only

0 Likes
835

Hi Vinod,

Thanks for your answer. My problem solved.

Thanks allot.

Read only

0 Likes
835

Hi

Use Modify or Update statements.

Read only

Former Member
0 Likes
835

Use Modify statement.

MODIFY SCARR.

Read only

0 Likes
835

If you want to insert the scarr structure values to your table, add

APPEND scarr TO table_name to your program. But only if scarr is your work area and not your table.

Regards

Avraham