‎2009 May 29 11:22 AM
i have one table ctrl one push button and matnr fld on screen 100.now my requirement is i need to show data in tab ctrl accd to field matnr from search help in screen 100 then relevent data shud be displayed in table ctrl .and even all value present in itab if we dont enter any value in matnr fld screen matnr .
plz suggest me regarding select query how to wirte query related this.
‎2009 May 29 12:19 PM
say your input field is Io_field the dtabse table is MARA and the internal table is ITAB then code goes like this
if IO_FIELD is initial.
select * from MARA into ITAB.
else.
select * from MARA into ITAB where matnr = IO_FIELD.
endif.
‎2009 May 29 12:19 PM
say your input field is Io_field the dtabse table is MARA and the internal table is ITAB then code goes like this
if IO_FIELD is initial.
select * from MARA into ITAB.
else.
select * from MARA into ITAB where matnr = IO_FIELD.
endif.
‎2009 May 29 1:28 PM
Hi 12asad,
According to my understanding you have
one table ctrl one push button and matnr fld on screen 100.
Your I/O Field = p_matnr
Do not make the matnr field mandatory which takes even blank spaces.
Now go for the query
select * from dbtable into int_table where matnr = p_matnr .
Int table will have all the data fromthe db table with condition matbr = your i/o field on the screen.
pretty simple
Thanks and regards
Srikanth.P
‎2009 Jun 24 4:57 AM