‎2008 Nov 07 5:03 AM
Hello Experts,
This is my code
loop at gt_all_nodes INTO WA_ALL_NODES.
SHIFT wa_all_nodes-parent_id LEFT DELETING LEADING ' '.
READ TABLE PT_NVALS INDEX 1.
if WA_all_nodes-parent_id GE PT_NVALS-ID.
(
CODE
)
ELSE
EXIT.
The problem which I am facing is as suppose the value of pt_nvals-id is 36, then as soon as the value wa_all_nodes-parent_id is becomes more than 2 digits like 100 or more, even though it is fulfilling the criteria it exits the loop. The loop is working fine for 2 digits value.
I am clearing all the work areas, the data type of wa_all_nodes-parent_id and pt_nvals-id is the same. but still the problem is not getting solved.I am not able to find out where the problem is?
Thanx in advance
‎2008 Nov 07 5:11 AM
‎2008 Nov 07 5:13 AM
loop at gt_all_nodes INTO WA_ALL_NODES.
SHIFT wa_all_nodes-parent_id LEFT DELETING LEADING ' '.
READ TABLE PT_NVALS INDEX 1.
if WA_all_nodes-parent_id GE PT_NVALS-ID.
(
CODE
)
ELSE
EXIT.
The value of pt_nvals-id is 36 and the value of wa_all_nodes-parent_id is 103.
This condition should ideally be true but in the loop pass it is failing the condition and exiting the loop.
‎2008 Nov 07 5:25 AM
I am not too sure whether this will help u or not , but still u can try.
Use the condense statement before the if statement.
condense WA_all_nodes-parent_id.
condense PT_NVALS-ID.
Regards
Sam.
‎2008 Nov 07 5:28 AM
‎2008 Nov 07 5:49 AM
>
> yaar priya try once again ..
Nice Cheering
Regards
Karthik D
‎2008 Nov 07 5:51 AM
‎2008 Nov 07 5:55 AM
Hi Priya,
I would just like to add on .
Check your DATA TYPE for the field ID.
If it CHAR then try using
CONDENSE <the fields > no-gaps.
After using SHIFT its always good to use CONDENSE.
Regards,
SuryaKiran
‎2008 Nov 07 6:00 AM
oh priya ..
sorry yaar i'm fuctional cosultant ...
but give me some time for discuss with my ABAP team here ..
if any solution i'll forrward to u very soon..
‎2008 Nov 07 6:04 AM
‎2008 Nov 07 6:08 AM
‎2008 Nov 07 6:15 AM
>
> my plesure
I hope this is not a chat forum, rather you can ask your ABAPER to reply to this question
Regards
Karthik D
‎2008 Nov 07 6:13 AM
put break-point on if WA_all_nodes-parent_id GE PT_NVALS-ID.
check the value of WA_all_nodes-parent_id and pt_nvals-id
at runtime..
thanks
Punit Singh
‎2008 Nov 07 6:14 AM
put break-point on if WA_all_nodes-parent_id GE PT_NVALS-ID.
check the value of WA_all_nodes-parent_id and pt_nvals-id
at runtime..
in case of 3 digit...
‎2008 Nov 07 6:16 AM
I have already done that as soon as the value reaches 3 digits, it exits the loop
‎2008 Nov 07 6:26 AM
check the data type of both..
parent_id and id..
after this ..make shift stmt comment..
‎2008 Nov 07 6:28 AM
‎2008 Nov 07 6:41 AM
loop at gt_all_nodes INTO WA_ALL_NODES.
*SHIFT wa_all_nodes-parent_id LEFT DELETING LEADING ' '.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = wa_all_nodes-parent_id
IMPORTING
OUTPUT = wa_all_nodes-parent_id.
READ TABLE PT_NVALS INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = PT_NVALS-ID
IMPORTING
OUTPUT = PT_NVALS-ID .
if WA_all_nodes-parent_id GE PT_NVALS-ID.
(
CODE
)
ELSE
EXIT.