‎2007 Nov 16 6:30 AM
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
‎2007 Nov 16 7:58 AM
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
‎2007 Nov 16 7:58 AM
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
‎2007 Nov 16 9:54 AM
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.
‎2007 Nov 16 9:59 AM
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.