Application Development 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: 

How to programmatically listing articles in assortment?

Former Member
0 Kudos

Hi,

This is Retail.

I am creating articles from scratch based on data uploaded to some Z-tables.

I have already successfully created the article. Now I need to list this article in some assortments, but I can't seem to understand how this can be done in ABAP. I tried to look for relevant FM but didn't find any.

Can anyone help?

Thanks,

Nuno

1 ACCEPTED SOLUTION

Former Member
0 Kudos

how you going determine in which assortments list article?

from algorithm point of view

0. you have relations "article - store - yes/no" in your scratch DB

1. for each article change article listing procedure (mm42 -> listing -> listing procedures 03 (manual)

2. for each store create standart module (wso1)

3. fill module with articles according to relations from scratch DB

4. assign module to store local assortment (ws05, local assortment exists for each store and has same code as store)

5 REPLIES 5

Former Member
0 Kudos

how you going determine in which assortments list article?

from algorithm point of view

0. you have relations "article - store - yes/no" in your scratch DB

1. for each article change article listing procedure (mm42 -> listing -> listing procedures 03 (manual)

2. for each store create standart module (wso1)

3. fill module with articles according to relations from scratch DB

4. assign module to store local assortment (ws05, local assortment exists for each store and has same code as store)

0 Kudos

Hi Mikhail,

Thank you for your answer.

But in ABAP I don't want to start inserting records in tables directly so I'm looking for a function which helps me achieve this safely. Now I'm already doing it by submitting program RWSORLIARTI which is assigned to transaction WSM3 which kind of works, but it's not easy to get error reporting and it always commits. With a function I'd have much more control.

Thanks,

Nuno

Former Member
0 Kudos

I did this awhile back: Loop at your matnrs, then....

LOOP AT t_outdata INTO wa_outdata. "MATNRS

CLEAR: t_assortments_matnrs.* REFRESH: t_assortments_matnrs.*

SELECT filia FROM wlk1 APPENDING CORRESPONDING FIELDS OF TABLE t_assortments_matnrs

WHERE artnr = wa_outdata-matnr AND

datab <= sy-datum AND

datbi => sy-datum.

0 Kudos

Hi Tom,

Thank you for answering.

Actually I need to CREATE listing for this materials in WLK1. Not list existing entries in WLK1 because there are none since I've just created the material programmatically.

Regards,

Nuno

0 Kudos

Well,

I found the solution by analysing report RWSORLIARTI. It can be done using two function modules: MODULE_CREATE followed by ASSIGNMENT_POS_TO_SHOP. It's fast and it works quite well.

Regards,

Nuno