If you've done a bit of substitutions or validations, tocdes GBB1 and GBB0, respectively, then you might've encountered a case where you need to retrieve another object's details, e.g. get parent's WBS element's cost center. You might think that you'll only need to get the object's ID or number and work from there, but remember that the details may not have been committed to the database yet.

There are a couple of direct ways to achieve this:
1. Use matrix parameter
Set this feature when you define your exit in your custom copy of RGGBR000/RGGBS000. There is an example to capture this in the sample programs already, but basically it is to capture the FI document items (single BKPF entry & multiple BSEG entries).

2. Use SAP standard function modules to read from the buffer
SAP standard function modules related to the objects in validations/substitutions generally have a function module that will enable you to read from the buffer, instead from the database.

The first tips are usually the most obvious, but they can also be the most overlooked. To save yourself and your supervisors hours of reworking & re-reviewing, here are some tips:

1. Thorough, intuitive unit testing
Unit testing is the start of it all. If you manage to cut down the problems at this stage, it's like weeding out wild grass at its root, you'll save a great deal of time, both for yourself and for your supervisors.

Thorough means that you systematically test your unit, from the very beginning, and step-by-step work your way towards the end. Don't skip out on any parts, unless you're very, very sure that they can be done so. MOST importantly, you will need to make sure that your unit works correctly. That means, verifying the source data, the process, and the outcome of data. Are the calculations correct? Are there any duplicate entries in the output?

It is extremely easy to say that you've tested one unit just because the output is... well, tidy, or pretty (or the outcome didn't shortdump). But that doesn't mean that it is correct. Verify input, process, and output!

It is also easy to just focus on the main functionality of your unit. For example, remember that your unit may work correctly for, say, its functionality to display a nice, tidy, and correct ALV report, but it may be completely incorrect and/or messy when it comes to outputting it to, say, a form or a local file. Test each piece of the functionality, and before you say you've tested it, make sure you've actually done it and the results are OK.

Intuitive means don't just test what the scenarios written in the functional design told you to test. Think outside the box. Position yourself as if you are the user. Would you be satisfied with your own work? The functional designer may not explicitly say to test one thing, but if you, as a user, would be annoyed or confused at the approach you take when coding the unit, then it is logical to either improve or reconsider that approach.

2. Assume only when it is safe, not just when it is convenient to do so (i.e. avoid assumptions!)
It might be convenient to assume one thing when you're developing, but a wrong assumption may lead to extensive rework, or, on the contrary, may lead to extensive development when it is not required (or even must not exist).

There are some things that can be directly assumed, such as, your unit will work if the server is not somehow hit by lightning or an earthquake, but if it is not unambiguously written, then do confirm. And when you confirm, make sure you have evidence that the other party has confirmed.

3. Get a pair of extra eyes
It can be generally said that developers know more (at least technically) about his/her own units than other people. While this is expected and it's natural, this could lead to the "alpha-tester syndrome" (yes, I made the term up), which means that the developers may subconsciously assume things or may overlook things because he/she was the one who developed it.

Ask a colleague or your supervisor, if they're not busy, to come and give a look about your unit's results. See if they notice something that may be useful for you to either detect a bug and fix it, or change a part of the code to improve the unit.

4. Learn outside the scope
Your scope may be in development, but don't let that stop you from learning about the functionality and your unit's place inside the "big picture", i.e. what your unit contributes to the overall business process.

Knowing about the background of your unit will enable to get a sense of what the users will expect of your unit, so you could anticipate those by implementing things that may improve the user experience with your unit. You may even see an "invisible" hole that might've been overlooked by the functional designer, or even suggest a better approach.

Well, that's it for part 1. If I ever have the urge for part 2, I'll post it here. Hopefully the above will help you in doing your assignments and improve our overall quality.

Here's the case. I've added some fields in ANLU table and I want to make them as part of dynamic selection on reports such as s_alr_87011990.

How do we do this?

I got this info from SDN. Here are the steps.

