on 2022 Dec 23 7:06 AM
Hi,
I am not able to see data in ALV report,its a blank window with column names only.
TABLES hrp1001.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_hrp,
otype TYPE hrp1001-otype,
sobid TYPE hrp1001-sobid,
objid TYPE hrp1001-objid,
adatanr TYPE hrp1001-adatanr,
END OF ty_hrp.
DATA : it_hrp TYPE TABLE OF ty_hrp,
wa_hrp TYPE ty_hrp.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
SELECT-OPTIONS : s_otype FOR hrp1001-sobid.
SELECT sobid
otype
objid
adatanr
INTO TABLE it_hrp
FROM hrp1001
WHERE otype = s_otype AND
adatanr EQ '.00'.
wa_fieldcat-fieldname = 'SOBID'. " Fieldname in the data table
wa_fieldcat-tabname = 'it_hrp'.
wa_fieldcat-seltext_m = 'SOBID'. " Column description in the output
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'OTYPE'.
wa_fieldcat-tabname = 'it_hrp'.
wa_fieldcat-seltext_m = 'OTYPE'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'OBJID'.
wa_fieldcat-tabname = 'it_alv'.
wa_fieldcat-seltext_m = 'OBJID.'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'ADATANR'.
wa_fieldcat-tabname = 'it_hrp'.
wa_fieldcat-seltext_m = 'ADATANR'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* is_layout = layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_hrp
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Yes, select query is wrong for Select-Options, use 'IN' not '='.
SELECT sobid
otype
objid
adatanr
INTO TABLE it_hrp
FROM hrp1001
WHERE otype IN s_otype AND
adatanr EQ '.00'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your select is wrong. You have select option. You need "in s_otype[]" not "= s_otype"
BR,Christos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vrush09,
Your query was wrong
For select-option you have to use 'IN' and for parameters 'EQ'.
WHERE otype IN s_otype.Thanks
Tarun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.