Upload customer master

hi,
could someone please explain how to upload customer master
using call transaction method
what is the transaction
and what are the tables and what is the procedure
regards,
siri.

check below code....it is used to upload customer data....
it is used for vendor upload...modify according to ur requirement...
REPORT  ZFC_VENDOR_CREATE  LINE-SIZE 100
                           NO STANDARD PAGE HEADING
                           MESSAGE-ID ZZ.
                     TABLES
TABLES : SSCRFIELDS.   " Fields on selection screens
                     CONSTANTS
DATA : C_SPLIT TYPE C VALUE '#'.  " Used for Has Separator in GUI_UPLAOD
                     TYPES
Int'table to hold Vendor Master Data
TYPES : BEGIN OF TY_VENDOR_MASTER,
          FLAG  TYPE C,               " Update Flag
          LIFNR TYPE LIFNR,           " Vendor Number
          BUKRS TYPE BUKRS,           " Company Code
          KTOKK TYPE KTOKK,           " Account Group
          ANRED TYPE ANRED,           " Title
          NAME1 TYPE NAME1_GP,        " Name1
          NAME2 TYPE NAME2_GP,        " Name2
          SORTL TYPE SORTL,           " Search Term 1
          SORT2 TYPE AD_SORT2UL,      " Search Term 2
          STRAS TYPE STRAS_GP,        " Street
          PSTLZ TYPE PSTLZ,           " Postal Code
          ORT01 TYPE ORT01_GP,        " City
          REGIO TYPE REGIO,           " Region
          LAND1 TYPE LAND1_GP,        " Country
          SPRAS TYPE SPRAS,           " Language
          VBUND TYPE RASSC,           " Trading Partner
          BANKS TYPE BANKS,           " Country
          BANKL TYPE BANKK,           " Bank Key
          BANKN TYPE BANKN,           " Bank Account
          BKONT TYPE BKONT,           " Bank Control Key
          BANKA TYPE BANKA,           " Name of Bank
          AKONT TYPE AKONT,           " Reconciliation Account
          FDGRV TYPE FDGRV,           " Cash Management Group
          ZTERM TYPE DZTERM,          " Payment Terms
          REPRF TYPE REPRF,           " Check Double Invoice
          ZWELS TYPE DZWELS,          " Payment Methods
          XPORE TYPE XPORE,           " Pay all items separately
        END   OF TY_VENDOR_MASTER,
Int'table to hold Vendor Extend Data
        BEGIN OF TY_VENDOR_EXTEND,
          FLAG  TYPE C,               " Update Flag
          LIFNR     TYPE LIFNR,           " Vendor Number
          BUKRS     TYPE BUKRS,           " Company Code
          KTOKK     TYPE KTOKK,           " Account Group
          REF_LIFNR TYPE LIFNR,           " Reference Vendor Number
          REF_BUKRS TYPE BUKRS,           " Reference Company Code
          AKONT     TYPE AKONT,           " Reconciliation Account
          FDGRV     TYPE FDGRV,           " Cash Management Group
          ZTERM     TYPE DZTERM,          " Payment Terms
          REPRF     TYPE REPRF,           " Check Double Invoice
          ZWELS     TYPE DZWELS,          " Payment Methods
          XPORE TYPE XPORE,           " Pay all items separately
        END   OF TY_VENDOR_EXTEND,
Int'table to hold Error Records Data
        BEGIN OF TY_ERROR,
          MSG(200) TYPE C,                " To hold Message
          LIFNR    TYPE LIFNR,            " Vendor Number
          BUKRS    TYPE BUKRS,            " Company Code
        END   OF TY_ERROR.
                     DATA (Simple Fields)
DATA : W_COUNT TYPE I,               " Variable to hold count of Records
       W_SUCC_REC TYPE I,            " No. of Success Records
       W_SUCC_REC1 TYPE I,           " No. of Updated Records
       W_ERR_REC TYPE I,             " No. of Error Records
       w_noupdate_rec type i.        " No. of Records not Changed
                     INTERNAL TABLES
Int'table to hold uploaded data from File
DATA : IT_VENDOR_MASTER    TYPE STANDARD TABLE OF TY_VENDOR_MASTER,
       WA_IT_VENDOR_MASTER TYPE TY_VENDOR_MASTER,
       IT_VENDOR_EXTEND    TYPE STANDARD TABLE OF TY_VENDOR_EXTEND,
       WA_IT_VENDOR_EXTEND TYPE TY_VENDOR_EXTEND,
       WA_IT_BDCDATA       TYPE BDCDATA,
       IT_BDCDATA          TYPE STANDARD TABLE OF BDCDATA,
       WA_IT_MESSTAB       TYPE BDCMSGCOLL,
       IT_MESSTAB          TYPE STANDARD TABLE OF BDCMSGCOLL,
       IT_ERROR            TYPE STANDARD TABLE OF TY_ERROR,
       WA_IT_ERROR         TYPE TY_ERROR,
       it_error_fk01       type standard table of ty_error,
       wa_it_error_fk01    type ty_error,
       it_error_fk02       type standard table of ty_error,
       wa_it_error_fk02    type ty_error,
       it_succ_rec1        type standard table of ty_error,
       wa_it_succ_rec1     type ty_error,
       it_noupdate         type standard table of ty_error,
       wa_it_noupdate      type ty_error.
                     FLAGS
DATA : FL_FLAG1 TYPE C,          " Flag to check error upload file
       FL_FLAG2 TYPE C,          " Flag to hold value
       FL_FLAG3 TYPE C,          " Flag to hold value
       FL_FLAG4 TYPE C.          " Flag to hold value
                     SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-001,
            POSITION POS_LOW.
PARAMETERS :       P_FILE(128) DEFAULT 'C:\UPLOAD.TXT' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-002,
            POSITION POS_LOW.
PARAMETERS :       P_VENMAS RADIOBUTTON GROUP R1 DEFAULT 'X'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-003,
            POSITION POS_LOW.
PARAMETERS :       P_VENEXT RADIOBUTTON GROUP R1.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-004,
            POSITION POS_LOW.
PARAMETERS :       P_MODE(1) DEFAULT 'N'.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-005,
            POSITION POS_LOW.
PARAMETERS :       P_GROUP(12) DEFAULT 'ZFC_VENDOR_C' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN : BEGIN OF LINE,
            COMMENT 1(30) TEXT-016,
            POSITION POS_LOW.
PARAMETERS :       P_GROUP1(12) DEFAULT 'ZFC_VENDOR_U' OBLIGATORY.
SELECTION-SCREEN : END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
                     AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
Form to get file path for upload of data
  PERFORM GET_FILE_PATH.
AT SELECTION-SCREEN ON BLOCK B1.
Form to Validate data specified on Selection Screen
  CHECK SSCRFIELDS-UCOMM EQ 'ONLI'.
  PERFORM VALIDATE_DATA.
                     START - OF - SELECTION
START-OF-SELECTION.
  IF P_VENMAS = 'X'.
Form to upload data from Presentation Server for Vendor Master
    PERFORM UPLOAD_DATA TABLES IT_VENDOR_MASTER.
    IF FL_FLAG1 NE 'X'.
      SORT IT_VENDOR_MASTER BY LIFNR BUKRS KTOKK.
      DELETE IT_VENDOR_MASTER WHERE LIFNR = ' '
                              AND   BUKRS = ' '
                              AND   KTOKK = ' '.
Form to process data for Vendor Master
      PERFORM INSERT_VENDOR_MASTER_DATA.
    ENDIF.
  ELSEIF P_VENEXT = 'X'.
Form to upload data from Presentation Server for Vendor Extend
    PERFORM UPLOAD_DATA TABLES IT_VENDOR_EXTEND.
    IF FL_FLAG1 NE 'X'.
      SORT IT_VENDOR_EXTEND BY LIFNR BUKRS KTOKK.
      DELETE IT_VENDOR_EXTEND WHERE LIFNR = ' '
                              AND   BUKRS = ' '
                              AND   KTOKK = ' '.
Form to process data for Vendor Master
      PERFORM CHK_AND_INS_VENDOR_EXTEND_DATA.
    ENDIF.
  ENDIF.
                     END - OF - SELECTION
END-OF-SELECTION.
  IF FL_FLAG1 NE 'X'.
    FORMAT COLOR 7.
    WRITE:/2 TEXT-O01.           " Total Number of records read :
    FORMAT COLOR OFF.
    WRITE:40 W_COUNT.
    FORMAT COLOR 7.
    WRITE:/2 TEXT-O02.           " Total Number of Success records :
    FORMAT COLOR OFF.
    WRITE:40 W_SUCC_REC.
    FORMAT COLOR 7.
    WRITE:/2 TEXT-O07.           " Total Number of Updated records :
    FORMAT COLOR OFF.
    WRITE:40 W_SUCC_REC1.
    FORMAT COLOR 7.
    WRITE:/2 TEXT-O08.           " Total Number of Unchanged records :
    FORMAT COLOR OFF.
    WRITE:40 W_noupdate_REC.
    FORMAT COLOR 7.
    WRITE:/2 TEXT-O03.           " Total Number of Error records :
    FORMAT COLOR OFF.
    WRITE:40 W_ERR_REC.
    if not it_succ_rec1 is initial.
      skip 1.
      perform display_changed_report.
    endif.
    if not it_noupdate is initial.
      skip 1.
      perform display_nochange_report.
    endif.
    IF NOT IT_ERROR IS INITIAL.
      SKIP 3.
