cancel
Showing results for 
Search instead for 
Did you mean: 

Create Vendor

Former Member
0 Kudos

Hi Guys,

I am creating new vendor using the FM - VENDOR_INSERT, the problem is while creating vendor, i have to attach more than one partner functions to this vendor. the above function module has not having the parameters to pass Partner Functions.

pls help on this issue..

Regards,

Parameswaran.K

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Problem Solved, its a customization problem. The e-mail field is hidden based on the account group. while am creating the vendor with another account group its working fine.

Former Member
0 Kudos

Hi Parameswaran.K,

According to your reply to the thread, you mention that you had create the vendor record by using FM VENDOR_INSERT and after which you use ADDRESS_SAVE_INTRN to update the related address.

Currently I had a requirement to create vendor using FM. So I used VENDOR_INSERT to create the vendor record. It does work but when I try to see the address screen, it shows an error message indicating "Internal Error: ADDR_GET call error". I do believe that this is due to the address problem. I had try to look for the FM ADDRESS_SAVE_INTRN in my system but I could not find the exact FM, instead I found another FM ADDR_SAVE_INTERN in my system. Is this FM ADDR_SAVE_INTERN that you are referring to in the thread?

Could you please advice me on how to use the FM to update the related address for the vendor such as the relevant table to be pass into the FM and how to relate the address inserted with the vendor?

Best Regards,

Elaine Lin

Former Member
0 Kudos

did u try using the BAPI?

Former Member
0 Kudos

Hi Raymond,

yeah your are right ,but BAPI_VENDOR_CREATE IS NOT ONLY CALLING xk01.BUT ALSO THE SAME CAN BE USED IN ONLINE VENDOR CREATION

Regards,

Amitteja

raymond_giuseppi
Active Contributor
0 Kudos

