Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC XK02

Former Member
0 Likes
1,122

hi all,

i have to do a BDC on xk02 and fill in the details of the <b>other communications</b>.

But the problem is that the dialog box displayed on press of the button is a Grid display ,

i have to select the URL homepage in the list to update the URLs but it doent get recorded.

can any one please tell me what can be done to do the same.

Please its sort of urgent.

thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

Check note 653536. You have to enter the OK code for URL directly. (It's =$URI for URL (home page)).

Rob

hi all,

i have to do a BDC on xk02 and fill in the details of the <b>other communications</b>.

But the problem is that the dialog box displayed on press of the button is a Grid display ,

i have to select the URL homepage in the list to update the URLs but it doent get recorded.

can any one please tell me what can be done to do the same.

Please its sort of urgent.

thanks,

4 REPLIES 4
Read only

Former Member
0 Likes
830

Hi

See the sample code for XK01 with the commn fields like MailID and Fax no etc modify it and use it

REPORT zmm_vendor_master_upload

NO STANDARD PAGE HEADING

LINE-SIZE 255.

***********************************************************************

  • ABAP Name : ZMM_VENDOR_MASTER_UPLOAD

  • Description : This Program is used to Upload the Vendor Master.

***********************************************************************

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_vendor OCCURS 0,

bukrs(004), " Company Code

ekorg(004), " Purchase Orgn

ktokk(004), " Account Group

  • Address Screen

anred(015), " Title

name1(035), " Name1

sortl(010), " Sort Field

name2(035), " Name2

name3(035), " Contact Person1

name4(035), " Contact Person 2

stras(035), " Street

pfach(010), " PO Box

ort01(035), " City

pstlz(010), " Postal Code

land1(003), " Country

spras(002), " Language

telf1(016), " Telephone No

telfx(031), " Fax Number

lfurl(132), " URL-Mail Id

  • Material Group Characteristics

  • klart(003), " Class Type '010'

  • class(018), " Class 'Vendor'

  • mname_01(030), " Characteristic

  • mname_02(030), " Characteristic

  • mname_03(030), " Characteristic

mwert_01(030), " Charct.Value

mwert_02(030), " Charct.Value

mwert_03(030), " Charct.Value

  • Control Data

emnfr(010), " Manufact.Part No

  • Bank Details

banks_01(003), " Country of Bank1

banks_02(003), " Country of Bank2

bankl_01(015), " Bank Key of 1

bankl_02(015), " Bank Key of 2

bankn_01(018), " Account No Bank1

bankn_02(018), " Account No Bank2

  • Accounting Info

akont(010), " Reconcillation Account

zuawa(003), " Sort Key

fdgrv(010), " Cash Management Group

  • Payment Transactions

zterm(004), " Payment terms

  • reprf(001), " Check Double Inv.

zwels(010), " Payment Method

hbkid(005), " House Bank

  • xpore(001), " Individ.Payment

  • Correspondence

mahns(001), " Dunning Level

xausz(001), " Account Statement

  • Withholding Tax Details

qland(003), " Withholding Tax Country

witht_01(002), " WH tax Type

  • wt_withcd(002), " WH Tax Code

  • wt_subjct(001), " Indicator:WH Tax

  • Purchasing Data

waers(005), " Currency

zterm1(004), " Payment Terms

END OF i_vendor.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X'. " Flag

  • Paramters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_vendor

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

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

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

ENDIF.

  • Upload the Data from Internal Table

LOOP AT i_vendor.

PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RF02K-KTOKK'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RF02K-BUKRS'

i_vendor-bukrs.

PERFORM bdc_field USING 'RF02K-EKORG'

i_vendor-ekorg.

PERFORM bdc_field USING 'RF02K-KTOKK'

i_vendor-ktokk.

PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-SPRAS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=KLAS'.

PERFORM bdc_field USING 'LFA1-ANRED'

i_vendor-anred.

PERFORM bdc_field USING 'LFA1-NAME1'

i_vendor-name1.

PERFORM bdc_field USING 'LFA1-SORTL'

i_vendor-sortl.

PERFORM bdc_field USING 'LFA1-NAME2'

i_vendor-name2.

PERFORM bdc_field USING 'LFA1-NAME3'

i_vendor-name3.

PERFORM bdc_field USING 'LFA1-NAME4'

i_vendor-name4.

PERFORM bdc_field USING 'LFA1-STRAS'

i_vendor-stras.

PERFORM bdc_field USING 'LFA1-PFACH'

i_vendor-pfach.

PERFORM bdc_field USING 'LFA1-ORT01'

i_vendor-ort01.

PERFORM bdc_field USING 'LFA1-PSTLZ'

i_vendor-pstlz.

PERFORM bdc_field USING 'LFA1-LAND1'

i_vendor-land1.

PERFORM bdc_field USING 'LFA1-SPRAS'

i_vendor-spras.

PERFORM bdc_field USING 'LFA1-TELF1'

i_vendor-telf1.

PERFORM bdc_field USING 'LFA1-TELFX'

i_vendor-telfx.

PERFORM bdc_field USING 'LFA1-LFURL'

i_vendor-lfurl.

PERFORM bdc_dynpro USING 'SAPLCLCA' '0602'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMCLF-KLART'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTE'.

PERFORM bdc_field USING 'RMCLF-KLART'

'010'. "i_vendor-klart.

PERFORM bdc_dynpro USING 'SAPLCLFM' '0500'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMCLF-CLASS(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=AUSW'.

PERFORM bdc_field USING 'RMCLF-CLASS(01)'

'Vendor'."i_vendor-class.

PERFORM bdc_dynpro USING 'SAPLCTMS' '0109'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RCTMS-MWERT(03)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

PERFORM bdc_field USING 'RCTMS-MNAME(01)'

'MATERIALGROUP'." i_vendor-mname_01.

PERFORM bdc_field USING 'RCTMS-MNAME(02)'

'MATERIALGROUP'." i_vendor-mname_02.

PERFORM bdc_field USING 'RCTMS-MNAME(03)'

'MATERIALGROUP'." i_vendor-mname_03.

PERFORM bdc_field USING 'RCTMS-MWERT(01)'

i_vendor-mwert_01.

PERFORM bdc_field USING 'RCTMS-MWERT(02)'

i_vendor-mwert_02.

PERFORM bdc_field USING 'RCTMS-MWERT(03)'

i_vendor-mwert_03.

PERFORM bdc_dynpro USING 'SAPLCLFM' '0500'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMCLF-CLASS(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENDE'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-ANRED'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0120'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-EMNFR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFA1-EMNFR'

i_vendor-emnfr.

PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBK-BANKN(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFBK-BANKS(01)'

i_vendor-banks_01.

PERFORM bdc_field USING 'LFBK-BANKS(02)'

i_vendor-banks_02.

PERFORM bdc_field USING 'LFBK-BANKL(01)'

i_vendor-bankl_01.

PERFORM bdc_field USING 'LFBK-BANKL(02)'

i_vendor-bankl_02.

PERFORM bdc_field USING 'LFBK-BANKN(01)'

i_vendor-bankn_01.

PERFORM bdc_field USING 'LFBK-BANKN(02)'

i_vendor-bankn_02.

  • PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'LFBK-BANKS(01)'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=VW'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB1-FDGRV'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFB1-AKONT'

i_vendor-akont.

PERFORM bdc_field USING 'LFB1-ZUAWA'

i_vendor-zuawa.

PERFORM bdc_field USING 'LFB1-FDGRV'

i_vendor-fdgrv.

PERFORM bdc_dynpro USING 'SAPMF02K' '0215'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB1-XPORE'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFB1-ZTERM'

i_vendor-zterm.

PERFORM bdc_field USING 'LFB1-REPRF'

c_x. "i_vendor-reprf.

PERFORM bdc_field USING 'LFB1-ZWELS'

i_vendor-zwels.

PERFORM bdc_field USING 'LFB1-HBKID'

i_vendor-hbkid.

PERFORM bdc_field USING 'LFB1-XPORE'

c_x. "i_vendor-xpore.

PERFORM bdc_dynpro USING 'SAPMF02K' '0220'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFB5-MAHNS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFB5-MAHNS'

i_vendor-mahns.

PERFORM bdc_field USING 'LFB1-XAUSZ'

i_vendor-xausz.

PERFORM bdc_dynpro USING 'SAPMF02K' '0610'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBW-WT_SUBJCT(01)'.

PERFORM bdc_field USING 'LFB1-QLAND'

i_vendor-qland.

PERFORM bdc_field USING 'LFBW-WITHT(01)'

i_vendor-witht_01.

  • PERFORM bdc_field USING 'LFBW-WT_WITHCD(01)'

  • i_vendor-wt_withcd.

PERFORM bdc_field USING 'LFBW-WT_SUBJCT(01)'

c_x.

PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFM1-ZTERM'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=VW'.

PERFORM bdc_field USING 'LFM1-WAERS'

i_vendor-waers.

PERFORM bdc_field USING 'LFM1-ZTERM'

i_vendor-zterm1.

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'.

ENDLOOP.

  • Close the BDc Session

PERFORM close_group.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
831

Check note 653536. You have to enter the OK code for URL directly. (It's =$URI for URL (home page)).

Rob

Read only

Former Member
0 Likes
830

Thanks a lot Rob.

Read only

0 Likes
830

Happy to help.

Rob