Form to display error data
      PERFORM DISPLAY_ERROR_REPORT.
    ENDIF.
    IF FL_FLAG2 = 'X'.
      SKIP 2.
      FORMAT COLOR 4.
      WRITE:/2 TEXT-O04.        " BDC Session Name for Creation (FK01) :
      FORMAT COLOR OFF.
      WRITE:40 P_GROUP.
      perform display_error_report_fk01.
    ENDIF.
    IF FL_FLAG3 = 'X'.
      SKIP 2.
      FORMAT COLOR 4.
      WRITE:/2 TEXT-O09.        " BDC Session Name for Updation (FK02) :
      FORMAT COLOR OFF.
      WRITE:40 P_GROUP1.
      perform display_error_report_fk02.
    ENDIF.
  ENDIF.
*&      Form  GET_FILE_PATH
This form is used to get the specified path for uploading of data from
flat file with the help of F4 function key
FORM GET_FILE_PATH .
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      PROGRAM_NAME  = SYST-CPROG
      DYNPRO_NUMBER = SYST-DYNNR
      FIELD_NAME    = ' '
    IMPORTING
      FILE_NAME     = P_FILE.
ENDFORM.                    " GET_FILE_PATH
*&      Form  VALIDATE_DATA
This form is used to validate the data given by user on the Selection
Screen and the appropriate message is been displayed when an wrong
entry is inputted
FORM VALIDATE_DATA .
  IF SY-BATCH EQ 'X'.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E001(ZZ) WITH TEXT-011.
    " Excel file not to be used in Batch Mode
  ENDIF.
  IF P_MODE NE 'A' AND P_MODE NE 'N' AND P_MODE NE 'E'.
    MESSAGE E001(ZZ) WITH TEXT-012.
    " Session Mode should be either A or N or E
  ENDIF.
ENDFORM.                    " VALIDATE_DATA
*&      Form  UPLOAD_DATA
This form is used to upload data from Presentation Server for either
Vendor Master or Vendor Extend
FORM UPLOAD_DATA TABLES P_IT_VENDOR.
  DATA : L_FILENAME TYPE STRING,
         L_FILETYPE TYPE CHAR10 VALUE 'ASC',
         L_HEADER_LENGTH TYPE I VALUE 0,
         L_READ_BY_LINE TYPE CHAR01 VALUE 'X'.
  MOVE P_FILE TO L_FILENAME.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME                = L_FILENAME
      FILETYPE                = L_FILETYPE
      HEADER_LENGTH           = L_HEADER_LENGTH
      READ_BY_LINE            = L_READ_BY_LINE
      HAS_FIELD_SEPARATOR     = C_SPLIT
    TABLES
      DATA_TAB                = P_IT_VENDOR
    EXCEPTIONS
      FILE_OPEN_ERROR         = 1
      FILE_READ_ERROR         = 2
      NO_BATCH                = 3
      GUI_REFUSE_FILETRANSFER = 4
      INVALID_TYPE            = 5
      NO_AUTHORITY            = 6
      UNKNOWN_ERROR           = 7
      BAD_DATA_FORMAT         = 8
      HEADER_NOT_ALLOWED      = 9
      SEPARATOR_NOT_ALLOWED   = 10
      HEADER_TOO_LONG         = 11
      UNKNOWN_DP_ERROR        = 12
      ACCESS_DENIED           = 13
      DP_OUT_OF_MEMORY        = 14
      DISK_FULL               = 15
      DP_TIMEOUT              = 16
      OTHERS                  = 17.
  IF SY-SUBRC <> 0.
   MESSAGE I001(ZZ) WITH TEXT-006 L_FILENAME.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    FL_FLAG1 = 'X'.
  ELSEIF P_IT_VENDOR[] IS INITIAL.
    MESSAGE I001(ZZ) WITH TEXT-014.   " Uploaded File contains no data
    FL_FLAG1 = 'X'.
  ENDIF.
ENDFORM.                    " UPLOAD_DATA
*&      Form  INSERT_VENDOR_MASTER_DATA
This form is used to process BDC data for Vendor Master
FORM INSERT_VENDOR_MASTER_DATA .
  DATA : L_LIFNR TYPE LIFNR.
  CLEAR : L_LIFNR.
  sort it_vendor_master by flag.
  LOOP AT IT_VENDOR_MASTER INTO WA_IT_VENDOR_MASTER.
    W_COUNT = W_COUNT + 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT  = WA_IT_VENDOR_MASTER-LIFNR
      IMPORTING
        OUTPUT = WA_IT_VENDOR_MASTER-LIFNR.
    if wa_it_vendor_master-flag = 'A'.
    SELECT SINGLE LIFNR
           FROM LFB1
           INTO L_LIFNR
           WHERE LIFNR = WA_IT_VENDOR_MASTER-LIFNR
           AND   BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
    IF SY-SUBRC EQ 0.
      WA_IT_ERROR-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
      WA_IT_ERROR-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
      WA_IT_ERROR-MSG   = TEXT-015.
      APPEND WA_IT_ERROR TO IT_ERROR.
      W_ERR_REC = W_ERR_REC + 1.
      CLEAR : WA_IT_ERROR, L_LIFNR.
    ELSE.
      REFRESH IT_BDCDATA.
      CLEAR IT_BDCDATA.
      PERFORM POPULATE_BDC_DATA_VEN_MASTER.
      PERFORM CALL_TRANSACTION.
    ENDIF.
    CLEAR : WA_IT_VENDOR_MASTER.
    elseif wa_it_vendor_master-flag = 'C'.
      IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
        PERFORM CLOSE_BDC_SESSION.
        fl_flag4 = 'X'.
      ENDIF.
      REFRESH IT_BDCDATA.
      CLEAR IT_BDCDATA.
      PERFORM POPULATE_BDC_DATA_VEN_MASTER.
      PERFORM CALL_TRANSACTION_FK02.
      CLEAR : WA_IT_VENDOR_MASTER.
    elseif wa_it_vendor_master-flag = 'N'.
      WA_IT_noupdate-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
      WA_IT_noupdate-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
      WA_IT_noupdate-MSG   = TEXT-018.
      APPEND WA_IT_noupdate TO IT_noupdate.
      W_noupdate_REC = W_noupdate_REC + 1.
      CLEAR : WA_IT_noupdate, WA_IT_VENDOR_MASTER.
    endif.
  ENDLOOP.
  IF FL_FLAG3 = 'X'.
    PERFORM CLOSE_BDC_SESSION.
  ENDIF.
ENDFORM.                    " INSERT_VENDOR_MASTER_DATA
*&      Form  POPULATE_BDC_DATA_VEN_MASTER
This form is used to populate BDC data of Vendor Master
FORM POPULATE_BDC_DATA_VEN_MASTER .
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT  = WA_IT_VENDOR_MASTER-ZTERM
    IMPORTING
      OUTPUT = WA_IT_VENDOR_MASTER-ZTERM.
  IF WA_IT_VENDOR_MASTER-REPRF = 'Y'.
    WA_IT_VENDOR_MASTER-REPRF = 'X'.
  ENDIF.
  IF WA_IT_VENDOR_MASTER-XPORE = 'Y'.
    WA_IT_VENDOR_MASTER-XPORE = 'X'.
  ENDIF.
  if wa_it_vendor_master-flag = 'A'.
  PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
           BDC_FIELD  USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
           BDC_FIELD  USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
           BDC_FIELD  USING 'RF02K-KTOKK' WA_IT_VENDOR_MASTER-KTOKK,
           BDC_FIELD  USING 'BDC_OKCODE'  '/00'.
  elseif wa_it_vendor_master-flag = 'C'.
  PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
           BDC_FIELD  USING 'RF02K-LIFNR' WA_IT_VENDOR_MASTER-LIFNR,
           BDC_FIELD  USING 'RF02K-BUKRS' WA_IT_VENDOR_MASTER-BUKRS,
           BDC_FIELD  USING 'BDC_OKCODE'  '=MALL',
           BDC_DYNPRO USING 'SAPMF02K' '0106',
           BDC_FIELD  USING 'RF02K-D0110' 'X',
           BDC_FIELD  USING 'RF02K-D0120' 'X',
           BDC_FIELD  USING 'RF02K-D0130' 'X',
           BDC_FIELD  USING 'RF02K-D0210' 'X',
           BDC_FIELD  USING 'RF02K-D0215' 'X',
           BDC_FIELD  USING 'RF02K-D0220' 'X',
           BDC_FIELD  USING 'BDC_OKCODE'  '/00'.
  endif.
  perform :BDC_DYNPRO USING 'SAPMF02K' '0110',
           BDC_FIELD  USING 'LFA1-ANRED'  WA_IT_VENDOR_MASTER-ANRED,
           BDC_FIELD  USING 'LFA1-NAME1'  WA_IT_VENDOR_MASTER-NAME1,
           BDC_FIELD  USING 'LFA1-NAME2'  WA_IT_VENDOR_MASTER-NAME2,
           BDC_FIELD  USING 'LFA1-SORTL'  WA_IT_VENDOR_MASTER-SORTL,
           BDC_FIELD  USING 'LFA1-STRAS'  WA_IT_VENDOR_MASTER-STRAS,
           BDC_FIELD  USING 'LFA1-ORT01'  WA_IT_VENDOR_MASTER-ORT01,
           BDC_FIELD  USING 'LFA1-PSTLZ'  WA_IT_VENDOR_MASTER-PSTLZ,
           BDC_FIELD  USING 'LFA1-LAND1'  WA_IT_VENDOR_MASTER-LAND1,
           BDC_FIELD  USING 'LFA1-REGIO'  WA_IT_VENDOR_MASTER-REGIO,
           BDC_FIELD  USING 'LFA1-SPRAS'  WA_IT_VENDOR_MASTER-SPRAS,
           BDC_FIELD  USING 'BDC_OKCODE'  '/00',
           BDC_DYNPRO USING 'SAPMF02K' '0120',
           BDC_FIELD  USING 'LFA1-VBUND'  WA_IT_VENDOR_MASTER-VBUND,
           BDC_FIELD  USING 'BDC_OKCODE'  '/00',
           BDC_DYNPRO USING 'SAPMF02K' '0130',
           BDC_FIELD  USING 'LFBK-BANKS(01)'  WA_IT_VENDOR_MASTER-BANKS,
           BDC_FIELD  USING 'LFBK-BANKL(01)'  WA_IT_VENDOR_MASTER-BANKL,
           BDC_FIELD  USING 'LFBK-BANKN(01)'  WA_IT_VENDOR_MASTER-BANKN,
           BDC_FIELD  USING 'BDC_OKCODE'  '=BANK',
           BDC_DYNPRO USING 'SAPLBANK' '0100',
           BDC_FIELD  USING 'BNKA-BANKA'  WA_IT_VENDOR_MASTER-BANKA,
           BDC_FIELD  USING 'BDC_OKCODE'  '=ENTR',
           BDC_DYNPRO USING 'SAPMF02K' '0130',
           BDC_FIELD  USING 'BDC_OKCODE'  '=ENTR',
           BDC_DYNPRO USING 'SAPMF02K' '0210',
           BDC_FIELD  USING 'LFB1-AKONT'  WA_IT_VENDOR_MASTER-AKONT,
           BDC_FIELD  USING 'LFB1-FDGRV'  WA_IT_VENDOR_MASTER-FDGRV,
           BDC_FIELD  USING 'BDC_OKCODE'  '=/00',
           BDC_DYNPRO USING 'SAPMF02K' '0215',
           BDC_FIELD  USING 'LFB1-ZTERM'  WA_IT_VENDOR_MASTER-ZTERM,
           BDC_FIELD  USING 'LFB1-REPRF'  WA_IT_VENDOR_MASTER-REPRF,
           BDC_FIELD  USING 'LFB1-ZWELS'  WA_IT_VENDOR_MASTER-ZWELS,
           BDC_FIELD  USING 'LFB1-XPORE'  WA_IT_VENDOR_MASTER-XPORE,
           BDC_FIELD  USING 'BDC_OKCODE'  '=UPDA'.
