‎2012 Feb 08 6:12 AM
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
‎2012 Feb 08 9:19 AM
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.
‎2012 Feb 08 9:19 AM
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.
‎2012 Feb 08 9:34 AM
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.
‎2012 Feb 08 9:52 AM
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.
‎2012 Feb 09 3:58 AM
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