‎2006 Dec 04 7:59 AM
Hi All,
Is there any function module to insert a new record in to the Z-table.I want to give the Z-table name and the specific fields to be inserted and the value for those firlds.Examples will be useful.
Thanks in Advance.
‎2006 Dec 04 8:03 AM
I don't think there is any generic function that can be used to update any Z Table.
You might have to write one.
Regards,
Ravi
note - Please mark all the helpful answers
‎2006 Dec 04 11:21 AM
You need to write your logic to update it. Please check this....
DATA WF_TABLE_NAME LIKE DD02L-TABNAME.
DATA ITABREF TYPE REF TO DATA.
DATA WF_WHERE(100) TYPE C.
FIELD-SYMBOLS:
<DBTAB> TYPE STANDARD TABLE,
<FS_ITAB> TYPE ANY.
*
Get WF_TABLE_NAME value from user input.
SELECT SINGLE * FROM DD02L
WHERE TABNAME EQ WF_TABLE_NAME AND
AS4LOCAL EQ 'A'.
If sy-subrc eq 0.
CREATE DATA ITABREF TYPE STANDARD TABLE OF (WF_TABLE_NAME).
ASSIGN ITABREF->* TO <DBTAB>.
SELECT * FROM (WF_TABLE_NAME)
INTO TABLE INT_TABLE WHERE <fldname> = WF_WHERE.
IF SY-SUBRC EQ 0.
LOOP AT INT_TABLE ASSIGNING <FS_ITAB>.
******
Write your logic....
******
ENDLOOP.
ENDIF.
ENDIF.
Let me know, if you need any info.
Regards,
Ramki.
‎2006 Dec 04 1:55 PM
1. Go to SE80.
2. Create a Z function group
3. Create a Z function module inside that group
4. Put all the input data as the import parametr of the FM. Can use a structure also
5. Inside the FM do the insert of the data into the Z table
6. Also do exception handling and documentation
‎2006 Dec 05 8:44 AM
Hi Shri Ram,
Try FM COC2_TABLE_INSERT_DB.
Hope this helps
Thanks
Lakshman