01-12-2016 9:56 AM
Hi Experts,
I am facing the problem with the below select statement.This statement is working well in frontend.If I execute this in background it is not retrieving the data.Kindly any one assist how to solve this problem.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_ekkona_a
FROM v_ekkona AS a INNER JOIN ekko AS b
ON a~ebeln = b~ebeln
WHERE a~ebeln IN s_ebeln[]
AND a~bukrs EQ p_bukrs
AND a~kappl = 'EF'
AND a~bstyp = 'F'
AND a~loekz = space
AND a~bsart IN s_bsart[]
AND a~lifnr IN s_lifnr[]
AND a~kschl IN ('ZEML','ZNON') "IN s_kschl[]
AND a~ekorg IN s_ekorg[]
AND a~ekgrp IN s_ekgrp[]
AND a~bedat IN s_bedat[]
AND b~frgke EQ '1'
AND b~ernam in s_ernam
AND a~vstat = p_vstat
AND a~aktiv = space
AND a~snddr = space.
Thanks & Regards,
Anusha
01-12-2016 4:53 PM
Foreground or background, the same code will be execured AND on the same server. So there should be no difference.
I do see you use select-options with the table mark on it (e.g. s_ebeln[] ), Although this is not necessary, I also think that would not be a reason to have different behavior in fore and background processing.
01-12-2016 10:10 AM
Did you get data in foreground run? check again
Did you run program with the help of variant? check again.
do you still receive blank.
then
debug background job. and check above mentioned values again.
01-12-2016 10:19 AM
Hi Anu,
If you are getting different output in the background job,
Compare the selection screen inputs in the variant & selection selection values of your report.
If your variant is corrupted/modified, try to recreate the variant and schedule the job.
Thanks,
Karthikeyan
01-12-2016 10:26 AM
This should work both ways properly. But for more performance avoid using
Select * in to corresponding fields of.
Rather create a type and mention the fields in correct sequence which you want to fetech.
Example select XXX XXX XXX....... into gt_ekkona_a FROM v_ekkona AS a INNER JOIN ekko AS b
This might be helpful. We can look in detail if there is any error generated in ST22.
Regards,
Veera
01-12-2016 10:26 AM
Hi Anu,
I don understand why your select is not working.
You can try use the follow fm:
call function 'VIEW_GET_DATA'
exporting
view_name = view
tables
data = gt_data.
And then use FOR ALL ENTRIES instead of inner join.
If the view havent a lot of data. I think, It could work.
Regards.
David Cárceles.
01-12-2016 10:52 AM
SELECT execution is not related to execution in interactive or background, so « The truth is out there » (Plato, Heidegger, Fox Mulder)
Looking in actual values of selection criteria for some wrong formatted data, e.g. missing conversion-exit, should be your current aim.
Regards,
Raymond
01-12-2016 11:20 AM
Hi Anu,
This should work in both foreground and background.
Functioning of select query is same in both the modes.
Check your variants in both the ways and try to debug in background. I am sure there is some condition missing in your variant in background mode.
Regards,
Swati
01-12-2016 12:40 PM
Hello,
You can add the command WAIT UP TO XX SECONDS (XX should be enought time to the next operation) before the select, then while the process is waiting you can use the TCODE SM50 to debug it in background and check what parameters are in the where clause. To debug in SM50 select the PID with your program and click in the menu "Administration->Program->Debugging".
Regards,
Lucas
01-12-2016 3:57 PM
Anu Gottumukka wrote:
This statement is working well in frontend.If I execute this in background it is not retrieving the data
There is a difference between frontend/backend and foreground/background. What do you really mean??
Rob
01-12-2016 4:53 PM
Foreground or background, the same code will be execured AND on the same server. So there should be no difference.
I do see you use select-options with the table mark on it (e.g. s_ebeln[] ), Although this is not necessary, I also think that would not be a reason to have different behavior in fore and background processing.
01-13-2016 1:26 AM
Hi All,
Thank you for your replies.
I am calling this in function module immediately after PO release.I check V_ekkona has data but my select statement is returning sy-subrc eq 4.
Thanks & Regards,
Anusha.B
01-13-2016 3:35 AM
I have realised frgke is not set 1 after PO complete release,that is the reason select statement is not retrieving data.