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

learning BDC

Former Member
0 Likes
669

hi i am learning BDC call transaction,

i went through SHDB, ran the transaction XK01, with minimum most data,

got the recording, and after selecting this recording, and pressing the create program button, i got the following code, can any one tell me where to make changes to make this program a call transaction program,

or am i in a wrong way, do i need to go in a different approach:

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

report ZHW01

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPMF02K' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RF02K-REF_EKORG'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RF02K-REF_LIFNR'

'3950000'.

perform bdc_field using 'RF02K-REF_BUKRS'

'zz01'.

perform bdc_field using 'RF02K-REF_EKORG'

'0001'.

perform bdc_dynpro using 'SAPMF02K' '0110'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-ANRED'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFA1-LAND1'

'US'.

perform bdc_field using 'LFA1-SPRAS'

'EN'.

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'

'=ENTR'.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_transaction using 'XK01'.

perform close_group.

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

i posted this in Data transfer section also, but i didnot get any response there so, i had to post in general section.

thank you

3 REPLIES 3
Read only

Former Member
Read only

Former Member
0 Likes
611

Hi

see the sample code for XK01 which was done using recording and modifying the program.

REPORT zmm_vendor_master_upload

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • 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

mwert_01(030), " Charct.Value

mwert_02(030), " Charct.Value

mwert_03(030), " Charct.Value

mwert_04(030), " Charct.Value

mwert_05(030), " Charct.Value

  • 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

  • Correspondence

  • mahns(001), " Dunning Level

xausz(001), " Account Statement

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

'EN'."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)'

'MATGROUP'." i_vendor-mname_01.

if i_vendor-mwert_02 <> Space.

PERFORM bdc_field USING 'RCTMS-MNAME(02)'

'MATGROUP'." i_vendor-mname_02.

endif.

if i_vendor-mwert_03 <> space.

PERFORM bdc_field USING 'RCTMS-MNAME(03)'

'MATGROUP'." i_vendor-mname_03.

endif.

if i_vendor-mwert_04 <> Space.

PERFORM bdc_field USING 'RCTMS-MNAME(04)'

'MATGROUP'." i_vendor-mname_04.

endif.

if i_vendor-mwert_05 <> space.

PERFORM bdc_field USING 'RCTMS-MNAME(05)'

'MATGROUP'." i_vendor-mname_05.

endif.

PERFORM bdc_field USING 'RCTMS-MWERT(01)'

i_vendor-mwert_01.

if i_vendor-mwert_02 <> Space.

PERFORM bdc_field USING 'RCTMS-MWERT(02)'

i_vendor-mwert_02.

endif.

if i_vendor-mwert_03 <> Space.

PERFORM bdc_field USING 'RCTMS-MWERT(03)'

i_vendor-mwert_03.

endif.

if i_vendor-mwert_04 <> Space.

PERFORM bdc_field USING 'RCTMS-MWERT(04)'

i_vendor-mwert_04.

endif.

if i_vendor-mwert_05 <> Space.

PERFORM bdc_field USING 'RCTMS-MWERT(05)'

i_vendor-mwert_05.

endif.

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

i_vendor-reprf.

PERFORM bdc_field USING 'LFB1-ZWELS'

i_vendor-zwels.

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' '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 if useful

Anji

Read only

Former Member
0 Likes
611

hi sanjana,

here is a complete BDC program for complete reference for Call transaction.

Reward points if usefull...

REPORT zmm0069 NO STANDARD PAGE HEADING

MESSAGE-ID z0

LINE-SIZE 132

LINE-COUNT 65(2).

----


  • Internal Tables *

----


*Internal table for the purchasing info records fields.

DATA: BEGIN OF i_inforecord OCCURS 0,

matnr(18),

lifnr(10),

uom(3),

ekgrp(3),

planned_time(3),

under_tol(3),

over_tol(3),

qty(10),

price_cat(5),

inco(3),

designation(28),

netpr(13),

scale_qty1(10),

scale_pr1(13),

scale_qty2(10),

scale_pr2(13),

scale_qty3(13),

scale_pr3(10),

scale_qty4(13),

scale_pr4(10),

scale_qty5(13),

scale_pr5(10),

scale_qty6(13),

scale_pr6(10),

scale_qty7(13),

scale_pr7(10),

scale_qty8(13),

scale_pr8(10),

scale_qty9(13),

scale_pr9(10),

scale_qty10(13),

scale_pr10(10),

END OF i_inforecord.

    • Internal table for Old and New Vendor number

DATA : BEGIN OF i_lfb1 OCCURS 1,

lifnr(10),

altkn(10),

