‎2009 Jan 23 8:31 AM
this is my code :
LOOP AT git_areas INTO gs_areas.
if gs_areas-name ne 'Pu'.
AND gs_areas-name ne 'Co'.
AND gs_areas-name ne 'In'.
APPEND gs_areas to git_areas1.
ENDIF.
ENDLOOP.
I do not want to append values where name is pu, or co or in.
but it is not working.
how i can do this ?
Study SAP
‎2009 Jan 23 8:33 AM
I think you should use capitals in the name of the areas:
if gs_areas-name ne 'PU'
AND gs_areas-name ne 'CO'.
AND gs_areas-name ne 'IN'.
‎2009 Jan 23 8:35 AM
Hi,
Make this change, Use OR logical operation.
LOOP AT git_areas INTO gs_areas.
if gs_areas-name ne 'Pu'.
OR gs_areas-name ne 'Co'.
OR gs_areas-name ne 'In'.
APPEND gs_areas to git_areas1.
ENDIF.
ENDLOOP.
‎2009 Jan 23 8:37 AM
‎2009 Jan 23 8:38 AM
‎2009 Jan 23 8:43 AM
Hi,
Use as below and it will work...
LOOP AT git_areas INTO gs_areas.
IF gs_areas-name EQ 'Pu' OR gs_areas-name EQ 'Co' OR gs_areas-name EQ 'In'.
ELSE.
APPEND gs_areas to git_areas1.
ENDIF.
ENDLOOP.
‎2009 Jan 23 9:50 AM
HI,
Try this...
LOOP AT GIT_AREAS INTO GS_AREAS.
IF GS_AREAS-NAME NE 'PU'.
OR GS_AREAS-NAME NE 'C0'.
OR GS_AREAS-NAME NE 'IN'.
APPEND GS_AREAS to GIT_AREAS1.
ENDIF.
ENDLOOP.
Hope this will help.
Regards,
Rohan.
Edited by: Rohan on Jan 23, 2009 10:50 AM
‎2009 Jan 23 10:51 AM
Try this
LOOP AT git_areas INTO gs_areas where name <> 'PU' and
name <> 'CO' and name <> 'IN'.
APPEND gs_areas to git_areas1.
ENDIF.
ENDLOOP.
Thanks,
Prashant
‎2009 Jan 23 11:03 AM
>
> Try this
>
> LOOP AT git_areas INTO gs_areas where name <> 'PU' and
> name <> 'CO' and name <> 'IN'.
>
> APPEND gs_areas to git_areas1.
>
> ENDIF.
>
> ENDLOOP.
>
> Thanks,
> Prashant
I think you mean:
LOOP AT git_areas INTO gs_areas where name NE 'PU' and name NE 'CO' and name NE 'IN'.
APPEND gs_areas to git_areas1.
ENDLOOP.
‎2009 Jan 23 11:45 AM
Hi
Try
LOOP AT git_areas INTO gs_areas.
if gs_areas-name not in ( 'Pu', 'Co', 'In').
APPEND gs_areas to git_areas1.
else.
continue.
ENDIF.
ENDLOOP.
Hope this helps
Regards,
Jayanthi.K
‎2009 Jan 23 11:49 AM
Use OR instead of AND in your IF condition and use upper case while comparing values.
LOOP AT git_areas INTO gs_areas.
if gs_areas-name ne 'PU' OR
gs_areas-name ne 'CO' OR
gs_areas-name ne 'IN'.
APPEND gs_areas to git_areas1.
ENDIF.
ENDLOOP.With luck,
Pritam.