Application Development 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: 

SM30 Saving data event

Former Member
0 Kudos

Hello,

This SM30 event coding is really bugging me. In the event 18 I put following code

if <action> = 'U'.

zcustomtable-date = sydatum.

zcustomtable-uname = sy-uname.

modify zcustomtable.

endif.

However while this does not work, the coding was ok for event 05 when I said as following

if <action> = 'N'.

zcustomtable-date = sydatum.

zcustomtable-uname = sy-uname.

modify zcustomtable.

endif.

So I changed the code to following

if <action> = 'U'.

extract+41(10) = sy-datum.

extract+49(12) = sy-uname.

modify extract index sy-tabix.

total+41(10) = sy-datum.

total+49(12) = sy-uname.

modify total index sy-tabix.

endif.

now what is happeneing in this case is although the correct placement in sy-uname is not happeneing but it shows me on the screen the values who is chaning and when, when i press the Save button and then go to SE12 to see whether really it has saved the data, it is not doing so. Can somebody help me understand where I am going wrong?

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can use event 01(before save) and write your code there.

Tables in this event will be <vcl_extract> and <vcl_total>. There won't be any variable named <action>.

You have to figure out the postion of the action in global tables(vcl_extract> and <vcl_total>). eg. <wa_vcl_extract>+48(1) = 'U'.

Regards,

Seema Naharia

3 REPLIES 3

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

I think this code should used in Event#01. Why are you using Event#18 ?

Also i think the constants you are using does not look correct. From SAP documentation:

The field symbols which show the processing status of the entries in the internal tables TOTAL and EXTRACT can take the following constant values:

GELOESCHT flagged for deletion

NEUER_EINTRAG: New entry

AENDERN: changed entry

UPDATE_GELOESCHT: entry first changed and then flagged for deletion

NEUER_GELOESCHT: entry first newly created, not yet saved, and then flagged for deletion

ORIGINAL: the same as the database status

BR,

Suhas

Edited by: Suhas Saha on Feb 22, 2010 12:02 PM

Former Member
0 Kudos

Hi,

You can use event 01(before save) and write your code there.

Tables in this event will be <vcl_extract> and <vcl_total>. There won't be any variable named <action>.

You have to figure out the postion of the action in global tables(vcl_extract> and <vcl_total>). eg. <wa_vcl_extract>+48(1) = 'U'.

Regards,

Seema Naharia

Former Member
0 Kudos

Its done.