cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SM30 - Screen Refresh of data added via TMG

tamitdassharma
Active Participant
515

Hi Experts,

I have a scenario where in one of the customising, i.e., maintained via SM30, the screen is not getting refreshed after the data is saved to the table in the DB. 

Scenario:

The table stores information about the active/inactive details of an attribute for a specified validity. For example, material active/inactive in a given period. The requirement here is that when a user enters information about a material which is already present in the DB with a specific validity, say date 1 to date 2. Then a custom event is written which checks the validity of the newly entered entry, in this case same material but with overlapping validity, say date 4 and date 5. In this case the delimitation should happen automatically and if needed new record should be created. This can arise in a situation where the dates are in the following order date 1 < date 4 < date 5 < date 2. In such situation there would be 3 records formed by updating new record, creating the entered record and the additional new record. For example. Record 1 with validity date 1 to ( date 4 - 1), Record 2 with validity date 4 to date 5, and Record 3 with validity from ( date 5 + 1 ) to date 2. So the new record is generated but is not displayed on the maintenance screen unless the maintenance view is re-opened.

Expectation:

Once the date is saved to the DB the maintenance screen should also show the additional record created.

Example:

  • Existing Record in DB
    MaterialActiveValid From Valid To
    M12345X01.01.202031.12.9999
  • New Record from Customising
    MaterialActiveValid From Valid To
    M12345-01.01.202431.12.2024
  • Expected Records in the customising
    MaterialActiveValid From Valid To 
    M12345X01.01.202031.12.2023(existing)
    M12345 01.01.202431.12.2024(user input)
    M12345X01.01.202531.12.9999(generated)
  • Records displayed after the trigger of the event
    MaterialActiveValid FromValid To 
    M12345X01.01.202031.12.2023(existing & updated)
    M12345 01.01.202431.12.2024(user input)

As mentioned, the user can only see the generated data once the maintenance screen is re-loaded.

Technical Information:

  • Created a customising database table with the following information ( material (key), active indicator (key), valid from (key), and valid to.
  • Created a maintenance view on top of the database table and created a TMG on it.
  • Created a custom event for the TMG with event type as 01.

It would be great if someone can provide some working clue on how to achieve the refresh of the TMG screen when a new record is created programatically.

ABAP Extensibility SAP NetWeaver Application Server for ABAP 

Accepted Solutions (0)

Answers (1)

Answers (1)

Maciej__Galica
Explorer
0 Kudos

Hello,

Did you try with option using LOOP AT TOTAL. ? when you use Event 01 or 18 any new entry are added to a Table called "Total" you can loop over this table but have to handle split of variables into the work area of the table and write your custom logic in the event and append/Modify the row into the "Total". Interesting part is even though User enters only one record and presses save the backend logic will get executed and update the values and the table with new records when user presses back button. I replicated the scenario and worked perfectly fine. Comment here if it has worked for you.