‎2015 Mar 03 8:47 PM
Hi Experts ,
i have an strange situation, when i am trying to fetch data from rbkp table passing company code and posting date , i am not getting any records, according to my knowledge , select statement is correct.,while i checked in se11 with same inputs, it is showing records.
where am i going wrong,
i am attaching the both screen shots.please check.help required.
‎2015 Mar 03 11:13 PM
Validate if the P_LIFNR is empty, because if that is true, your parameter set the value in P_LIFNR = '' and search this in the database.
Option 1: Set P_LIFNR as an obligatory parameter
p_lifnr type bsik-lifnr obligatory
Option 2: Validate P_LIFNR is empty
if p_lifnr is initial.
select ...
where ...
else.
select ...
where LIFNR = P_LIFNR.
Option 3: Convert the P_LIFNR as a Select-Option, you need to change the "=" to "IN" instruction in Where.
Best Regards,
Francisco Romero
‎2015 Mar 03 9:18 PM
No - the selection conditions are not the same in both cases. In your program, you using P_LIFNR, but not in the data browser. I suspect that P_LIFNR is blank in the program and that is why you do not get any records.
Or if P_LIFNR is a SELECT-OPTION, you cannot use "=".
Rob
Message was edited by: Rob Burbank
‎2015 Mar 03 9:55 PM
Regards,
Philip.
‎2015 Mar 03 11:13 PM
Validate if the P_LIFNR is empty, because if that is true, your parameter set the value in P_LIFNR = '' and search this in the database.
Option 1: Set P_LIFNR as an obligatory parameter
p_lifnr type bsik-lifnr obligatory
Option 2: Validate P_LIFNR is empty
if p_lifnr is initial.
select ...
where ...
else.
select ...
where LIFNR = P_LIFNR.
Option 3: Convert the P_LIFNR as a Select-Option, you need to change the "=" to "IN" instruction in Where.
Best Regards,
Francisco Romero
‎2015 Mar 04 5:23 AM
Hi -
In your code, you have P_BELNR, P_BUKRS, P_LIFNR is mentioned. If P_BUKRS or P_LIFNR are parameters it will cause the issue. You need make these fields mandatory for your case.