Application Development and Automation 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: 
Read only

Function module for Article creation (transaction MM41)

Former Member
0 Likes
4,633

Hello,

I have been trying to create an article which is normally done using transaction MM41.

I am trying to use BAPI_MATERIAL_SAVEDATA to do this, but since article creation is different from regular material creation, there are fields that are not available, for example article category (MARA-ATTYP).

Another problem encountered with the BAPI is that the industry section is a required input. For MM41 it is not a required field.

Therefore, is there an available function module aside from the BAPI mentioned above that can perform article creation?

If the BAPI above is sufficient, how can I properly populate the necessary fields?

Additional information: requirement is developed in 4.6c.

provide the code I've been working on if asked.

Thanks in advance!

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,140

You can try WRF_MATERIAL_MAINTAINDATA_RT or go for BDC

16 REPLIES 16
Read only

Former Member
0 Likes
3,140

Hi again

I refined my forum search and managed to found this thread:

[Article creation using BAPI|;

It mentions the use of BAPI_MATEIRAL_MAINTAINDATA_RT, which is for IS-Retail.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,141

You can try WRF_MATERIAL_MAINTAINDATA_RT or go for BDC

Read only

0 Likes
3,140

Thanks for the additional options, however customer does not want me to use BDC because it's error-prone.

Will try your other suggested FM if the one I found doesn't work.

Read only

0 Likes
3,140

I managed to populate the structure of BAPI_MATERIAL_MAINTAINDATA_RT, but after running I get this return message:

"Messages for article DT.1011019.000: log number 0000000000014948"

Does anyone know where to access the log so I can interpret the error message?

Thanks.

Read only

0 Likes
3,140

This message was moderated.

Read only

0 Likes
3,140

This message was moderated.

Read only

VivekG
Participant
0 Likes
3,140

Hi,

You can try the BAPI BAPI_RETAILMATERIAL_CREATE also to create an article in retail specific transaction MM41.

Hope it helps

Vivek Gupta

Read only

Former Member
0 Likes
3,140

I also had a look on that BAPI, but it calls transaction MM41.

The requirement is that article creation can also be done as a scheduled job.

I managed to get the message details, and it said

Invalid load format for BAPI_MATERIAL_MAINTAINDATA_RT=FT

The specified program was found in the database with an incorrect load

version number and was therefore re-generated by the system.

I have absolutely no idea what this means. Can someone please help to interpret?

Read only

VivekG
Participant
0 Likes
3,140

Hi ,

Better you go for BDC recording and create articles rather than using a FM if you are facing these problems and let me know if you face any issues in recording.

Vivek

Read only

Former Member
0 Likes
3,140

BAPI_MATERIAL_MAINTAINDATA_RT did the trick. I am now able to create the article and extend it to as many salesorg or dc as i need also.

Read only

0 Likes
3,140

Hi Paula,

Need a help from your side. We need to extend an article to some other Distribution Chain in IS Retail. As mentioned by you, you were successful in doing so by using the BAPI "BAPI_MATERIAL_MAINTAINDATA_RT".

Could you please guide us how to use this BAPI.

Thanks and Regards,

Harsh

Read only

0 Likes
3,140

Hello Harsh

To extend the article to another distribution channel you need to populate the salesdata/salesdatax structures of the BAPI. For example:


  CLEAR wa_salesdata.
  wa_salesdata-material            = material.
  wa_salesdata-sales_org           = salesorg.
  wa_salesdata-distr_chan          = dstchan.
  wa_salesdata-item_cat            = itemcat.
  wa_salesdata-matl_stats          = '1'.
  APPEND wa_salesdata TO i_salesdata.
  CLEAR wa_salesdatax.
  wa_salesdata-material            = material.
  wa_salesdata-sales_org           = salesorg.
  wa_salesdata-distr_chan          = dstchan.
  wa_salesdatax-item_cat            = 'X'.
  wa_salesdatax-matl_stats          = 'X'.
  APPEND wa_salesdatax TO i_salesdatax.

I believe the important data you need to have are material, sales org, and distribution channel.

Hope this helps.

Read only

0 Likes
3,140

Hi Paula,

I know It's been a while now, but I'd like to know if you ever had the opportunity to test article creation including variants (generic articles + variants).

Can you recommend any specific method to create these articles assigning and identifiying characteristics and values, as well the result-matrix-table for variant generation?

Thank you very much,

Manuel Nascimento

Read only

0 Likes
3,140

This message was moderated.

Read only

Former Member
0 Likes
3,140

You can use BAPI_MATERIAL_MAINTAINDATA_RT' for article change/creation. But if we need to extend the article to multiple vendors or input vendor specific/purchasing organization details then instead of using BDC for these data fields we can go and use the function module WRF_MATERIAL_MAINTAINDATA_RT - this FM enhances the functionality of the former BAPI.

Read only

0 Likes
3,140

This message was moderated.