END OF i_lfb1.

    • Declare internal table for Call Transaction and BDC Session

DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.

----


  • Global Variables *

----


DATA: g_counter(2) TYPE n,

g_field_name(18) TYPE c,

zc_yes TYPE syftype VALUE 'X'.

----


  • Selection Screen *

----


SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.

PARAMETERS: p_fname1 TYPE localfile .

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.

PARAMETERS: p_rloc1 AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.

PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZPURCHINFO'.

SELECTION-SCREEN END OF BLOCK c.

SELECTION-SCREEN END OF BLOCK b.

SELECTION-SCREEN END OF BLOCK a.

**WRITE the report header

TOP-OF-PAGE.

INCLUDE zheading.

----


  • Start of selection *

----


START-OF-SELECTION.

  • Load Input file

PERFORM f_load_input_file.

  • Create BDC records.

PERFORM create_bdc_records .

&----


*& Form Create_BDC_records

&----


  • Perform the BDC for the records in the internal table

----


FORM create_bdc_records .

IF NOT i_inforecord[] IS INITIAL.

    • Open BDC session

PERFORM open_bdc_session.

SELECT lifnr altkn FROM lfb1 INTO TABLE i_lfb1

FOR ALL ENTRIES IN i_inforecord

WHERE altkn = i_inforecord-lifnr.

  • Sorting the Internal table for better performance

SORT i_lfb1 BY altkn.

LOOP AT i_inforecord.

***Mapping Old Vendor number to the new Vendor number

READ TABLE i_lfb1 WITH KEY altkn = i_inforecord-lifnr BINARY

SEARCH.

IF sy-subrc EQ 0.

i_inforecord-lifnr = i_lfb1-lifnr.

ENDIF.

CLEAR i_bdc_table[].

PERFORM insert_screen_header.

  • call transaction 'ME11' using i_bdc_table

  • mode 'A'.

  • CLEAR i_bdc_table.

ENDLOOP.

CLEAR i_inforecord[].

PERFORM close_bdc_session.

    • Release the BDC sessions created

PERFORM release_bdc.

ENDIF.

ENDFORM. " open_group

&----


*& Form bdc_dynpro_start

&----


  • Start the screen for the transfer of fields

----


FORM bdc_dynpro_start USING p_g_program_1

p_g_screen.

CLEAR i_bdc_table.

i_bdc_table-program = p_g_program_1.

i_bdc_table-dynpro = p_g_screen.

i_bdc_table-dynbegin = 'X'.

APPEND i_bdc_table.

ENDFORM. " bdc_dynpro_start_start

&----


*& Form bdc_insert_field

&----


  • Insert field *

----


FORM bdc_insert_field USING f_name f_value.

IF f_value <> space.

CLEAR i_bdc_table.

i_bdc_table-fnam = f_name.

i_bdc_table-fval = f_value.

APPEND i_bdc_table.

ENDIF.

ENDFORM. "bdc_insert_field

&----


*& Form open_bdc_session

&----


  • Open a BDC session

----


FORM open_bdc_session .

    • Open BDC session and create and update records

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

  • DEST = FILLER8

group = p_group

  • HOLDDATE = FILLER8

keep = 'X'

user = sy-uname

  • RECORD = FILLER1

  • PROG = SY-CPROG

  • IMPORTING

  • QID =

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.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " create_bdc_session

&----


*& Form insert_screen_header

&----


  • Screen flow for the transfer of fields

----


FORM insert_screen_header .

  • First Screen 100

PERFORM bdc_dynpro_start USING 'SAPMM06I' '0100'.

PERFORM bdc_insert_field USING:'BDC_CURSOR' 'EINA-LIFNR',

'BDC_OKCODE' '/00',

'EINA-LIFNR' i_inforecord-lifnr,

'EINA-MATNR' i_inforecord-matnr,

'EINE-EKORG' '1000',

'RM06I-NORMB' zc_yes.

****----


*******

  • Next Screen 101

PERFORM bdc_dynpro_start USING 'SAPMM06I' '0101'.

PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINA-MAHN1',

'BDC_OKCODE' '/00',

'EINA-MEINS' i_inforecord-uom.

****----


*******

*Next Screen 102

PERFORM bdc_dynpro_start USING 'SAPMM06I' '0102'.

PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINE-INCO2',

'EINE-APLFZ' i_inforecord-planned_time,

'EINE-EKGRP' i_inforecord-ekgrp,

'EINE-NORBM' i_inforecord-qty.

PERFORM bdc_insert USING 'EINE-UEBTK' ' '.

PERFORM bdc_insert_field USING:'EINE-PEINH' i_inforecord-scale_qty1,

