We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-abap] Loop With Where Condition As Select Option

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from mic-bv on Feb 10 at 7:29 AM
Koushik ,
I'm wondering about the "WHERE record = '1'" - sure, that record is "1" not only in one line, and it's really "1" and not "0001" etc.? Sometimes it's a good idea to go through with debugger and possible take out some of the where-clauses....


Horacio,
requesting the sy-SubRC after the loop makes sence:
* to find out, if there were records matching the where conditions
* to avoid calculating the amount of lines in the looped table. I guess in most cases a loop...endloop. if sy-SubRC should be slightly more performant (but only, if the loop should be processed anyway, not depending on the amount of records). However, at least it's a bit less to write and one conditional layer less compared to if...loop...endloop...endif.
(as far as I know, the subrc after the endloop is set depending on the loop - no matter how the subrc within the loop was before leaving the loop).

Regards,
Stefan

---------------Original Message---------------
From: Rajavel
Sent: Monday, February 10, 2014 6:15 AM
Subject: Loop With Where Condition As Select Option

Hi all,
This is my code where i passed the select options as where condition.
LOOP AT it_input INTO wa_input
WHERE record = '1'.
AND sold_party IN s_sold
AND material IN s_matl.
wa_input1-record = wa_input-record.
wa_input1-sold_party = wa_input-sold_party.
wa_input1-material = wa_input-material.
wa_input1-quantity = wa_input-quantity.
wa_input1-unit = wa_input-unit.
APPEND wa_input1 TO it_input1.
ENDLOOP.

It_input has records and there is no syntax error.
but sy-subrc is failing.
Can anyone tell me what is the possible error?

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
mic-bv  

achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language