ENDFORM.                    " POPULATE_BDC_DATA_VEN_MASTER
*&      Form  BDC_DYNPRO
This form is used to move data to BDCDATA int'table
FORM BDC_DYNPRO  USING PROGRAM TYPE BDC_PROG
                       DYNPRO  TYPE BDC_DYNR.
  CLEAR WA_IT_BDCDATA.
  WA_IT_BDCDATA-PROGRAM  = PROGRAM.
  WA_IT_BDCDATA-DYNPRO   = DYNPRO.
  WA_IT_BDCDATA-DYNBEGIN = 'X'.
  APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM.                    " BDC_DYNPRO
*&      Form  BDC_FIELD
This form is used to move data to BDCDATA int'table
FORM BDC_FIELD  USING FNAM TYPE ANY
                      FVAL TYPE ANY.
  CLEAR WA_IT_BDCDATA.
  WA_IT_BDCDATA-FNAM = FNAM.
  WA_IT_BDCDATA-FVAL = FVAL.
  APPEND WA_IT_BDCDATA TO IT_BDCDATA.
ENDFORM.                    " BDC_FIELD
*&      Form  CALL_TRANSACTION
This form is used to Call FK01 for processing of data either for
Vendor Master or Vendor Extend. The error records are inserted to
Session which can be processed using SM35
FORM CALL_TRANSACTION .
  DATA : L_OPTION TYPE CTU_PARAMS,
         L_SUBRC TYPE SYSUBRC.
  REFRESH IT_MESSTAB.
  CLEAR IT_MESSTAB.
  L_OPTION-DEFSIZE = 'X'.
  L_OPTION-DISMODE = P_MODE.
  L_OPTION-UPDMODE = 'S'.
  CALL TRANSACTION 'FK01'
       USING IT_BDCDATA
       MESSAGES INTO IT_MESSTAB
       OPTIONS FROM L_OPTION.
  L_SUBRC = SY-SUBRC.
  IF L_SUBRC = 0.
    W_SUCC_REC = W_SUCC_REC + 1.
  ELSE.
    IF FL_FLAG2 NE 'X'.
      PERFORM OPEN_BDC_SESSION.
      FL_FLAG2 = 'X'.
    ENDIF.
    PERFORM BDC_INSERT.
    W_ERR_REC = W_ERR_REC + 1.
    PERFORM ERROR_RECORD_DATA.
  ENDIF.
ENDFORM.                    " CALL_TRANSACTION
*&      Form  OPEN_BDC_SESSION
Form used to open session for Error out Records
FORM OPEN_BDC_SESSION .
  DATA : L_USERID TYPE APQ_MAPN,      " Variable to hold user-id
         L_GROUP TYPE APQ_GRPN.       " Variable to hold value
  MOVE P_GROUP TO L_GROUP.
  MOVE SY-UNAME TO L_USERID.
  CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
      CLIENT              = SY-MANDT
      GROUP               = L_GROUP
      KEEP                = SPACE
      USER                = L_USERID
    EXCEPTIONS
      CLIENT_INVALID      = 1
      DESTINATION_INVALID = 2
      GROUP_INVALID       = 3
      GROUP_IS_LOCKED     = 4
      HOLDDATE_INVALID    = 5
      INTERNAL_ERROR      = 6
      QUEUE_ERROR         = 7
      RUNNING             = 8
      SYSTEM_LOCK_ERROR   = 9
      USER_INVALID        = 10
      OTHERS              = 11.
  IF SY-SUBRC <> 0.
    WRITE:/ TEXT-008.              " Unable to open BDC Session
  ENDIF.
ENDFORM.                    " OPEN_BDC_SESSION
*&      Form  BDC_INSERT
This form is used to insert error records to a Session method
FORM BDC_INSERT .
  CALL FUNCTION 'BDC_INSERT'
    EXPORTING
      TCODE            = 'FK01'
    TABLES
      DYNPROTAB        = IT_BDCDATA
    EXCEPTIONS
      INTERNAL_ERROR   = 1
      NOT_OPEN         = 2
      QUEUE_ERROR      = 3
      TCODE_INVALID    = 4
      PRINTING_INVALID = 5
      POSTING_INVALID  = 6
      OTHERS           = 7.
  IF SY-SUBRC <> 0.
    WRITE:/ TEXT-009.             " Unable to Insert Data to BDC Session
  ENDIF.
ENDFORM.                    " BDC_INSERT
*&      Form  ERROR_RECORD_DATA
This form is used to process the messages for the error records which
will be displayed on the output report
FORM ERROR_RECORD_DATA .
  DATA : L_LINES TYPE I,
         L_MSG(200) TYPE C.
  DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
  READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
  IF SY-SUBRC = 0.
    CLEAR L_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID        = WA_IT_MESSTAB-MSGID
        LANG      = SY-LANGU
        NO        = WA_IT_MESSTAB-MSGNR
        V1        = WA_IT_MESSTAB-MSGV1
        V2        = WA_IT_MESSTAB-MSGV2
        V3        = WA_IT_MESSTAB-MSGV3
        V4        = WA_IT_MESSTAB-MSGV4
      IMPORTING
        MSG       = L_MSG
      EXCEPTIONS
        NOT_FOUND = 1
        OTHERS    = 2.
    IF SY-SUBRC = 0.
      WA_IT_ERROR_fk01-MSG = L_MSG.
    ENDIF.
    IF P_VENMAS = 'X'.
      WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
      WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
    ELSEIF P_VENEXT = 'X'.
      WA_IT_ERROR_fk01-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
      WA_IT_ERROR_fk01-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
    ENDIF.
    APPEND WA_IT_ERROR_fk01 TO IT_ERROR_fk01.
    CLEAR WA_IT_ERROR_fk01.
  ENDIF.
ENDFORM.                    " ERROR_RECORD_DATA
*&      Form  CLOSE_BDC_SESSION
Form used to close session of the Error Records
FORM CLOSE_BDC_SESSION .
  CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
      NOT_OPEN    = 1
      QUEUE_ERROR = 2
      OTHERS      = 3.
  IF SY-SUBRC <> 0.
    WRITE:/ TEXT-010.             " Unable to Close BDC Session
  ENDIF.
