‎2011 Aug 08 10:11 AM
Dear friend,
LOOP AT IT_DATA INTO WA_DATA.
READ TABLE IT_BKPF INTO WA_BKPF---------------------------------------------------------------
WITH KEY BUKRS = WA_DATA-BUKRS
GJAHR = WA_DATA-GJAHR
BELNR = WA_DATA-BELNR BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DATA-STGRD = WA_BKPF-STGRD.
MODIFY IT_DATA FROM WA_DATA TRANSPORTING STGRD.
ENDIF.
CLEAR : WA_DATA, WA_BKPF.
ENDLOOP.piece code of my program, the most strange thing it working proper in devlopment ,but not in prodution
where i made big line(-------) in that work area data not coming when the cursor on sy-subrc.
kindly help me out
victor ezaaz
Edited by: Matt on Aug 8, 2011 1:20 PM added tags
‎2011 Aug 08 10:16 AM
Hi,
Hi, i have faced the issue several times.
This issue is because of the use of binary search.You can remove it and test,Should work fine.
‎2011 Aug 08 10:23 AM
Hi ,
LOOP AT IT_DATA INTO WA_DATA.
READ TABLE IT_BKPF INTO WA_BKPF---------------------------------------------------------------
WITH KEY BUKRS = WA_DATA-BUKRS
GJAHR = WA_DATA-GJAHR
BELNR = WA_DATA-BELNR BINARY SEARCH.
IF SY-SUBRC = 0.
WA_DATA-STGRD = WA_BKPF-STGRD.
MODIFY IT_DATA FROM WA_DATA TRANSPORTING STGRD.
ENDIF.
CLEAR : WA_DATA, WA_BKPF.
ENDLOOP.in above code you have used work area WA_DATA . Please check which table you have assigned while creating wa_data whether thay have same no of fields and order in Production and Development .
regards
Deepak.
‎2011 Aug 08 10:24 AM
Hi,
Before using binary search .. hope you have sorted your internal table.
You need to sort the internal table before using read statment..Binary search.
Regards,
Nagaraj
‎2011 Aug 08 10:28 AM
‎2011 Aug 08 11:57 AM
Firstly sort your internal table to read any table using binary search. above answer is correct
‎2011 Aug 08 12:13 PM
You should Sort the internal table BY BURKS....it will be fine then...
‎2011 Aug 08 12:14 PM
Hi Victor,
I too faced same issue and this is because of BINARY SEARCH keyword.
And sy-subrc values are set to 6 or 8.
so just remove Keyword BINARY SEARCH where ever you have used them and then move to productiona and run again.
BR
Dep
‎2011 Aug 08 12:21 PM
Anyone else wishing to suggest sorting before using Binary Search?
‎2011 Aug 08 3:18 PM
Anybody else want to suggest removing the binary saearch?
Rob
‎2011 Aug 08 4:20 PM
Anyone else wishing to suggest sorting before using Binary Search?
if I may add : use F1 help on READ statement...
‎2011 Aug 08 4:54 PM
Hi
Every one will suggest
SORT IT_BKPF BY BUKRS GJAHR BELNR.
That is the basic rule of BINARY SEARCH.
The fields which are used for binary search must be sorted.
Don't ever remove it will affect your performance as it will flow linear search
Thanks
Hariharan.
‎2011 Aug 08 5:08 PM
Of course you remove it. Design your program correctly, and you'll never* need to use it. SORTED/HASHED tables anyone? I haven't used binary search in years.
*well, hardly ever.
‎2011 Aug 08 6:11 PM
Hi
IF YOU USE SORTED/HASHED TABLE NO NEED TO USE BINARY SEARCH . AS WE KNOW BOTH FOLLOW BINARY SEARCH .
THANKS MATT .
THANKS
HARIHARAN.
‎2011 Sep 26 1:09 PM