Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Context Condition causes strange behaviour

My form displays item-level data from a table provided by the Interface.  The table has fields TYPE and AMOUNT (character and currency respectively).  If the TYPE is filled, then I want to display the AMOUNT; otherwise I don't want to display the AMOUNT.  To achieve that, I use Conditions on the AMOUNT field in the Context so that the AMOUNT is not shown if the TYPE is <space>.

If I have data like this, then everything is ok:

Item:    1     2     3     4

Type:    A     A     B     C

Amount: 1.00  0.00  2.00  3.00

But if the data is like this, then there is a problem:

Item:    1     2     3     4

Type:    A           B     C

Amount: 1.00  0.00  2.00  3.00

For item 2, the Condition is not met, so I don't want to display the AMOUNT.  But it goes wrong.

Instead of just suppressing the AMOUNT field, the form (for some reason) takes the AMOUNT from the next available item, and displays as if the data was like this:

Item:    1     2     3     4

Type:    A           B     C

Amount: 1.00  2.00  3.00

So for item 2, the AMOUNT is displayed without a TYPE, and no AMOUNT is displayed for item 4.

How can I prevent or avoid this strange behaviour?

Thanks,

Dave

replied

Hi Raghu,

After some experimentation, I found that it is necessary to use the "Validate" event instead of the "Form Ready" event to control the output.  I think that's because the latter event is only fired for sub-forms, whereas my fields are on a Master Form.

Then using code more-or-less as you described, everything works ok now.

Thanks again,

Dave

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question