on 01-16-2021 6:16 AM
Hello Guys,
Hope you all are doing great.
I have a requirement to write a variable value to all rows of a specific column. Yes both the fields are of same type.
For Example.
Variable 1 = SAP
Internal Table before
column 1 Column 2
Name 1 (empty)
Name 2 (empty)
Name 3 (empty)
After
column 1 Column 2
Name 1 SAP
Name 2 SAP
Name 3 SAP
Currently am able to achieve this by looping on to the internal table assigning field symbol and moving the variable value.
But, am already in a loop and inside a perform, so I wanted to avoid loop inside the loop.
Is there any way I can achieve this, without loop?
Is there any 7.4 syntax to achieve this?
You can use the MODIFY itab statement like so:
variable_1 = 'SAP'.
MODIFY internal_table
FROM VALUE #( column_2 = variable_1 )
TRANSPORTING column_2
WHERE column_2 <> variable_1.
Here is a link to the SAP documentation for reference
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.