ENDFORM.                    " CLOSE_BDC_SESSION
*&      Form  CHK_AND_INS_VENDOR_EXTEND_DATA
This form is used to process BDC data for Vendor Extend
FORM CHK_AND_INS_VENDOR_EXTEND_DATA .
  DATA : L_LIFNR TYPE LIFNR.
  CLEAR : L_LIFNR, fl_flag4.
  sort it_vendor_extend by flag.
  LOOP AT IT_VENDOR_EXTEND INTO WA_IT_VENDOR_EXTEND.
    W_COUNT = W_COUNT + 1.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT  = WA_IT_VENDOR_EXTEND-REF_LIFNR
      IMPORTING
        OUTPUT = WA_IT_VENDOR_EXTEND-REF_LIFNR.
    if wa_it_vendor_extend-flag = 'A'.
    SELECT SINGLE LIFNR
           FROM LFB1
           INTO L_LIFNR
           WHERE LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR
           AND   BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
    IF SY-SUBRC NE 0.
      WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-REF_LIFNR.
      WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-REF_BUKRS.
      WA_IT_ERROR-MSG   = TEXT-007.
      APPEND WA_IT_ERROR TO IT_ERROR.
      W_ERR_REC = W_ERR_REC + 1.
      CLEAR : WA_IT_ERROR, L_LIFNR.
    ELSE.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = WA_IT_VENDOR_EXTEND-LIFNR
        IMPORTING
          OUTPUT = WA_IT_VENDOR_EXTEND-LIFNR.
      SELECT SINGLE LIFNR
             FROM LFB1
             INTO L_LIFNR
             WHERE LIFNR = WA_IT_VENDOR_EXTEND-LIFNR
             AND   BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
      IF SY-SUBRC EQ 0.
        WA_IT_ERROR-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
        WA_IT_ERROR-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
        WA_IT_ERROR-MSG   = TEXT-015.
        APPEND WA_IT_ERROR TO IT_ERROR.
        W_ERR_REC = W_ERR_REC + 1.
        CLEAR : WA_IT_ERROR, L_LIFNR.
      ELSE.
        REFRESH IT_BDCDATA.
        CLEAR IT_BDCDATA.
        PERFORM POPULATE_BDC_DATA_VEN_EXTEND.
        PERFORM CALL_TRANSACTION.
      ENDIF.
    ENDIF.
    CLEAR : WA_IT_VENDOR_EXTEND.
    elseif wa_it_vendor_extend-flag = 'C'.
      IF FL_FLAG2 = 'X' and fl_flag4 ne 'X'.
        PERFORM CLOSE_BDC_SESSION.
        fl_flag4 = 'X'.
      ENDIF.
      REFRESH IT_BDCDATA.
      CLEAR IT_BDCDATA.
      PERFORM POPULATE_BDC_DATA_VEN_extend.
      PERFORM CALL_TRANSACTION_FK02.
       CLEAR : WA_IT_VENDOR_EXTEND.
    elseif wa_it_vendor_extend-flag = 'N'.
      WA_IT_noupdate-LIFNR = WA_IT_VENDOR_extend-LIFNR.
      WA_IT_noupdate-BUKRS = WA_IT_VENDOR_extend-BUKRS.
      WA_IT_noupdate-MSG   = TEXT-019.
      APPEND WA_IT_noupdate TO IT_noupdate.
      W_noupdate_REC = W_noupdate_REC + 1.
      CLEAR : WA_IT_noupdate, WA_IT_VENDOR_EXTEND.
    endif.
  ENDLOOP.
  IF FL_FLAG2 = 'X'.
    PERFORM CLOSE_BDC_SESSION.
  ENDIF.
  if fl_flag3 = 'X'.
    PERFORM CLOSE_BDC_SESSION.
  ENDIF.
ENDFORM.                    " CHK_AND_INS_VENDOR_EXTEND_DATA
*&      Form  POPULATE_BDC_DATA_VEN_EXTEND
This form is used to populate BDC data of Vendor Extend
FORM POPULATE_BDC_DATA_VEN_EXTEND .
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT  = WA_IT_VENDOR_EXTEND-ZTERM
    IMPORTING
      OUTPUT = WA_IT_VENDOR_EXTEND-ZTERM.
  IF WA_IT_VENDOR_EXTEND-REPRF = 'Y'.
    WA_IT_VENDOR_EXTEND-REPRF = 'X'.
  ENDIF.
  IF WA_IT_VENDOR_extend-XPORE = 'Y'.
    WA_IT_VENDOR_extend-XPORE = 'X'.
  ENDIF.
  if wa_it_vendor_extend-flag = 'A'.
  PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0105',
           BDC_FIELD  USING 'RF02K-LIFNR' WA_IT_VENDOR_EXTEND-LIFNR,
           BDC_FIELD  USING 'RF02K-BUKRS' WA_IT_VENDOR_EXTEND-BUKRS,
           BDC_FIELD  USING 'RF02K-KTOKK' WA_IT_VENDOR_EXTEND-KTOKK,
           BDC_FIELD  USING 'RF02K-REF_LIFNR'
                                      WA_IT_VENDOR_EXTEND-REF_LIFNR,
           BDC_FIELD  USING 'RF02K-REF_BUKRS'
                                      WA_IT_VENDOR_EXTEND-REF_BUKRS,
           BDC_FIELD  USING 'BDC_OKCODE'  '/00'.
  elseif wa_it_vendor_extend-flag = 'C'.
  PERFORM :BDC_DYNPRO USING 'SAPMF02K' '0106',
           BDC_FIELD  USING 'RF02K-LIFNR' WA_IT_VENDOR_extend-LIFNR,
           BDC_FIELD  USING 'RF02K-BUKRS' WA_IT_VENDOR_extend-BUKRS,
           BDC_FIELD  USING 'RF02K-D0210' 'X',
           BDC_FIELD  USING 'RF02K-D0215' 'X',
           BDC_FIELD  USING 'BDC_OKCODE'  '/00'.
  endif.
  perform :BDC_DYNPRO USING 'SAPMF02K' '0210',
           BDC_FIELD  USING 'LFB1-AKONT'  WA_IT_VENDOR_EXTEND-AKONT,
           BDC_FIELD  USING 'LFB1-FDGRV'  WA_IT_VENDOR_EXTEND-FDGRV,
           BDC_FIELD  USING 'BDC_OKCODE'  '=/00',
           BDC_DYNPRO USING 'SAPMF02K' '0215',
           BDC_FIELD  USING 'LFB1-ZTERM'  WA_IT_VENDOR_EXTEND-ZTERM,
           BDC_FIELD  USING 'LFB1-REPRF'  WA_IT_VENDOR_EXTEND-REPRF,
           BDC_FIELD  USING 'LFB1-ZWELS'  WA_IT_VENDOR_EXTEND-ZWELS,
           BDC_FIELD  USING 'LFB1-XPORE'  WA_IT_VENDOR_extend-XPORE,
           BDC_FIELD  USING 'BDC_OKCODE'  '=UPDA'.
ENDFORM.                    " POPULATE_BDC_DATA_VEN_EXTEND
*&      Form  DISPLAY_ERROR_REPORT
This form is used to display the error records on the output screen
FORM DISPLAY_ERROR_REPORT .
  IF P_VENMAS = 'X'.
    WRITE:/ TEXT-O05.            " Error List for Vendor Master
  ELSEIF P_VENEXT = 'X'.
    WRITE:/ TEXT-O06.            " Error List for Vendor Master Extended
  ENDIF.
  WRITE:/ SY-ULINE(100).
  FORMAT COLOR 1.
  WRITE:/1   SY-VLINE,
         2   TEXT-H01,              " Vendor Number
         17  SY-VLINE,
         18  TEXT-H02,              " Company Code
         31  SY-VLINE,
         32  TEXT-H03,              " Error Message
         100 SY-VLINE.
  FORMAT COLOR OFF.
  WRITE:/ SY-ULINE(100).
  LOOP AT IT_ERROR INTO WA_IT_ERROR.
    FORMAT COLOR 2.
    WRITE:/1   SY-VLINE,
           2   WA_IT_ERROR-LIFNR,
           17  SY-VLINE,
           18  WA_IT_ERROR-BUKRS,
           31  SY-VLINE,
           32  WA_IT_ERROR-MSG,
           100 SY-VLINE.
    CLEAR : WA_IT_ERROR.
    FORMAT COLOR OFF.
  ENDLOOP.
  WRITE:/ SY-ULINE(100).
ENDFORM.                    " DISPLAY_ERROR_REPORT
*&      Form  CALL_TRANSACTION_FK02
Form used to Call Transaction FK02
form CALL_TRANSACTION_FK02 .
  DATA : L_OPTION TYPE CTU_PARAMS,
         L_SUBRC TYPE SYSUBRC.
  REFRESH IT_MESSTAB.
  CLEAR IT_MESSTAB.
  L_OPTION-DEFSIZE = 'X'.
  L_OPTION-DISMODE = P_MODE.
  L_OPTION-UPDMODE = 'S'.
  CALL TRANSACTION 'FK02'
       USING IT_BDCDATA
       MESSAGES INTO IT_MESSTAB
       OPTIONS FROM L_OPTION.
  L_SUBRC = SY-SUBRC.
  IF L_SUBRC = 0.
    W_SUCC_REC1 = W_SUCC_REC1 + 1.
    WA_IT_succ_rec1-MSG = Text-017.
    IF P_VENMAS = 'X'.
      WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
      WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
    ELSEIF P_VENEXT = 'X'.
      WA_IT_succ_rec1-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
      WA_IT_succ_rec1-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
    ENDIF.
    APPEND WA_IT_succ_rec1 TO IT_succ_rec1.
  ELSE.
    IF FL_FLAG3 NE 'X'.
      PERFORM OPEN_BDC_SESSION_fk02.
      FL_FLAG3 = 'X'.
    ENDIF.
    PERFORM BDC_INSERT_fk02.
    W_ERR_REC = W_ERR_REC + 1.
    PERFORM ERROR_RECORD_DATA1.
  ENDIF.
endform.                    " CALL_TRANSACTION_FK02
*&      Form  OPEN_BDC_SESSION_fk02
Form used to Open session for FK02
form OPEN_BDC_SESSION_fk02 .
  DATA : L_USERID TYPE APQ_MAPN,      " Variable to hold user-id
         L_GROUP TYPE APQ_GRPN.       " Variable to hold value
  MOVE P_GROUP1 TO L_GROUP.
  MOVE SY-UNAME TO L_USERID.
  CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
      CLIENT              = SY-MANDT
      GROUP               = L_GROUP
      KEEP                = SPACE
      USER                = L_USERID
    EXCEPTIONS
      CLIENT_INVALID      = 1
      DESTINATION_INVALID = 2
      GROUP_INVALID       = 3
      GROUP_IS_LOCKED     = 4
      HOLDDATE_INVALID    = 5
      INTERNAL_ERROR      = 6
      QUEUE_ERROR         = 7
      RUNNING             = 8
      SYSTEM_LOCK_ERROR   = 9
      USER_INVALID        = 10
      OTHERS              = 11.
  IF SY-SUBRC <> 0.
    WRITE:/ TEXT-008.              " Unable to open BDC Session
  ENDIF.