'EINE-BPRME' i_inforecord-uom,

'EINE-UNTTO' '5',

'EINE-UEBTO' '25',

'EINE-MEPRF' i_inforecord-price_cat,

'EINE-NETPR' i_inforecord-netpr,

'EINE-INCO1' i_inforecord-inco,

'EINE-INCO2' i_inforecord-designation.

  • Checking for Scale quantities

IF i_inforecord-scale_qty2 = space.

PERFORM bdc_insert_field USING 'BDC_OKCODE' '=BU'.

PERFORM insert_bdc_new.

ELSE.

PERFORM bdc_insert_field USING 'BDC_OKCODE' '=KO'.

****----


*******

  • Next Screen 201

PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.

PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'RV13A-DATAB',

'BDC_OKCODE' '=PSTF'.

****----


*******

  • Next Screen 201

PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.

PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONP-KSCHL(01)',

'BDC_OKCODE' '=PSTF',

'RV130-SELKZ(01)' zc_yes.

****----


*******

  • LAST SCREEN 303

PERFORM bdc_dynpro_start USING 'SAPMV13A' '0303'.

PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONM-KBETR(03)',

'BDC_OKCODE' '=SICH'.

  • Counter to Loop the Item level entry

g_counter = 0.

PERFORM scale_entry USING i_inforecord-scale_qty2

i_inforecord-scale_pr2.

PERFORM scale_entry USING i_inforecord-scale_qty3

i_inforecord-scale_pr3.

PERFORM scale_entry USING i_inforecord-scale_qty4

i_inforecord-scale_pr4.

PERFORM scale_entry USING i_inforecord-scale_qty5

i_inforecord-scale_pr5.

PERFORM scale_entry USING i_inforecord-scale_qty6

i_inforecord-scale_pr6.

PERFORM scale_entry USING i_inforecord-scale_qty7

i_inforecord-scale_pr7.

PERFORM scale_entry USING i_inforecord-scale_qty8

i_inforecord-scale_pr8.

PERFORM scale_entry USING i_inforecord-scale_qty9

i_inforecord-scale_pr9.

PERFORM scale_entry USING i_inforecord-scale_qty10

i_inforecord-scale_pr10.

PERFORM insert_bdc_new.

ENDIF.

ENDFORM. " insert_screen_header

&----


*& Form insert_bdc

&----


  • Insert BDC

----


FORM insert_bdc_new .

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'ME11'

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

dynprotab = i_bdc_table

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.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CLEAR i_bdc_table[].

ENDFORM. " insert_bdc

&----


*& Form close_bdc_session

&----


  • Close the BDC session

----


FORM close_bdc_session .

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS

not_open = 1

queue_error = 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.

ENDFORM. " close_bdc_session

&----


*& Form f_load_input_file

&----


  • Upload the file

----


FORM f_load_input_file.

  • Check always Local file for upload

IF p_rloc1 = zc_yes.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

filename = p_fname1

filetype = 'DAT'

TABLES

data_tab = i_inforecord

EXCEPTIONS

conversion_error = 1

file_open_error = 2

file_read_error = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

OTHERS = 10.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

STOP.

ENDIF.

ENDIF.

*

ENDFORM. " f_load_input_file

&----


*& Form release_bdc

&----


  • Release the session

----


FORM release_bdc.

SUBMIT rsbdcsub WITH mappe EQ p_group

WITH von EQ sy-datum

WITH bis EQ sy-datum

WITH fehler EQ '.'

EXPORTING LIST TO MEMORY

AND RETURN.

ENDFORM. " release_bdc

&----


*& Form scale_entry

&----


  • Populate the Scale quantities

----


  • -->P_SCALE_QTY

  • -->P_SCALE_PRICE

----


FORM scale_entry USING p_scale_qty

p_scale_price.

  • Increment the Counter

g_counter = g_counter + 1.

IF p_scale_qty <> space.

CONCATENATE 'KONM-KSTBM(' g_counter ')' INTO g_field_name.

PERFORM bdc_insert_field USING g_field_name p_scale_qty.

CONCATENATE 'KONM-KBETR(' g_counter ')' INTO g_field_name.

PERFORM bdc_insert_field USING g_field_name p_scale_price.

ENDIF.

ENDFORM.

&----


*& Form bdc_insert

&----


  • To uncheck the Unlimited (UEBTK)

----


FORM bdc_insert USING f_name f_value.

CLEAR i_bdc_table.

i_bdc_table-fnam = f_name.

i_bdc_table-fval = f_value.

APPEND i_bdc_table.

ENDFORM. " bdc_insert