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

Structure query

Former Member
0 Likes
705

Dear all

I have taken activity unit based on activity type

throuh CSLA table

SELECT SINGLE leinh FROM csla INTO (eenheid)

WHERE lstar EQ zorg_product.

so based on the unit i have to take the text

how can do that

the text is in structure CSLAZ

Can u anybody help me out the query

thanx n advance

senthil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
672
REPORT ychatest LINE-SIZE 350.

TABLES : csla , t006a.

DATA : v_unit LIKE csla-leinh,
       v_text LIKE t006a-msehl.

SELECT SINGLE leinh FROM csla INTO v_unit
WHERE lstar EQ zorg_product.

IF sy-subrc EQ 0.
  SELECT SINGLE msehl FROM t006a INTO v_text WHERE msehi EQ v_unit.
ENDIF.
6 REPLIES 6
Read only

athavanraja
Active Contributor
0 Likes
672

leinh text can be taken from table T006A

Regards

Raja

Read only

Former Member
0 Likes
673
REPORT ychatest LINE-SIZE 350.

TABLES : csla , t006a.

DATA : v_unit LIKE csla-leinh,
       v_text LIKE t006a-msehl.

SELECT SINGLE leinh FROM csla INTO v_unit
WHERE lstar EQ zorg_product.

IF sy-subrc EQ 0.
  SELECT SINGLE msehl FROM t006a INTO v_text WHERE msehi EQ v_unit.
ENDIF.
Read only

0 Likes
672

Hi,

select cslaleinh t006amsehl from leinh inner join msehl on cslaleinh = t006aleinh where csla~lstar eq zorg_product.

This above will work only if leinh is primary key in both the tables.

Read only

Former Member
0 Likes
672

HI Senthil,

The text will be stored in table <b>T006A</b>

SELECT SINGLE leinh FROM csla INTO (eenheid)

WHERE lstar EQ zorg_product.

IF sy-subrc EQ 0.

SELECT SINGLE MSEHL FROM T))6A INTO TEXT

WHERE MSEHI EQ EENHEID.

ENDIF.

Regards

Sudheer

Read only

Former Member
0 Likes
672

Hi Senthil,

I hope the following code will helps you.

<b>* We are not using full key - so please change select...single to select ... upto 1 rows.

select leinh

from csla

into lv_eenheid

where lstar EQ zorg_product

upto 1 rows.

endselect.

select *

from t006A

into wa_t006A

where spras eq 'EN and

MSEHI eq lv_eenheid.

if sy-subrc eq 0.

write wa_t006 -MSEHT,wa_t006-MSEHL.

endif.</b>

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
672

thanx for all your replies

senthil