2016 Feb 27 7:57 PM
Hello guys! I have a problem with a internal table into of a my badi, I try of get each position of a PO is saved in t_posic. The problem it's that for each position, only save a register in my table t_posic. I use the BADI ME_PROCESS_PO_CUST with method ITEM.
e_posic-ebelp = ls_mepoitem-ebelp.
e_posic-pspnr = ls_account-ps_psp_pnr.
e_posic-waers = ls_mepoitem-waers.
READ TABLE
t_posic
INTO ls_posic
WITH KEY
pspnr = e_posic-pspnr
BINARY SEARCH.
IF SY-SUBRC EQ 0.
ELSE.
APPEND e_posic TO t_posic.
ENDIF.
2016 Feb 28 12:04 AM
Your question is very unclear, but one problem I see with your code is that you are using BINARY SEARCH but then also just appending an entry to the table. How are you keeping the table sorted?
2016 Feb 28 10:41 PM
2016 Feb 29 11:05 AM
if you sort by EBELN and PSPNR, in case you have different EBELN, the binary search go mess.
Remove that option (i do not think you have 10000 items in your internal table).
In my system i cannot find the method "ITEM": you mean "process Item"?
2016 Feb 29 12:43 PM
Hi Juan Fco Morales,
I am afraid i did not understand your question, but befor using binary search in read statement please sort the internal table with same key.
Regards,
Pravin