Skip to Content

bdc

Hi all

I want to know t-codes that we can upload through bdc using call-transaction

& session methods.

T-codes that can be uploded by bdc control table ?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2007 at 03:10 AM

    hi,

    try

    XKO1- vendor master

    xdo1-customer master

    mm01-material master

    xk01 is very easy try it.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member abap fighter

      How can I upload vendor master excel file to sap table?

      Check this code to upload vendor master through SHDB transaction.

      report ZVEND_MST no standard page heading line-size

      255.

      *include bdcrecx1.

      *parameters: dataset(132) lower case default

      'c:\vend.mst'.

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

              data: begin of record,

              • data element: LIF16

              LIFNR_001(016),

              • data element: BUKRS

              BUKRS_002(004),

              • data element: EKORG

              EKORG_003(004),

              • data element: KTOKK

              KTOKK_004(004),

              • data element: NAME1_GP

              NAME1_005(035),

              • data element: SORTL

              SORTL_006(010),

              • data element: LAND1_GP

              LAND1_007(003),

              • data element: SPRAS

              SPRAS_008(002),

              • data element: BSTWA

              WAERS_009(005),

              end of record.

                  • End generated data section ***

                  DATA : ITAB TABLE OF RECORD WITH HEADER LINE.

                  start-of-selection.

                  *perform open_dataset using dataset.

                  *perform open_group.

                  *

                  *do.

                  *

                  *read dataset dataset into record.

                  *if sy-subrc <> 0. exit. endif.

                  CALL FUNCTION 'GUI_UPLOAD'

                  EXPORTING

                  FILENAME = 'C:\VENDOR.TXT'

                  "TEXT FILE

                  FILETYPE = 'ASC'

                  HAS_FIELD_SEPARATOR = 'X'

                  TABLES

                  DATA_TAB = ITAB

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

                  *In Loop Change Record With ITAB

                  • like record-lifnr_001 with itab-lifnr_001

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

                  record-LIFNR_001.

                  perform bdc_field using 'RF02K-BUKRS'

                  record-BUKRS_002.

                  perform bdc_field using 'RF02K-EKORG'

                  record-EKORG_003.

                  perform bdc_field using 'RF02K-KTOKK'

                  record-KTOKK_004.

                  perform bdc_dynpro using 'SAPMF02K' '0110'.

                  perform bdc_field using 'BDC_CURSOR'

                  'LFA1-SPRAS'.

                  perform bdc_field using 'BDC_OKCODE'

                  '/00'.

                  perform bdc_field using 'LFA1-NAME1'

                  record-NAME1_005.

                  perform bdc_field using 'LFA1-SORTL'

                  record-SORTL_006.

                  perform bdc_field using 'LFA1-LAND1'

                  record-LAND1_007.

                  perform bdc_field using 'LFA1-SPRAS'

                  record-SPRAS_008.

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

                  perform bdc_field using 'BDC_CURSOR'

                  'LFB1-AKONT'.

                  perform bdc_field using 'BDC_OKCODE'

                  '/00'.

                  perform bdc_dynpro using 'SAPMF02K' '0215'.

                  perform bdc_field using 'BDC_CURSOR'

                  'LFB1-ZTERM'.

                  perform bdc_field using 'BDC_OKCODE'

                  '/00'.

                  perform bdc_dynpro using 'SAPMF02K' '0220'.

                  perform bdc_field using 'BDC_CURSOR'

                  'LFB5-MAHNA'.

                  perform bdc_field using 'BDC_OKCODE'

                  '/00'.

                  perform bdc_dynpro using 'SAPMF02K' '0310'.

                  perform bdc_field using 'BDC_CURSOR'

                  'LFM1-WAERS'.

                  perform bdc_field using 'BDC_OKCODE'

                  '/00'.

                  perform bdc_field using 'LFM1-WAERS'

                  record-WAERS_009.

                  perform bdc_dynpro using 'SAPMF02K' '0320'.

                  perform bdc_field using 'BDC_CURSOR'

                  'RF02K-LIFNR'.

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

                  endLOOP..

                  regards,

                  srinivas

              • author's profile photo Former Member
                Former Member
                Posted on Sep 05, 2007 at 02:38 AM

                You can use :

                sales order - VA01

                Purchase order - ME21

                Delivery - VL01

                Shippment - VT01

                vendor - Xk01 -. ank dbetails

                Thanks

                Seshu

                Add a comment
                10|10000 characters needed characters exceeded

              • Posted on Sep 05, 2007 at 04:06 AM

                Hi

                Almost all Tcodes will have the requirement to upload the data using Table control.

                Most importantly in Transaction Data like Sales orders (VA01) Purchase Orders (ME21),

                Purchase requisitions (ME51) the line items are entered in Table control.

                <b>Reward if helpful</b>

                Add a comment
                10|10000 characters needed characters exceeded

              • author's profile photo Former Member
                Former Member
                Posted on Sep 05, 2007 at 04:29 AM

                Hi,

                All the tcodes related to master can be used for for BDC. Many of the transaction data can also apply the same. You can get lots of sample coding for call transaction & session.

                <b>Check this sample table control bdc</b>

                <b>Table Control - BDC</b>

                DATA : BEGIN OF IT_DUMMY OCCURS 0,

                DUMMY(100) TYPE C,

                END OF IT_DUMMY.

                DATA : BEGIN OF IT_XK01 OCCURS 0,

                LIFNR(10) TYPE C,

                BUKRS(4) TYPE C,

                EKORG(4) TYPE C,

                KTOKK(4) TYPE C,

                NAME1(30) TYPE C,

                SORTL(10) TYPE C,

                LAND1(3) TYPE C,

                SPRAS(2) TYPE C,

                AKONT(6) TYPE C,

                FDGRV(2) TYPE C,

                WAERS(3) TYPE C,

                END OF IT_XK01,

                BEGIN OF IT_BANK OCCURS 0,

                BANKS(3) TYPE C,

                BANKL(10) TYPE C,

                BANKN(10) TYPE C,

                KOINH(30) TYPE C,

                LIFNR(10) TYPE C,

                END OF IT_BANK.

                DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,

                IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

                CALL FUNCTION 'WS_UPLOAD'

                EXPORTING

                FILENAME = 'C:\VENDOR.TXT'

                FILETYPE = 'ASC'

                TABLES

                DATA_TAB = IT_DUMMY.

                LOOP AT IT_DUMMY.

                IF IT_DUMMY-DUMMY+0(2) = '11'.

                IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).

                IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).

                IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).

                IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).

                IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).

                IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).

                IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).

                IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).

                IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).

                IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).

                IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).

                APPEND IT_XK01.

                ELSE.

                IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).

                IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).

                IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).

                IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).

                IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).

                APPEND IT_BANK.

                ENDIF.

                ENDLOOP.

                LOOP AT IT_XK01.

                REFRESH IT_BDCDATA.

                perform bdc_dynpro using 'SAPMF02K' '0100'.

                perform bdc_field using 'BDC_CURSOR'

                'RF02K-REF_LIFNR'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_field using 'RF02K-LIFNR'

                IT_XK01-LIFNR.

                perform bdc_field using 'RF02K-BUKRS'

                IT_XK01-BUKRS.

                perform bdc_field using 'RF02K-EKORG'

                IT_XK01-EKORG.

                perform bdc_field using 'RF02K-KTOKK'

                IT_XK01-KTOKK.

                perform bdc_dynpro using 'SAPMF02K' '0110'.

                perform bdc_field using 'BDC_CURSOR'

                'LFA1-TELX1'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_field using 'LFA1-NAME1'

                IT_XK01-NAME1.

                perform bdc_field using 'LFA1-SORTL'

                IT_XK01-SORTL.

                perform bdc_field using 'LFA1-LAND1'

                IT_XK01-LAND1.

                perform bdc_field using 'LFA1-SPRAS'

                IT_XK01-SPRAS.

                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-KOINH(02)'.

                perform bdc_field using 'BDC_OKCODE'

                '=ENTR'.

                DATA : FNAM(20) TYPE C,

                IDX TYPE C.

                MOVE 1 TO IDX.

                LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.

                CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.

                perform bdc_field using FNAM

                IT_BANK-BANKS.

                CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.

                perform bdc_field using FNAM

                IT_BANK-BANKL.

                CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.

                perform bdc_field using FNAM

                IT_BANK-BANKN.

                CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.

                perform bdc_field using FNAM

                IT_BANK-KOINH.

                IDX = IDX + 1.

                ENDLOOP.

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

                perform bdc_field using 'BDC_CURSOR'

                'LFB1-FDGRV'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_field using 'LFB1-AKONT'

                IT_XK01-AKONT.

                perform bdc_field using 'LFB1-FDGRV'

                IT_XK01-FDGRV.

                perform bdc_dynpro using 'SAPMF02K' '0215'.

                perform bdc_field using 'BDC_CURSOR'

                'LFB1-ZTERM'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_dynpro using 'SAPMF02K' '0220'.

                perform bdc_field using 'BDC_CURSOR'

                'LFB5-MAHNA'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_dynpro using 'SAPMF02K' '0310'.

                perform bdc_field using 'BDC_CURSOR'

                'LFM1-WAERS'.

                perform bdc_field using 'BDC_OKCODE'

                '/00'.

                perform bdc_field using 'LFM1-WAERS'

                IT_XK01-WAERS.

                perform bdc_dynpro using 'SAPMF02K' '0320'.

                perform bdc_field using 'BDC_CURSOR'

                'WYT3-PARVW(01)'.

                perform bdc_field using 'BDC_OKCODE'

                '=ENTR'.

                perform bdc_dynpro using 'SAPLSPO1' '0300'.

                perform bdc_field using 'BDC_OKCODE'

                '=YES'.

                CALL TRANSACTION 'XK01' USING IT_BDCDATA

                MODE 'A'

                UPDATE 'S'

                MESSAGES INTO IT_BDCMSGCOLL.

                ENDLOOP.

                FORM BDC_DYNPRO USING PROG SCR.

                CLEAR IT_BDCDATA.

                IT_BDCDATA-PROGRAM = PROG.

                IT_BDCDATA-DYNPRO = SCR.

                IT_BDCDATA-DYNBEGIN = 'X'.

                APPEND IT_BDCDATA.

                ENDFORM.

                FORM BDC_FIELD USING FNAM FVAL.

                CLEAR IT_BDCDATA.

                IT_BDCDATA-FNAM = FNAM.

                IT_BDCDATA-FVAL = FVAL.

                APPEND IT_BDCDATA.

                ENDFORM.

                <b>Reward Points if Useful</b>

                Regards

                Gokul

                Add a comment
                10|10000 characters needed characters exceeded

              • author's profile photo Former Member
                Former Member
                Posted on Sep 07, 2007 at 09:33 AM

                Hi i will tell u how recording BDC for MM01 ,

                Goto Tcode SHDB ,

                Click on New Recording ,

                Give The Recording Name and Tranction Code For which U have to write BDC Suppose MM01 for ur Requirtment ,

                Click on Start Recoding ,

                Give the value :

                Material: 01ABC.

                Industry Sector:Food & Related Product,

                Material Type : Finished Product ,

                One this kept in ur mind when ever u recorded a BDC First u see Industry Sector and Material type Should be Match other wish i will give error .

                After Giving Three Fields in First Screen Press Select Views

                Choose Basic Data1 and Basic Data2 then press continue button .

                In Third Screen give the Material Description : meal.

                unit of measured : BT Then Press save buttom .again save and back

                Select the recoding name click on program and give the program name then continue ,

                Plz carefully this BDC code For MM01 given bellow...............................

                REPORT zm_mm01_bdc NO STANDARD PAGE HEADING LINE-SIZE 255.

                DATA: ibdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

                DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

                DATA: message(255).

                DATA: BEGIN OF ITAB OCCURS 0,

                MATNR TYPE MARA-MATNR,

                MBRSH TYPE MARA-MBRSH,

                MTART TYPE MARA-MTART,

                END OF ITAB.

                CALL FUNCTION 'UPLOAD'

                EXPORTING

                filename = ' '

                filetype = ' '

                • has_field_separator = 'X'

                TABLES

                data_tab = itab.

                • DESCRIBE TABLE itab LINES lines1.

                • WRITE : / lines1 , 'REcords uploaded' .

                START-OF-SELECTION.

                LOOP AT ITAB.

                REFRESH IBDCDATA.

                PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'RMMG1-MTART'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '/00'.

                PERFORM bdc_field USING 'RMMG1-MATNR'

                ITAB-MATNR.

                PERFORM bdc_field USING 'RMMG1-MBRSH'

                ITAB-MBRSH.

                PERFORM bdc_field USING 'RMMG1-MTART'

                ITAB-MTART.

                PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'MSICHTAUSW-DYTXT(02)'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=ENTR'.

                PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'

                'X'.

                PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'

                'X'.

                PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '/00'.

                PERFORM bdc_field USING 'MAKT-MAKTX'

                'TEST MATERIAL'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'MARA-MEINS'.

                PERFORM bdc_field USING 'MARA-MEINS'

                'EA'.

                PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=BU'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'MAKT-MAKTX'.

                PERFORM bdc_field USING 'MAKT-MAKTX'

                'TEST MATERIAL'.

                CALL TRANSACTION 'MM01'

                USING ibdcdata

                UPDATE 'A'

                MODE 'E'

                MESSAGES INTO messtab.

                ENDLOOP.

                IF NOT messtab[] IS INITIAL.

                LOOP AT messtab.

                CALL FUNCTION 'FORMAT_MESSAGE'

                EXPORTING

                id = messtab-msgid

                lang = messtab-msgspra

                no = messtab-msgnr

                IMPORTING

                msg = message

                EXCEPTIONS

                not_found = 1

                OTHERS = 2.

                ENDLOOP.

                ENDIF.

                ----


                • Start new screen *

                ----


                FORM bdc_dynpro USING program dynpro.

                CLEAR ibdcdata.

                ibdcdata-program = program.

                ibdcdata-dynpro = dynpro.

                ibdcdata-dynbegin = 'X'.

                APPEND ibdcdata.

                ENDFORM. "BDC_DYNPRO

                ----


                • Insert field *

                ----


                FORM bdc_field USING fnam fval.

                CLEAR ibdcdata.

                ibdcdata-fnam = fnam.

                ibdcdata-fval = fval.

                APPEND ibdcdata.

                ENDFORM. "BDC_FIELD

                __________________________________________________

                This BDC For AS01

                ____________________________________________________

                BDC For : AS02: Asset Initial ,

                TRICK-HOW TO RECORDING THAT TCODE-AS02

                GO TO TOCDE-AS02

                ASSET-130000007

                SUBNUMBER-0

                COMPNAY CODE-7000

                CLICK

                NEXT SCREEN CLICK TIME-DEPENDATNT

                SCROLL-DOWM CLICK ON MORE INTERVAL

                THEN CLICK ON ADD-INTERVAL-FOR-DATE NEW INTERVAL-01.02.2006

                SHIFT-FACTOR-1.2(CHANGE)-BACK

                CLICK ON DEPREC.AREA

                DOUBLE CLICK ON DEPREC.AREA

                IN NEXT SCREEN-GIVE VARIABLE DEP.PORTION-500.000

                SAVE-BACK.

                Program:

                REPORT z_asset_shift4

                NO STANDARD PAGE HEADING LINE-SIZE 255.

                • INTERNAL TABLE DECLARATION***************************

                DATA : BEGIN OF itab OCCURS 0,

                anln1 TYPE anla-anln1,

                anln2 TYPE anla-anln2,

                bukrs TYPE anla-bukrs,

                adatu(10) TYPE C ,

                msfak(3) TYPE C ,

                aprop(7) TYPE C,

                END OF itab.

                **********END OF INTERNAL TABLE DECLARATION*****************

                DATA: filename LIKE ibipparms-path,

                path TYPE string,

                user_action TYPE i.

                INCLUDE bdcrecx1.

                START-OF-SELECTION.

                • MOVE p_file TO x_file.

                CALL FUNCTION 'F4_FILENAME' "Prompts for filepath

                EXPORTING

                program_name = syst-cprog

                dynpro_number = syst-dynnr

                IMPORTING

                file_name = filename.

                path = filename.

                CALL FUNCTION 'GUI_UPLOAD' "Uploads Data into internal table common

                EXPORTING

                filename = path

                filetype = 'ASC'

                has_field_separator = 'X'

                TABLES

                data_tab = itab.

                IF sy-subrc <> 0.

                ENDIF.

                PERFORM open_group.

                LOOP AT itab .

                REFRESH bdcdata.

                CLEAR bdcdata.

                PERFORM bdc_dynpro USING 'SAPLAIST' '0100'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLA-ANLN1'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=MAST'.

                PERFORM bdc_field USING 'ANLA-ANLN1'

                itab-anln1.

                PERFORM bdc_field USING 'ANLA-ANLN2'

                itab-anln2.

                PERFORM bdc_field USING 'ANLA-BUKRS'

                itab-bukrs.

                PERFORM bdc_dynpro USING 'SAPLAIST' '1000'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=TAB02'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLA-TXT50'.

                • PERFORM bdc_field USING 'ANLA-TXT50'

                • 'Attendance Recorder B/1/393/'.

                • PERFORM bdc_field USING 'ANLA-TXA50'

                • 'Attendance Recorder B/1/393/'.

                • PERFORM bdc_field USING 'ANLH-ANLHTXT'

                • 'Attendance Recorder B/1/393/'.

                • PERFORM bdc_field USING 'ANLA-INVNR'

                • 'FO340N0001'.

                • PERFORM bdc_field USING 'RA02S-XHIST'

                • 'X'.

                PERFORM bdc_dynpro USING 'SAPLAIST' '1000'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=TIME'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLZ-KOSTL'.

                • PERFORM bdc_field USING 'ANLZ-KOSTL'

                • '7001-053'.

                • PERFORM bdc_field USING 'ANLZ-WERKS'

                • '7001'.

                • PERFORM bdc_field USING 'ANLZ-STORT'

                • 'MBE423'.

                • PERFORM bdc_field USING 'ANLZ-MSFAK'

                • '1.50'.

                PERFORM bdc_dynpro USING 'SAPLAIST' '3000'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=CINV'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLA-ANLN1'.

                PERFORM bdc_dynpro USING 'SAPLAIST' '3010'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLZ-ADATU'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=ENTE'.

                PERFORM bdc_field USING 'ANLZ-ADATU'

                itab-adatu.

                PERFORM bdc_dynpro USING 'SAPLAIST' '3000'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLZ-MSFAK(01)'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=RW'.

                PERFORM bdc_field USING 'ANLZ-MSFAK(01)'

                itab-msfak.

                PERFORM bdc_dynpro USING 'SAPLAIST' '1000'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=TAB08'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLZ-KOSTL'.

                • PERFORM bdc_field USING 'ANLZ-KOSTL'

                • '7001-053'.

                • PERFORM bdc_field USING 'ANLZ-WERKS'

                • '7001'.

                • PERFORM bdc_field USING 'ANLZ-STORT'

                • 'MBE423'.

                • PERFORM bdc_field USING 'ANLZ-MSFAK'

                • '1.50'.

                PERFORM bdc_dynpro USING 'SAPLAIST' '1000'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=SELZ'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'T093T-AFBKTX(01)'.

                PERFORM bdc_dynpro USING 'SAPLAIST' '0195'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'ANLB-APROP'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=BUCH'.

                • PERFORM bdc_field USING 'ANLB-AFASL'

                • '0475'.

                • PERFORM bdc_field USING 'ANLB-NDJAR'

                • ' 99'.

                • PERFORM bdc_field USING 'ANLC-NDABJ'

                • ' 10'.

                • PERFORM bdc_field USING 'ANLC-NDABP'

                • '241'.

                • PERFORM bdc_field USING 'ANLB-AFABG'

                • '04.08.1995'.

                PERFORM bdc_field USING 'ANLB-APROP'

                itab-aprop.

                PERFORM bdc_transaction USING 'AS02'.

                ENDLOOP .

                PERFORM close_group.

                ___________________________________________

                This Is the BDC For XK01

                ____________________________________________

                REPORT zn_bdc_vendorcreation NO STANDARD PAGE HEADING LINE-SIZE 255.

                DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

                START-OF-SELECTION.

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

                '4'.

                PERFORM bdc_field USING 'RF02K-BUKRS'

                '1000'.

                PERFORM bdc_field USING 'RF02K-EKORG'

                '1000'.

                PERFORM bdc_field USING 'RF02K-KTOKK'

                '0001'.

                PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'LFA1-TELFX'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=UPDA'.

                PERFORM bdc_field USING 'LFA1-ANRED'

                'Ms'.

                PERFORM bdc_field USING 'LFA1-NAME1'

                'Keerthi Kamath'.

                PERFORM bdc_field USING 'LFA1-SORTL'

                'VKM'.

                PERFORM bdc_field USING 'LFA1-STRAS'

                'ricmond road'.

                PERFORM bdc_field USING 'LFA1-PFACH'

                ''.

                PERFORM bdc_field USING 'LFA1-ORT01'

                'bangalore'.

                PERFORM bdc_field USING 'LFA1-PSTLZ'

                '560001'.

                PERFORM bdc_field USING 'LFA1-ORT02'

                'bangalore'.

                PERFORM bdc_field USING 'LFA1-LAND1'

                'IN'.

                PERFORM bdc_field USING 'LFA1-SPRAS'

                'en'.

                PERFORM bdc_field USING 'LFA1-TELF1'

                '24356785'.

                PERFORM bdc_field USING 'LFA1-TELFX'

                '65467509'.

                PERFORM bdc_dynpro USING 'SAPMF02K' '0210'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'LFB1-FDGRV'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=UPDA'.

                PERFORM bdc_field USING 'LFB1-AKONT'

                '31000'.

                PERFORM bdc_field USING 'LFB1-FDGRV'

                'A1'.

                PERFORM bdc_dynpro USING 'SAPMF02K' '0310'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'LFM1-WAERS'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=UPDA'.

                PERFORM bdc_field USING 'LFM1-WAERS'

                'INR'.

                CALL TRANSACTION 'XK01'

                USING bdcdata

                UPDATE 'A'

                MODE 'A' .

                ----


                • Start new screen *

                ----


                FORM bdc_dynpro USING program dynpro.

                CLEAR bdcdata.

                bdcdata-program = program.

                bdcdata-dynpro = dynpro.

                bdcdata-dynbegin = 'X'.

                APPEND bdcdata.

                ENDFORM. "BDC_DYNPRO

                ----


                • Insert field *

                ----


                FORM bdc_field USING fnam fval.

                CLEAR bdcdata.

                bdcdata-fnam = fnam.

                bdcdata-fval = fval.

                APPEND bdcdata.

                ENDFORM. "BDC_FIELD

                ________________________________________________

                This Is The BDC for ME52

                _________________________________________________

                REPORT zpurcloseing

                NO STANDARD PAGE HEADING LINE-SIZE 255.

                DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

                DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

                DATA: x_file TYPE string.

                • INTERNAL TABLE DECLARATION***************************

                DATA : BEGIN OF itab OCCURS 0,

                banfn TYPE eban-banfn,

                ebakz TYPE eban-ebakz,

                menge TYPE eban-menge,

                ekgrp TYPE eban-ekgrp ,

                dispo TYPE eban-dispo,

                frgdt TYPE eban-frgdt ,

                webaz TYPE eban-webaz,

                preis TYPE eban-preis ,

                waers TYPE eban-waers ,

                peinh TYPE eban-peinh,

                repos TYPE eban-repos ,

                ekorg TYPE eban-ekorg,

                END OF itab.

                **********END OF INTERNAL TABLE DECLARATION*****************

                PARAMETERS : p_file TYPE rlgrap-filename OBLIGATORY.

                AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

                PERFORM f4_help.

                *include bdcrecx1.

                START-OF-SELECTION.

                MOVE p_file TO x_file.

                CALL FUNCTION 'GUI_UPLOAD'

                EXPORTING

                filename = x_file

                filetype = 'ASC'

                has_field_separator = 'X'

                TABLES

                data_tab = itab

                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.

                WRITE:/ 'internal table not populated ' .

                ENDIF.

                • PERFORM open_group.

                LOOP AT itab.

                REFRESH bdcdata.

                CLEAR bdcdata.

                PERFORM bdc_dynpro USING 'SAPMM06B' '0105'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'EBAN-BANFN'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '/00'.

                PERFORM bdc_field USING 'EBAN-BANFN'

                itab-banfn.

                PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'RM06B-BNFPO'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '/00'.

                PERFORM bdc_field USING 'RM06B-BNFPO'

                '10'.

                PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'RM06B-BNFPO'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '/00'.

                PERFORM bdc_field USING 'RM06B-BNFPO'

                '10'.

                PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'EBAN-BNFPO(01)'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=DETA'.

                PERFORM bdc_field USING 'RM06B-BNFPO'

                '10'.

                PERFORM bdc_field USING 'RM06B-TCSELFLAG(01)'

                'X'.

                PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.

                PERFORM bdc_field USING 'BDC_CURSOR'

                'EBAN-EBAKZ'.

                PERFORM bdc_field USING 'BDC_OKCODE'

                '=BU'.

                PERFORM bdc_field USING 'EBAN-TXZ01'

                'HMHD Liner 22"x36"x100gm'.

                PERFORM bdc_field USING 'EBAN-MENGE'

                itab-menge.

                PERFORM bdc_field USING 'RM06B-EEIND'

                '09.04.2006'.

                PERFORM bdc_field USING 'RM06B-LPEIN'

                'D'.

                PERFORM bdc_field USING 'EBAN-EKGRP'

                itab-ekgrp.

                PERFORM bdc_field USING 'EBAN-DISPO'

                itab-dispo.

                PERFORM bdc_field USING 'EBAN-FRGDT'

                itab-frgdt.

                PERFORM bdc_field USING 'EBAN-WEBAZ'

                itab-webaz.

                PERFORM bdc_field USING 'EBAN-EBAKZ'

                itab-ebakz.

                PERFORM bdc_field USING 'EBAN-PREIS'

                itab-preis.

                PERFORM bdc_field USING 'EBAN-WAERS'

                itab-waers.

                PERFORM bdc_field USING 'EBAN-PEINH'

                itab-peinh.

                PERFORM bdc_field USING 'EBAN-REPOS'

                itab-repos.

                PERFORM bdc_field USING 'EBAN-EKORG'

                itab-ekorg.

                CALL TRANSACTION 'ME52' USING bdcdata

                MODE 'A'

                UPDATE 'S'

                MESSAGES INTO messtab.

                • PERFORM bdc_transaction USING 'ME52'.

                • PERFORM close_group.

                ENDLOOP .

                ----


                • Start new screen

                *

                ----


                FORM bdc_dynpro USING program dynpro.

                CLEAR bdcdata.

                bdcdata-program = program.

                bdcdata-dynpro = dynpro.

                bdcdata-dynbegin = 'X'.

                APPEND bdcdata.

                ENDFORM. "bdc_dynpro

                ----


                • Insert field *

                ----


                FORM bdc_field USING fnam fval.

                CLEAR bdcdata.

                bdcdata-fnam = fnam.

                bdcdata-fval = fval.

                APPEND bdcdata.

                ENDFORM. "BDC_FIELD

                &----


                *& Form f4_help

                &----


                • text

                ----


                • --> p1 text

                • <-- p2 text

                ----


                FORM f4_help .

                CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

                CHANGING

                file_name = p_file

                EXCEPTIONS

                mask_too_long = 1

                OTHERS = 2.

                .

                IF sy-subrc <> 0.

                WRITE:/ 'FILE NAME NOT FOUND '.

                ENDIF.

                ENDFORM.

                <b>Thanks.

                Nihar Swain.</b>

                Add a comment
                10|10000 characters needed characters exceeded

              • author's profile photo Former Member
                Former Member
                Posted on Sep 20, 2007 at 06:45 AM

                please help me in recording and code for AS01(Asset master) by session method

                Add a comment
                10|10000 characters needed characters exceeded

              Before answering

              You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
              You must be Logged in to submit an answer.

              Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.