Curious Case of Adding Custom Fields to CN43N Output
Recently, I came across a requirement of adding custom fields to t-code: CN43N (PS). As usual and as always I went straight to find any user exit or a BADI available to serve this purpose but all in vain. So, just like any other SAP guy, I went searching for SCN (didn’t tell this to my client 😉 ), there I found out something pretty sad, guys are hoping against hope and crying their heart out with numerous unanswered posts and I can bet they are still looking for an answer to their query.
Anyhow, I started looking at CN43N and I was wondering how to add just one custom field to this mysterious T-Code’s output. Found out couple of things, first, there is a structure include called CI_PRPS in standard table: PRPS. This include lets you add your custom fields in the said table. This means, wherever PRPS is being used, it will take your custom field along! Great, see my first achievement below 😀
Since we have added our custom fields to the respective table, so theoretically, technically and logically these should be appearing in our T-code. Yeah? So, let’s see if that came up or not?
Here is the demonstration of my second part for the task.
Wow! Fields are now available in CN43N but unfortunately there is no data 🙁 . Let me tell you frankly, above two steps were easy. Adding fields to PRPS and getting them displayed in CN43N ALV but here comes the hard part.
Client: Mansoor! From where are you going to populate the data?
I had a conversation with client with no solution in hand but luckily as always Implicit enhancements never betray you! You they don’t! So, being devilish! I knew that implicit would do the trick for me! How? I don’t know.
To answer this HOW I started debugging CN43N and after hours of banging my head against SAP code, I finally found out what I was looking for, all you have to do is just follow. Just before showing output, CN43N calls an FM! There you go! What does the blind desires, but of course eyesight. There was I!
FM: PSIS_SINGLE01_CREATE_ALV (here PRPS data is filled) does it for me. All I needed to do was put an implicit enhancement and bingo!
Below, I tried to make most out of SAP’s amazing inline declaration concept!
Spot on! Now CN43N was bound to follow me! 😉
I hope you liked it, there is no need to thank me! If you know any other way, please share!