on 11-20-2008 8:38 AM
Dear Friends,
When i am uploading data thru BDC, i am unable to find email and house number fields thru recording.
But I am able to create a customer thru XD01 txn code with email(SMTP_ADDR) and house number(HOUSE_NUM1)).
How can i find these fields thru recording or how can i upload these two fields also.
Please help.
Regards,
S.Vinod
Hi Vinod,
Please use the correct or most appropriate forum.
This thread will be moved from to .
Please see the [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
Also read this thread .
Greetings,
Marcelo Ramos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When u do the recording, U will see "Use central address management" radio button.
Select that radio button then u will see the missing things.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this it might be useful:
1-http://learningabap.wordpress.com/2007/03/28/step-by-step-guide-for-using-lsmw-to-update-customer-master-records/
2-http://www.abapprogramming.net/2007/11/abap-bdc-sample-code-xd01.html
-
Hope this code might help u.
report Z_BDCP_CUSTOMER_XD01
no standard page heading
line-size 255.
include bdcrecx1.
*-- Internal Table to hold customer data
data: begin of it_customer occurs 0,
f1(4), " Company Code
f2(4), " Sales organization
f3(2), " Distribution Channel
f4(2), " Division
f5(4), " Acct group
f6(30), " Title
f7(40), " Name 1
f8(40), " Name 2
f9(20), " Search Term1
f10(20), " Search Term1
f11(60), " Street
f12(40), " District
f13(10), " Postal Code
f14(40), " City
f15(3), " Country
f16(3), " Region
f17(10), " Transportation zone
f18(10), " Po Box
f19(10), " Postal Code
f20(2), " Language
f21(30), " Telephone Number
f22(30), " Fax Number
email(241), " Email address
f23(35), " First name
f24(35), " Name
f25(10), " Recon. account
f26(10), " Prev. Acc
f27(2), " Cst Group
f28(5), " Currency
f29(1), " Cust.pric.proc.
f30(1), " Cst Stat Group
f31(2), " Shipping Condn
f32(3), " Incoterm 1
f33(28), " Incoterm 2
f34(2), " Acc Group
end of it_customer.
start-of-selection.
Clear it_customer.
PERFORM UPLOAD.
perform open_group.
**Looping of Customer intenal table.
loop at it_customer.
perform bdc_dynpro using 'SAPMF02D' '0100'.
perform bdc_field using 'BDC_CURSOR'
'USE_ZAV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
''.
perform bdc_field using 'RF02D-BUKRS'
it_customer-f1.
perform bdc_field using 'RF02D-VKORG'
it_customer-f2.
perform bdc_field using 'RF02D-VTWEG'
it_customer-f3.
perform bdc_field using 'RF02D-SPART'
it_customer-f4.
perform bdc_field using 'RF02D-KTOKD'
it_customer-f5.
perform bdc_field using 'RF02D-REF_KUNNR'
''.
perform bdc_field using 'RF02D-REF_BUKRS'
''.
perform bdc_field using 'RF02D-REF_VKORG'
''.
perform bdc_field using 'RF02D-REF_VTWEG'
''.
perform bdc_field using 'RF02D-REF_SPART'
''.
perform bdc_field using 'USE_ZAV'
'X'.
perform bdc_field using 'USE_ZAV'
'X'.
perform bdc_dynpro using 'SAPMF02D' '0111'.
perform bdc_field using 'BDC_OKCODE'
'VW'.
perform bdc_field using 'BDC_CURSOR'
'SZA1_D0100-SMTP_ADDR'.
perform bdc_field using 'SZA1_D0100-TITLE_MEDI'
it_customer-f6.
perform bdc_field using 'ADDR1_DA
-
Regards
Neha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use FM 'BAPI_CUSTOMER_CHANGEFROMDATA1' for creation of Customer master data.
So in my experience, the following parameters of BAPI_CUSTOMER_CHANGEFROMDATA1 were needed to successfully change the email address:
pi_personaldata
fill in at least the lastname, language, and
currency fields, in addition to the new email.
you might want to consider using
BAPI_CUSTOMER_GETDETAIL1.
pi_personaldatax
set the email field to 'X'.
pi_salesorg
pi_distr_chan
pi_division
customerno
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Raj,
I have created a customer thru BDC without fields email and house number.
Now i am trying to update the two fields (email and house number ) thru BAPI 'BAPI_CUSTOMER_CHANGEFROMDATA1 ' to the customer which i have created
I am passing following parameters in
pi_personaldata :
Tittle,first name, housenumber, country, lang, and email.
pi_personaldatax :
setting X,X,X,X,X and X to the corresponding values in (pi_personaldata)
and also
pi_salesorg
pi_distr_chan
pi_division
customerno
But i am getting a error "Make an entry in all fields where required" .
Please help me out.
Regards,
S.Vinod
report Zxk01
no standard page heading line-size 255.
************************************************************************
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
*
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
*
Generated data section with specific formatting - DO NOT CHANGE ***
Dear Vinod,
Refer this BDC code
include bdcrecx1.
*parameters: dataset(132) lower case.
data: begin of record occurs 0,
General Data
data element: BUKRS
BUKRS_001(004), " Company Code
data element: EKORG
EKORG_002(004), " Purchase Orgn
data element: KTOKK
KTOKK_003(004), " Account Group
* Address Screen
data element:
USE_ZAV_004(001),
data element: AD_TITLETX
TITLE_MEDI_005(030), " Title
data element: AD_NAME1
NAME1_006(040), " Name1
data element: AD_NAME2
NAME2_007(040), " Name2
data element: AD_NAME3
NAME3_008(040), " Name3
data element: AD_NAME4
NAME4_009(040), " Name4
data element: AD_SORT1UL
SORT1_010(020), " Sort Field
data element: AD_STREET
STREET_011(060), " Street
data element: AD_HSNM1
HOUSE_NUM1_012(010), " House number
data element: AD_PSTCD1
POST_CODE1_013(010), " Postal Code
data element: AD_CITY1
CITY1_014(040), " City
data element: LAND1
COUNTRY_015(003), " Country
data element: REGIO
REGION_016(003), " Regio
data element: SPRAS
LANGU_017(002), " Language
data element: AD_TLNMBR1
TEL_NUMBER_018(030), " Telephone No
data element: AD_MBNMBR1
MOB_NUMBER_019(030), " Mobile No
data element: AD_FXNMBR1
FAX_NUMBER_020(030), " Fax Number
data element: AD_SMTPADR
SMTP_ADDR_021(132), " URL-Mail Id
data element: AD_REMARK1
REMARK_022(050), " Comments
CIN Details
data element: J_1ICSTNO
J_1ICSTNO_023(040), " CST no
data element: J_1ISERN
J_1ISERN_024(040), " Ser.Reg.No
data element: J_1IPANNO
J_1IPANNO_025(040) ," PAN.No
* Accounting Info
data element: AKONT
AKONT_026(010)," Reconcillation Account
data element: FDGRV
FDGRV_027(010)," Cash Management Group
* Payment Transactions
data element: DZTERM
ZTERM_028(004), " Payment terms
data element: REPRF
REPRF_029(001), " Check Double Inv.
data element: TOGRR
TOGRR_030(004), " Tolerance Grp
* Withholding Tax Details
data element: QLAND
QLAND_031(003), " Withholding Tax Country
data element: WITHT
WITHT_01_032(002), " WH tax Type
data element: WT_WITHCD
WT_WITHCD_01_038(002)," WH Tax Code
data element: WT_SUBJCT
WT_SUBJCT_01_044(001)," Indicator:WH Tax
data element: WITHT
WITHT_02_033(002),
data element: WT_WITHCD
WT_WITHCD_02_039(002),
data element: WT_SUBJCT
WT_SUBJCT_02_045(001),
data element: WITHT
WITHT_03_034(002),
data element: WT_WITHCD
WT_WITHCD_03_040(002),
data element: WT_SUBJCT
WT_SUBJCT_03_046(001),
data element: WITHT
WITHT_04_035(002),
data element: WT_WITHCD
WT_WITHCD_04_041(002),
data element: WT_SUBJCT
WT_SUBJCT_04_047(001),
data element: WITHT
WITHT_05_036(002),
data element: WT_WITHCD
WT_WITHCD_05_042(002),
data element: WT_SUBJCT
WT_SUBJCT_05_048(001),
data element: WITHT
WITHT_06_037(002),
data element: WT_WITHCD
WT_WITHCD_06_043(002),
data element: WT_SUBJCT
WT_SUBJCT_06_049(001),
* Purchasing Data
data element: BSTWA
WAERS_051(005)," Currency
data element: KALSK
KALSK_052(002)," Schema Grp,vendor
data element: WEBRE
WEBRE_053(001)," GR-based inv.verif
end of record.
End generated data section ***
data: begin of it_bdcdata occurs 0.
include structure bdcdata.
data: end of it_bdcdata.
*
Internal Table
data:it_excel like table of alsmex_tabline with header line.
data:it_success like table of record with header line.
data:it_error like table of record with header line .
data:returnm type table of bapi_matreturn2 with header line.
*Internal Table for Success Log
data:begin of s_fret occurs 0,
MSGTYP like messtab-MSGTYP,
MSGV1 like messtab-MSGV1,
MSGV2 like messtab-MSGV2,
MSGV3 like messtab-MSGV3,
MSGV4 like messtab-MSGV4,
end of s_fret.
*Internal Table for Error Log
data:begin of e_fret occurs 0,
type like bapiret2-type,
name like lfa1-name1,
message like bapiret2-message,
end of e_fret.
*Data Variables & Constants
constants : c_x value 'X'. " Flag
data : len type i .
data : final_len type i.
data: v_message(255) type c. " Variable for storing error message
data: fstring type string.
data: message type c.
data : msgtab type standard table of BDCMSGCOLL with header line.
data :total_rec type i .
data :success_rec type i .
data :error_rec type i .
data: l_mstring(480).
start-of-selection.
data : vf_index type i.
data : vf_start_col type i value '1', "start column
vf_start_row type i value '4', "start row
vf_end_col type i value '200', "maximum column
vf_end_row type i value '2500', "maximum row
p_text(20). "stores error messages
************************************************************************
*/ Work Area
data: wa_intern like it_excel.
************************************************************************
*/ Field symbol
field-symbols : <fs>.
parameters: p_file like rlgrap-filename default 'c:\vendor_creation.xls'
.
parameter: slogfile type rlgrap-filename default 'c:\slog.txt'.
parameter: elogfile type rlgrap-filename default 'c:\elog.txt'.
*********************************************************************
*********Fn Module to convert the excel file data into internal table
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = 'c:\vendor_creation.xls'
i_begin_col = vf_start_col
i_begin_row = vf_start_row
i_end_col = vf_end_col
i_end_row = vf_end_row
tables
intern = it_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
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 it_excel[] is initial.
p_text = 'No Data Uploaded'.
else.
sort it_excel by row col.
loop at it_excel.
move : it_excel-col to vf_index.
assign component vf_index of structure record to <fs>.
move : it_excel-value to <fs>.
at end of row.
append record.
clear record.
endat.
endloop.
endif.
*----
Validating the Data
*----
loop at record.
********************Validations**********************Start
final_len = STRLEN( record-J_1ICSTNO_023 ).
if ( record-BUKRS_001 CS 'SGL' ).
if ( record-EKORG_002 NE '2000' ) .
MOVE-CORRESPONDING record TO it_error.
APPEND it_error.
e_fret-type = 'E'.
e_fret-name = it_error-NAME1_006.
e_fret-message = 'Only Pur Org 2000 is valid for Company Code SGL'.
append e_fret.
elseif ( ( record-KTOKK_003 = '1000' AND record-J_1ICSTNO_023 eq '' )
or ( record-KTOKK_003 = '3000' AND record-J_1IPANNO_025 eq '' ) ).
MOVE-CORRESPONDING record TO it_error.
APPEND it_error.
e_fret-type = 'E'.
e_fret-name = it_error-NAME1_006.
e_fret-message = 'A/c Grp:1000 CST is must & A/c Grp:3000 PAN is must'
.
append e_fret.
else.
MOVE-CORRESPONDING record TO it_success.
APPEND it_success.
endif.
endif.
if ( record-BUKRS_001 cs 'SCL' ).
if ( ( record-ekorg_002 ne '1000' ) AND
( record-ekorg_002 ne '1100' ) AND
( record-ekorg_002 ne '1200' ) ).
move-corresponding record to it_error.
append it_error.
e_fret-type = 'E'.
e_fret-name = it_error-NAME1_006.
e_fret-message = 'For Com Code SCL Pur Org 1000,1100 & 1200 is valid '.
append e_fret.
elseif ( ( record-KTOKK_003 = '1000' and record-J_1ICSTNO_023 eq '' )
or ( record-KTOKK_003 = '3000' and record-J_1IPANNO_025 eq '' ) ).
MOVE-CORRESPONDING record TO it_error.
APPEND it_error.
e_fret-type = 'E'.
e_fret-name = it_error-NAME1_006.
e_fret-message = 'Invalid Entry'.
append e_fret.
else.
MOVE-CORRESPONDING record TO it_success.
APPEND it_success.
endif.
endif.
endloop.
********************Validations**********************End
fstring = elogfile.
perform download_data tables e_fret using fstring.
*******************************************
loop at it_success.
General Data
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'USE_ZAV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-BUKRS'
it_success-BUKRS_001.
perform bdc_field using 'RF02K-EKORG'
it_success-EKORG_002.
perform bdc_field using 'RF02K-KTOKK'
it_success-KTOKK_003.
perform bdc_field using 'USE_ZAV'
it_success-USE_ZAV_004.
* Address Screen
perform bdc_dynpro using 'SAPMF02K' '0111'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'ADDR1_DATA-REMARK'.
perform bdc_field using 'SZA1_D0100-TITLE_MEDI'
it_success-TITLE_MEDI_005.
perform bdc_field using 'ADDR1_DATA-NAME1'
it_success-NAME1_006.
perform bdc_field using 'ADDR1_DATA-NAME2'
it_success-NAME2_007.
perform bdc_field using 'ADDR1_DATA-NAME3'
it_success-NAME3_008.
perform bdc_field using 'ADDR1_DATA-NAME4'
it_success-NAME4_009.
perform bdc_field using 'ADDR1_DATA-SORT1'
it_success-SORT1_010.
perform bdc_field using 'ADDR1_DATA-STREET'
it_success-STREET_011.
perform bdc_field using 'ADDR1_DATA-HOUSE_NUM1'
it_success-HOUSE_NUM1_012.
perform bdc_field using 'ADDR1_DATA-POST_CODE1'
it_success-POST_CODE1_013.
perform bdc_field using 'ADDR1_DATA-CITY1'
it_success-CITY1_014.
perform bdc_field using 'ADDR1_DATA-COUNTRY'
it_success-COUNTRY_015.
perform bdc_field using 'ADDR1_DATA-REGION'
it_success-REGION_016.
perform bdc_field using 'ADDR1_DATA-LANGU'
it_success-LANGU_017.
perform bdc_field using 'SZA1_D0100-TEL_NUMBER'
it_success-TEL_NUMBER_018.
perform bdc_field using 'SZA1_D0100-MOB_NUMBER'
it_success-MOB_NUMBER_019.
perform bdc_field using 'SZA1_D0100-FAX_NUMBER'
it_success-FAX_NUMBER_020.
perform bdc_field using 'SZA1_D0100-SMTP_ADDR'
it_success-SMTP_ADDR_021.
perform bdc_field using 'ADDR1_DATA-REMARK'
it_success-REMARK_022.
Tax Categories
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=OPFI'.
CIN Details
perform bdc_dynpro using 'SAPLJ1I_MASTER' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CIN_VENDOR_FC2'.
perform bdc_field using 'BDC_CURSOR'
'J_1IMOVEND-J_1IEXCD'.
perform bdc_dynpro using 'SAPLJ1I_MASTER' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CIN_VENDOR_FC3'.
perform bdc_field using 'BDC_CURSOR'
'J_1IMOVEND-J_1ISERN'.
perform bdc_field using 'J_1IMOVEND-J_1ICSTNO'
it_success-J_1ICSTNO_023.
perform bdc_field using 'J_1IMOVEND-J_1ISERN'
it_success-J_1ISERN_024.
perform bdc_dynpro using 'SAPLJ1I_MASTER' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'BDC_CURSOR'
'J_1IMOVEND-J_1IPANNO'.
perform bdc_field using 'J_1IMOVEND-J_1IPANNO'
it_success-J_1IPANNO_025.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
* Accounting Info
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-AKONT'
it_success-AKONT_026.
perform bdc_field using 'LFB1-FDGRV'
it_success-FDGRV_027.
* Payment Transactions
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-TOGRR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-ZTERM'
it_success-ZTERM_028.
perform bdc_field using 'LFB1-REPRF'
it_success-REPRF_029.
perform bdc_field using 'LFB1-TOGRR'
it_success-TOGRR_030.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
* Withholding Tax Details
perform bdc_dynpro using 'SAPMF02K' '0610'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'LFBW-WT_SUBJCT(06)'.
perform bdc_field using 'LFB1-QLAND'
it_success-QLAND_031.
perform bdc_field using 'LFBW-WITHT(01)'
it_success-witht_01_032.
perform bdc_field using 'LFBW-WT_WITHCD(01)'
it_success-WT_WITHCD_01_038.
perform bdc_field using 'LFBW-WT_SUBJCT(01)'
c_x.
perform bdc_field using 'LFBW-WITHT(02)'
it_success-witht_02_033.
perform bdc_field using 'LFBW-WT_WITHCD(02)'
it_success-WT_WITHCD_02_039.
perform bdc_field using 'LFBW-WT_SUBJCT(02)'
c_x.
perform bdc_field using 'LFBW-WITHT(03)'
it_success-WITHT_03_034.
perform bdc_field using 'LFBW-WT_WITHCD(03)'
it_success-WT_WITHCD_03_040.
perform bdc_field using 'LFBW-WT_SUBJCT(03)'
c_x.
perform bdc_field using 'LFBW-WITHT(04)'
it_success-witht_04_035.
perform bdc_field using 'LFBW-WT_WITHCD(04)'
it_success-WT_WITHCD_04_041.
perform bdc_field using 'LFBW-WT_SUBJCT(04)'
c_x.
perform bdc_field using 'LFBW-WITHT(05)'
it_success-witht_05_036.
perform bdc_field using 'LFBW-WT_WITHCD(05)'
it_success-WT_WITHCD_05_042.
perform bdc_field using 'LFBW-WT_SUBJCT(05)'
c_x.
perform bdc_field using 'LFBW-WITHT(06)'
it_success-witht_06_037.
perform bdc_field using 'LFBW-WT_WITHCD(06)'
it_success-WT_WITHCD_06_043.
perform bdc_field using 'LFBW-WT_SUBJCT(06)'
c_x.
* Purchasing Data
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_field using 'LFM1-WAERS'
record-waers_051.
perform bdc_field using 'LFM1-kalsk'
record-kalsk_052.
perform bdc_field using 'LFM1-webre'
record-webre_053.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=VW'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
* Call the Transaction
perform bdc_transaction using 'XK01' .
s_fret-MSGTYP = messtab-MSGTYP.
s_fret-MSGV1 = messtab-MSGV1.
s_fret-MSGV2 = messtab-MSGV2.
s_fret-MSGV3 = messtab-MSGV3.
s_fret-MSGV4 = messtab-MSGV4.
append s_fret.
perform close_group.
endloop.
fstring = slogfile.
perform download_data tables s_fret using fstring.
*********************************************************************
****Call Fn Module for log file of Success/Error records*******Start
form download_data tables main_table using g_filename.
call function 'GUI_DOWNLOAD'
exporting
filename = g_filename
filetype = 'ASC'
write_field_separator = 'X'
trunc_trailing_blanks = 'X'
tables
data_tab = main_table.
endform. "download_data
*********************************************************************
******Call Fn Module for logfile of Success/Error records*******End
*CALL FUNCTION 'CONVERT_BDCMSGCOLL_TO_BAPIRET2'
TABLES
IMT_BDCMSGCOLL =
EXT_RETURN =
.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.