Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

help with small logic

Hi all,

I have an internal with more than 10000 records.

I have data like this

id matnr test

A M1

B M2

C M3

D M4

D M5

C M6

A M7

B M8

NOW I WANT TO SECT TEST A VALUE BASED ON ID

IF ID = A then test = 1

IF ID = B then test = 2

IF ID = C then test = 3

IF ID = D then test = 4

NOW MY OUTPUT SHOULD LIKE THIS

id matnr test

A M1 1

B M2 2

C M3 3

D M4 4

D M5 4

C M6 3

A M7 1

B M8 2

i DON'T WANT TO LOOP AND MODIFY EACH RECORD BY CHECKING.

Is there any statment that would single attempt i.e set test = 1 for all id = A in a single step and another single step for id = B

i did like this

teMP = 1.

modify table itab transporting teMP where id = 'A'.

teMP = 2.

modify table itab transporting temp where id = 'B'.

I know its wrong but iam looking something like this

Thanks

Tags:
Former Member
Former Member replied

Hi,

You can only do with MODIFY statement as you did. if you want in a single statement.

Regards

Rani.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question