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: 

Problems in ALV Report

Former Member
0 Kudos
82

Hi all,

I have a Problem with the ALV report felated to FI Data. Where in the Selection screen I have two fields Commitment Item, Fund Center and Fiscal Year. When i am executing the report it is printing correctly.

The Problem is that when i give a commitment which is not related to the Fund Center It is displaying all the records.

That is nothing but it is displaying all the data where the data of the selection screen is not in the internal table.

instead i should display a message that the Commitment item is not related to Fund Center. and the ALV Should not print any values. How do i achieve this?

Please help me in solving the problem. Rewards will be awarded.

Message was edited by:

sravan varanasi

1 ACCEPTED SOLUTION

Former Member
0 Kudos
52

Hi Sravan,

Validate commitment with Fund center in at Selection-screen on field event.

ex:

Select Single <Commitment> into Comm_var where fundcenter = <parameter-fundcenter>.

if sy-subrc <> 0.

Message 'Commitment item is not related to Fund Center' TYPE 'E'.

endif.

Reward if it helps,

Satish

3 REPLIES 3

Former Member
0 Kudos
53

Hi Sravan,

Validate commitment with Fund center in at Selection-screen on field event.

ex:

Select Single <Commitment> into Comm_var where fundcenter = <parameter-fundcenter>.

if sy-subrc <> 0.

Message 'Commitment item is not related to Fund Center' TYPE 'E'.

endif.

Reward if it helps,

Satish

Former Member
0 Kudos
52

Hi

I think u can select the records from the table into the corresponding internal table by using the where condition. In the condition u have to filter the records based on the fund center in the table and in the select-options.

If the sy-subrc is zero just print the records from the internal table else give an error message.

Hope useful for u.

Regards

Harish.

Former Member
0 Kudos
52

Hi,

Here is a small ex.

SELECT mtart mtbez FROM t134t

INTO CORRESPONDING FIELDS OF TABLE it_t134t

WHERE mtart IN so_mtart AND spras = 'EN'.

IF sy-subrc = 0.

*********PERFORM display

ELSE.

MESSAGE ID 'Selection error' TYPE 'E' NUMBER '0040'.

ENDIF.

Hope useful.

Regards

Harish.