Application Development and Automation 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: 
Read only

Problems in ALV Report

Former Member
0 Likes
613

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
Read only

Former Member
0 Likes
583

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
Read only

Former Member
0 Likes
584

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

Read only

Former Member
0 Likes
583

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.

Read only

Former Member
0 Likes
583

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.