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: 

Selection screen -Query

Former Member
0 Kudos

Hi Gurus:

I have a query which has selections form extars tab in the

infoset and one selection for language from the selection tab.

The problem is that when this selection in teh selection screen

from the selection tab is filled with no language(blank)

and run withoutselecting anyother selection it gives all teh result,

similaryly if I put in a language and in it and run it still shows up

witha ll the result. Actually I would like to see only thiose

materials with description for which the language is entered and not all .

Since this selection copmes from teh selection tab fo the infoset

its not filtering as required but the other selection criteria which

comes from teh extra tab does filter accordingly.

Could anyone sufggest as how tyo gho about doing it so

that it shows the result by filtering from this languiage criteria also.

My selection screen is as follows.

(General data selection)

TDG Language ___<----- this comes from the selection tab in infoset

(Report-specific selection)

Material Number ____ to ____ (these comes from the extra tab in infoset)

Material Type ____ to ____

Material Desc. Language ____ to ____

Layout ____

Thanks

7 REPLIES 7

Former Member
0 Kudos

Any suggestions please.

0 Kudos

Could anyone please suggest as what to do for this . I ahve added a piece of code to it . Thera re two columns for text one for english language text and other for other language tyext and the call function is used . When I put this poiece of code it works for the english one , such that when I enter EN in selection screen it shows only for the materials having EN text , but the same code dosent work with the other language , it shows both the texts in it. The quesry is showing an warning saying 'Recursive sourcing in teh code'. as sequnec for both code is 2 and eitjher of them has the variable used in each other.

Is ther a way I can solve this problem.

Thanks

former_member212002
Active Contributor
0 Kudos

Hi Aarav,

Probably the problem lies in your select query.

Can you give the snippet of your code??

Anyways it should go something like this.



if rad_1 = 'x'.

select *
from table 
into corresponding fields of table itab 
where (give ur language specification here).

Regards

Abhinab.

0 Kudos

I have two different columsn(additional field) for two diffrenet texts.

FOr the first one its :and its sequence is 2.

data: name3 type tdobname,
      language3 type spras,
      tlines3 type table of tline with header line.
language3 = sy-langu.
clear tdgtextz1.
name3 = mara-matnr.
call function 'READ_TEXT'
  exporting
    id                            = 'PRUE'
    language                      = language3
    name                          = name3
    object                        = 'MATERIAL'
  tables
    lines                         = tlines3
  exceptions
    others                        = 1.
if sy-subrc = 0.
  loop at tlines3.
    if sy-tabix = 1.
      tdgtextz1 = tlines3-tdline.
    else.
      concatenate tdgtextz1 tlines3-tdline into
          tdgtextz1 separated by space.
    endif.
  endloop.
endif.
if p_spras = language3.
check not tdgtextz1 = ' '.
tdg_text = ' '.
endif.

for the second one as follows and has the same sequence in infoset as 2.

data: name2 type TDOBNAME,
      language2 type SPRAS,
      tlines2 type table of TLINE WITH HEADER LINE.
language2 = sy-langu.
clear tdg_text.
name2 = mara-matnr.
CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID                            = 'PRUE'
    LANGUAGE                      = language2
    NAME                          = name2
    OBJECT                        = 'MATERIAL'
  TABLES
    LINES                         = tlines2
  exceptions
    others                        = 1.
IF SY-SUBRC = 0.
  loop at tlines2.
    if sy-tabix = 1.
      tdg_text = tlines2-tdline.
    else.
      concatenate tdg_text tlines2-tdline into
          tdg_text SEPARATED BY space.
    endif.
  endloop.
ENDIF.
if p_spras = language2.
check not tdg_text = ' ' .
tdgtextz1 = ' '.
endif.

0 Kudos

This is a Query and infoset. the code exists in the infoset .

0 Kudos

Do you suggest anything on this so that I get the text for only the language i enter and only materiuals that have text in them .

Thanks

Former Member
0 Kudos

.