cancel
Showing results for 
Search instead for 
Did you mean: 

Select query unable to fetch respected data from table.

Former Member
0 Kudos

Hello,

I am not able to get the respected PSA table name by below query.There is no error in the code.

Can anyone suggest me on it.

Regards,

Disha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


Hi disha,

i have tried same in my system iam able to get the result .

please find the program result .

RSDSSEG:

RSTSODS :

Report

logic:  i have writen program in  simple way .

REPORT  ZSDN.



data:IT_PSA type table of RSDSSEG,

      WA_PSA type RSDSSEG,

    IT_ODS type table of RSTSODS,

     WA_ODS type RSTSODS,



select * from  RSDSSEG into TABLE IT_PSA where OBJVERS = 'A' and LOGSYS = 'ERTCLNT901' and PSA = '/BIC/B0017812'.



  if sy-subrc = 0.

loop at IT_PSA into WA_PSA.



  endloop.

  endif.



select * from RSTSODS into TABLE IT_ODS where ODSNAME = WA_PSA-PSA .



LOOP AT IT_ODS into WA_ODS .

write : WA_ODS-ODSNAME_TECH.

ENDLOOP.

Former Member
0 Kudos

Report Result:

Regards,

Polu.

Former Member
0 Kudos

Hello polu,

Thanks for your help.

Now my problem is solved by ur code.

Regards,

Disha

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Disha,

Please check the length and type of PSA_ACT and ODSNAME_TECH.

Regards,
dipti

RafkeMagic
Active Contributor
0 Kudos

compare the lengths of RSDSSEG-PSA and RSTSODS-ODSNAME_TECH... they're not the same

( add '000' to the end of RSDSSEG-PSA and try again)

RamanKorrapati
Active Contributor
0 Kudos

Required to 0's to prefix of ODSNAME_TECH(16 length)

RSDSSEG-PSA - 30 digits length.

Or define one more char for ODSNAME_TECH.

RafkeMagic
Active Contributor
0 Kudos

you mean SUFfix... (not prefix)

another option is to use ODSNAME (key) instead of ODSNAME_TECH... then there is a 1-1 match (at least in our systems)

RamanKorrapati
Active Contributor
0 Kudos

Yes,

One more thing, have you observed second select statement where clause.

ODSNAME = PSA1 -PSA_TAB, thru first select query PSA_tab have PSA name.

How it possible psa name = ods name?

hi disha,

please recheck your second select query where clause condition.

Thanks

RafkeMagic
Active Contributor
0 Kudos

first of all, those are just "table field names", so that doesn't matter... the field could even be called "ICECREAM" in one table and "HOT_SAUCE" in another

secondly, PSAs and DSOs were one and the same thing back in the early days...