Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Movement type condition.

Former Member
0 Likes
510

Hi

my requirement is i need to select material, plant, storage information with the movement type (BWART) having 2 in the second character.

Movement type is of char data type with length 3. I need those records where BWART has the second character to be 2.

EX: 120, 120, etc...

I wrote the condition as:

LOOP AT IT_MSEG INTO WA_MSEG.

IF WA_MSEG-BWART+2(1) EQ '2'.

WA_MSEG2-BWART = WA_MSEG-BWART.

APPEND WA_MSEG2 TO IT_MSEG2.

ENDIF.

ENDLOOP.

But I'm getting all types of movementtypes.

This condition is not working. pls help me. thank u.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
367

Hi,

try this.

LOOP AT IT_MSEG INTO WA_MSEG.
IF WA_MSEG-BWART+1(1) EQ '2'.
WA_MSEG2-BWART = WA_MSEG-BWART.
APPEND WA_MSEG2 TO IT_MSEG2.

ENDIF.
ENDLOOP.

Cheers,

Will.

2 REPLIES 2
Read only

Former Member
0 Likes
368

Hi,

try this.

LOOP AT IT_MSEG INTO WA_MSEG.
IF WA_MSEG-BWART+1(1) EQ '2'.
WA_MSEG2-BWART = WA_MSEG-BWART.
APPEND WA_MSEG2 TO IT_MSEG2.

ENDIF.
ENDLOOP.

Cheers,

Will.

Read only

0 Likes
367

Smith,

Its working now. Thank u very very much yaar. u saved my time.

I thought it is 2(1) but my calculation went wrong. Once again a lot of thanks to u mate.