8 Replies Latest reply: Jun 5, 2007 9:34 AM by soumya nagaraj RSS

FK01

kanny d m
Currently Being Moderated

HI ALL

   CAN ANYBODY TELL ME FIELDS IN FK01 WHILE RUNNING A BDC?

 

 

 

  THANKS & REGARDS

  • Re: FK01
    anitha averneni
    Currently Being Moderated

    Hi,

     

    Can you be bit clear, what fields you want for BDC.

    For doing BDC- do the Recording, you will know the field names.

     

     

    Thanks,

    Anitha

  • Re: FK01
    Currently Being Moderated

    hi,

         your code is like this.

    use this code in ur program

    You can code like ,

     

    DATA: ok_code LIKE sy-ucomm,

    BDCDATA TYPE TABLE OF BDCDATA,

    WA_BDCDATA TYPE BDCDATA.

     

    *Accountgroup

    WA_BDCDATA-PROGRAM = 'SAPMF02K'.

    WA_BDCDATA-DYNPRO = '0105'.

    WA_BDCDATA-DYNBEGIN = 'X'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    WA_BDCDATA-FNAM = 'RF02K-KTOKK'.

    WA_BDCDATA-FVAL = 'ZHRO'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    *Leverandør

    WA_BDCDATA-FNAM = 'RF02K-LIFNR'.

    WA_BDCDATA-FVAL = '1115'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

    *Firmakode

    WA_BDCDATA-FNAM = 'RF02K-BUKRS'.

    WA_BDCDATA-FVAL = '1000'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    • Name

    WA_BDCDATA-PROGRAM = 'SAPMF02K'.

    WA_BDCDATA-DYNPRO = '111'. "v

    WA_BDCDATA-DYNBEGIN = 'X'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    WA_BDCDATA-FNAM = 'ADDR1_DATA-NAME1'.

    WA_BDCDATA-FVAL = 'Shou'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    *Search Term

    WA_BDCDATA-FNAM = 'ADDR1_DATA-SORT1'.

    WA_BDCDATA-FVAL = 'Shou'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    • VendorName

    WA_BDCDATA-PROGRAM = 'SAPMF02K'.

    WA_BDCDATA-DYNPRO = '0110'.

    WA_BDCDATA-DYNBEGIN = 'X'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    WA_BDCDATA-FNAM = 'LFA1-Name1'.

    WA_BDCDATA-FVAL = 'Shou'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    • Sort Key

    WA_BDCDATA-FNAM = 'LFA1-SORTL'.

    WA_BDCDATA-FVAL = 'Shou'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    • Language Key

    WA_BDCDATA-FNAM = 'LFA1-SPRAS'.

    WA_BDCDATA-FVAL = 'DA'.

    APPEND WA_BDCDATA TO BDCDATA.

    CLEAR WA_BDCDATA.

     

    Call Transaction 'FK01' using BDCDATA.

     

    ENDFUNCTION.

     

     

    *Reward points

     

    Regards

     

  • Re: FK01
    naveen kumar
    Currently Being Moderated

    This transaction hits so many tables that's why it is good to record this transaction with SD transaction then you will get to know which tables which tables.

  • Re: FK01
    Mayank Agarwal
    Currently Being Moderated

    Following are some of the screen name, screen number & fieds that are hit while performing BDC on FK01

     

                                                          T     FK01

    SAPMF02K     0105     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

                                                                RF02K-LIFNR

                                                                RF02K-BUKRS

                                                                RF02K-KTOKK

    SAPMF02K     0110     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

                                                                LFA1-ANRED

                                                                LFA1-NAME1

                                                                LFA1-SORTL

                                                                LFA1-LAND1

                                                                LFA1-SPRAS

    SAPMF02K     0120     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

                                                                BDC_SUBSCR

    SAPMF02K     0130     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

    SAPMF02K     0210     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

                                                                LFB1-AKONT

                                                                LFB1-ZUAWA

                                                                LFB1-FDGRV

    SAPMF02K     0215     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

                                                                LFB1-ZTERM

                                                                LFB1-REPRF

                                                                LFB1-KULTG

                                                                LFB1-ZWELS

    SAPMF02K     0220     X                                                                               

    BDC_CURSOR

                                                                BDC_OKCODE

    SAPMF02K     0610     X                                                                               

    BDC_OKCODE

                                                                BDC_SUBSCR

                                                                BDC_CURSOR

     

    Please reward points if found helpful

    Thanks

  • Re: FK01
    Currently Being Moderated

    the  below  program is the table control   bdc  of thE FK01  with  all mandatory fields....

     

    report ZSDN_BDC_TBLCTRL
           no standard page heading line-size 255.
    *
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record occurs 0,
    * data element: LIF16
            LIFNR_001(016),
    * data element: BUKRS
            BUKRS_002(004),
    * data element: KTOKK
            KTOKK_003(004),
    * data element: ANRED
            ANRED_004(015),
    * data element: NAME1_GP
            NAME1_005(035),
    * data element: SORTL
            SORTL_006(010),
    * data element: LAND1_GP
            LAND1_007(003),
    * data element: KUNNR
            KUNNR_008(010),
    * data element: BANKS
            BANKS_01_009(003),
    * data element: BANKK
            BANKL_01_011(015),
    * data element: BANKN
            BANKN_01_013(018),
    * data element: AKONT
            AKONT_015(010),
    * data element: FDGRV
            FDGRV_016(010),
          end of record,
     
          it_bdc type bdcdata occurs 0 with header line,
          it_msg type bdcmsgcoll occurs 0 with header line.
    data: v_bankl(14), v_banks(14), v_bankn(14).
    data: v_numc(2) type n, lv_tabix like sy-tabix.
    *** End generated data section ***
     
    start-of-selection.
     
    perform upload_data.
    loop at record.
    lv_tabix = sy-tabix.
     
    at new lifnr_001.
      read table record index lv_tabix.
      clear v_numc.
     clear : it_bdc, it_bdc[], it_msg, it_msg[].
     
    perform bdc_dynpro      using 'SAPMF02K' '0105'.
    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-KTOKK'
                                  record-KTOKK_003.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-LAND1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-ANRED'
                                  record-ANRED_004.
    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_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-KUNNR'
                                  record-KUNNR_008.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKN(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
     
    endat.
    v_numc = v_numc + 1.
     
    concatenate 'LFBK-BANKS(' v_numc ')' into v_banks.
    concatenate 'LFBK-BANKL(' v_numc ')' into v_bankl.
    concatenate 'LFBK-BANKN(' v_numc ')' into v_bankn.
     
    perform bdc_field       using v_banks
                                  record-BANKS_01_009.
     
    perform bdc_field       using v_bankl
                                  record-BANKL_01_011.
     
    perform bdc_field       using v_bankn
                                  record-BANKN_01_013.
     
    at end of lifnr_001.
      read table record index lv_tabix.
    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'
                                  '=UPDA'.
    perform bdc_field       using 'LFB1-AKONT'
                                  record-AKONT_015.
    perform bdc_field       using 'LFB1-FDGRV'
                                  record-FDGRV_016.
    *perform bdc_transaction using 'FK01'.
     
    call transaction 'FK01' using it_bdc mode 'A' update 'S' messages into
    it_msg.
    endat.
    endloop.
    *&---------------------------------------------------------------------*
    *&      Form  upload_data
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM upload_data .
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'C:CALLT.TXT'
    *   FILETYPE                      = 'ASC'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    = FILELENGTH
    *   HEADER                        = HEADER
      TABLES
        DATA_TAB                      = record
    * 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.
     
    ENDFORM.                    " upload_data
     
    *----------------------------------------------------------------------*
    *        Start new screen                                              *
    *----------------------------------------------------------------------*
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR it_bdc.
      it_bdc-PROGRAM  = PROGRAM.
      it_bdc-DYNPRO   = DYNPRO.
      it_bdc-DYNBEGIN = 'X'.
      APPEND it_bdc.
    ENDFORM.
     
    *----------------------------------------------------------------------*
    *        Insert field                                                  *
    *----------------------------------------------------------------------*
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> ' '.
        CLEAR it_bdc.
        it_bdc-FNAM = FNAM.
        it_bdc-FVAL = FVAL.
        APPEND it_bdc.
      ENDIF.
    ENDFORM.
    *&---------------------------------------------------------------------*
    *&      Form  format_msg
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM format_msg .
     
      data: lv_str type string.
     
      loop at it_msg.
        clear lv_str.
      CALL FUNCTION 'FORMAT_MESSAGE'
       EXPORTING
         ID              = it_msg-MSGID
         LANG            = 'EN'
         NO              = it_msg-MSGNR
         V1              = it_msg-MSGV1
         V2              = it_msg-MSGV2
         V3              = it_msg-MSGV3
         V4              = it_msg-MSGV4
       IMPORTING
         MSG             = lv_str
       EXCEPTIONS
         NOT_FOUND       = 1
         OTHERS          = 2
                .
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      else.
       write :/ lv_str.
      ENDIF.
      endloop.
     
    ENDFORM.                    " format_msg
    
    
    

    Regards

    Girish

  • Re: FK01
    maddipatla Seshadri naidu
    Currently Being Moderated

    hi kanny,

     

     

    whatever the t.code it may be,

     

    u just record that T.code through T.code <b>shdb</b> by giving dummy data in the mandatory fields,

    then transfwer this recording to <b>zreport</b>,

    in this <b>zreport</b> u can find the required fields.

     

    regards,

    seshu.

  • Re: FK01
    Chandra Sekhar
    Currently Being Moderated

    data: begin of record,

    • data element: LIF16

            LIFNR_001(016),

    • data element: BUKRS

            BUKRS_002(004),

    • data element: KTOKK

            KTOKK_003(004),

    • data element: ANRED

            ANRED_004(015),

    • data element: NAME1_GP

            NAME1_005(035),

    • data element: SORTL

            SORTL_006(010),

    • data element: LAND1_GP

            LAND1_007(003),

    • data element: AKONT

            AKONT_008(010),

     

    end of record.

     

    perform bdc_dynpro      using 'SAPMF02K' '0105'.

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

                                  record-KTOKK_003.

    perform bdc_dynpro      using 'SAPMF02K' '0110'.

    perform bdc_field       using 'BDC_CURSOR'

                                  'LFA1-LAND1'.

    perform bdc_field       using 'BDC_OKCODE'

                                  '/00'.

    perform bdc_field       using 'LFA1-ANRED'

                                  record-ANRED_004.

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

                                  '=UPDA'.

    perform bdc_dynpro      using 'SAPMF02K' '0210'.

    perform bdc_field       using 'BDC_CURSOR'

                                  'LFB1-AKONT'.

    perform bdc_field       using 'BDC_OKCODE'

                                  '/00'.

    perform bdc_field       using 'LFB1-AKONT'

                                  record-AKONT_008.

    perform bdc_transaction using 'FK01'.

  • Re: FK01
    soumya nagaraj
    Currently Being Moderated

    use the t.code shdb.click on new recording in this give transaction code as fk01.go on entering the mandatory fields.save all these and then click on program u'll get all the fields.

Actions