endform.                    " OPEN_BDC_SESSION_fk02
*&      Form  BDC_INSERT_fk02
Form used to insert data into BDC session using FK02
form BDC_INSERT_fk02 .
  CALL FUNCTION 'BDC_INSERT'
    EXPORTING
      TCODE            = 'FK02'
    TABLES
      DYNPROTAB        = IT_BDCDATA
    EXCEPTIONS
      INTERNAL_ERROR   = 1
      NOT_OPEN         = 2
      QUEUE_ERROR      = 3
      TCODE_INVALID    = 4
      PRINTING_INVALID = 5
      POSTING_INVALID  = 6
      OTHERS           = 7.
  IF SY-SUBRC <> 0.
    WRITE:/ TEXT-009.             " Unable to Insert Data to BDC Session
  ENDIF.
endform.                    " BDC_INSERT_fk02
*&      Form  display_changed_report
Form to display Updated Vendor data
form display_changed_report .
  IF P_VENMAS = 'X'.
    WRITE:/ TEXT-O10.          " Updated List for Vendor Master
  ELSEIF P_VENEXT = 'X'.
    WRITE:/ TEXT-O11.          " Updated List for Vendor Master Extended
  ENDIF.
  WRITE:/ SY-ULINE(100).
  FORMAT COLOR 1.
  WRITE:/1   SY-VLINE,
         2   TEXT-H01,              " Vendor Number
         17  SY-VLINE,
         18  TEXT-H02,              " Company Code
         31  SY-VLINE,
         32  TEXT-H04,              " Message
         100 SY-VLINE.
  FORMAT COLOR OFF.
  WRITE:/ SY-ULINE(100).
  LOOP AT IT_succ_rec1 INTO WA_IT_succ_rec1.
    FORMAT COLOR 2.
    WRITE:/1   SY-VLINE,
           2   WA_IT_succ_rec1-LIFNR,
           17  SY-VLINE,
           18  WA_IT_succ_rec1-BUKRS,
           31  SY-VLINE,
           32  WA_IT_succ_rec1-MSG,
           100 SY-VLINE.
    CLEAR : WA_IT_succ_rec1.
    FORMAT COLOR OFF.
  ENDLOOP.
  WRITE:/ SY-ULINE(100).
endform.                    " display_changed_report
*&      Form  display_nochange_report
Form to display No Changed data for Vendors
form display_nochange_report .
  IF P_VENMAS = 'X'.
    WRITE:/ TEXT-O12.       " No Changes List for Vendor Master
  ELSEIF P_VENEXT = 'X'.
    WRITE:/ TEXT-O13.       " No Changes List for Vendor Master Extended
  ENDIF.
  WRITE:/ SY-ULINE(100).
  FORMAT COLOR 1.
  WRITE:/1   SY-VLINE,
         2   TEXT-H01,              " Vendor Number
         17  SY-VLINE,
         18  TEXT-H02,              " Company Code
         31  SY-VLINE,
         32  TEXT-H04,              " Message
         100 SY-VLINE.
  FORMAT COLOR OFF.
  WRITE:/ SY-ULINE(100).
  LOOP AT IT_noupdate INTO WA_IT_noupdate.
    FORMAT COLOR 2.
    WRITE:/1   SY-VLINE,
           2   WA_IT_noupdate-LIFNR,
           17  SY-VLINE,
           18  WA_IT_noupdate-BUKRS,
           31  SY-VLINE,
           32  WA_IT_noupdate-MSG,
           100 SY-VLINE.
    CLEAR : WA_IT_noupdate.
    FORMAT COLOR OFF.
  ENDLOOP.
  WRITE:/ SY-ULINE(100).
endform.                    " display_nochange_report
*&      Form  ERROR_RECORD_DATA1
Form to get Error Message for Changed Vendors
form ERROR_RECORD_DATA1 .
  DATA : L_LINES TYPE I,
         L_MSG(200) TYPE C.
  DESCRIBE TABLE IT_MESSTAB LINES L_LINES.
  READ TABLE IT_MESSTAB INTO WA_IT_MESSTAB INDEX L_LINES.
  IF SY-SUBRC = 0.
    CLEAR L_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        ID        = WA_IT_MESSTAB-MSGID
        LANG      = SY-LANGU
        NO        = WA_IT_MESSTAB-MSGNR
        V1        = WA_IT_MESSTAB-MSGV1
        V2        = WA_IT_MESSTAB-MSGV2
        V3        = WA_IT_MESSTAB-MSGV3
        V4        = WA_IT_MESSTAB-MSGV4
      IMPORTING
        MSG       = L_MSG
      EXCEPTIONS
        NOT_FOUND = 1
        OTHERS    = 2.
    IF SY-SUBRC = 0.
      WA_IT_ERROR_fk02-MSG = L_MSG.
    ENDIF.
    IF P_VENMAS = 'X'.
      WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_MASTER-LIFNR.
      WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_MASTER-BUKRS.
    ELSEIF P_VENEXT = 'X'.
      WA_IT_ERROR_fk02-LIFNR = WA_IT_VENDOR_EXTEND-LIFNR.
      WA_IT_ERROR_fk02-BUKRS = WA_IT_VENDOR_EXTEND-BUKRS.
    ENDIF.
    APPEND WA_IT_ERROR_fk02 TO IT_ERROR_fk02.
    CLEAR WA_IT_ERROR_fk02.
  ENDIF.
endform.                    " ERROR_RECORD_DATA1
*&      Form  display_error_report_fk01
Form to display Error Report for Master Vendors (FK01)
form display_error_report_fk01 .
  IF P_VENMAS = 'X'.
    WRITE:/ TEXT-O05.     " Error List for Vendor Master (FK01)
  ELSEIF P_VENEXT = 'X'.
    WRITE:/ TEXT-O06.     " Error List for Vendor Master Extended (FK01)
  ENDIF.
  WRITE:/ SY-ULINE(100).
  FORMAT COLOR 1.
  WRITE:/1   SY-VLINE,
         2   TEXT-H01,              " Vendor Number
         17  SY-VLINE,
         18  TEXT-H02,              " Company Code
         31  SY-VLINE,
         32  TEXT-H04,              " Message
         100 SY-VLINE.
  FORMAT COLOR OFF.
  WRITE:/ SY-ULINE(100).
  LOOP AT IT_ERROR_fk01 INTO WA_IT_ERROR_fk01.
    FORMAT COLOR 2.
    WRITE:/1   SY-VLINE,
           2   WA_IT_ERROR_fk01-LIFNR,
           17  SY-VLINE,
           18  WA_IT_ERROR_fk01-BUKRS,
           31  SY-VLINE,
           32  WA_IT_ERROR_fk01-MSG,
           100 SY-VLINE.
    CLEAR : WA_IT_ERROR_fk01.
    FORMAT COLOR OFF.
  ENDLOOP.
  WRITE:/ SY-ULINE(100).
endform.                    " display_error_report_fk01
*&      Form  display_error_report_fk02
Form to display Error Report for changed Vendors (FK02)
form display_error_report_fk02 .
  IF P_VENMAS = 'X'.
    WRITE:/ TEXT-O14.     " Error List for Vendor Master (FK02)
  ELSEIF P_VENEXT = 'X'.
    WRITE:/ TEXT-O15.     " Error List for Vendor Master Extended (FK02)
  ENDIF.
  WRITE:/ SY-ULINE(100).
  FORMAT COLOR 1.
  WRITE:/1   SY-VLINE,
         2   TEXT-H01,              " Vendor Number
         17  SY-VLINE,
         18  TEXT-H02,              " Company Code
         31  SY-VLINE,
         32  TEXT-H04,              " Message
         100 SY-VLINE.
  FORMAT COLOR OFF.
  WRITE:/ SY-ULINE(100).
  LOOP AT IT_ERROR_fk02 INTO WA_IT_ERROR_fk02.
    FORMAT COLOR 2.
    WRITE:/1   SY-VLINE,
           2   WA_IT_ERROR_fk02-LIFNR,
           17  SY-VLINE,
           18  WA_IT_ERROR_fk02-BUKRS,
           31  SY-VLINE,
         

