2015 Dec 04 7:36 AM
Hi
Can you please tell me how to use parallel cursor technique if second loop has the NE selection section,
I know normally , but here in where condition NE selection is there.
Thanks,
Srinivas.
2015 Dec 04 8:16 AM
Hi Srinivas,
I think you can try the below way.
read table fp_it_temp into l_wa_temp with key kunwe eq <l_fs_final_today>-kunwe
matnr eq <l_fs_final_today>-matnr binary search.
if l_wa_temp-vbeln ne <l_fs_final_today>-vbeln.
lv_index = sy-tabix.
loop at fp_it_temp into l_wa_temp from lv_index.
if l_fs_final_today ne l_wa_temp-kunwe. "Add if you need other conditions.
exit.
endif.
"Write your respective coding here
endloop.
endif.
Regards,
Mounika
2015 Dec 04 9:01 AM
Hi Mounika,
Thanks for your response.
after read table if condition is satisfied then it will get the sy-tabix.
But my question is if the l_wa_emp-vbeln NE <l_fs_final_today>-vbeln record is in second postion in fp_it_temp,
then the read statement won't go to second record right for that combination.
Read statement will take first record for the satisfied condition , it is the problem if we right the logic suggest by you.
2015 Dec 04 9:08 AM
Hello,
Am wondering why is it not possible to use the following approach below,
read table fp_it_temp into l_wa_temp with key kunwe eq <l_fs_final_today>-kunwe
matnr eq <l_fs_final_today>-matnr
vbeln ne <l_fs_final_today>-vbeln binary search.
lv_index = sy-tabix.
loop at fp_it_temp into l_wa_temp from lv_index.
if l_fs_final_today ne l_wa_temp-kunwe. "Add if you need other conditions.
exit.
endif
I assume this approach will even work, why to check the condition later ??
Regards,
Deepan Swaminathan.
2015 Dec 04 9:21 AM
Hello deepan,
Read statement doesn't allow Relational operators ( EQ NE ).
Need to use = arithmeticonly
2015 Dec 04 9:22 AM
lella sri wrote:
But my question is if the l_wa_emp-vbeln NE <l_fs_final_today>-vbeln record is in second postion in fp_it_temp,
then the read statement won't go to second record right for that combination.
After read statement I've checked 'if l_wa_temp-vbeln ne <l_fs_final_today>-vbeln.' Only if this satisfies, your loop condition will be executed else it will not.
loop at fp_it_temp into l_wa_temp from lv_index.
if l_fs_final_today-knuwe ne l_wa_temp-kunwe and l_fs_final_today-matnr eq <l_fs_final_today>-matnr and l_wa_temp-vbeln ne <l_fs_final_today>-vbeln
exit.
endif.
endloop.
If you change your code in the above way for the second record,as you mentioned, if the condition fails then it will exit the loop.
Regards,
Mounika
2015 Dec 04 9:37 AM
Hello mouinka,
Ex data:
Fp_it_final_today:
VBELN KUNWE MATNR
0410 10 FA1010 - header
FP_FINAL_TODAY:
VBELN KUNWE MATNR
0410 10 FA1010 - 1st
0420 10 FA1010 - 2nd
If we go through the above logic.
Read statement will satisfy the combination of kunwe and matnr
after that in if condition vbeln won't satisfy so it won't get sy-tabix. because 0410 = 0410.
So it will exit the read statement but my record is in second position,
whenever read statement run it will get the first record only, it won't go to second record
because of this I'm missing the 2nd position record.;
2015 Dec 04 9:50 AM
Better to loop the item table first followed by header table. You can append the data only when the header table vbeln is not equal to item tab vbeln.
I hope there will not be any issue if you do so.
Regards,
Mounika
2015 Dec 04 10:41 AM
hi lella,
I think you can read for VBELN after the first loop, than
If sy-subrc = 0.
continue.
endif.
"Normal parallel cursor logic goes Here"
Here no need to check the NE condition for VBELN, because in above logic if it finds the value of VBELN in both the internal tables it will continue with next iteration.
Regards,
Shadab.
2015 Dec 04 1:02 PM
Thank you guys for your suggestion.
Problem got resolved by my self.
Thanks,
Srinivas.
2015 Dec 04 8:24 AM