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: 

Custom Table in creating WBS element (CJ20)

Missschaaa
Participant
0 Kudos

Hello guys,

I'm trying to enhance the wbs element branch data with a custom table displayed as ALV Grid. Now I know that enhancement CNEX0007 is made for CI_PRPS enhancement fields. But in my case I do not have single fields but a Z-Table which I want to fill.

To have some checks before the update of the z-Table I wanted to use BADI WORKBREAKDOWN_UPDATE with method AT_SAVE. Unfortunately the BADI does not get triggered because standard WBS program does not set the value changed flag. So what can I do now to get that BADI triggered for my ALV Z-table changes? I found an enhancement spot directly after setting the value change flag but I would prefer to avoid enhancement spots. Any ideas?

Regards

Michael

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

You can use the SMOD enhancement CNEX0007 to display update the customer z-table, but in your CMOD project you must handle the update task yourself.

You could use some PERFORM ON COMMIT/ROLLBACK of a form in the Exit function group for this purpose, in the FORM call some z-update FM in update task. You should also consider maintaining a field in CI_PRPS to trigger update when your data was changed in subscreen (e.g. last change timestamp of the z-table).

Missschaaa
Participant
0 Kudos

Hello Raymond,

Yes, I use the CNEX0007 enhancement to display the alv grid. This works fine, but I do not want to save the data in this enhancement, because I think it is to early and canot fetch some errors on standard fields that happen when clicking on save.

What do you mean with PERFORM ON COMMIT? I never heard of that. I thought in the same way with some z-field in CI_PRPS. I therefor used a flag which I set and unset when changes happen in z-table (I compare db values with values when clicking on save). This works fine, but does not sound like the best workaround for me. But you're right last change timestamp sounds more sinful 😉

Regards

Michael

0 Kudos

The form registered with PERFORM ON COMMIT will only be executed ON COMMIT, so when main program of transaction execute the COMMIT-WORK and you can add your own CALL IN UPDATE TASK in this form. As the form should be defined in the exit function group, you can access to function group global data so internal table of your ALV.

Missschaaa
Participant
0 Kudos

I now found another problem of using the grid in my custom function group.

When I transfer data from CNEX0007 to my custom function group its always for one wbs element with prps structure only. But when user changes wbs elements in transaction CJ20N, he is able to change several wbs elements by clicking them on the hierarchy at the left without saving after finishing one wbs element. So it can happen that I have to update several wbs elements when clicking on save. Any idea how to handle this?