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

Update Vendor Master

Former Member
0 Likes
4,350

Hi,

I have made a z-prg that checks vendor existance in the system. Now if vendor exists in the system, I have to change the street field .ie. LFA1-STRAS.

I am trying to use the function module VENDOR_READ to get that Vendor's lfa1 and lfb1 data... and BBP_VENDOR_GET_DATA2 to read lfm1 data for that vendor.

Then i am using VENDOR_UPDATE function to update the STRAS field... before calling VENDOR_UPDATE, i am changing stras of lfa1 with the value that i have to store.

***********CODE*********

  • READ LFA1 AND LFB1

CALL FUNCTION 'VENDOR_READ'

EXPORTING

i_bukrs = lit_upld_empl_desig-lifnr

i_lifnr = lit_upld_empl_desig-bukrs

IMPORTING

E_LFA1 = LS_LFA1

E_LFB1 = LS_LFB1

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*UPDATE LFA1/ LFB1

*SET STRAS FIELDS OF LFA1 TABLE TO THE VALUE FROM EXCEL SHEET

LS_LFA1-STRAS = lit_upld_empl_desig-street.

CALL FUNCTION 'VENDOR_UPDATE'

EXPORTING

i_lfa1 = LS_LFA1

i_lfb1 = LS_LFB1

  • i_lfm1 =

  • i_ylfa1 =

  • i_ylfb1 =

  • i_ylfm1 =

  • tables

  • t_xlfas =

  • t_xlfb5 =

  • t_xlfbk =

  • t_xlfza =

  • t_ylfas =

  • t_ylfb5 =

  • t_ylfbk =

  • t_ylfza =

.

However, the changes are not getting reflected when i am checking through FK02.

Regards,

Reema

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
1,738

Hi Reema,

Perhaps you add this FM at the end CALL FUNCTION 'VENDOR_UPDATE' when SY-SUBRC = 0.

  call function 'OPEN_FI_PERFORM_00001420_E'
       exporting
            i_lifnr = LS_LFA1-lifnr
            i_xvbup = 'X'
            i_aktyp = 'V'
       exceptions
            others  = 1.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,738

Reema - this FM is neither documented nor released. If you do a where used list on it, you'll find it used in include MF02KFV0. And if you look at that include, you'll see that a lot of processing is done before calling VENDOR_UPDATE.

So I wouldn't use this FM. I've used batch input for this process and it works well.

Rob

Read only

0 Likes
1,738

First of all thanks for the quick response.

I have done the needful using BDC

Call Transaction FK02

and it works perfectly.

However, I do not want to use this method.

The task is to be done using a function module instead of calling the transaction...

Is there any function module to update address of a vendor...

Regards,

Reema.