1. Run TCode SE36, enter the logical database which is used (in this case it's ADA), choose display
2. Go to menu path Extras --> Selection Views (Ctrl+F7)
3. Change the origin of view to SAP, click change
4. Find the appropriate node/table that contains the custom fields on the right upper side
(You can browse through the fields after you double click the node/table)
5. Find the custom fields that you want to add
6. Choose the function group which the custom fields will be inserted into. If you need to, you can add function group(s) for these
fields.
7. Save

Hopefully it can help ;)

Update !

BDC Mode is now available in global class. Below are the attributes :

C_BDC_DISMODE_E : BDC Processing mode, Display error
C_BDC_DISMODE_N : BDC Processing mode, No Display - if break point sy-subrc
C_BDC_DISMODE_A : BDC Processing mode, Display all screen
C_BDC_DISMODE_P : BDC Processing mode,No Display - if break point debug

C_BDC_UPMODE_S : BDC Update mode, Synchronous
C_BDC_UPMODE_A : BDC Update mode, Asynchronous
C_BDC_UPMODE_L : BDC Update mode, Local update

There are two ways to implement traffic lights (lamp icon) in your ALV Grid:

1.For any icon (including traffic lights)
Define a field in the internal table LIKE ICON-ID
For example...
DATA: BEGIN OF ITAB...
icon_field LIKE ICON-ID,
... END OF ITAB.
Then fill the field icon, for example...
itab-icon_field = @0A@ "Red light
Preparing the fieldcatalog...
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-fieldname = 'ICON_FIELD'.
wa_fieldcat-icon = 'X'.

2.For traffic lights only
icon_field(1) TYPE C.
itab-icon_field = '1'. "Red
itab-icon_field = '2'. "Yellow
itab-icon_field = '3'. "Green
wa_layout-lights_tabname = 'ITAB'.
wa_layout-lights_fieldname = 'ICON_FIELD'.

Dear All,

I just had this simple lesson but yet can be stressful for us when we're using HIDE. I used it on the program assigned to me ZMPUR_PO_EXPEDITING_RPT and it was used on AT LINE-SELECTION event to call a transaction which later on will display the PO. When using HIDE in a loop, don't put it after sy-uline (If you're writing table form report). Let's take a look at some part of the code below.

WRITE AT : /g_hoff001(1) sy-vline,
g_hoffset001(g_hwidth001) wa_temp_exp-ebeln,
g_hoff002(1) sy-vline,
g_hoffset002(g_hwidth002) wa_temp_exp-bedat,
g_hoff003(1) sy-vline,
g_hoffset003(g_hwidth003) wa_temp_exp-verkf,
g_hoff004(1) sy-vline,
g_hoffset004(g_hwidth004) wa_lfa1-telf1,
g_hoff005(1) sy-vline,
g_hoffset005(g_hwidth005) wa_temp_exp-reswk,
g_offlast(1) sy-vline.
WRITE / sy-uline(170).
HIDE: wa_temp_exp-ebeln,
wa_temp_exp-bsart.



If you do this, the AT LINE-SELECTION event will work properly when you double click on the sy-uline, not on the fields (ie wa_temp_exp-reswk). To make the event work properly as expected, simply put the HIDE before the sy-uline, so the code will look like this:

WRITE AT : /g_hoff001(1) sy-vline,
g_hoffset001(g_hwidth001) wa_temp_exp-ebeln,
g_hoff002(1) sy-vline,
g_hoffset002(g_hwidth002) wa_temp_exp-bedat,
g_hoff003(1) sy-vline,
g_hoffset003(g_hwidth003) wa_temp_exp-verkf,
g_hoff004(1) sy-vline,
g_hoffset004(g_hwidth004) wa_lfa1-telf1,
g_hoff005(1) sy-vline,
g_hoffset005(g_hwidth005) wa_temp_exp-reswk,
g_offlast(1) sy-vline.
HIDE: wa_temp_exp-ebeln,
wa_temp_exp-bsart.
WRITE / sy-uline(170).



So the event will work properly when you click on any of the fields.
Well, I hope this simple thing can help you when you're working with HIDE. Thanks to Albert who helped debug and resolve this problem.

Instead of recreating the text symbol 'Select-Option'(001) each time the program displays message 255(ZM), just use ZCL_ZCA_COMMON=>C_SELECT_OPTION. Same as for PARAMETER.

Just follow the link for tutorial how to send email from SAP using CL_BCS class.

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/789