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

No Output being displayed

simantini_sh
Explorer
0 Likes
1,579

In the following code when I give entry in ZSSO, then after execution no output is being displayed, can someone pls help me out

TYPES: BEGIN OF ty_zps,
zsso TYPE zps_resource_asn-zsso,
zcity TYPE zps_resource_asn-zcity,
zstate TYPE zps_resource_asn-zstate,
zcountry TYPE zps_resource_asn-zcountry,
END OF ty_zps.

DATA: it_zps TYPE TABLE OF ty_zps,
wa_zps TYPE ty_zps.

DATA: BEGIN OF list OCCURS 0.
DATA: zsso LIKE zps_resource_asn-zsso,
lname LIKE pa0002-nachn,
fname LIKE pa0002-vorna,
hcountry LIKE t005-land1,
wcountry LIKE zps_resource_asn-zcountry,
wcity LIKE zps_resource_asn-zcity,
wloc_prov LIKE zps_resource_asn-zstate,
date LIKE catsdb-workdate.
DATA: END OF list.

SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-001.
PARAMETERS:
p_zsso TYPE zps_resource_asn-zsso OBLIGATORY, "SSO
p_land1 TYPE t001-land1, " OBLIGATORY, "HomeCountry
p_name TYPE zps_resource_asn-zcountry, " OBLIGATORY, "WorkCountry
p_date TYPE catsdb-workdate. "OBLIGATORY. "WorkDate
SELECTION-SCREEN END OF BLOCK b01.

*START-OF-SELECTION.
SELECT zsso zcity zstate zcountry
INTO table it_zps
FROM zps_resource_asn
WHERE zsso = p_zsso.
*END-OF-SELECTION.

READ TABLE it_zps WITH KEY p_zsso into wa_zps BINARY SEARCH.
IF sy-subrc = 0.
list-zsso = wa_zps-zsso.
ENDIF.

1 ACCEPTED SOLUTION
Read only

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes
1,485

You have to use WRITE keyword if you want to display anything.

IF sy-subrc = 0.

list-zsso = wa_zps-zsso.

WRITE:/ 'SSO:'LIST-ZSSO.

ELSE.

write:/ 'Entry not found'.

ENDIF.
6 REPLIES 6
Read only

ChrisSolomon
Active Contributor
1,485

I don't see anywhere where you actually "write" out any output.

Read only

prabukannans
Participant
0 Likes
1,485

below code is necessary?

DATA: BEGIN OF list OCCURS 0.
DATA: zsso LIKE zps_resource_asn-zsso,
lname LIKE pa0002-nachn,
fname LIKE pa0002-vorna,
hcountry LIKE t005-land1,
wcountry LIKE zps_resource_asn-zcountry,
wcity LIKE zps_resource_asn-zcity,
wloc_prov LIKE zps_resource_asn-zstate,
date LIKE catsdb-workdate.
DATA: END OF list.

write this below internal table loop statement.

loop at it_zps into wa_zps..

write : wa_zps-lname, wa_zps-fname, wa_zps-hcountry.

endloop.

you can get output..

Read only

RaymondGiuseppi
Active Contributor
1,485

There are no statement to display anything in your code, so no output is logical?

Did you also code some ALV call (Class or FM) or list statements (WRITE) in your actual report?

Read only

Nikhil_Rao_ABAP
Participant
1,485

Also, could you SORT it_zps BY zsso, you've used a BINARY search, but the it_zps table is neither declared as SORTED nor is there an ORDER BY in the Select query....The READ TABLE it_zps will fail 😞

Read only

matt
Active Contributor
0 Likes
1,485

And tables with header lines (OCCURS) are obsolete so should not be used.

Read only

Gourab_Dey
Product and Topic Expert
Product and Topic Expert
0 Likes
1,486

You have to use WRITE keyword if you want to display anything.

IF sy-subrc = 0.

list-zsso = wa_zps-zsso.

WRITE:/ 'SSO:'LIST-ZSSO.

ELSE.

write:/ 'Entry not found'.

ENDIF.