Skip to Content

Select statement is not retrieving the data in background

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    Posted on Jan 12, 2016 at 04: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2016 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 12, 2016 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 12, 2016 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2016 at 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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 12, 2016 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 12, 2016 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2016 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2016 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.