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

Changes and Logical Delete in View Maintenance

Former Member
0 Likes
672

Hi everybody.

I've defined a table view maintenance V_TABLE for T_TABLE, with five fields. One of them is defined as 'R' (not editable field).

I defined an event 05 and an event 02 (for create and save) where I move SY-DATUM to the CREATED_DATE or UPDATE_DATE fields depending on it is a new record or a modification.

But if I modify several records only one is updated.

Besides, if the action is "delete" in the view maintenance, it must be a logical delete and move an 'X' to one of the editable fields.

Can you help me please ?

I can't see the action for each record in global tables.

Event f_save ( 02 )

IF t_table-created_date IS INITIAL.

t_table-created_date = sy-datum.

ELSE.

t_table-last_upd_date = sy-datum.

ENDIF.

MODIFY t_table.

Event f_new_entry ( 05 )

t_table-created_date = sy-datum.

Thanks in advance,

Liliana.

1 ACCEPTED SOLUTION
Read only

karol_seman
Active Participant
0 Likes
633

Hi Liliana,

you shouldn't update directly your table T_TABLE. In maintenance view events you should work with tables total and extract. See my post in following thread

You want to save changes when user press save button only ...

See my declared type "t_data" which contains flag "aktkz" in which is stored information what was done with record.

Regards,

Karol

P.S.: You have 21 open questions. The answered questions you should close becuase it can happens that next time nobody will help you because of that ...

Hi everybody.

I've defined a table view maintenance V_TABLE for T_TABLE, with five fields. One of them is defined as 'R' (not editable field).

I defined an event 05 and an event 02 (for create and save) where I move SY-DATUM to the CREATED_DATE or UPDATE_DATE fields depending on it is a new record or a modification.

But if I modify several records only one is updated.

Besides, if the action is "delete" in the view maintenance, it must be a logical delete and move an 'X' to one of the editable fields.

Can you help me please ?

I can't see the action for each record in global tables.

Event f_save ( 02 )

IF t_table-created_date IS INITIAL.

t_table-created_date = sy-datum.

ELSE.

t_table-last_upd_date = sy-datum.

ENDIF.

MODIFY t_table.

Event f_new_entry ( 05 )

t_table-created_date = sy-datum.

Thanks in advance,

Liliana.

3 REPLIES 3
Read only

karol_seman
Active Participant
0 Likes
634

Hi Liliana,

you shouldn't update directly your table T_TABLE. In maintenance view events you should work with tables total and extract. See my post in following thread

You want to save changes when user press save button only ...

See my declared type "t_data" which contains flag "aktkz" in which is stored information what was done with record.

Regards,

Karol

P.S.: You have 21 open questions. The answered questions you should close becuase it can happens that next time nobody will help you because of that ...

Read only

0 Likes
633

Hello Karol, thank you for your answer.

Now, when I create new entries and select modify, hidden fields are updated.

But when I select the delete option, it must be a logical delete, not physical. I must update one field with an 'X', but not delete. Can you help me with this ?

Below is the include up now.


FORM f_delete

TYPES: BEGIN OF t_data.
INCLUDE STRUCTURE /tenr/t_ppintwc.
TYPES: action,
END OF t_data.

DATA: ls_total   TYPE t_data.
DATA: lt_total   TYPE TABLE OF t_data.
DATA: ls_extract TYPE t_data.
DATA: lt_extract TYPE TABLE OF t_data.

* get data from table maintenance

lt_total[] = total[].
lt_extract[] = extract[].
LOOP AT lt_total INTO ls_total WHERE action = 'D'.

IF sy-datum BETWEEN ls_total-begda AND ls_total-endda.
ls_total-endda = sy-datum.
IF ls_total-created_date IS INITIAL.
ls_total-created_date = sy-datum.
ls_total-created_time = sy-uzeit.
ls_total-created_by = sy-uname.
ELSE.
ls_total-last_upd_date = sy-datum.
ls_total-last_upd_time = sy-uzeit.
ls_total-last_upd_by = sy-uname.
ENDIF.
ENDIF.
IF sy-datum < ls_total-begda.
ls_total-endda = ls_total-begda.
IF ls_total-created_date IS INITIAL.
ls_total-created_date = sy-datum.
ls_total-created_time = sy-uzeit.
ls_total-created_by = sy-uname.
ELSE.
ls_total-last_upd_date = sy-datum.
ls_total-last_upd_time = sy-uzeit.
ls_total-last_upd_by = sy-uname.
ENDIF.
ENDIF.

MODIFY lt_total FROM ls_total.
total[] = lt_total[]. 
append ls_total to lt_extract.
extract[] = lt_extract[]. 

ENDLOOP.

ENDFORM.                    " F_DELETE

Thanks in advance.

Liliana.

Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 3:12 PM

Read only

Former Member
0 Likes
633

Delete: logical delete, I changed the action field in total and extract tables (U instead of D), and the <ACTION> field too.