Skip to Content
-2

Dynamic Transporting fields in Modify Internal table

Jan 30 at 06:36 AM

87

avatar image

Hi,

Need to modify an internal table by transporting many fields but in dynamic way. As of now it is working good for one field. When I tried with multiple fields it is throwing error.

Below code is working fine for one field.

DATA lv_fields TYPE string.
lv_fields = 'BSART'.
MODIFY lt_data FROM lw_data TRANSPORTING (lv_fields) WHERE ebeln = lw_temp-ebeln.

Below code is throwing error as two fields are used.

DATA lv_fields TYPE string.
lv_fields = 'BSART BSTYP'.
MODIFY lt_data FROM lw_data TRANSPORTING (lv_fields) WHERE ebeln = lw_temp-ebeln.

Please provide a suggestion to use dynamic transporting with multiple fields.

Thanks in advance.

Regards,

Senthil kumar K

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Horst Keller
Jan 30 at 06:42 AM
2
DATA lv_field1 TYPE string.
DATA lv_field2 TYPE string.
lv_field1 = 'BSART'.
lv_field2 = 'BSTYP'.
MODIFY lt_data FROM lw_data TRANSPORTING (lv_field1) (lv_field2) WHERE ebeln = lw_temp-ebeln.
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Horst,

Thanks for your quick response. Very much appreciated.

So for each field we need to declare separate data object.

Thought there will be an option to have only one data object for N fields. So in that case it will become fully dynamic thus helping developer not to consider number of data objects to be declared even if the fields count are varying.

Thanks and Regards,

Senthil kumar K

0

Yep, as documented. No internal table solution here, as we have it for SORT.

You have to prepare a set of fields and leave those empty, which you don't need.

0
Kali Charan Jan 30 at 06:48 AM
-2

What is the error.?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Getting error as ITAB_ILLEGAL_COMPONENT

0