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: 

Changed Data not updating through TMG

Former Member
0 Kudos

Hi All,

I have a Z table in which I have added some events in its TMG.

My problem is the table is not getting updated while I change any record.

The event number is 18.

Please help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi all,

It is done.

Solution is as below.

In the Event 02 the code is written.

DATA: W_ZDCC_REMARK TYPE ZDCC_REMARK. " DCC Document Reason for Remark

   FIELD-SYMBOLS: <FS1> TYPE ANY,
                  <FS2> TYPE ANY,
                  <FS3> TYPE ANY.

   CLEAR W_ZDCC_REMARK.

   ASSIGN ('<VIM_EXTRACT_STRUC>-REMARK') TO <FS1>.


   IF <FS1> IS ASSIGNED.
     SELECT SINGLE * FROM ZDCC_REMARK INTO W_ZDCC_REMARK
       WHERE REMARK = <FS1>.
       IF  sy-subrc = 0.
         W_ZDCC_REMARK-ZUNAME = SY-UNAME.
         W_ZDCC_REMARK-ZERSDA = SY-DATUM.
         W_ZDCC_REMARK-ZUZEIT = SY-UZEIT.
         MODIFY ZDCC_REMARK FROM W_ZDCC_REMARK.
       ENDIF.
   ENDIF. " IF <FS1> IS ASSIGNED


One additional thing is also needed for the same.

We have to configure the table in transaction SCDO.

This will solve the purpose.

15 REPLIES 15

Former Member
0 Kudos

Hi Yash,

After creating event number 18, Create another event 02 for "after save".

It will save the changes.

Best Regards,

Somya

0 Kudos

Hi Somya.

I tried the same. But the data is not getting updated.

Former Member
0 Kudos

You're going to have to share your code if you really want some help.

Rob

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Yash,

Are you updating the Table primary key via TMG. Normally during change, when we are updating the  Table primary key for the particular record  in that time only the TMG won't work. Kindly confirm the same.

If you still face the problem, kindly share the code written in event and table screenshot too...

Regards

Rajkumar Narasimman

0 Kudos

No I am not updating the primary key..

ZDCC_REMARK-ZUNAME = sy-uname.
ZDCC_REMARK-ZERSDA = SY-DATUM.
ZDCC_REMARK-ZUZEIT = Sy-UZEIT.
modify ZDCC_REMARK.

This is my code. And the event is 2.

0 Kudos

Hi Yash,

No need to use this line  modify ZDCC_REMARK.

Please just  write your  front 3 lines code in event 24 or event 05.(I forget which 1 detailly.)


Regards

Feiyun

0 Kudos

Hi Feiyun

Event 5 is for new entry. I have written the create entry code. It is working perfect.

I need an event which updates the change.

0 Kudos

Hi Yash,

Can you try using event AB.

ABInstead of the standard database change routine

Thanks,

Greeshma.

0 Kudos

Tried This. Not working.

0 Kudos

Hi Yash,

you want to change table through events only?

did you try the below code?

Instead of doing it through event . you can achieve this through writing

code in overview sceen number PAI.

TRY below code.

IN PAI

   FIELD ZDCC_REMARK-ZUNAME module custom_pai.

FIELD ZDCC_REMARK-ZERSDA module custom_pai.

FIELD ZDCC_REMARK-ZUZEITmodule custom_pai.

MODULE   custom_pai input.

ZDCC_REMARK-ZUNAME = sy-uname.
ZDCC_REMARK-ZERSDA = SY-DATUM.
ZDCC_REMARK-ZUZEIT = Sy-UZEIT.

ENDMODULE.

0 Kudos

Yes I want to change through events.

There are so many includes. Which one is to be used?

0 Kudos

Hi..


Marimuthu Kaliyaraj wrote:

Hi Yash,

you want to change table through events only?

did you try the below code?

Instead of doing it through event . you can achieve this through writing

We have some problem in defining the code in the screen Flow logic(PAI/PBO) for few cases.

If TMG is recreated, in those case, we are suppose to do the change in the flow logic again.

The Maintenance cost comes into matter at the EOD.

So it is required to use Events instead of writing the code in Flow logic.

If I am wrong, kindly correct me..

Regards

Rajkumar Narasimman

0 Kudos

Yes Rajkumar . you are right...

Former Member
0 Kudos

Hi Yash,

Instead of doing it through event . you can achieve this through writing

code in overview sceen number PAI.

TRY below code.

IN PAI

   FIELD ZDCC_REMARK-ZUNAME module custom_pai.

FIELD ZDCC_REMARK-ZERSDA module custom_pai.

FIELD ZDCC_REMARK-ZUZEITmodule custom_pai.

MODULE   custom_pai input.

ZDCC_REMARK-ZUNAME = sy-uname.
ZDCC_REMARK-ZERSDA = SY-DATUM.
ZDCC_REMARK-ZUZEIT = Sy-UZEIT.

ENDMODULE.


Thanks,

Marimuthu.K

Former Member
0 Kudos

Hi all,

It is done.

Solution is as below.

In the Event 02 the code is written.

DATA: W_ZDCC_REMARK TYPE ZDCC_REMARK. " DCC Document Reason for Remark

   FIELD-SYMBOLS: <FS1> TYPE ANY,
                  <FS2> TYPE ANY,
                  <FS3> TYPE ANY.

   CLEAR W_ZDCC_REMARK.

   ASSIGN ('<VIM_EXTRACT_STRUC>-REMARK') TO <FS1>.


   IF <FS1> IS ASSIGNED.
     SELECT SINGLE * FROM ZDCC_REMARK INTO W_ZDCC_REMARK
       WHERE REMARK = <FS1>.
       IF  sy-subrc = 0.
         W_ZDCC_REMARK-ZUNAME = SY-UNAME.
         W_ZDCC_REMARK-ZERSDA = SY-DATUM.
         W_ZDCC_REMARK-ZUZEIT = SY-UZEIT.
         MODIFY ZDCC_REMARK FROM W_ZDCC_REMARK.
       ENDIF.
   ENDIF. " IF <FS1> IS ASSIGNED


One additional thing is also needed for the same.

We have to configure the table in transaction SCDO.

This will solve the purpose.