To load customer master using bapi

HI GUYS ,
DOES ANYONE HAVE A SAMPLE CODE TO LOAD THE CUSTOER MASTER  DATA USING BAPIS.

Hi Nishanth,
TO LOAD THE CUSTOER MASTER DATA USING BAPIS.
In case you wish to read the customer data you can use the following BAPI, it retrieves the Customer Master (Company Code) Data and the General Data in Customer Master.
CUSTOMER_READ
You need to pass the Customer Number and the Company Code. See the example given below.
REPORT ZEX_CUSTOMERREAD .
Parameters: p_bukrs like KNB1-BUKRS,
            p_kunnr like KNA1-KUNNR.
Data: ty_kna1 type kna1,
      ty_knb1 type knb1.
Data: int_kna1 like ty_kna1,
      int_knb1 like ty_knb1.
CALL FUNCTION 'CUSTOMER_READ'
  EXPORTING
    I_BUKRS         = p_bukrs
    I_KUNNR         = p_kunnr
IMPORTING
   E_KNA1          = int_Kna1
   E_KNB1          = int_knb1
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.
thanks
karthik

Similar Messages

  • Data transper for customer master using BAPI

    I am trying to upload the customer master data from flat file to SAP tables using BAPI Customer.CreateFromData1. But not all of the fields are availble in this BAPI. Few of the important fields are absent e.g incoterms, account signment group of customer..it picks up default value from ref cust.....Is there any other way to load it......
    Thanks and regards,
    Tushar

    Look at OSS [Note 390045 - Usage of BAPI_CUSTOMER_* of function group V02D|https://service.sap.com/sap/support/notes/390045]
    you can only do this using ALE or Batch Input
    So use [ALE|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=createcustomerALE&cat=sdn_all] or [BDC|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=createcustomerBDC&adv=false&sortby=cm_rnd_rankvalue]. (dixit SAP)
    Regards

  • URGENT:Creating customer master using Sd_Customer_Maintain_all

    hello all ,
    I am creating customer master using SD_Customer_Maintain_All.I will be thankful if somebody Can  tell me how to pass data to this function module.Better if somebody can provide code.
    Thanks.
    Sandeep.

    hello all ,
    I am creating customer master using SD_Customer_Maintain_All.I will be thankful if somebody Can  tell me how to pass data to this function module.Better if somebody can provide code.
    Thanks.
    Sandeep.

  • Error while loading Customer master

    Dear all,
    I am loading customer master from ECC and it got loaded successfully to PSA but when i am executing DTP, then it is giving an error as some of the data are not maintained in English Language and they are in chinese or japanese or some other languages.
    So is there any way to solve it??
    Regards,
    Sohil Shah.

    Hi,
    You can exclude those in Transformations by writing code.
    Below is the thread for your reference.
    start routine code for deleting records in different language
    Let us know if you still have any issues.
    Reg
    Pra

  • Error while loading customer master data through Idoc (DEBMAS) from BODS

    Hi All,
    I am trying to load customer master data from BODS to SAP ECC through IDOC(DEBMAS). The jobs run successfully but IDOC is not getting posted. Please find the error below.
    I checked in TSKD table the entry 0 is present. Please help me to resolve this issue.
    Thanks & Regards,
    Balamurugan G

    Hi, did you referred this link : Error during customer master mass update through XD99

  • Loading customer master data using lsmw and bdc

    Hi all..
    Iam a beginner in sap world and my first project is to load the customer master data from mainframes into sap.
    Can anyone guide me how to approach to this project and what are the best materials to go through. Also can any one send some sample programs related to these..
    It would be a great help of you guys for a beginner like me..
    Thanks,
    mahi

    Message type DEBMAS
    Idoc type DEBMAS**  where ** is highest number available in your system (check via WE30). e.g. DEBMAS06

  • Creation of Customer master using CLASS( 'MAINTAIN_BAPI')..

    I am creating customer master by class 'MAINTAIN_BAPI'.  So all fields are sucessfully created except the field 'Remarks / Comments' on customer..Please suggest for the same as far as posiible..
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Edited by: Rob Burbank on Jul 18, 2011 10:06 AM

    Hi Yogesh,
    Hi,
    sorry to reply after the message closure.
    Maybe you will read it.
    SD_CUSTOMER_MAINTAIN_ALL is used in standard during the maintenance of a consumer using the standard customer master data transaction XD01 & XD02.
    It is not intended to be used out of the transaction and in no case it should be used out of its original context. Due to the specificity of the function module, out of the original context we may face limitations and data inconsistencies.
    For the maintenance of customers, there is NO BAPI and NO direct function module.
    There are some functions modules like the one above where the name is looking nice. But these should not be used.
    BAPI_CUSTOMER_CREATEFROMDATA1 is part of them. This one uses SD_CUSTOMER_MAINTAIN_ALL, so the above remark is still valid. Moreover, this BAPI is to be used only from process  SAP Product Catalog. Out of it and due to its limitation, a lot of troubles are expected.
    Sorry.
    Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]
    Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
    Hope this helps.
    BR
    Alain

  • Classification View in customer master using lsmw

    Hi folks,
    I have a requirement regarding conversion method that is fields regarding classification view in customer master needed to be populated r created in through xd01 transaction this should be done using lsmw tool,if tried with standard method and bapi method ,can any one tell how to do whether it is bapi r standard method plz dont suggest recording method,even it is idoc method k r can any tell me which function module exists fr this ,POINTS will be awrded for answers .

    Try FM : SD_CUSTOMER_MAINTAIN_ALL
    Thanks
    Seshu

  • F4 Help in Customer Master using Dropdown Box

    Dear All,
    I am using BAPI_CUSTOMER_CREATEFROMDATA1 for customer master creation.
    I have a requirement from customer that he wants a drop down for Sales Organization, Distribution Channel, Division and for other necessary fields, data should come from R/3.
    Please tell me how to achieve it? How I get these master data from R/3 so that I can populate it on the corresponding dropdowns? is there any standard BAPI exist for it??
    Please help.
    Thanks in Advance

    Hi,
      Is the search help custom or standard? If custom then use the search help exit provided in the search help. If standard copy it into a custom one and make use of the search help exit.

  • Customer Master using Appended structure KNA1

    Hi
    We have to update few ZZ description fields in ZAKNA1, which are not part of user interface in XD01/02/03. The available options are such as LSMW, Batch input require code addition through user exit ZXF04U01/ EXIT_SAPMF02D_001.
    I would like to use BAPI as we have a plan to use web services. Any idea how to extend the BAPI's such as BAPI_CUSTOMER_CHANGEFROMDATA1 or BAPI_CUSTOMER_CREATEFROMDATA1 using best practice?  I donu2019t find any extension structures like other BAPIu2019s have. Without ExtensionIn and ExtensionOut parameters, a BAPI can not be enhanced correct?
    The version we are using is ECC 5.0. Any ideas with customer master BAPI will be greatly appreciated.
    Bala

    Hi Bala,
    Just some general comments without having looked at your specific problem. Since you're on ECC 5.0 you cannot use the new [Enhancement Framework|http://help.sap.com/saphelp_nw2004s/helpdata/EN/94/9cdc40132a8531e10000000a1550b0/frameset.htm], which would make such changes more easy...
    A rather awkward workaround for extending the BAPI's is sometimes to add append structures to an IMPORT parameter of the BAPI. However, this is a rather dangerous and limited approach, because you might get into trouble depending on where the structures are used (i.e. if you add a field, it might cause harm in other programs that use the structure) and you also have to study the source code to see if you even could utilize those additional fields.
    A pretty generic option in lieu of other approaches is to generate a custom wrapper function module around the standard BAPI. Within your custom BAPI you can add the missing fields as parameters, call the standard BAPI and then do the additional updates. The big advantage of such a solution is that
    <ol>
    <li>Your change/additional logic is obvious (not hidden in a customer exit or BAdI, which are often harder to find when troubleshooting or changing functionality)</li>
    <li>Any changes to the standard BAPI will automatically also take effect in your custom BAPI (since you didn't copy the original one); this excludes of course interface changes, but here you anyhow would have to do something...</li>
    </ol>
    Should you have custom fields that are already exposed on the customer maintenance screens via enhancements, then you might want to consider using the wrapper approach, but simply export the additional data to memory, then call the standard BAPI and within the customer/user exits handling the additional fields fill them via an import from memory.
    Cheers, harald

  • No change log is created when updating the customer master using LSMW

    Hi Gurus,
         I am a bit confused on why no change log is created when I use the LSMW to update the customer master. What I update is the customer partner of the customers. For example I have a sold-to 1000 then a customer representative (Z3) 50001, now when I use the LSMW to change the customer representative to 50002 it is correctly updated however no change log is found if you check for the changes on that specific customer. This is a bother for me since I want to send all the customer changes through IDOC and the processing needs to access the change log.
    Thank you.

    Hello,
    What process are you using object, BAPI, etc.
    Regards
    Waza

  • Upload partner functions to customer master using LSMW

    Dear Friends,
    I'm trying to uplaod customer partner functions data through LSMW. I have tried to upload the data using recording method in LSMW(Tr. code: XD02).
    As per the business requirement, I need to upload multiple number(For example: 10 records) of SP(Sold to) partners to a single customer.
    While executing session, instead of adding all 10 records of partner functions, only the last record(i.e 10th records) is adding in the customer master.
    Your response will be highly appraciated.
    Regards
    Satish

    Hi Satish,
    You can't use XD02 to upload multiple partner functions by recording the transaction. It will not create multiple entries, always it will replace the existing ones with the new entry. you need to use the standard BI program or Idoc method do the same.
    I know the scenarios for the vendors it didnot work in that way for me at that time I used Standard BI method to create the multiple partner associations.

  • Date error during creation of asset master using bapi

    Hi All,
    Am creating asset master using BAPI_FIXEDASSET_OVRTAKE_CREATE ,,
    but am getting date problem while passing value  '21022005'  ( or any date )  in the format  'ddmmyyyy' 
    the error says 'the capitalization date is invalid' ....
    the capitalization date is under  the structure BAPI1022_FEGLG002 of the above mentioned bapi....
    even i have tried using '21.02.2005' its still not working as the capitalization date is 8 char...
    kindly help me out with the possibilities
    thanks
    john

    Hi John,
    Some of the structures you have to fill for the IDOC belongs to a  referencing ...X structure. For example structure BAPI1022_FEGLG002 and BAPI1022_FEGLG002X.                                                                               
    When you fill the capitalization dat (BAPI1022_FEGLG002-CAP_DATE = '19981231') it's necessary to fill the corresponding field (BAPI1022_FEGLG002X-CAP_DATE = 'X') to  specify that the content of the field should be transferred to the fixed asset. Otherwise it'll be not transferred and you'll get an error message instead.                                                 
    Regards Bernhard

  • Change Customer Master using CMD_EI_API MAINTAIN_BAPI Method

    Hi Experts,
    I am using CMD_EI_API=>MAINTAIN_BAPI method for Creating Customer through Custom program. The Creation of Customer Master is working fine.
    I have another requirement i need to perform the following for the Customer Change
    1 . Delete all Phone , Fax and SMTP entries from the table and create a new entries for Customer.
    2 . Delete a Contact Person based on the information from the legacy system.
    I am facing problem in the above two issues
    ADR2, ADR3 and ADR6 entries are retrieved for customer.
    this values are populated and passed to the method with Task as 'D' - delete.
    there is no error message  from the Method. when i call commit statement
    1 . the address details are not getting deleted in the tables
    2. if a contact person is deleted then i am getting a short dump while commit.
    Please help me if you know the details of MAINTAIN_BAPI method whic can be used for the Deletion purpose.
    Thanks,
    Shrikanth R

    Hi Experts
    I'm having the same problem it looks like the method maintain_bapi does not commit the new values, I debuged it and found a call to a badi lr_badi_update but I could not find information about it.
    Any help will be appreciate
    Leo

  • Customer creation using BAPI with given customer number

    Hi All,
    Can we create the customer with our own customer number using the BAPI - BAPI_CUSTOMER_CREATEFROMDATA1.
    Generally SAP Creates its own number using number range objects,but i want to create customer with our own specified number.
    I found the BADI - CUSTOMER_ADD_DATA for XD01,but it is not working for BAPI.
    Please give me the solutions.
    Regards,
    Srinivas.

    Thanks once again.
    The interface is like this NON-SAP (Front-end)
                              Mercator
                              SAP (Back-end).
    and the volume of Date is more than 20,000 a day and mercator will put into the 'Q'.i do not think the data flow in front-end and back-end is authentic.
    and lot of business logic is involved in these three systems.
    I found the BADI for this,but it is not working for the BAPI.Please suggest any thing for BAPI - BAPI_CUSTOMER_CREATEFROMDATA1.
    Regards,
    Srinivas.

Maybe you are looking for

  • Random pan & zoom effects?

    I'm trying to create a movie from a lot of still images and I would like to have a pan & zoom effect to each image, but not the exact same to every image. Is there a way to have a random pan & zoom effect applied to all images?

  • Oracle 8i Locks

    We are having problems with users locking each other throughout the day, in which one user is doing a select, and the other an update. In the last case, the user doing the following select statement acquired an exclusive lock: SELECT "INVENTORY"."INV

  • How Files Display on a Mac vs on a PC

    I'm an architectural photographer working in CS4 on a MacPro with a monitor calibrated with Monaco Optix. My hard proofs are done on a calibrated Epson 2400. I send digital proofs to my clients as pdf files and am running into a problem with clients

  • [JS] [CS5] Possible to change "Paragraph Spacing Limit" with a Script

    Hi, right now I'm writing a simple script which formats some text. For this formatting I need the vertical Justification "Justify" with a "Paragraph Spacing Limit" but I can't find something helpful. Does anyone know how to set the limit to a specifi

  • Payee Status Table update

    Hi, It is a great advantage to have all of you here sharing the knowledge. I am new to PS and still learning :) In our DEV environment sometimes we would like to Finalize the calendar quickly but before that we need to clear the error/warning in the