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: 

why i am unable to get data from t-tables

Former Member
0 Kudos

Hi Gurus,

small question,

I am trying to retrieve data from the table T5UCA, but no data is coming from this table. Data is present in this table. I am just trying to retrieve bplan in my abap program with a simple select statement. This field is not producing any value. Please guide me.

Thanks

Ravi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I am getting it.

data : itab like standard table of T5UCA with header line.

select * up to 100 rows from t5uca into table itab where langu =

sy-langu.

loop at itab.

write / itab-ltext.

endloop.

send me your code ..

Thanks

Mahesh

11 REPLIES 11

Former Member
0 Kudos

I am getting it.

data : itab like standard table of T5UCA with header line.

select * up to 100 rows from t5uca into table itab where langu =

sy-langu.

loop at itab.

write / itab-ltext.

endloop.

send me your code ..

Thanks

Mahesh

0 Kudos

my code is as follows

FUNCTION zhr_ben_worflow_data.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(PLANNAME) TYPE T5UCA-LTEXT

*" REFERENCE(PERNR) TYPE PA0001-PERNR OPTIONAL

*" REFERENCE(DEPENDANCY) TYPE T5UCF-LTEXT OPTIONAL

*"----


TABLES : t5uca.

DATA companycode TYPE pa0001-bukrs.

DATA bplan TYPE t5uca-bplan.

DATA depcv TYPE t5ucf-depcv.

DATA: lt_t5uca TYPE TABLE OF t5uca.

SELECT bplan into bplan FROM t5uca WHERE ltext EQ planname AND

barea EQ

'US'.

ENDSELECT.

ENDFUNCTION.

here planname is imported

Thanks a lot for quick reply mahesh

0 Kudos

HI,

What i understand is that you are tying to read the data based on the long text that is the reason y you are not getting the data. the text that you are passing to the FM should be exaclty the same that you have in the table other wise it will not select.. say if you pas <b>PAS</b> and it is <b>pas</b> in the table then it is not selected.

is it not possible to pass BPLAN field to ur FM..

Thanks

Mahesh

0 Kudos

LTEXT is case sensitive. Is it being imported in upper and lower case?

(changed planname to ltext).

Rob

Message was edited by:

Rob Burbank

0 Kudos

Mahesh,

By using long text I have to get the bplan. How can I solve this problem.

0 Kudos

Rob,

I gave the same long text from the table t5uca for testing purpose, still not retrieving any value. I tried in all ways I know. Can you suggest me how to solve.

0 Kudos

HI try this way..

DATA : itab LIKE STANDARD TABLE OF t5uca WITH HEADER LINE.

DATA : lv_string(30) TYPE c.

lv_string = 'Alberta Health Care'.

SELECT * FROM t5uca INTO TABLE itab WHERE langu =

sy-langu AND barea EQ 'US'.

LOOP AT itab.

TRANSLATE lv_string TO UPPER CASE.

TRANSLATE itab-ltext TO UPPER CASE.

IF lv_string = itab-ltext.

WRITE / itab-bplan.

ENDIF.

ENDLOOP.

Thaks

Mahesh

0 Kudos

OK - step back a bit. does this work:


REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

TABLES: t5uca.

PARAMETERS: planname LIKE t5uca-ltext.

DATA: bplan LIKE t5uca-ltext.

SELECT bplan INTO bplan
  FROM t5uca
  WHERE ltext EQ planname
    AND barea EQ 'US'.

  BREAK-POINT.

ENDSELECT.

Rob

0 Kudos

Thanks a lot mahesh. Its working perfectly.

Former Member
0 Kudos

whats your select statement like ??

Data: lt_tab type table of T5UCA.

Select * from T5UCA into table  lt_tab where LANGU eq  sy-langu.

if this doesn't give anything to you.. i am hoping you haven't updated the table from the Databse.. check the MANDT field from the DB.

Amandeep

Former Member
0 Kudos

Would you post your code please?

Rob