on 03-06-2024 8:46 AM
Hi experts!
I have a table productions containing, among others, article ids. Now I want to loop over all entries for which no Article ID exists in the articleIs table. Can I do this inline with the new abap syntax.
Something like this
LOOP AT filter #( productions IN articles where ArticleId not in articles-ArticleId ) INTO DATA(production).
Does anyone know if this is possible.
Thanks and regards,
Sebastian
TYPES: BEGIN OF ty_production,
prod_id TYPE string,
article_id TYPE string,
END OF ty_production,
BEGIN OF ty_article,
article_id TYPE string,
END OF ty_article,
tt_productions TYPE SORTED TABLE OF ty_production WITH UNIQUE KEY prod_id,
tt_articles TYPE SORTED TABLE OF ty_article WITH UNIQUE KEY article_id.
DATA(productions) = VALUE tt_productions( ( prod_id = 'P1' article_id = 'A1' )
( prod_id = 'P2' article_id = 'A2' )
( prod_id = 'P3' article_id = 'A3' ) ).
DATA(articles) = VALUE tt_articles( ( article_id = 'A1' )
( article_id = 'A3' )
( article_id = 'A4' ) ).
LOOP AT FILTER #( productions EXCEPT IN articles WHERE article_id = article_id )
ASSIGNING FIELD-SYMBOL(<prod_with_not_exst_art>).
out->write( <prod_with_not_exst_art>-prod_id ).
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.