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

BAPI for Source List Upload ( ME01 )

nidhi_agrawal6
Discoverer
0 Likes
16,373

Hi All..

Is there any BAPI available for uploading source list for a material??

Transaction involved - ME01.

Thanks & Regards,

Nidhi

5 REPLIES 5
Read only

Former Member
0 Likes
8,497

Hi,

Please try to use these FM-

'ME_MAINTAIN_SOURCE_LIST'. or

BAPI_SOURCEDETERMIN_GETSOS

Thanks & Regards,

Chandralekha.

Read only

GauthamV
Active Contributor
0 Likes
8,497

hi,

WELCOME TO SDN.

check this .

ME_MAINTAIN_SOURCE_LIST.

Read only

Former Member
0 Likes
8,497

Hi,

Try the below function module ME_UPDATE_SOURCES_OF_SUPPLY which is being used by standard transaction ME01.

sample code

REPORT ZTEST.

DATA: BEGIN OF XORD OCCURS 50.

INCLUDE STRUCTURE EORD.

DATA: UPDKZ,

END OF XORD,

YORD type table of EORD with header line.

clear xord.

clear yord.

xord-MATNR = '100-100'.

xord-WERKS = '3000'.

xord-ZEORD = '00001'.

xord-ERDAT = '20080403'.

xord-ERNAM = 'SAPDEV02'.

xord-VDATU = '20080403'.

xord-BDATU = '20100510'.

xord-LIFNR = '0000001000'.

xord-FLIFN = 'X'.

xord-EKORG = '1000'.

xord-UPDKZ = 'U'.

append xord.

move-corresponding xord to yord.

append yord.

CALL FUNCTION 'ME_UPDATE_SOURCES_OF_SUPPLY' IN UPDATE TASK

EXPORTING

I_CHANGEDOCUMENT = 'X'

TABLES

XEORD = XORD

YEORD = YORD.

COMMIT WORK.

Cheers,

vasavi.v

Read only

nidhi_agrawal6
Discoverer
0 Likes
8,497

Thanks All for your replies...

I have already tried ME_MAINTAIN_SOURCE_LIST function module - It will just maintain the source list, there is no updation even through COMMIT WORK.

BAPI_SOURCEDETERMIN_GETSOS will give you the the list of Source of Supplies , my requirement is to upload entries ( similar to ME01 )

I have already tried ME_UPDATE_SOURCES_OF_SUPPLY function module , but it will just upload the data we provide ; in that case we will not be able to track all the errors which occurs due to invalid entries.

I need to track errors as well ; the way we get errors in BDC .

So, Please let me know if there is a BAPI available for this purpose...or is there any other way ( other than BDC ) to do the same !!!

Regards,

Nidhi

Read only

david-raffin
Newcomer
0 Likes
8,497

Hello,

I know it's several years too late but for the ones like me who are seeking to use ME_UPDATE_SOURCES_OF_SUPPLY while having a log : you can use the class cl_mmpur_source_list.

Sample code :
DATA :

lo_api_sl TYPE REF TO cl_mmpur_source_list,
lt_eord TYPE meout_t_eord,
lt_message_sl TYPE mepo_t_messages_bapi,
ls_message_sl TYPE mepo_s_messages_bapi,
lt_protocol TYPE bapirettab.

SELECT * FROM eord
INTO CORRESPONDING FIELDS OF TABLE lt_eord
WHERE matnr = '013139'
AND werks = '0100'
AND lifnr = '0000100199'.

CREATE OBJECT lo_api_sl.

SELECT * FROM eord
INTO CORRESPONDING FIELDS OF TABLE lt_eord
WHERE matnr = '013139'
AND werks = '0100'
AND lifnr = '0000100199'.

LOOP AT lt_eord ASSIGNING FIELD-SYMBOL(<fs_eord>).
<fs_eord>-bdatu = '20231231'.
<fs_eord>-autet = '1'.
ENDLOOP.

lo_api_sl->maintain_source_list( EXPORTING it_eord = lt_eord
IMPORTING et_messages = lt_message_sl ).
cl_ops_ehp_mapping_helper=>convert_mmmsg_to_bapimsg(
EXPORTING it_mm_msg = lt_message_sl
IMPORTING et_bapirettab = lt_protocol ).

IF lt_protocol is INITIAL. "Or if it doesn't contain type E, you can check whatever you want here
COMMIT WORK AND WAIT.
ENDIF.