Online = Dialog = call transaction, correct me ? ([BAPI_VENDOR_CREATE|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapiVENDORCREATE&adv=true&sdn_author_name=&sortby=cm_rnd_rankvalue#])

Regards

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Raymond,

What is wrong in using BAPI_VENDOR_CREATE ?

BR,

Suhas

raymond_giuseppi
Active Contributor
0 Kudos

In the systems i have access to today, this BAPI only call transaction XK01 and return the created vendor id. Can you try in your system ?

The creator of this thread seemed to request for a offline BAPI without any dialog (he even used an update task FM to insert into table, ...)

If in your system you get more (one is more) input parameters and an option to execute without dialog, it would be for me a good news, i assure you.

So as it is a creation, the direct-input interface used by LSMW seems to be a good option, even if it is necessary to go through a temporary application server file. Batch input/Call transaction may also be executed of course.

Regards

Former Member
0 Kudos

Hi guys,

Thanks for your replies. i have created a vendor using the FM VENDOR_INSERT and updated the related address using ADDRESS_SAVE_INTRN and bank details using BAPI_BANK_CREATE for that vendor. Every thing working fine except the e-mail id when i view that particular vendor in XK03.

i have updated the e-mail id in adr6 table, and the flag flagcomm6 also set to 'X' in ADRC table.

even though am not getting the e-mail id while displaying that vendor in XK03.

Pls help...

Regards,

Parameswaran.K

Former Member
0 Kudos

Hi paramesh,

I watched your thread regarding the vendor creation using vendor_insert FM.

I am facing similar problem which have faced earlier..... the address is not getting updated...

i require your help in using the ADDR_SAVE_INTERN....

the other vendor related datas have been successfully stored by using "vendor_insert".

Pls help.

Girish

Former Member
0 Kudos

Hi Girish,

U have to generate address number, based on the account group for vendor using fm, NUMBER_GET_NEXT.

You can find the number range assigned to a particular account group for vendor, using transaction OMSJ.

(eg)

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'ADRNR'

IMPORTING

number = address_num

EXCEPTIONS

error_message = 1.

Update this address number in lfa1 table of adrnr field using fm VENDOR_INSERT.

Based on this address number update corresponding details for address using fm ADDRESS_SAVE_INTERN.

Regards,

Paramesh

Former Member
0 Kudos

Dear all,

I have followed this thread and found it very useful as we need to create vendors from an external system in R/3. We are doing all the steps specified in previous posts and calling FM VENDOR_INSERT but when I execute the function it returns an exception:


JCoException: (104) RFC_ERROR_SYSTEM_FAILURE: Missing parameter with PERFORM.

We have checked and all the needed BAPIs are enabled but we are stuck at this first step. I have tried a variety of things but nothing seems to work. Not sure how I can specify the PERFORM parameter using JCo. Did anyone else fase this issue?

Here is what some of the relevant Java code looks like:



        JCoFunctionTemplate tmplt1 = repository.getFunctionTemplate("VENDOR_INSERT");
        JCoFunction vfunc = tmplt1.getFunction();        
        JCoParameterList vparams =  vfunc.getImportParameterList();

        JCoStructure jcs= vparams.getStructure("I_LFA1");
        try
        {

        	LocalSupplier s = getSupplier1();
        	jcs.setValue("MANDT", "010");
        	jcs.setValue("NAME1", s.getSupName());
        	jcs.setValue("NAME2", s.getSupName2());
        	jcs.setValue("PSTLZ", s.getSupPostalCode());
        	jcs.setValue("ORT01", s.getSupCity());
        	jcs.setValue("LAND1", s.getIdCountry().getIsocode());
        	jcs.setValue("STRAS", s.getAddress1() +", " + s.getAddress2());
        	jcs.setValue("MCOD1", "test");
        	jcs.setValue("KTOKK", "ZKRE");
        	jcs.setValue("SPRAS", s.getIdmasterSupplier().getIdlanguage().getLocale());
        	jcs.setValue("STCD1", s.getIdmasterSupplier().getTaxId());
        	jcs.setValue("TELF1", s.getTelephone());
        	jcs.setValue("TELFX", s.getFax());
        	        	
        	execute(vfunc, destination);        	

        }
        catch(Exception e)
        {
            System.out.println(e.toString());
            e.printStackTrace();
            return;
        }


	/**
	 * Method execute will call a function. The Caller of this function has
	 * already set all required parameters of the function
	 * 
	 */
	public static void execute(JCoFunction function, JCoDestination dest) {
		try {
			JCoContext.begin(dest);
			function.execute(dest);
			JCoContext.end(dest);
		} catch (JCoException e) {
			e.printStackTrace();
		}
	}
    

Any help from some of view that have succesfully implemented vendor creation using the JCo would be highly appreciated.

Former Member
0 Kudos

Hi,

don't use function module VENDOR_INSERT.

As written before it is an update task FM. And also it do not check any field validity.

This is the best way to face inconsistencies in the future.

As you have also noticed, troubles and difficulties will come very soon related to the address management.

In standard there is NO FM or BAPI to do so.

The only supported option is via batch-input or idocs. Eventually, LSMW could help

See [note 384462|https://service.sap.com/sap/support/notes/384462]

With ECC 2005, a synchronisation class can help a lot. See class VMD_EI_API.

With ECC 2005 ehp3, you have an eSOA service to create vendor asynchronously. Not all fields are supported.

BR

Alain

raymond_giuseppi
Active Contributor
0 Kudos

Warning - This function module is an update task function module which is executed by the system after commit-work and with other function modules started from an application or a BAPI, it is not intended to be used stand-alone, it only performs some insert into database without checking any data and without updating related tables. Using this FM is no more allowed than directly inserting into database.

Look for BDC or LSMW to input those data.

Regards

Former Member
0 Kudos

Hi,

Use this BAPI

BAPI_VENDOR_CREATE

raymond_giuseppi
Active Contributor
0 Kudos

BAPI_VENDOR_CREATE just call transaction XK01.... (alas)

LSMW call report RFBIKR00. (you will need to export your data to a file of the application server, look the good report documentation.)

Regards

Former Member
0 Kudos

you can try with LSMW Batch input method\

Object 0040 Vendor master

Method 0001 Standard

Program Name RFBIKR00

Program Type B Batch Input

Former Member
0 Kudos

you can use these transactions.


M-02                 Create goods vendor
M-07                 Create one-time vendor
M-51                 Create vendor
M-52                 Create goods vendor
M-57                 Create one-time vendor
MK01                 Create vendor (Purchasing)
WDKR                 Create customers from vendors
WLF1                 Create vendor billing document
XK01                 Create vendor (centrally)