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

program to insert/update/delete entries in table

Former Member
0 Likes
2,422

Hi Everyone,

I have to write a program to insert/update/delete table entries(read text) as I fields are STRING type Table Maintainance is not possible.

I got many examples on web but nothing is working properly with string type as in some I am declaring my Z table with TABLES: keyword...it says this keyword is not valid for string type fields.

It would be great if I can get any sample.

Here are some links which I already tried:

http://www.sapdev.co.uk/reporting/alv/alvgrid_editable.htm

<link to blocked site removed by moderator>

Here I have tried but not able to update when SAVE.

  • Check function code

CASE r_ucomm.

WHEN '&DATA_SAVE'. "or what even event you want

loop at it_content into wa_content.

  • process each line of table including new values

ENDLOOP.

  • MODIFY TABLE zdu_test_content FROM IT_CONTENT .

ENDCASE.

Here I am getting an error at this Statement:TABLES:ZTEST.(must be a flat structure)

Appreciate your help.

Thanks,

Kiran

Edited by: Thomas Zloch on Feb 8, 2012

1 ACCEPTED SOLUTION
Read only

meghomallar_das
Participant
0 Likes
1,044

Hi...

You can try this...

LOOP AT IT_CONTENT INTO WA_CONTENT.

(ADD VALUES TO WA_CONTENT).

UPDATE ZTABLE VALUES WA_CONTENT.

ENDLOOP.

May be this would work.

Megh.

4 REPLIES 4
Read only

meghomallar_das
Participant
0 Likes
1,045

Hi...

You can try this...

LOOP AT IT_CONTENT INTO WA_CONTENT.

(ADD VALUES TO WA_CONTENT).

UPDATE ZTABLE VALUES WA_CONTENT.

ENDLOOP.

May be this would work.

Megh.

Read only

Former Member
0 Likes
1,044

Hi,

  • MODIFY TABLE zdu_test_content FROM IT_CONTENT .

you need to use structure in place of IT_CONTENT and need to use UPDATE command not the MODIFY.

syntax: UPDATE ztable from ls_structure.

Read only

0 Likes
1,044

Thanks.Also,can you please suggest me how to make the ALV fields dynamic as my table fields are string type but in ALV fields I can only enter limited text.I have seen some examples all are using field symbols.don't want to use field symbol.

Read only

0 Likes
1,044

Hi,

You can also enter strings in ALV fields.

please find the belowlink which may help you.

[Dynamic Field Catalog In ALV |http://wiki.sdn.sap.com/wiki/display/ABAP/DynamicFieldCatalogInALV]

Regards,

Karuna