‎2009 Sep 16 10:43 AM
Hi All,
Please check the below code in that i am able to fetch the w_duedate for first and third if condition.
But i am not able to fetch the w_duedate for the second if condition can anyone let me know how
deal with this issue. I have made bold for the if condition which is not working.
IF fs_terms-ztag1 NE 0 AND
fs_terms-ztag2 NE 0.
w_days = fs_terms-ztag3.
w_duedate = fs_bseg-zfbdt + fs_terms-ztag3.
ENDIF.
IF fs_terms-ztag3 EQ 0 AND
fs_terms-ztag1 NE 0.
w_days = fs_terms-ztag2.
w_duedate = fs_bseg-zfbdt + fs_terms-ztag2.
ENDIF.
IF fs_terms-ztag2 EQ 0 AND
fs_terms-ztag3 EQ 0.
w_days = fs_terms-ztag1.
w_duedate = fs_bseg-zfbdt + fs_terms-ztag1.
ENDIF.
regards
VENk@
‎2009 Sep 16 10:47 AM
hai,
Check Condition Properly, It will not be fulfilled thats y its not fetching data second time.
‎2009 Sep 16 10:47 AM
Hi,
If the IF condition is not working it just means that the condition is not statisfied. There can be no other reason for this when the syntax is correct.
Check in the internal table fs_terms for any records where the field ztag3 is zero and ztag1 is not zero. Since you have used AND, but these conditions must be satisfied.
Regards,
Vikranth
‎2009 Sep 16 10:49 AM
What is the data type of the fields ztag1, ztag2 & ztag3 , I'm hoping it numeric.
BR,
Advait
‎2009 Sep 16 10:51 AM
can you please tell us whats the value going to thse two fields and how have you defined the type of those fields
fs_terms-ztag3 EQ 0 AND
fs_terms-ztag1 NE 0.
‎2009 Sep 16 11:08 AM
Hi,
Itu2019s based on data type; Try below 3 options mostly it will work
1) If itu2019s character the try with SPACE
2) Otherwise try with INITIAL.
3) Also try with u20180u2019
Salil....
‎2009 Sep 16 11:16 AM
Hello,
Please check for initial and not 0 for data type date
Edited by: Arvind Soni on Sep 16, 2009 3:46 PM
‎2009 Sep 16 11:25 AM
Hi all,
My data type is DEC (BSEG-ZBD2T) and i have also checked with initial space.
But still it is not working. Please anymore answers.
Cheers!!
VEnk@
‎2009 Sep 16 11:29 AM
Hello,
Did you try with IS INITIAL?
IF fs_terms-ztag3 IS INITIAL AND
fs_terms-ztag1 IS NOT INITIAL.
w_days = fs_terms-ztag2.
w_duedate = fs_bseg-zfbdt + fs_terms-ztag2.
ENDIF.BR,
Suhas
‎2009 Sep 16 11:59 AM
I dont know why it should not work.
At least this code is working in my system.
DATA: BEGIN OF fs_terms,
ztag1 LIKE bseg-zbd2t,
ztag2 LIKE bseg-zbd2t,
ztag3 LIKE bseg-zbd2t,
END OF fs_terms.
fs_terms-ztag1 = 12.
IF fs_terms-ztag3 EQ 0 AND
fs_terms-ztag1 NE 0.
WRITE 'Valid condition'.
ENDIF.
" Output : Valid condition
Of course , the assumption is that there is a non zero value in ztag1 field.
BR,
Advait
‎2009 Sep 16 12:18 PM
Hi all i have debugged the program there was no entries in internal table.
CLosed.
‎2009 Sep 16 12:22 PM
You should have done this before posting the question here. From now check all the possibilities and still if you are stuck only then post.
‎2009 Sep 16 12:28 PM
Vikranth Reddy i have done it before posting itself and found it is working fine for all my conditions.
But except 2 payment terms(0009, 0006 ) is not working which i have checked after posting. So with this
i hope i am not wrong posting my query.
If possible try to see i have posted another query wth which you can understand.
Regards
VEnk@