2023 Feb 15 1:45 PM
Hi All.
I am writing new ABAP syantx for LOOP.
I have count as one of the column where SY-TABIX value of LOOP is stored as record counter. Below Code is not populating any value : Please suggsest
Material and Batch are populated but count field is blank
ct_data = VALUE #( FOR ls_details IN lt_details
( count = sy-tabix
material = ls_details-matnr
batch = ls_details-charg ) ).
2023 Feb 15 1:54 PM
SY-TABIX is not changed by FOR. It's different from LOOP AT.
Use INDEX INTO:
ct_data = VALUE #( FOR ls_details IN lt_details INDEX INTO index
( count = index
material = ls_details-matnr
batch = ls_details-charg ) ).
2023 Feb 15 1:48 PM
I am like the compiler, I don't understand what you are trying to do
2023 Feb 15 1:54 PM
SY-TABIX is not changed by FOR. It's different from LOOP AT.
Use INDEX INTO:
ct_data = VALUE #( FOR ls_details IN lt_details INDEX INTO index
( count = index
material = ls_details-matnr
batch = ls_details-charg ) ).
2023 Feb 15 2:00 PM
Thanks Sandra !! I was using SY-TABIX from conventional ABAP LOOP - ENDLOOP to update counter.But with code correction suggsted by you, its woeking !!
2023 Feb 15 1:54 PM
Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!