3 Replies Latest reply: Feb 24, 2010 12:26 PM by Jane Sanjane RSS

SM30 Saving data event

Jane Sanjane
Currently Being Moderated

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

  • Re: SM30 Saving data event
    Suhas Saha
    Currently Being Moderated

    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

  • Re: SM30 Saving data event
    Seema Naharia
    Currently Being Moderated

    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

  • Re: SM30 Saving data event
    Jane Sanjane
    Currently Being Moderated

    Its done.

Actions