‎2006 Mar 21 11:39 PM
Hi All,
This is another case of selection screen field comparisions i am facing a problem...
There is a selection screen field as:
SELECT-OPTIONS: S_HDTXID FOR TTXID-TDID.
There is a range field similar to above as given below:
RANGES: R_HDTXID FOR TTXID-TDID.
I am updating the range field as given below.
LOOP AT S_HDTXID.
R_HDTXID-LOW = S_HDTXID-LOW.
R_HDTXID-SIGN = 'I'.
IF S_HDTXID-HIGH <> ''.
R_HDTXID-OPTION = 'BT'.
R_HDTXID-HIGH = S_HDTXID-HIGH.
ELSE.
R_HDTXID-OPTION = 'EQ'.
ENDIF.
APPEND R_HDTXID.
ENDLOOP.
In the below given piece of code i have to get the header text for each text id inputted in the field S_HDTXID.
IF NOT R_HDTXID IS INITIAL.
LOOP AT R_HDTXID.
CLEAR: Z_ID, Z_OBJECT.
CLEAR A01_HEAD.
REFRESH A01_LINE.
Z_ID = R_HDTXID-LOW. "object id
Z_OBJECT = 'VBBK'. "object
Z_NAME = A00_VBAK-VBELN.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = Z_ID
LANGUAGE = SY-LANGU
NAME = Z_NAME
OBJECT = Z_OBJECT
IMPORTING
HEADER = A01_HEAD
TABLES
LINES = A01_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC EQ 0.
IF NOT A01_LINE[] IS INITIAL.
READ TABLE A01_LINE INDEX 1.
IF SY-SUBRC = 0.
A02_HTEXT-Z_ID = Z_ID.
A02_HTEXT-Z_GSID = A01_LINE-TDLINE.
APPEND A02_HTEXT.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
For eg: Z003 and Z095 are the input values of the selection screen field then by assigning the value as Z_ID = R_HDTXID-LOW. I am able to get the value of only R_HDTXID-LOW (Z003), where as i am unable to get the value of R_HDTXID-HIGH (Z095) and the range of values between them.
Please suggest or clarify to proceed accordingly.
Thank You,
Suresh
‎2006 Mar 22 12:21 AM
refer to the text header table directly before your loop:
select * from STXH into coresponding fields of table it_stxh
for all entries in A00_VBAK
where tdobject = 'VBBK'
and tdname = a00_vbak-vbeln
and tdid in s_hdtxid.
Then loop at these:
loop at it_stxh.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = it_stxh-tdid
LANGUAGE = SY-LANGU
NAME = it_stxh-tdname
OBJECT = 'VBBK'
*.......etc
*etc
endloop.
‎2006 Mar 22 12:21 AM
refer to the text header table directly before your loop:
select * from STXH into coresponding fields of table it_stxh
for all entries in A00_VBAK
where tdobject = 'VBBK'
and tdname = a00_vbak-vbeln
and tdid in s_hdtxid.
Then loop at these:
loop at it_stxh.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = it_stxh-tdid
LANGUAGE = SY-LANGU
NAME = it_stxh-tdname
OBJECT = 'VBBK'
*.......etc
*etc
endloop.
‎2006 Mar 22 4:50 AM
Hi suresh,
1. where as i am unable to get the value of R_HDTXID-HIGH (Z095) and the range of values between them.
Thats bcos u are on the wrong track.
2. FIRST we have to get
all values
using some SELECT and select-option entry,
in some internal table
(this will take care of ALL low and high values and all
ranges between them)
(there is no need to use RANGES separately,
bcos select-option is already there)
3. like this
4. just copy paste in new program
and u will understand what i say !
<b>(it will give u all RANGES between low and high)</b>
REPORT abc.
TABLES : ttxid.
DATA : BEGIN OF itab OCCURS 0,
tdid LIKE ttxid-tdid,
END OF itab.
SELECT-OPTIONS: s_hdtxid FOR ttxid-tdid.
*----
IMPORTANT
<b>SELECT tdid INTO TABLE itab
FROM ttxid
WHERE tdid IN S_hdtxid.</b>
*----
LOOP AT ITAB.
*--- PROCESS WITH ITAB-TDID
WRITE 😕 ITAB-TDID.
ENDLOOP.
regards,
amit m.
‎2006 Mar 22 5:57 AM
Hi suresh,
1. where as i am unable to get the value of R_HDTXID-HIGH (Z095) and the range of values between them.
Thats bcos u are on the wrong track.
2. FIRST we have to get
all values
using some SELECT and select-option entry,
in some internal table
(this will take care of ALL low and high values and all
ranges between them)
(there is no need to use RANGES separately,
bcos select-option is already there)
3. like this
4. just copy paste in new program
and u will understand what i say !
<b>(it will give u all RANGES between low and high)</b>
REPORT abc.
TABLES : ttxid.
DATA : BEGIN OF itab OCCURS 0,
tdid LIKE ttxid-tdid,
END OF itab.
SELECT-OPTIONS: s_hdtxid FOR ttxid-tdid.
*----
IMPORTANT
<b>SELECT tdid INTO TABLE itab
FROM ttxid
WHERE tdid IN S_hdtxid.</b>
*----
LOOP AT ITAB.
*--- PROCESS WITH ITAB-TDID
WRITE 😕 ITAB-TDID.
ENDLOOP.
regards,
amit m.