2018 Sep 01 9:02 PM
Hi everyone,
I am stuck in a requirement wherein I need to segregate a field base on some values. w is The screenshot of what my debugger is below:
The fields are from table AUSP. My requirement is that I have to concatenate the values of ATWRT for recurring values of ATINN (as highlighted above) and display the remaining values of ATWRT for non recurring values of ATINN. The output of the above table should be like below:
Just like for the 9 series above , the same goes for the rest of the series as well. So for the 12 series it will be like :
Can anyone please help me out with the logic for the above ?
Regards,
Manish
2018 Sep 02 9:05 AM
as your description I suppose that you want to group data base on OBJEK and ATINN.
i think below logic should be work ( dont have system right now to check so you can base on this ideal to check yourself):
loop at itab into wa_source
group by ( objek = wa_source-objek atinn = wa_source-atinn )
into wa_key.
append wa_source to final_itab
assigning field-symbols(<fs>). " here we have the group
loop at group wa_key into wa_mem.
<fs>-atwrt = |{ <fs>-atwrt },{wa_mem-atwrt}|." here we concatente atwrt
endloop.
endloop.
2018 Sep 02 10:09 AM
Hi,
Sorry but I am not able to understand your code. Can you tell me what is wa_key and wa_mem ? Also can u do it using a work area instead of field symbol ?
2018 Sep 02 3:54 PM
2018 Sep 03 12:51 AM
im using GROUP BY in internal table to achive your goal, you should copy the source code to your system and check. its ok to do it using work area, you can try the old technical AT END to concatenate data and append it to one temporary table, its simply logic thinking not something complicate.
2018 Sep 03 12:04 PM
2018 Sep 03 8:37 AM
Question already posted here: https://answers.sap.com/questions/622149/divide-a-field-into-3-different-fields.html
This question is closed. I've reopened the other one.
Please ask questions once and once only. If they need bumping up, you can add a comment.
Matt Billingham - Community Moderator