2009 Jun 30 7:20 AM
Hi experts,
i am using hide statement but it is not working..The problem with it is that after line selection the variable on which i have used hide is carrying the last value of internal table always..<< Removed >>
Regards,
Raman
Edited by: Rob Burbank on Jun 30, 2009 10:41 AM
2009 Jun 30 7:24 AM
Hi Raman,
It will be better if you paste your Loop code here so that your requirement will be more clear.
Use Hide statement in loop after write statement.
Regards,
Vijay
2009 Jun 30 7:24 AM
2009 Jun 30 7:26 AM
2009 Jun 30 7:32 AM
BUT GET CURSOR IS SPECIFICALLY USED FOR ONLY PARTICULAR FIELD...IF USER SELECTS ANOTHER FIELD IN THE SAME LINE IT WILL GIVE DIFF DATA....
2009 Jun 30 7:34 AM
thats true,
you can have case after
get cursor field <fname> value <value>.
based on fieldname you can have different logic. will it be a show stooper..??
2009 Jun 30 7:39 AM
2009 Jun 30 7:44 AM
Hi Raman,
Use this GET CURSOR command
GET CURSOR LINE <var_for_line_no> VALUE val.
<li> You can pass SY-LILLI system variable value to <var_for_line_no> at runtime
<li> SY-LILLI -Selected list row
Thanks
Venkat.O
2009 Jun 30 7:33 AM
Hi Raman,
Try this in AT LINE-SELECTION event
"Lets say field is Matnr in the table ITAB
GET CURSOR FIELD 'ITAB-MATNR' VALUE itab-matnr.
Thanks
Venkat.O
2009 Jun 30 7:45 AM
2009 Jun 30 7:47 AM
2009 Jun 30 8:04 AM
You might have used your HIDE statment outside LOOP...ENDLOOP.
That is why you are getting always last value of ITAB.
use HIDE with in LOOP..ENDLOOP.
2009 Jun 30 8:12 AM
Hi Raman,
Have a look at this sample program. It works fine. Can you try this way .
Thanks
Venkat.O
REPORT ztest_notepad.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
ort01 TYPE t001-ort01,
END OF it_t001.
START-OF-SELECTION.
"Select data
SELECT *
FROM t001
INTO CORRESPONDING FIELDS OF TABLE it_t001
UP TO 20 ROWS.
"Loop data and send it to Hide area
FORMAT HOTSPOT.
LOOP AT it_t001.
WRITE:/ it_t001-bukrs,
it_t001-butxt,
it_t001-ort01.
HIDE: it_t001-bukrs,
it_t001-butxt,
it_t001-ort01.
ENDLOOP.
"Secondary list
AT LINE-SELECTION.
WRITE:/ it_t001-bukrs,
it_t001-butxt,
it_t001-ort01.
2009 Jun 30 8:54 AM
I am sending a test program with same problem...iin this after line selection the field variable emp-name is displayin only last entry of internal table...
&----
*& Report ZBASICX12
*&
&----
*&
*&
&----
REPORT ZBASICX12.
INITIALIZATION.
DATA: BEGIN OF ITAB OCCURS 0,
EMPID TYPE ZTEMP-EMPID,
EMPNAME TYPE ZTEMP-EMPNAME,
END OF ITAB.
START-OF-SELECTION.
SELECT EMPID EMPNAME FROM ZTEMP INTO TABLE ITAB.
SORT ITAB BY EMPID.
LOOP AT ITAB.
WRITE: / ITAB-EMPID HOTSPOT.
HIDE ITAB-EMPID.
ENDLOOP.
END-OF-SELECTION.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
WRITE: ITAB-EMPNAME.
ENDCASE.
2009 Jun 30 9:03 AM
LOOP AT ITAB.
WRITE: / ITAB-EMPID HOTSPOT.
*HIDE ITAB-EMPID.
"Here you are hiding only EMPID and NOT EMPNAME.
"But in display you are using EMPNAME, so HIDE EMPNAME as well then it 'll work.
"OR you can hide whole work area as well
"ex: HIDE ITAB.
HIDE : ITAB-EMPID, ITAB-EMPNAME.
ENDLOOP.
2009 Jun 30 10:16 AM
Hi Raman,
try hiding the whole work area.
LOOP AT ITAB.
WRITE: / ITAB-EMPID HOTSPOT.
HIDE ITAB.
ENDLOOP.
2009 Jun 30 2:30 PM
Raman,
Perez answered your question in less than 10 minutes after you finally posted your code. This is a classic example of why it is so important to post your code, when there is a question about code.
2009 Jun 30 7:33 AM
Befor READ LINE statement did you use CLEAR <variable> Statement??
2009 Jun 30 7:45 AM
Hi, Sharma
Please Test the following Sample Code Hope will help you to solve out your problem,
DATA: it_t247 LIKE STANDARD TABLE OF t247 WITH HEADER LINE,
wa_t247 LIKE LINE OF it_t247.
SELECT * FROM t247
INTO CORRESPONDING FIELDS OF TABLE it_t247
WHERE spras = 'E'.
LOOP AT it_t247.
WRITE: / it_t247-mnr HOTSPOT ON. HIDE it_t247.
ENDLOOP.
AT LINE-SELECTION.
READ TABLE it_t247 INTO wa_t247 WITH KEY mnr = it_t247-mnr.
IF sy-subrc EQ 0.
WRITE: wa_t247-mnr, wa_t247-ktx, wa_t247-ltx.
ENDIF.
Best Regards,
Faisal
2009 Jun 30 8:02 AM
HI FAISAL,
I have also used hide statement like this..but after line selection the corresponding field is picking up the last value of internal table....
Regards,
Raman