Hello everyone,
because I am new to abap and sap in general (3 weeks), I've got a question regarding the following code. The problem is that only 5 of the 6 in total sap_objects get appended to lt_results, so I need a syntax or whatever that states that the last sap_object gets appeneded as well.
Does anyone know how to do that?
Most of the code was done with a colleague that teaches me but for this specific problem I am left on my own and I coulndt find anything else on the internet to that. Let me know if any info might be missing.
Thanks in advance!
SORT lt_toaAll BY sap_object.
LOOP AT lt_toaALL INTO ls_toaALL.
IF sy-tabix = 1.
sap_object = ls_toaAll-sap_object.
index = index + 1.
ELSEIF sap_object = ls_toaAll-sap_object.
index = index + 1.
ELSE.
ls_result-sap_object = sap_object.
ls_result-sap_object_index = index.
CLEAR: sap_object, index.
sap_object = ls_toaAll-sap_object.
index = index + 1.
APPEND ls_result TO lt_results.
ENDIF.
ENDLOOP.