2021 Jun 25 11:15 AM
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.
2021 Jun 25 2:03 PM
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.
2021 Jun 25 11:19 AM
I don't see anywhere where you actually "write" out any output.
2021 Jun 25 12:06 PM
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..
2021 Jun 25 12:34 PM
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?
2021 Jun 25 12:46 PM
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 😞
2021 Jun 25 1:45 PM
And tables with header lines (OCCURS) are obsolete so should not be used.
2021 Jun 25 2:03 PM
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.