BDC Steps

Post on 02-Jul-2015

64 views 3 download

Tags:

Transcript of BDC Steps

For creating a bdc. First I’ll explain hw to create a new table bcz this is a just sample bdcGoto T. Code SE11

Give ur table name and click on create button

Give Short Description

Press F4 at Delivery class & select A

Select Display /Maintenance Allowed

Save it and assign a package for instance $tmp

Click on Fields Tab give ur field and data element

Now double click on data element

Click Yes Button to create new data element

Short Text

Give domain name

After entering domain name press enter then a pop-up will come as shown then press enter

Save it

Assign a package

After pressing enter it will asks u to create new domain then press yes for creating new domain

Fill all the necessary values

Save it and activate it

Go back up to your initial table screen

Now Click on Technical Settings or press Ctrl+ Shift +F9

Select APPL0 and 0

now goto Tcode SHDB to create new recording

At least enter a single entry and save it

Press F5 or click on create button

Recording name

Enter Tcode SE11

Press enter or click on start recording

Now u r directed to the following screen

Click on Contents

Here one more thing u have to remember is each and every step u have done will be recorded and at last that will be reflected in your coding also. If u had made any small mistake while recording it will effected while upload also. So be careful

Enter a new name and number and save it

Go back until u get back to recording program lines

Save here and come back to your recording initial screen

Select ur recording

After selecting your recording click on Program button or press Shift + F5

Give ur program name

Select radio button Transfer from recording then press enter

Fill ur attributes and click on Source code

A code will be generated automatically you just have to declare the internal table and all the required fields

Declare ur internal table

data : begin of itab occurs 0, empno like zbdc_sunitha-empno, name like zbdc_sunitha-empname, end of itab.

Call the function upload

Uncomment the wanted lines and fill with necessary information

complete coding part

report ZSUN_BDC no standard page heading line-size 255.

include bdcrecx1.

data : begin of itab occurs 0, empno like zbdc_sunitha-empno, name like zbdc_sunitha-empname, end of itab.

start-of-selection.

CALL FUNCTION 'UPLOAD' EXPORTING* CODEPAGE = ' ' FILENAME = 'C:\TEST.TXT' FILETYPE = 'DAT'* ITEM = ' '* FILEMASK_MASK = ' '* FILEMASK_TEXT = ' '* FILETYPE_NO_CHANGE = ' '* FILEMASK_ALL = ' '* FILETYPE_NO_SHOW = ' '

Like this loop repeats until the data is completed

* LINE_EXIT = ' '* USER_FORM = ' '* USER_PROG = ' '* SILENT = 'S'* IMPORTING* FILESIZE =* CANCEL =* ACT_FILENAME =* ACT_FILETYPE = TABLES DATA_TAB = itab* 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.

perform open_group.

loop at itab.

perform bdc_dynpro using 'SAPMSRD0' '0102'.perform bdc_field using 'BDC_CURSOR' 'RSRD1-TBMA_VAL'.perform bdc_field using 'BDC_OKCODE' '=SHOW'.perform bdc_field using 'RSRD1-TBMA' 'X'.perform bdc_field using 'RSRD1-TBMA_VAL' 'ZBDC_SUNITHA'.perform bdc_dynpro using 'SAPLSD41' '2200'.perform bdc_field using 'BDC_OKCODE' '=TDSH'.perform bdc_field using 'BDC_CURSOR' 'DD03D-ROLLNAME(01)'.perform bdc_dynpro using '/1BCDWB/DBZBDC_SUNITHA' '1000'.perform bdc_field using 'BDC_CURSOR' 'I2-LOW'.perform bdc_field using 'BDC_OKCODE' '=SPOS'.perform bdc_field using 'I1-LOW'* ' 1211'. itab-empno.perform bdc_field using 'I2-LOW'* 'SUNITHA'. itab-name.perform bdc_field using 'LIST_BRE' ' 250'.perform bdc_field using 'MAX_SEL' ' 1,000'.perform bdc_dynpro using 'SAPMSSY0' '0120'.perform bdc_field using 'BDC_OKCODE'

'/ELEAV'.perform bdc_field using 'BDC_CURSOR' '02/42'.perform bdc_dynpro using '/1BCDWB/DBZBDC_SUNITHA' '1000'.perform bdc_field using 'BDC_OKCODE' '/EE'.perform bdc_field using 'BDC_CURSOR' 'I2-LOW'.perform bdc_dynpro using 'SAPLSD41' '2200'.perform bdc_field using 'BDC_OKCODE' '=WB_BACK'.perform bdc_field using 'BDC_CURSOR' 'DD03D-ROLLNAME(01)'.perform bdc_dynpro using 'SAPMSRD0' '0102'.perform bdc_field using 'BDC_CURSOR' 'RSRD1-TBMA_VAL'.perform bdc_field using 'BDC_OKCODE' '=BACK'.perform bdc_field using 'RSRD1-TBMA' 'X'.perform bdc_field using 'RSRD1-TBMA_VAL' 'ZBDC_SUNITHA'.perform bdc_transaction using 'SE11'.

endloop.

perform close_group.