Skip to Content
-4

alv output based on my selection screen input

Apr 13, 2017 at 04:37 AM

84

avatar image

Hello everyone,

i have a alv report on which im working upon . i need that my alv report on clicking execute the final o/p depending upon what the user inputs.

my selection screen i/p param are :

company code ,

month

year

posting date

Two radiobuttons are also there : zinc metal

i want that if data for month = 11 year = 2016 is entered then only data for that period be obtained.

currently if i enter month = 11 year = 2016 it is giving data for all the months.

my main select query is as follows :

if p_metal = 'X'.

SELECT d~matnr d~v_mh1 e~meins f~maktx FROM zstdrate as d INNER JOIN mara as e ON d~matnr = e~matnr
INNER JOIN makt as f ON e~matnr = f~matnr INTO CORRESPONDING FIELDS OF TABLE it_mara WHERE ( mtart = 'FERT' OR mtart = 'HALB')
AND e~lvorm NE 'X' AND d~matnr in ( SELECT matnr FROM marc WHERE werks = 'RIH1').

endif.

IF p_zin = 'X'.

SELECT d~matnr d~v_mh2 d~v_mh4 d~v_mn1 d~v_mn2 e~meins f~maktx FROM zstdrate as d INNER JOIN mara as e ON d~matnr = e~matnr
INNER JOIN makt as f ON e~matnr = f~matnr INTO CORRESPONDING FIELDS OF TABLE it_mara WHERE
( mtart = 'FERT' OR mtart = 'HALB') AND e~lvorm NE 'X' AND d~matnr in ( SELECT matnr FROM marc WHERE werks = 'RIH2' OR werks = 'RIH4' OR werks = 'RIN1' OR werks = 'RIN2').

ENDIF.

10 |10000 characters needed characters left characters exceeded

I don't even see the month or year in your queries.

0

none of your inputs are passed on to the select query..... Your query is totally based on hardcoded input.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Apr 20, 2017 at 06:02 AM
0

Did you forget some table in your select, you don't use any table relatde to accounting documen,like BSIM?

Share
10 |10000 characters needed characters left characters exceeded