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

TRANSPORTING field inside a loop

Former Member
0 Likes
1,714

Hi,

Problem with TRANSPORTING field inside a loop

Please see code below and advice

The fields dont get updated FKART & TABIX

DATA : BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBRK-VBELN,

FKART LIKE VBRK-FKART,

VKORG LIKE VBRK-VKORG,

TABIX LIKE SY-TABIX,

END OF ITAB.

DATA : WA_ITAB LIKE LINE OF ITAB.

DATA : IT_ITAB LIKE STANDARD TABLE OF ITAB WITH HEADER LINE.

.

SELECT VBELN FKART VKORG FROM VBRK INTO TABLE IT_ITAB

WHERE VBELN IN S_VBELN

AND VKORG = P_VKORG.

LOOP AT IT_ITAB INTO WA_ITAB.

CLEAR i_lines.

WA_ITAB-TABIX = SY-TABIX.

WA_ITAB-FKART = 'RAS'.

MODIFY TABLE IT_ITAB FROM WA_ITAB TRANSPORTING TABIX FKART.

Table doesnt get modified ?????

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

former_member671224
Participant
0 Likes
1,112

Hi Priya,

Use MODIFY IT_ITAB FROM WA_ITAB TRANSPORTING TABIX FKART.

Regards,

Amal

9 REPLIES 9
Read only

Former Member
0 Likes
1,112

Hi,

There is nothing wrong in this code. The field should get updated. You just check in the debugging by putting a break-point after the ENDLOOP.

Regards,

Atish

Read only

0 Likes
1,112

modify statement some how doesn't update the record ?????

No It doesn't work

Edited by: kamala priya on Jan 10, 2008 12:51 AM

Read only

Former Member
0 Likes
1,112

Show the whole code of yours.

Regards,

Atish

Read only

0 Likes
1,112

report zatest_alv .

tables : vbrk.

data : begin of itab occurs 0,

vbeln like vbrk-vbeln,

fkart like vbrk-fkart,

vkorg like vbrk-vkorg,

tabix like sy-tabix,

end of itab.

data : wa_itab like line of itab.

data : it_itab like standard table of itab with header line.

data i_repid like sy-repid.

  • field to check table length

----


  • Data for ALV display

type-pools: slis.

data int_fcat type slis_t_fieldcat_alv.

parameters : p_vkorg like vbrk-vkorg default 'RAPI'.

select-options : s_vbeln for vbrk-vbeln.

select vbeln fkart vkorg from vbrk into table it_itab

where vbeln in s_vbeln

and vkorg = p_vkorg.

loop at it_itab into wa_itab.

clear i_lines.

wa_itab-tabix = sy-tabix.

wa_itab-fkart = 'RAS'.

modify table it_itab from wa_itab transporting fkart tabix.

endloop.

  • Store report name

i_repid = sy-repid.

  • Create Fieldcatalogue from internal table

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_program_name = i_repid

i_internal_tabname = 'ITAB' "capital letters!

i_inclname = i_repid

changing

ct_fieldcat = int_fcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3.

*explanations:

if sy-subrc <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.

endif.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

  • I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'

i_callback_program = i_repid

it_fieldcat = int_fcat

i_save = 'A'

tables

t_outtab = it_itab

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_LIST_DISPLAY'.

Read only

Former Member
0 Likes
1,112

MODIFY IT_ITAB from wa_itab TRANSPORTING FKART TABIX.

Read only

former_member671224
Participant
0 Likes
1,113

Hi Priya,

Use MODIFY IT_ITAB FROM WA_ITAB TRANSPORTING TABIX FKART.

Regards,

Amal

Read only

mnicolai_77
Active Participant
0 Likes
1,112

hi,

try to use field-symols for modifing internal table.

>TYPES: BEGIN OF ty_line,

> vbeln LIKE vbrk-vbeln,

> fkart LIKE vbrk-fkart,

> vkorg LIKE vbrk-vkorg,

> tabix LIKE sy-tabix,

> END OF ty_line.

>

>DATA : it_itab TYPE STANDARD TABLE OF ty_line INITIAL SIZE 0 WITH HEADER LINE.

>FIELD-SYMBOLS <fs_itab> TYPE ty_line.

>

>SELECT vbeln fkart vkorg FROM vbrk INTO TABLE it_itab

> WHERE vbeln IN s_vbeln

> AND vkorg = p_vkorg.

>

>LOOP AT it_itab ASSIGNING <fs_itab> .

> <fs_itab>-tabix = sy-tabix.

> <fs_itab>-fkart = 'RAS'.

>ENDLOOP.

Bye

Marco

Read only

Former Member
0 Likes
1,112

Hello there,

I have the same issue...I was able to modify the table by doing following:

MODIFY TABLE IT_ITAB FROM WA_ITAB TRANSPORTING TABIX FKART.

get rid of "transporting tabix fkart" part.

just write:

MODIFY TABLE IT_ITAB FROM WA_ITAB.

hope this helps.

Read only

alejandro_bindi
Active Contributor
0 Likes
1,112

Try adding "INDEX sy-tabix" to MODIFY sentence.