Similar Messages

  • Upload Customer Master with LSMW

    Hi Experts,
    I have created an LSMW for uploading Customer Master in Development System and moved it to Quality System.
    Now can I upload the Customer Master in Production System from the LSMW in Quality System or it is the only option that I will have to move the LSMW to Production System and then Upload the Customer Master form Production?
    Thanks in Advance.
    Quick reply would be appriciated.
    Regards,
    HP

    I close the thread. I got the solution.
    It is possible with the Menu Path
    Extras > Export/Import

  • How to get legacy customer no. while uploading Customer master and vendor

    Hi All,
    I want to upload Customer master and Vendor master data from legacy using LSMW. I am using SAP standard programs available for the same. I am using internal number assignment in SAP for these masters.
    I case of material master these is a field in MARA named BISMT which is populated with old material no. used in legacy. Is there any corresponding field for customer and vendor master upload?. Moreover is this field automatically populated by SAP report while uploading?.I want to know which old material no. is mapped to which new internally generated number.
    Your feedback is highly appreciated.

    Hi,
    if you are looking for a field in customer and vendor master data that should contain the old (legacy number), take a look at knb1-altkn and in case of a vendor at lfb1-altkn.
    regards
    Siggi

  • FM to upload Customer master Contact details.......

    Hello frndz,
      Is there any FM to upload Customer master Contact details.......
    regards,
    ajit.

    Hi Ajit,
    To upload the customer master contact details ,
    use the FM BAPI_PARTNEREMPLOYEE_CREATE.
    And to update the already created contact details,
    use the FM BAPI_ADDRESSCONTPART_CHANGE .
    also see link.
    Help with function mocule BAPI_ADDRESSCONTPART_CHANGE
    Thanks,
    Kanishak
    Do contact if any more quiries

  • Outbond interface programme to upload customer master data.

    Hi experts,
              i need to develop an outbound interface programme to upload customer
    master data,which will be received from sap and posted to web methods using
    standard function mudule.can any one help me?

    Hi,
              Hi,
    Primary you should have Message type, Idoc type and Function module or Report to process Outbound interface.
    If your's is an Customized Process, then follow this.
    1. Create Message type in we81.
    2. Create segments in We31
    3. Create Idoc Type in WE30.
    4. Assign Message type to idoc type in WE82.
    5.Create an Partner profile in WE20.
    6.If you are creating an function Module create it in SE37.
    7. Assign it to process code in WE41.
    8. Charactersitics of FM in BD51.
    9. Assign FM and IDoc And Message type in WE57.
    <b>ALE IDOC</b>
    Sending System(Outbound ALE Process)
    Tcode SALE ? for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 ? Create Model View
    Tcode BD82 ? Generate partner Profiles & Create Ports
    Tcode BD64 ? Distribute the Model view
    Message Type MATMAS
    Tcode BD10 ? Send Material Data
    Tcode WE05 ? Idoc List for watching any Errors
    Receiving System(Inbound ALE )
    Tcode SALE ? for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 ? Check for Model view whether it has distributed or not
    Tcode BD82 -- Generate partner Profiles & Create Ports
    Tcode BD11 Getting Material Data
    Tcode WE05 ? Idoc List for inbound status codes
    ALE IDOC Steps
    Sending System(Outbound ALE Process)
    Tcode SALE ?3 for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 !V Create Model View
    Tcode BD82 !V Generate partner Profiles & Create Ports
    Tcode BD64 !V Distribute the Model view
    This is Receiving system Settings
    Receiving System(Inbound ALE )
    Tcode SALE ?3 for
    a) Define Logical System
    b) Assign Client to Logical System
    Tcode SM59-RFC Destination
    Tcode BD64 !V Check for Model view whether it has distributed or not
    Tcode BD82 -- Generate partner Profiles & Create Ports
    Tcode BD11 Getting Material Data
    Tcode WE05 !V Idoc List for inbound status codes
    Message Type MATMAS
    Tcode BD10 !V Send Material Data
    Tcode WE05 !V Idoc List for watching any Errors
    1)a Goto Tcode SALE
    Click on Sending & Receiving Systems-->Select Logical Systems
    Here Define Logical Systems---> Click on Execute Button
    go for new entries
    1) System Name : ERP000
    Description : Sending System
    2) System Name : ERP800
    Description : Receiving System
    press Enter & Save
    it will ask Request
    if you want new request create new Request orpress continue for transfering the objects
    B) goto Tcode SALE
    Select Assign Client to Logical Systems-->Execute
    000--> Double click on this
    Give the following Information
    Client : ERP 000
    City :
    Logical System
    Currency
    Client role
    Save this Data
    Step 2) For RFC Creation
    Goto Tcode SM59-->Select R/3 Connects
    Click on Create Button
    RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles
    give the information for required fields
    RFC Destination : ERP800
    Connection type: 3
    Description
    Target Host : ERP000
    System No:000
    lan : EN
    Client : 800
    User : Login User Name
    Password:
    save this & Test it & RemortLogin
    3)
    Goto Tcode BD64 -- click on Change mode button
    click on create moduleview
    short text : xxxxxxxxxxxxxx
    Technical Neme : MODEL_ALV
    save this & Press ok
    select your just created modelview Name :'MODEL_ALV'.
    goto add message type
    Model Name : MODEL_ALV
    sender : ERP000
    Receiver : ERP800
    Message type :MATMAS
    save & Press Enter
    4) Goto Tcode BD82
    Give Model View : MODEL_ALV
    Partner system : ERP800
    execute this by press F8 Button
    it will gives you sending system port No :A000000015(Like)
    5) Goto Tcode BD64
    seelct the modelview
    goto >edit>modelview-->distribute
    press ok & Press enter
    6)goto Tcode : BD10 for Material sending
    Material : mat_001
    Message Type : MATMAS
    Logical System : ERP800
    and Execute
    7)goto Tcode : BD11 for Material Receiving
    Material : mat_001
    Message Type : MATMAS
    and Execute --> 1 request idoc created for message type Matmas
    press enter
    Here Master Idoc set for Messge type MATMAS-->press Enter
    1 Communication Idoc generated for Message Type
    this is your IDOC
    Change Pointers
    I know how to change the description of a material using ALE Change Pointers.
    I will give the following few steps
    1) Tcode BD61---> check the change pointers activated check box
    save and goback.
    2) Tcode BD50---> check the MATMAS check box save and comeback.
    3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save and comeback.
    4) Tcode BD52---> give message type : matmas press ok button.
    select all what ever you want and delete remaining fields.
    save & come back.
    5) 5) go to Tcode MM02 select one material and try to change the description and save it
    it will effects the target systems material desciption will also changes
    6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute
    give Message type : MATMAS and Executte
    ALE/IDOC Status Codes/Messages
    01 Error --> Idoc Added
    30 Error --> Idoc ready for dispatch(ALE Service)
    then goto SE38 --> Execute the Program RBDMIDOC
    29 Error --> ALE Service Layer
    then goto SE38 --> Execute the Program RSEOUT00
    03 Error --> Data Passed to Port ok
    then goto SE38 --> Execute the Program RBDMOIND
    12 Error --> Dispatch ok
    Inbound Status Codes
    50 Error --> It will go for ALE Service Layer
    56 Error --> Idoc with Errors added
    51 Error --> Application Document not posted
    65 Error --> Error in ALE Service Layer
    for 51 or 56 Errors do the following steps
    goto WE19 > give the IDOC Number and Execute>
    Press on Inbound function Module
    for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your getting 51 Error
    Regards

  • Uploading Customer Master Tax Groupings

    Hi,
    I want to upload the customer master Tax groupings(table KNAT), Is there any standard function module or BAPI to acheive this?
    Please advice.
    steps to upload manually: XD02->control data->Tax categories
    Regards,
    Narayan

    What is LSMW?
    LSMW is a workbench which gives you 4 different options to import data to SAP.
    Just saying I use LSMW is no qualified info.
    but because you are just saying LSMW I can assume that you refer to recording, as this seems to be the only thing that is known by freshers.
    If you recorded your transaction, then you should have realized that the first screen looks different to the normal transaction.
    I am always get curious when I see screens that I have not seen before and try to get used to any fact that can be seen on that screen and I use F1 for any field that is different to the screen of the online transaction  which I know well.
    You should have seen there a small box for "use central address management"
    And only if this is ticked then you can the interface to the ADR* tables
    without activation of this box you actually operate like it was done before 4.0 release of SAP.
    I actually load my central address data with BAPI method.

  • Which is the best approach to upload customer master data?

    Hi Everyone,
    I have to load customer master data  which is extracted from ecc by using generic data source(view) when i try to  trigger DTP it is showing error message  as duplicates because the customer has two sales area ,two person number and two consumernumber and four partner functions.
    So i tried to make all these as compounding attributes but the length is exeeding 60 for these attributes so how can i implement this.can i implement hierarchy's?
    Please give me any suggestions.
    Thanks and Regards,
    G.Kavyasree

    Hi Yogesh,
    The issue is not resolved yet.If the length is manageable  in compounding attributes.please suggest me the solution.
    yes ,by enhancing two data sources 0customer_attr and 0customer_sales_attr i can meet my client requirement .but i dont know how to join these datasources  based on customer number in bi (i.e customer genral data from 0customer_attr  datasource and sales area data from 0customer_sales_attr  datasource ) and generate a report on these two datasources  data.
    my report should look like this .
    customer_id   firstname      city      country   sales_org  distribution_channel  division  telephone
      100                 mary       newyork    us          1010                     10                    10       +1xxxx456
      100                 mary       newyork    us          1010                     20                    10       +1xxxx457
      100                 mary       newyork    us          1010                     20                    20       +1xxxx433
      101               richard       texas        us          1010                     10                    10       +1xxxx351
    Please provide your valuable suggestions.
    Thanks,
    Kavya

  • Query in customer master data upload ....?

    Hi Guru's,
    I am uploading the customer master data from presentaion server to customer tables using functional module SD_CUSTOMER_MAINTAIN_ALL.
    while check the Function module separatly and it working properley and i am able to ctere customer...
    and i am using the same function module in the program i am unable to upload ..could please check and let me know where i am doing mistake in the below program logis..and values also moving properly before calling function module..while calling the functinal module the controle comming out of the loop and program went to dump i am able to see the message in dump as like this(it may helpfull for resolve):
    Name of function module...............: "SD_CUSTOMER_MAINTAIN_ALL"
    Name of formal parameter..............: "O_KNA1"
    Technical type of actual parameter....: "C"
    Technical length of actual parameter..: 20 bytes
    Technical type of formal parameter....: "u"
    Technical length of formal parameter..: 3634 bytes
    Name of formal parameter at caller....: "O_KNA1"
    *& Report  ZERP_CUSTOMER_CREATE_UPLOAD
    REPORT  zerp_customer_create_upload.
    PARAMETERS:p_files        TYPE string.
    *DATA :xkunnr(10)      LIKE kna1-kunnr.  "unique KUNNR
    DATA: gs_i_kna1           TYPE kna1,
          gs_i_knb1             TYPE knb1,
          gs_i_knvv           TYPE knvv,
          gs_return           TYPE bapireturn1,
          gs_i_bapiaddr1      TYPE   bapiaddr1,
          gt_t_xknvi          TYPE STANDARD TABLE OF fknvi,
          gwa_t_xknvi         TYPE fknvi,
          gt_t_xknbk          TYPE STANDARD TABLE OF fknbk,
          gwa_t_xknbk         TYPE fknbk,
          gt_t_yknvp          TYPE STANDARD TABLE OF fknvp,
          gwa_t_xknvp         TYPE fknvp.
    TYPES:BEGIN OF gty_itab1,
          abc(305),
          END OF gty_itab1.
    DATA: gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
          gwa_itab1 TYPE gty_itab1.
    TYPES :BEGIN OF gty_itab2,
           ktokd(4),        "customer account grp      kna1
           kunnr(10),       "customer                  kna1
           name1(35),       "name1                     kna1
           sortl(10),       "sort filed                kna1
           stras(35),       "house number and adres    kna1
           pstlz(10),       "postal code               kna1
           ort01(35),       "city                      kna1
           land1(3),        "country                   kna1
           telf1(16),       "tele phone no             kna1
           telfx(31),       "fax num                   kna1
           kukla(2),        "cust classificaion        kna1
           bukrs(4),        "company code              knb1
           akont(10),       "reconcilation acct        knb1
           vkorg(4),        "sales org                 knvv
           vtweg(2),        "distr chan                knvv
           spart(2),        "division                  knvv
           zterm(4),        "terms of payment          knvv
           bzirk(6),        "sales district            knvv
           vkbur(4),        "sales office              knvv
           vkgrp(3),        "sales grp                 knvv
           kdgrp(2),        "cust grp                  knvv
           waers(5),        "currency                  knvv
           konda(2),        "price grp                 knvv
           kalks(1),        "pricing procedure assign  knvv
           lprio(2),        "delivery plant            knvv
           vsbed(2),        "shipping conditions       knvv
           vwerk(4),        "delivering plant          knvv
           inco1(3),        "inco1                     knvv
           inco2(28),       "inco2                     knvv
           kkber(4),        "cred control area         knvv
           ktgrd(2),        "acc assgn grp             knvv
           taxkd(1),        "tax classification 4 cust knvi
           bankn(18),       "bank account number       knbk -
            xkunnr(10),
           END OF gty_itab2.
    DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
          gwa_itab2 TYPE gty_itab2.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = p_files
        filetype                = 'ASC'
      TABLES
        data_tab                = gt_itab1
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT gt_itab1 INTO gwa_itab1.
      gwa_itab2 = gwa_itab1-abc(305).
      APPEND gwa_itab2 TO gt_itab2.
    ENDLOOP.
    LOOP AT gt_itab2 INTO gwa_itab2.
      SPLIT gwa_itab2 AT ',' INTO gwa_itab2-ktokd
                                  gwa_itab2-kunnr
                                  gwa_itab2-name1 gwa_itab2-sortl
                                  gwa_itab2-stras gwa_itab2-pstlz
                                  gwa_itab2-ort01 gwa_itab2-land1
                                  gwa_itab2-telf1 gwa_itab2-telfx
                                  gwa_itab2-kukla gwa_itab2-bukrs
                                  gwa_itab2-akont gwa_itab2-vkorg
                                  gwa_itab2-vtweg gwa_itab2-spart
                                  gwa_itab2-zterm gwa_itab2-bzirk
                                  gwa_itab2-vkbur gwa_itab2-vkgrp
                                  gwa_itab2-kdgrp gwa_itab2-waers
                                  gwa_itab2-konda gwa_itab2-kalks
                                  gwa_itab2-lprio gwa_itab2-vsbed
                                  gwa_itab2-vwerk gwa_itab2-inco1
                                  gwa_itab2-inco2 gwa_itab2-kkber
                                  gwa_itab2-ktgrd
                                  gwa_itab2-taxkd
                                  gwa_itab2-bankn.
    *moving files values from ITAB2 work area to global structure related to FM.
      gs_i_kna1-ktokd   = gwa_itab2-ktokd.
      gs_i_kna1-kunnr   = gwa_itab2-kunnr.
      gs_i_kna1-name1   = gwa_itab2-name1.
      gs_i_kna1-sortl   = gwa_itab2-sortl.
      gs_i_kna1-stras   = gwa_itab2-stras.
      gs_i_kna1-pstlz   = gwa_itab2-pstlz.
      gs_i_kna1-ort01   = gwa_itab2-ort01.
      gs_i_kna1-regio   = gwa_itab2-land1.
      gs_i_kna1-telf1   = gwa_itab2-telf1.
      gs_i_kna1-telfx   = gwa_itab2-telfx.
      gs_i_kna1-kukla   = gwa_itab2-kukla.
      gs_i_knb1-bukrs   = gwa_itab2-bukrs.
      gs_i_knb1-akont   = gwa_itab2-akont.
    *I FOR GOT TO INCLUDE THE ZTERM VALUE IN EXCELL SHEET SO INCLUDED HARD CODE HERE
      gs_i_knb1-zterm   = '0001'.
      gs_i_knvv-vkorg   = gwa_itab2-vkorg.
      gs_i_knvv-vtweg   = gwa_itab2-vtweg.
      gs_i_knvv-spart   = gwa_itab2-spart.
      gs_i_knvv-zterm   = gwa_itab2-zterm.
      gs_i_knvv-bzirk   = gwa_itab2-bzirk.
      gs_i_knvv-vkbur   = gwa_itab2-vkbur.
      gs_i_knvv-vkgrp   = gwa_itab2-vkgrp.
      gs_i_knvv-kdgrp   = gwa_itab2-kdgrp.
      gs_i_knvv-waers   = gwa_itab2-waers.
      gs_i_knvv-konda   = gwa_itab2-konda.
      gs_i_knvv-kalks   = gwa_itab2-kalks.
      gs_i_knvv-lprio   = '02'.             "gwa_itab2-lprio.
      gs_i_knvv-vsbed   = gwa_itab2-vsbed.
      gs_i_knvv-vwerk   = gwa_itab2-vwerk.
      gs_i_knvv-inco1   = gwa_itab2-inco1.
      gs_i_knvv-inco2   = gwa_itab2-inco2.
      gs_i_knvv-kkber   = gwa_itab2-kkber.
      gs_i_knvv-ktgrd   = gwa_itab2-ktgrd.
      gwa_t_xknvi-tatyp  = 'UTXJ'.          "HARD CODE
      gwa_t_xknvi-aland  = 'US'.            "HARD CODED
      gwa_t_xknvi-kz     = '0'.             "HADR CODE
      gwa_t_xknvi-taxkd  = '0'.             "gwa_itab2-taxkd.
      APPEND gwa_t_xknvi TO gt_t_xknvi.
      gwa_t_xknbk-bankn  = gwa_itab2-bankn.
      APPEND gwa_t_xknbk TO gt_t_xknbk.
      gs_i_knb1-lockb          = 'X'.
      gs_i_knvv-kzazu          = 'X'.
      gs_i_knvv-kztlf          = 'X'.
      gs_i_knvv-perfk          = 'X'.
      gs_i_knvv-prfre          = 'X'.
      gs_i_kna1-spras          = 'EN'.
      CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
       EXPORTING
         i_kna1                              = gs_i_kna1
         i_knb1                              = gs_i_knb1
         i_knvv                              = gs_i_knvv
      I_BAPIADDR1                         =
      I_BAPIADDR2                         =
      I_MAINTAIN_ADDRESS_BY_KNA1          = ' '
      I_KNB1_REFERENCE                    = ' '
      I_FORCE_EXTERNAL_NUMBER_RANGE       = ' '
      I_NO_BANK_MASTER_UPDATE             = ' '
      I_CUSTOMER_IS_CONSUMER              = ' '
      I_RAISE_NO_BTE                      = ' '
      PI_POSTFLAG                         = ' '
      PI_CAM_CHANGED                      = ' '
      PI_ADD_ON_DATA                      =
      I_FROM_CUSTOMERMASTER               = ' '
    IMPORTING
      e_kunnr                             = xkunnr
      o_kna1                              = xkunnr
      E_SD_CUST_1321_DONE                 =
       TABLES
      T_XKNAS                             =
         t_xknbk                             = gt_t_xknbk
      T_XKNB5                             =
      T_XKNEX                             =
      T_XKNVA                             =
      T_XKNVD                             =
         t_xknvi                             = gt_t_xknvi
      T_XKNVK                             =
      T_XKNVL                             =
      T_XKNVP                             =
      T_XKNZA                             =
      T_YKNAS                             =
      T_YKNBK                             =
      T_YKNB5                             =
      T_YKNEX                             =
      T_YKNVA                             =
      T_YKNVD                             =
      T_YKNVI                             =
      T_YKNVK                             =
      T_YKNVL                             =
       t_yknvp                             = gt_t_yknvp
      T_YKNZA                             =
      T_UPD_TXT                           =
       EXCEPTIONS
         client_error                        = 1
         kna1_incomplete                     = 2
         knb1_incomplete                     = 3
         knb5_incomplete                     = 4
         knvv_incomplete                     = 5
         kunnr_not_unique                    = 6
         sales_area_not_unique               = 7
         sales_area_not_valid                = 8
         insert_update_conflict              = 9
         number_assignment_error             = 10
         number_not_in_range                 = 11
         number_range_not_extern             = 12
         number_range_not_intern             = 13
         account_group_not_valid             = 14
         parnr_invalid                       = 15
         bank_address_invalid                = 16
         tax_data_not_valid                  = 17
         no_authority                        = 18
         company_code_not_unique             = 19
         dunning_data_not_valid              = 20
         knb1_reference_invalid              = 21
         cam_error                           = 22
         OTHERS                              = 23.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        WRITE: / 'Error Message:', 'error in creation'.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'costomer', gwa_itab2-kunnr, 'created'.
      ENDIF.
    ENDLOOP.

    please let me know if my qestion is not clear...
    and please cinfirm me ..that can i use the function module (SD_CUSTOMER_MAINTAIN_ALL) instead of BAPI (BAPI_CUSTOMER_CREATEFROMDATA1) for uploading customer master data.
    please respond me ASAP.
    thanks in advance and will give full points
    thanks&regards
    Srinivas.

  • How to upload different views of customer master data using LSMW-IDOC

    I need to upload customer master data  using LSMW Idoc method for my client. Now customer will have different views like main view, Sales data, Company code data, Partner function data etc. And except main data all other data can be multiple for each customer. We are going to upload data from tab delimited .TXT file. Should I propose different LSMW for upload different views for the customer from different .TXT files? or we can upload all the customer related data (like main view data and partner function data )from a single .TXT file. Kindly suggest which one in convenient and how we can prepare the data file in both cases.

    convinient is the method that you can handle.
    but as the guy who loads the data you have to load the data like they are available, like it is convinient for others to prepare the data.
    In general there is no problem to use an IDOC method to load a customer master with multiple comany codes and several sales orgs in one shot.
    the data can be in one source file, but need then to be maintained in a certain way
    Example1: all data in 1 structure
    GD1 - CC1 - SO1
    GD1 - CC2 - SO2
    GD1 - CC2 - SO3
    in this case the GD (general data) is redundand in each line which has different Company code data or different Sales Org data
    Example2: all data in 3 sturcures but one file
    GD1
    .CC1
    .CC2
    ..SO1
    ..SO2
    ..SO3
    Example3: data delivered in 3 files - you join the files in LSMW, they must have a common identifier like the old customer number in the beginning of each file
    FILE General data:
    GD1
    GD2
    GD3
    file Compamy code data:
    CC1
    CC2
    CC3
    file Sales org data:
    SO1
    SO2
    SO3
    LSMW is flexible and can handle each of this scenarios, are you flexible too?

  • Problem in Customer Master Upload using LSMW

    Hi,
    I am using LSMW direct input method to upload customer master. I have used ZSOURCE structure as parent structure and for multilple entries like Bank details and contact details i have used other child structure like ZBANK and ZCONTACT. I am using separate flat file for Bank and contact details.
    I have used one common field 'ID' as the first field both on ZSOURCE, ZBANK and ZCONTACT structure to link-up. Thus, i am able to load multiple records for Bank data. But i am unable to get contact details.
    Also, value for Reconciliation account(KNB1-AKONT) and sales group(KNVV-VKGRP) is not passed to screen.
    I have checked 'Generate Read Program','Read Data', 'Generate Conversion Program' and 'Convert Data' step again and again. Upto step 'Display Converted Data', data is converted successfully, but the same field values are not passed to screen.
    Can you pls help me to get the value..

    Hi,
    LSMW will have a Indicator for headr and itam, i do not remember the correct field, but it will have an indicator, check the fields, there will be a single charecter lenght field, that should be the indicator, and using that we can write the logic.
    check that single charecter field, if that is X that means the header record is processed, and do the items.
    and, this is another way, try this out also
    YOu can do this in "Define Source Structures" step,
    the HEADER is defined first,
    then the DETAIL below the HEADER.
    add the fields to the structures.
    Both should have some common key field
    Please take care that the name of the common field is the same.
    Once you do this it is linked. The you have a header and item corresponding to that header. then run the LSMW as you would.
    Re: Table control in LSMW

  • LSMW : Customer Master upload

    hello,
    i am uploading customer master data using the standard object : 0050 and program : RFBIDE00.
    I am trying to upload data like Street2, street3 and street 4 which can be viewed in the street address drop down in transacction XD01/02. In my lsmw i am using the mapping for these fields in the structure BIADDR2 where the fields i mapped to are str_suppl1, str_suppl2, str_suppl3.
    but when i try and upload data i do not get these fields updated even though i have given  them in the upload file.
    Please can anyone tell me the reason why it is doing so?
    Thanks and Regards
    Swanand

    Hi Swanand,
    We have done the customer master upload using LSMW but with the IDoc variant (message type DEBMAS). You can upload all data you need using this IDoc.
    Regards,
    John.

  • SEARCH TERM 2 UPLOAD IN CUSTOMER MASTER

    Hi,
    I have to upload SEARCH TERM 2 while uploading CUSTOMER MASTER DATA in XD01. Please let me know how to achieve this while creation of customer master.
    Points Gauranteed!!!
    Thank You,
    Suresh

    What is the problem exactly?... if you cannot see the Search Term 2 ("Search term B") field in the first XD01 screen then talk to your config team as it may have been suppressed in SPRO using the Address Field Status Group for that customer account group.
    Jonathan

  • Customer Hierarchy field not showing in change customer master

    Hi all,
    We are trying to upload customer master Hierarchy field A and Customer Number  in XD02 But Customer Hierarchy field not displaying in XD02 i check in account group OBD2 and OB20 setting its showing optional entries only still its not showing in XD02 But while creating customer master in XD01 its showing
    can any one guide me where i need config
    Thanks
    Rajesh

    Hi,
    You check out in OBD2 & in OB20,
    R u selected right account group in OBD2, check it.
    Kapil

  • How to maintain street2 and street3 in customer master

    Hello All,
    I m uploading customer master data through xd01 tcode, but while recording there is no field called street2 and street3 but if create customer manually through xd01 only i can extend tht tab.
    pls let me knw how i can maintain street 2 street3 field while uploading customer master
    regards,
    SUnny

    Hi,
    While recording for XD01 there is a check box in the initial screen. If u click that all the additional fields will be appeared in recording.
    Regards,
    Balavardhan.K
    Edited by: balavardhan k on Feb 26, 2008 11:48 AM

  • Customer master details

    hello guru's,
                    my requirment is i need to upload Customer Master details using BAPI  in LSMW. can anyone tell me the Business Object Type and Method name ..i know message type and idoc type for Customer Master bt i dont know how to search the Business Object type and Method...

    Hi,
    Object          0050  
    Method          0000
    Program Name    RFBIDE00
    As an alternative to using u2018Transaction Recordingu2019, you could also use a standard SAP object to update Customer Master Records. Business Object u20180050u2019 is already pre-defined in the system with standard Batch Input Interface Program u2018RFBIDE00u2019.
    Create an Object CUST_OBJ within Project as LSMW_DEMO and Subproject as CUSTOMERS as shown in Figure 20.
    Figure 20  LSMW Object with Standard SAP Object
    Note! Only steps that are different from the recording method are listed here.
    Step 1: Maintain Object attributes
    You will be updating the customer master records with the help of Standard Batch Input; therefore, choose radio-button Standard Batch/Direct Input as shown in Figure 21. Enter Object u20180050u2019 for Customer Master records and default method u20180000u2019 and click on Save. 
    Figure 21 Standard Batch/Direct Input Object Attributes
    Step 4: Maintain Structure Relations
    Sales view of Customer Master is stored in table KNVV. Accordingly, you need to update structure BKNVV. However, in addition, the Standard Object u20180050u2019 also requires updates to BGR00, BKN00 and BKNA1 structures. (If you do not maintain Structure relations for mandatory entries, you might get a message such as u2018Target structure BKNA1 needs a relation to a source structureu2019.) 
    Even though you donu2019t want to update any fields in these structures, you need to create a relationship with source structures. In all, you need to create relationship for four target structures. 
    Create relationship between source structures XD02S with these target structures with icon u2018Create Relationshipu2019  . 
    Keep Cursor on these four target structures and click on icon u2018Create Relationu2019 and structure relations are maintained as shown in Figure 22. 
    Figure 22 Structure Relation
    Step 5: Maintain field mapping and conversion rules
    -- Keep your cursor on u2018TCODEu2019 field and click on u2018Insert Ruleu2019 icon 
    Figure 23 LSMW Conversion Rules
    Choose radio button u2018Constantu2019 (Figure 23) to enter value u2018XD02u2019 transaction code.
    -- Keep your cursor on field u2018KUNNRu2019 and click on u2018Assign source fieldu2019 icon 
    Choose source field u2018Customeru2019 from source structure u2018XD02Su2019. (See Figure 24.)
    Figure 24 Assign Source fields
    -- Similarly, choose source fields for Sales Organization, Distribution Channel, and Division. (See Figure 25.)
    Figure 25 Field Mapping and Conversion Rules
    -- Scroll down to structure BKNVV fields and assign source fields to three fields Sales Office, Sales Group, and Customer Group (Figure 26).
    Figure 26 Field Mapping and Conversion Rules
    Save and go back to main screen.
    Step 12: Display Converted data
    When you convert data, LSMW automatically converts into the appropriate structure layouts, as required by Standard program (RFBIDE00). (See Figure 27).
    Figure 27 Converted data into multiple structures
    Note that if you had only one record in source file, the converted file has four records.
    Earlier, creating this input file, so that the standard interface program can read it, was a big nightmare, the primary reason being that it could have multiple record layouts. Even for a simple conversion with one input record, you would have to create this complex file with many record layouts. The advantage of LSMW is that it prepares these multi-layout files automatically.
    Step 13: Create batch input session
    Once source data is converted in internal format, you can create a BDC session to process the updates (Figures 28 and 29). 
    Figure 28 Create BDC Session
    Figure 29 BDC Session u2018CUST_OBJu2019 created.

Maybe you are looking for

  • How to save plain text attachments

    I often get email with plain text attachments (e.g., source code). Mail tries to be smart and displays the attachments in the body of the mail. But I wold like to save them as usual. I can't even control-click on them Does anyone have an idea what I

  • How to fix the program???

    Hi all, I'm writing an application which need to use a vector to store data from a file when the program starts. Then, after the user input new data and press "Save" button, the new data will be append to the vector. The following code has error. May

  • ACE - FQDN in a class map or other suggestions

    It appears it is only possible to use an IP address when creating match conditions in a class map which makes sense.  We are using this basically as a NAT. ie, server sends an HTTP message to the ACE containing XML ACE then encrypts with an SSL cert

  • Restoring iTunes music during hard drive crash

    I recently installed a new hard-drive for my computer. I also recently ended my .me/.mac email address subscription about a month ago. I plugged my phone in and saw my original music was restored from a month ago, but nothing I purchased within the l

  • Struts : Pre populating won't work !!

    How come initializing the form parameter in the action before forwarding to jsp does not populate the struts html controls such as html:text ?? in my action (WhatEverAction) class i do that : myOwnActionForm = (MyOwnActionForm) form; myOwnActionForm.