Select a specific view in MM02/MM01

Hi Abappers,
I am doing a BDC on MM01 transaction and want to just select the accounting view and extend materials for different valuation types. But the position of accounting view is coming different on different material and my BDC recording is failing to select the accounting view. Does anyone has any idea how we can pinpoint and select the accounting view?
Thanks,
David.

SELECTION_VIEWS_FIND  - This FM Will work depends on material type..
in your case this FM Is not required and you need to have Accounting view.
Any way See below program and you will get some idea and uploaded data into Material master change mode and it is applicable to user defined view
REPORT zjpmuim306 NO STANDARD PAGE HEADING LINE-SIZE 250 MESSAGE-ID
zjpm001.
*&   I N B O U N D  V I A   A B A P : Batch input Session method     *
*&   Development ID: IM_DD_306_LJP                                   *
*&   Report        : ZJPMUIM306                                      *
*&   The Purpose of the Object is to interface Create Input Record   *
*&   for SAP Migration from the Material master of BPCS All the      *
*&   information received at BPCS is collected into a single record. *
*&   By using session method upload data from file ,one item is
*&   created for one record                                          *
*&   Change Log:                                                     *
*&   Init       Who              Date         Text                   *
*&  MALIKDH1   Seshu Reddy    26-07-2003   Initial Version           *
                         Constants                                   *
CONSTANTS:c_vkorg(4) type c value 'JP20',        " Sales Organization
          c_vtweg(2) type c value 'TR' ,         " Distribution Channel
          c_werks(4) Type c value 'JP01' ,       " Plant
          c_viewlist(15) VALUE 'KDEALBSZXVPCFQG'," View list
          c_scm_view TYPE msichtausw-dytxt VALUE 'SCM View',
          c_sd_view TYPE msichtausw-dytxt VALUE 'SD View',
          c_seq_code(2) VALUE 'Z1',              " Sequential Code
          c_keep(1) TYPE c VALUE  'X',           " Keep
          c_group LIKE apqi-groupid VALUE 'IM306', " Session Name
          c_tcode  LIKE tstc-tcode VALUE 'MM02',  " Transaction Code
          c_blank(1) VALUE ' ',                   " Blank
          c_intls(1) VALUE 'N'.                  " Logistic Status
              Variables                                      *
DATA: g_flag1(1),  " Variable to hold
      g_flag(1),   " Variable to hold
      g_file LIKE rlgrap-filename VALUE
     'C:\Documents and Settings\seshur\Desktop\HCLT123.CSV'. " File name
       Internal tables/ Work area                           *
Internal Table for Delimter
DATA : BEGIN OF t_delim OCCURS 0,
       text(1000),
       END OF t_delim.
Internal table for BDC processing
DATA : t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Internal table for holding the data which has to be uploaded.
DATA: BEGIN OF t_bpcs OCCURS 0,
      matnr(15) TYPE c,  " material no
      dosage(40) TYPE c, " Dosage form(Local)
      appearance(40) TYPE c, " Appearance
      idcode(6) TYPE c,     " Identification Code
      prostformno(10) TYPE c, "SOP
      weitab(7) TYPE c,    " Weight/tablet
      uom1(2) TYPE c,     " UOM of Carton
      uom2(2) TYPE c,     " UOM of Case
      carsize(14) TYPE c, " Carton size
      cassize(14) TYPE c, " Case size
      rupqty(11) TYPE c,  " Round up
      abvname(3) TYPE c,  " Product short name
      END OF t_bpcs.
*Internal table for t_bpcs
DATA: BEGIN OF t_mdata OCCURS 0,
      matnr  LIKE marc-matnr, " Material number
      zzjp_dos_frm LIKE marc-zzjp_dos_frm, " Dosage form(Local)
      zzjp_aprn LIKE marc-zzjp_aprn, " Appearance
      zzjp_con_id LIKE marc-zzjp_con_id," Identification Code
      zzjp_nyu_sop LIKE marc-zzjp_nyu_sop,"SOP
      zzjp_wei_tab(10) type c , " Weight/tablet
      zzjp_bio  LIKE marc-zzjp_bio,"Biologics Indicator
      zzjp_itf LIKE marc-zzjp_itf, " ITF code
      zzjp_car(2) type c, " UOM of Carton
      zzjp_cas(2) type c, " UOM of Case
      zzjp_car_size(11) type c," Carton size
      zzjp_cas_size(11) type c, " Case size
      zzjp_rupqty(11) type c,  " Round up
      zzjp_init_ls LIKE marc-zzjp_init_ls, " Logistic Status
      zzjp_re1 LIKE marc-zzjp_re1, "Document type(Local)
      zzjp_re2 LIKE marc-zzjp_re2, "Report type
      zzjp_re3 LIKE marc-zzjp_re3, "Shipping report type
      zzjp_pro_id LIKE mvke-zzjp_pro_id," Product output sequence
      zzjp_bu_id LIKE mvke-zzjp_bu_id, " Business unit indicator
      zzjp_abv_name LIKE mvke-zzjp_abv_name," Product short name
      zzjp_abv_id1 LIKE mvke-zzjp_abv_id1," Product short name output
      zzjp_abv_id2 LIKE mvke-zzjp_abv_id2," Product short name internal
      zzjp_spl_id LIKE mvke-zzjp_spl_id,  " Sample internal order
      END OF t_mdata.
Internal table for Mara Table
DATA: BEGIN OF t_mara OCCURS 0,
      matnr LIKE mara-matnr,  " material Number
      vpsta LIKE mara-vpsta,  " Maintenance status of complete material
      pstat like mara-pstat,  " Maintenance status
      END OF t_mara.
Internal table for Material Master View Selection Screens
DATA: BEGIN OF t_bildtab OCCURS 0.
        INCLUDE STRUCTURE mbildtab.
DATA: END OF t_bildtab.
internal table for T_bildtab
DATA: t_bildtab_dup LIKE t_bildtab OCCURS 0 WITH HEADER LINE.
*Work area for T_bildtab internal table(Views Selection)
DATA: BEGIN OF w_data,
      flag1 type c,
      anzd70 TYPE i,
      field1(20) type c,
      field2(20) type c,
      field3(20) type c,
      field4(20) type c,
      count(2) TYPE c,
      END OF w_data.
            Main Processing                           *
START-OF-SELECTION.
Store data from file into internal table
  PERFORM f_uplaod_data.
Transfer the uploaded data into t_mdata internal Table
  PERFORM f_process_data.
Selecting The views based on Material number
  PERFORM f_view_list.
Open a BDC Session
  PERFORM f_bdc_open.
*Selecting the fields from mara table
  SELECT matnr
         vpsta
         pstat
    FROM mara
  INTO TABLE t_mara
  FOR ALL ENTRIES IN t_mdata
  WHERE matnr = t_mdata-matnr.
  SORT t_mara BY matnr.
  SORT t_mdata BY matnr.
Transfer the uploaded data into BDCDATA structure
  PERFORM f_process_bdc.
Close The BDC Session
  PERFORM f_close_group.
*&      Form  F_VIEW_LIST                                             *
         Routine to used for Calling the function module            *
          Selection_views_find                                      *
FORM f_view_list.
  CALL FUNCTION 'SELECTION_VIEWS_FIND'
       EXPORTING
            bildsequenz     = c_seq_code
            pflegestatus    = c_viewlist
       TABLES
            bildtab         = t_bildtab
       EXCEPTIONS
            call_wrong      = 1
            empty_selection = 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.                    " F_VIEW_LIST
*&      Form  f612_view_sort                                          *
  Routine to used for Selecting The views based on Material Number  *
FORM f612_view_sort.
  t_bildtab_dup[] = t_bildtab[].
Reading the Internal table t_mara
  READ TABLE t_mara WITH KEY matnr = t_mdata-matnr.
  TRANSLATE t_mara-pstat USING ' $'.
  CLEAR: w_data-flag1, w_data-anzd70.
  LOOP AT t_bildtab_dup.
    IF t_bildtab_dup-pstat CA t_mara-pstat.
      w_data-anzd70 = w_data-anzd70 + 1.
      IF t_bildtab_dup-kzanz IS INITIAL.
        t_bildtab_dup-kzanz = 'X'.
        w_data-flag1 = 'X'.
        MODIFY t_bildtab_dup.
      ENDIF.
    ELSE.
      IF NOT t_bildtab_dup-kzanz IS INITIAL.
        CLEAR t_bildtab_dup-kzanz.
        w_data-flag1 = 'X'.
        MODIFY t_bildtab_dup.
      ENDIF.
    ENDIF.
  ENDLOOP.
  TRANSLATE t_mara-pstat USING '$ '.
  IF NOT w_data-flag1 IS INITIAL.
    SORT t_bildtab_dup BY kzanz DESCENDING idxbd ASCENDING.
  ENDIF.
*Reading The internal table for T_bildtab_dup
  READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
  IF t_bildtab_dup-kzanz = 'X'.
    WRITE sy-tabix TO w_data-count.
    w_data-count = w_data-count + 2.
    IF w_data-anzd70 > 18.
      w_data-count = w_data-count - 18.
    ENDIF.
    CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field1.
    CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field2.
  ENDIF.
  READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
  IF t_bildtab_dup-kzanz = 'X'.
    WRITE sy-tabix TO w_data-count.
    IF w_data-anzd70 > 18.
          w_data-count = w_data-count + 2.
      w_data-count = w_data-count - 18.
    ENDIF.
    CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field3.
    CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field4.
  ENDIF.
ENDFORM.                    " f612_view_sort
*&      Form  f_uplaod_data                                           *
Routine to used for Uploading the data from file to Internal table *
FORM f_uplaod_data.
  CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
            filename                = g_file
            filetype                = 'DAT'
       TABLES
            data_tab                = t_delim
       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.
  ENDIF.
  IF t_bpcs IS INITIAL.
    LOOP AT t_delim.
      SPLIT t_delim-text AT ',' INTO t_bpcs-matnr
                                     t_bpcs-dosage
                                     t_bpcs-appearance
                                     t_bpcs-idcode
                                     t_bpcs-prostformno
                                     t_bpcs-weitab
                                     t_bpcs-uom1
                                     t_bpcs-uom2
                                     t_bpcs-carsize
                                     t_bpcs-cassize
                                     t_bpcs-rupqty
                                     t_bpcs-abvname.
      APPEND t_bpcs.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " f_uplaod_data
*&      Form  F_BDC_OPEN
      Routine  to create BDC Session to be processed
FORM f_bdc_open.
  CALL FUNCTION 'BDC_OPEN_GROUP'
       EXPORTING
            client              = sy-mandt
            group               = c_group
            keep                = c_keep
            user                = sy-uname
       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.
  ELSE.
  MESSAGE S000 WITH 'Batch input session is created successfully'(T02).
  ENDIF.
ENDFORM.                    " F_BDC_OPEN
*&      Form  F_PROCESS_BDC
      Processing of BDCDATA Structure
FORM f_process_bdc.
  LOOP AT t_mdata.
    PERFORM f612_view_sort.
    PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0060'.
    PERFORM f_bdc_field USING 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    PERFORM f_bdc_field USING 'BDC_OKCODE'
                                  '=AUSW'.
    PERFORM f_bdc_field USING 'RMMG1-MATNR'
                                  t_mdata-matnr.
    PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
    PERFORM f_bdc_field USING 'BDC_CURSOR'
                              'MSICHTAUSW-DYTXT(01)'.
    IF w_data-anzd70 > 18.
      PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                  '=P+'.
      PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '0070'.
      PERFORM f_bdc_field  USING 'BDC_OKCODE' '/00'.
    ENDIF.
reading the t_bildtab internal table
    READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
    IF t_bildtab_dup-kzanz = 'X'.
      PERFORM f_bdc_field       USING 'BDC_CURSOR'
                                    w_data-field1.
      PERFORM f_bdc_field       USING w_data-field2 'X'.
      g_flag = 'X'.
    ENDIF.
reading the t_bildtab internal table
    READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
    IF sy-subrc EQ 0.
      g_flag = 'X'.
    ENDIF.
    IF t_bildtab_dup-kzanz = 'X'.
      PERFORM f_bdc_field       USING 'BDC_CURSOR'
                                    w_data-field3.
      PERFORM f_bdc_field       USING w_data-field4 'X'.
      g_flag1 = 'X'.
    ENDIF.
    IF g_flag = 'X' AND g_flag1 = 'X'.
      PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '0080'.
      PERFORM f_bdc_field       USING 'BDC_CURSOR'
                                    'RMMG1-VTWEG'.
      PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                    '=ENTR'.
      PERFORM f_bdc_field       USING 'RMMG1-WERKS'
                                    c_werks.
      PERFORM f_bdc_field       USING 'RMMG1-VKORG'
                                    c_vkorg.
      PERFORM f_bdc_field       USING 'RMMG1-VTWEG'
                                    c_vtweg.
      CLEAR g_flag.
      CLEAR g_flag1.
    ELSE.
      IF g_flag = 'X'.
        PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '0080'.
        PERFORM f_bdc_field       USING 'RMMG1-WERKS'
                                    c_werks.
        PERFORM f_bdc_field      USING 'BDC_OKCODE' '/00'.
      ELSE.
        IF g_flag1 = 'X'.
          PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '0080'.
          PERFORM f_bdc_field       USING 'BDC_CURSOR'
                                        'RMMG1-VTWEG'.
          PERFORM f_bdc_field       USING 'RMMG1-WERKS'
                                      c_werks.
          PERFORM f_bdc_field       USING 'RMMG1-VKORG'
                                        c_vkorg.
          PERFORM f_bdc_field       USING 'RMMG1-VTWEG'
                                        c_vtweg.
          PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                         '=ENTR'.
        ENDIF.
      ENDIF.
    ENDIF.
*Processing of SCM View
    PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '4000'.
    PERFORM f_bdc_field       USING 'BDC_CURSOR' 'MARC-ZZJP_DOS_FRM'.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_DOS_FRM'
                                  t_mdata-zzjp_dos_frm.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_APRN'
                                  t_mdata-zzjp_aprn.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_CON_ID'
                                  t_mdata-zzjp_con_id.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_NYU_SOP'
                                  t_mdata-zzjp_nyu_sop.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_WEI_TAB'
                                  t_mdata-zzjp_wei_tab.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_CAR'
                                  t_mdata-zzjp_car.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_CAS'
                                  t_mdata-zzjp_cas.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_CAR_SIZE'
                                  t_mdata-ZZJP_CAR_SIZE.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_CAS_SIZE'
                                  t_mdata-ZZJP_CAS_SIZE.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_RUPQTY'
                                   t_mdata-ZZJP_RUPQTY.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_BIO'
                                  t_mdata-zzjp_bio.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_ITF'
                                  t_mdata-zzjp_itf.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_INIT_LS'
                                  t_mdata-zzjp_init_ls.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_RE1'
                                  t_mdata-zzjp_re1.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_RE2'
                                  t_mdata-zzjp_re2.
    PERFORM f_bdc_field       USING 'MARC-ZZJP_RE3'
                                  t_mdata-zzjp_re3.
    PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
*Processing of SD View
    PERFORM f_bdc_dynpro      USING 'SAPLMGMM' '4000'.
    PERFORM f_bdc_field       USING 'BDC_CURSOR' 'MVKE-ZZJP_PRO_ID'.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_PRO_ID'
                                  t_mdata-zzjp_pro_id.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_BU_ID'
                                  t_mdata-zzjp_bu_id.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_ABV_NAME'
                                  t_mdata-zzjp_abv_name.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_ABV_ID1'
                                  t_mdata-zzjp_abv_id1.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_ABV_ID2'
                                  t_mdata-zzjp_abv_id2.
    PERFORM f_bdc_field       USING 'MVKE-ZZJP_SPL_ID'
                                  t_mdata-zzjp_spl_id.
    PERFORM f_bdc_field      USING 'BDC_OKCODE' '/00'.
    PERFORM f_bdc_dynpro      USING 'SAPLSPO1' '0300'.
    PERFORM f_bdc_field       USING 'BDC_OKCODE'
                                  '=YES'.
perform f_bdc_insert.
REFRESH T_BDCDATA.
  ENDLOOP.
ENDFORM.                    " F_PROCESS_BDC
*&      Form  f_bdc_dynpro
  p_prog is the program name to which data is passed                *
  p_dyno is the screen number to which the data is passed
    Routine for populating the BDCDATA structure with the
    Screen related information
FORM f_bdc_dynpro USING    p_prog
                           p_dyno.
  t_bdcdata-program  = p_prog.
  t_bdcdata-dynpro   = p_dyno.
  t_bdcdata-dynbegin = 'X'.
  APPEND t_bdcdata.
  CLEAR t_bdcdata.
ENDFORM.                    " F_bdc_dynpro
*&      Form  F_BDC_FIELD
      p_fnam is the field name to which value is passed
      p_fval is the field value which is passed
   p_fnam is the field name to which value is passed
   p_fval is the field value which is passed
FORM f_bdc_field USING    p_fnam
                          p_fval.
  t_bdcdata-fnam = p_fnam.
  t_bdcdata-fval = p_fval.
  APPEND t_bdcdata.
  CLEAR t_bdcdata.
ENDFORM.                    " F_bdc_field
*&      Form  F_PROCESS_DATA                                          *
     Routine to used for moving data from T_bpcs internal table to  *
     t_mdata Internal Table                                         *
FORM f_process_data.
  LOOP AT t_bpcs.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
         EXPORTING
              input  = t_bpcs-matnr
         IMPORTING
              output = t_mdata-matnr.
    MOVE t_bpcs-dosage TO t_mdata-zzjp_dos_frm.
    MOVE t_bpcs-appearance TO t_mdata-zzjp_aprn.
    MOVE t_bpcs-idcode  TO t_mdata-zzjp_con_id.
    MOVE t_bpcs-prostformno TO t_mdata-zzjp_nyu_sop.
    MOVE t_bpcs-weitab TO t_mdata-zzjp_wei_tab.
    MOVE c_blank TO t_mdata-zzjp_bio.
    MOVE c_blank TO t_mdata-zzjp_itf.
    MOVE t_bpcs-uom1 TO t_mdata-zzjp_car.
    MOVE t_bpcs-uom2 TO t_mdata-zzjp_cas.
    MOVE t_bpcs-carsize TO t_mdata-zzjp_car_size.
    MOVE t_bpcs-cassize TO t_mdata-zzjp_cas_size.
    MOVE t_bpcs-rupqty TO t_mdata-zzjp_rupqty.
    MOVE c_intls TO t_mdata-zzjp_init_ls.
    MOVE c_blank TO t_mdata-zzjp_re1.
    MOVE c_blank TO t_mdata-zzjp_re2.
    MOVE c_blank TO t_mdata-zzjp_re3.
    MOVE c_blank TO t_mdata-zzjp_pro_id.
    MOVE c_blank TO t_mdata-zzjp_bu_id.
    MOVE t_bpcs-abvname TO t_mdata-zzjp_abv_name.
    MOVE c_blank TO t_mdata-zzjp_abv_id1.
    MOVE c_blank TO t_mdata-zzjp_abv_id2.
    MOVE c_blank TO t_mdata-zzjp_spl_id.
    APPEND t_mdata.
  ENDLOOP.
ENDFORM.                    " F_PROCESS_DATA
*&      Form  f_bdc_close
      Routine to close the BDC Session
FORM f_close_group.
  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.                    " f_close_group
*&      Form  f_bdc_insert
     routine to input batch data into the Transaction MM02 from the
     session created
FORM f_bdc_insert.
CALL FUNCTION 'BDC_INSERT'
         EXPORTING
              tcode            = c_tcode
         TABLES
              dynprotab        = t_bdcdata
         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.
ENDFORM.                    " f_bdc_insert
Reward Points if it is helpful
Thanks
Seshu

Similar Messages

  • Set cursor in a specific view of transaction MM01/MM02

    Hi,
    We have to check a condition in the user-exit EXIT_SAPLMGMU_001, for transaction MM01/MM02, and if the condition fails the client wants to set the cursor in a specific field from a specific view. Is it possible? I tried to use the sentence SET CURSOR referenced to a remote program but it doesn't work.  
    Does anybody knows how to solve this problem?
    Thanks in advance
    Regards
    Maribel

    Hi
    I hope, you have read the documetation attached with this Standard Enhancement - MGA00001.
    EXIT_SAPLMGMU_001
    Where Is the Customer Exit - EXIT_SAPLMGMU_001 called?
    The customer exit is in function module MATERIAL_UPDATE_ALL. The
    function module checks the data for errors (logical relationships,
    foreign keys, fixed domain values, and so on) when the material master
    is updated.
    Use
    o New fields
    You can make checks possible for new fields of your own. These
    checks must be identical to the checks that you carry out for your
    new fields in online maintenance.
    o Existing fields
    For existing fields, you can extend and intensify the checks.
    You can also change data for descriptions and general material data
    (MARA). For example, the descriptions can be generated from attributes
    of the material.
    Limitations
    You cannot bypass existing checks.
    Interface to Application
    The respective data of the current logical transaction is contained in
    the structures, for example, in structure WMARA for MARA. Nonrelevant
    structures are transferred with their initial values.
    General material data that can be changed (CMARA) has the structure
    MARU. This MARA view contains fewer internal fields than MARA itself. If
    WMARA is filled, CMARA is also filled when accessed.
    The customer exit contains the exception APPLICATION_ERROR for your
    self-defined error situations.
    Using the language element MESSAGE .. RAISING APPLICATION_ERROR, you can
    terminate the current (logical) transaction and display your message in
    the log.
    Also, I guess, have you put some code in the Includes available with the EXITS and then activated the Project in CMOD.
    <b>Reward points</b>
    Regards

  • Problem in BDC for selecting the QM View in MM02

    Hi,
    I am facing a problem that when the material is entered select view screen opens and the positioning of QM view is 11 or 13 sometimes. i want the processing should of QM should be irespective of position.
    report ZBDC_MM02_QM_VIEW
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of record OCCURS 0,
          MATNR_001(018),
                WERKS_002(004),
          ART_003(008),
          APA_004(001),
          AKTIV_005(001),
          end of record.
    PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
    initialization.
    CTUMODE = 'A'.
    CUPDATE = 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
       MASK                   = ',.'
       MODE                   = 'O'
    IMPORTING
       FILENAME               = P_FILNAM
    EXCEPTIONS
       INV_WINSYS             = 1
       NO_BATCH               = 2
       SELECTION_CANCEL       = 3
       SELECTION_ERROR        = 4
       OTHERS                 = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME                      = P_FILNAM
       FILETYPE                      = 'DAT'
      TABLES
        DATA_TAB                      = RECORD
    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
       NO_AUTHORITY                  = 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.
    LOOP AT RECORD.
      ON CHANGE OF RECORD-MATNR_001.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(11)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(11)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '0080'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-WERKS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'RMMG1-WERKS'
                                  record-WERKS_002.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PB01'.
    perform bdc_dynpro      using 'SAPLQPLS' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMQAM-ARGUMENT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NEU'.
    perform bdc_field       using 'RMQAM-INSMK'
                                  'X'.
    perform bdc_field       using 'RMQAM-QKZVERF'
                                  '06'.
    perform bdc_field       using 'RMQAM-PPL'
                                  'X'.
    perform bdc_field       using 'RMQAM-APP'
                                  'X'.
    perform bdc_field       using 'RMQAM-DYN'
                                  'X'.
    perform bdc_field       using 'RMQAM-MER'
                                  'X'.
    perform bdc_field       using 'RMQAM-AVE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLQPLS' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMQAM-AKTIV(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=WEIT'.
    perform bdc_field       using 'RMQAM-ART(01)'
                                  record-ART_003.
    perform bdc_field       using 'RMQAM-AKTIV(01)'
                                  'X'.
    perform bdc_transaction using 'MM02'.
    ENDON.
    ENDLOOP.

    Hi,
    Use following code
                  CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'
                    EXPORTING
                      MATERIAL                  = IT_UPLOAD-MATNR  " Material number
                      MATERIALART               = GI_MARA-MTART          " Material Type
                      SELECTION                 = 'Q'              " PSTAT(maintenance status) value for Quality Managemant.
                      TCODE                     = 'MM01'           " Tcode where view's are called.
                    TABLES
                      BTCI_D0070                = IT_BDCDATA_VIEW
                    EXCEPTIONS
                      MATERIAL_NOT_FOUND        = 1
                      MATERIAL_NUMBER_MISSING   = 2
                      MATERIAL_TYPE_MISSING     = 3
                      MATERIAL_TYPE_NOT_FOUND   = 4
                      NO_ACTIVE_DYNPRO_SELECTED = 5
                      NO_AUTHORITY              = 6
                      OTHERS                    = 7.
                  READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL  = 'X'.
                  IF SY-SUBRC = 0.
                    V_SELECTION = IT_BDCDATA_VIEW-FNAM.
                    VAR = IT_BDCDATA_VIEW-FNAM+17(2).
                    IF VAR > '17'.
                      VAR = VAR - 17.
                      IF VAR NE '2'.
                        CONCATENATE '0' VAR INTO VAR.
                      ENDIF.
                      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                  '=P+'.
                      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
                      CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
                      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                    VAR1.
                      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                    '=ENTR'.
                      CLEAR VAR1.
                      CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
                      PERFORM BDC_FIELD       USING VAR1
                                                    'X'.
                      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                  '=ENTR'.
                    ENDIF.
                    IF VAR < '17'.
                      CONCATENATE 'MSICHTAUSW-DYTXT(' VAR ')' INTO VAR1.
                      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                    VAR1.
                      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                    '=ENTR'.
                      CLEAR VAR1.
                      CONCATENATE 'MSICHTAUSW-KZSEL(' VAR ')' INTO VAR1.
                      PERFORM BDC_FIELD       USING VAR1
                                                    'X'.
                      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                  '=ENTR'.
                    ENDIF.
    Regards,
    Pritish

  • How to get the values inputted by the user in Classification view of  MM02

    Hello,
    Does anyone know how to get the inputted values in Classification view of MM02/MM01? I tried to use CLAF_CLASSIFICATION_OF_OBJECTS but this gets the values that is currently saved in the tables and not the values that the user recently inputted in the screen.
    Regards,
    Alfred

    hi
    try this...
    How to Display the Batch Characteristics in BOM?

  • Selection view in MM02 BDC program

    Hi Experts,
    I am doing BDC Session method for Tcode MM02.There i am getting selection View screen for different material.But if i select a material in Sales view i need to select Sales :Sales org dAta.
    It's coming third position.
    But for some material it's coming fourth view.
    If i record bdc in third position it'll take third view some other. how i can select the view in selection view.
    Please,Anybody knows give me the suggestion.
    Thanks & Regards,
    Nandha

    Hi,
    use this Function module <b>SELECTION_VIEWS_FIND</b> to find the view position.
    This One of functional modules for those who still has to use BDC for Material Master transactions (MM01 and MM02). Allows to determine line number for desired view in the "Select View(s)" window, to prepare BDC for the view access
    Find the positon of the View based on this function module and write the code to select that perticular view.
    Hope this solves your problem
    Thanks
    Sudheer

  • How select different type views in MM01

    Hi abapers,
    plz tell me how to handle diffrent different type views in MM01.
    thanks in addvance

    hi,
    After the recording, you might see, that the selection of the views is
    monething like that: SELECTION(3) = 'X'
    SELECTION(4) = 'X'
    SELECTION(5) = 'X'
    you have to address the selected
    views by their index in the table.
    in Tcode SHDB, record MM01 transaction only for the MRP1 MRP2 MRP3 and use the same code in ur BDC prog.
    Look at the below code for MM01
    http://www.sap-img.com/abap/example-how-views-are-dealt-in-bdc.htm
    You have + button in the MK01 trasaction code, if you press that you
    can enter new record in the table control, so every time, enter a New
    record and press that + button, then enter the record then press + , like this we need to handle the table control
    Check the links -
    bdc -- mm01
    MM01 BDC
    mm01
    example:
    Example how Views are dealt in BDC
    Can any body tell me some views of MM  that we can use in BDC?
    ***This is a BDC for Semi finished Materials*******
    report ZBDC_SEMIFIN
           no standard page heading line-size 255.
    include bdcrecx1.
    Tables: Mara,"General Material Data
            mard,"Storage Location Data for Material
            mvke,"Sales Data for Material
            Makt,"Material Descriptions
            marc,"Plant Data for Material
            mbew,"Material Valuation
            rlgrap."Program Fields/Screen Fields for SAPLGRAP
    Data: begin of ITAB occurs 0,"Internal table for Semi-Finished Material
    Initial data
          matnr like mara-matnr,  "Material Code
          mbrsh like mara-mbrsh,  "Industry Data
          mtart like mara-mtart,  "Material Type
    Org Data
          Werks like marc-werks,  "Plant
          lgort like mard-lgort,  "Storage Location
          vkorg like mvke-vkorg,  "Sales Orgnization
          vtweg like mvke-vtweg,  "Distribution Chanel
    Basic 1
          Maktx Like makt-maktx,  "Description
          meins like mara-meins,  "Uom
          matkl like mara-matkl,  "Material Group
          BISMT LIKE MARA-BISMT, " Old Material Number
          spart like mara-spart,  "Division
          brgew(7),"like mara-brgew,  "Gross Weight
          gewei like MARA-GEWEI,  "Weight Unit
          ntgew(7)," like mara-ntgew,  "Net Weight
    Purchasing
           MAKTL LIKE MARA-MATKL, "Material Group
           ekwsl like MARA-EKWSL, " Purchasing Value Key
           ekgrp like MARC-EKGRP, " Purchasing Group
    Mrp 1
          disgr like MARC-DISGR,  "Mrp Group
        ekgrp like MARC-EKGRP,  "Purchasing group
          dismm like MARC-DISMM,  "Mrp Type
          dispo like MARC-DISPO,  "Mrp Controller
          disls like MARC-DISLS,  "Lot Size
          BSTMI like MARC-BSTMI,
          BSTMA like MARC-BSTMA,
          BSTRF like MARC-BSTRF,
          BSTFE like MARC-BSTFE,
    Mrp 2
          beskz like MARC-BESKZ,  "Procurement type
          lgpro like MARC-LGPRO,  "Production Storage Location
          dzeit(3),"like MARC-DZEIT,  "In house Production time
          plifz(3),"like MARC-PLIFZ,  "Planned delivery time
          fhori(3),"like MARC-FHORI,  "Sched margin key
          eisbe like MARC-EISBE,  "Safety stock
    Mrp 3
          PERKZ LIKE MARC-PERKZ,
          vrmod like MARC-VRMOD,  "Consumption mode
          vint1(3)," like MARC-VINT1,  "Backward Consumption period
          vint2(3),"like MARC-VINT2,  "Forward Consumption period
          mtvfp like MARC-MTVFP,  "Availability Check
    Mrp 4
          sbdkz like MARC-SBDKZ,  "Individual/ Collective
          SAUFT like MARC-SAUFT,  "Repetitive Manufacturing
          SFEPR like MARC-SFEPR,  "REM Profile
    Work Scheduling View
          ausme like MARC-AUSME,  "Unit of issue
          FEVOR LIKE MARC-FEVOR, "Production Scheduler
          SFCPF like MARC-SFCPF, "Production Scheduler Profile
          umren(5)," like RMMZU-UMREN,  "Val for base uom
          umrez(5) ,"like RMMZU-UMREz,  "Value for uo issue
    Accounting 1
          bklas like MBEW-BKLAS,  "Valuation Class
          vprsv like MBEW-VPRSV,  "Price Control Indicator
          verpr(7)," like MBEW-VERPR,  "Value/Price
          STPRS like MBEW-STPRS,
    *COSTING
         EKALR LIKE MBEW-EKALR," With qty str
         LOSGR like MARC-LOSGR, " Costing Lot size
        end of ITAB.
    Data: W_record type  I,  "Record Allready exists.
          w_trecord type I. "Total record processed
    start-of-selection.
    perform upload.        "Upload Data from Text File
    Perform Open_group.    "Create a session
    clear : w_record,w_trecord.
    perform semi. "Create Semi Finish Materials
    if w_trecord gt 0 or w_record gt 0.
      perform batch_job.
    endif.
    perform close_group.   "Close session
    FORM SEMI.
    loop at ITAB.
      Check for material in master        select single * from mara where matnr eq ITAB-matnr.
             if sy-subrc ne 0.
              w_trecord = w_trecord + 1.
    *Initial Screen
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MTART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=AUSW'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  ITAB-MATNR.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  'M'.
    perform bdc_field       using 'RMMG1-MTART'
                                  'HALB'.
    **********************Views*********************************
    *Select Views
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(17'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                   'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(09)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(12)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(13)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(14)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(15)'
                                  'X'..
    perform bdc_field       using 'MSICHTAUSW-KZSEL(17)'
                                  'X'.
    **********************Views*****************************
    *perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'MSICHTAUSW-DYTXT(01)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'MSICHTAUSW-DYTXT(17)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_field       using 'MSICHTAUSW-KZSEL(17)'
                                 ITAB-KZSEL_17_011.
    *perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'MSICHTAUSW-DYTXT(01)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'MSICHTAUSW-DYTXT(13)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '=ENTR'.
    *perform bdc_field       using 'MSICHTAUSW-KZSEL(13)'
                                 ITAB-KZSEL_13_012.
    *Org Data
    perform bdc_dynpro      using 'SAPLMGMM' '0080'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-LGORT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'RMMG1-WERKS'
                                  ITAB-WERKS.
    perform bdc_field       using 'RMMG1-LGORT'
                                  ITAB-LGORT.
    *Basic 1
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP09'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MARA-MATKL'
                                  ITAB-MATKL.
    perform bdc_field       using 'MARA-BISMT'
                                  ITAB-BISMT.
    perform bdc_field       using 'MARA-SPART'
                                  ITAB-SPART.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  'NORM'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-NTGEW'.
    perform bdc_field       using 'MARA-BRGEW'
                                  ITAB-BRGEW.
    perform bdc_field       using 'MARA-GEWEI'
                                  ITAB-GEWEI.
    perform bdc_field       using 'MARA-NTGEW'
                                  ITAB-NTGEW.
    *Purchasing
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP12'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MARC-EKGRP'
                                  ITAB-EKGRP.
    perform bdc_field       using 'MARA-MATKL'
                                  ITAB-MATKL.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-EKWSL'.
    perform bdc_field       using 'MARA-EKWSL'
                                  ITAB-EKWSL.
    *MRP 1
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP13'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MARC-EKGRP'
                                  ITAB-EKGRP.
    perform bdc_field       using 'MARC-DISMM'
                                  ITAB-DISMM.
    perform bdc_field       using 'MARC-DISPO'
                                  ITAB-DISPO.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-DISLS'.
    perform bdc_field       using 'MARC-DISLS'
                                  ITAB-DISLS.
    IF ITAB-DISLS EQ 'EX'   .
    perform bdc_field       using 'MARC-BSTMI'
                                  ITAB-BSTMI."MIN LOT SIZE
    perform bdc_field       using 'MARC-BSTMA'
                                  ITAB-BSTMA."MAX LOT SIZE
    perform bdc_field       using 'MARC-BSTRF'
                                  ITAB-BSTRF."RNDING
    ELSEIF ITAB-DISLS EQ 'FX'.
    perform bdc_field       using 'MARC-BSTFE'
                                  ITAB-BSTFE.
    ENDIF.
    *MRP 2
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP14'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARC-BESKZ'
                                  ITAB-BESKZ.
    perform bdc_field       using 'MARC-LGPRO'
                                  ITAB-LGPRO.
    perform bdc_field       using 'MARC-DZEIT'
                                  ITAB-DZEIT.
    perform bdc_field       using 'MARC-PLIFZ'
                                  ITAB-PLIFZ.
    perform bdc_field       using 'MARC-FHORI'
                                  ITAB-FHORI.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-EISBE'.
    perform bdc_field       using 'MARC-EISBE'
                                  ITAB-EISBE.
    *MRP 3
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP15'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARC-PERKZ'
                                  ITAB-PERKZ.
    perform bdc_field       using 'MARC-VRMOD'
                                  ITAB-VRMOD.
    perform bdc_field       using 'MARC-VINT1'
                                  ITAB-VINT1.
    perform bdc_field       using 'MARC-VINT2'
                                  ITAB-VINT2.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-MTVFP'.
    perform bdc_field       using 'MARC-MTVFP'
                                  ITAB-MTVFP.
    *MRP 4
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP17'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARC-SBDKZ'
                                  ITAB-SBDKZ.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-SFEPR'.
    perform bdc_field       using 'MARC-SAUFT'
                                  ITAB-SAUFT.
    perform bdc_field       using 'MARC-SFEPR'
                                  ITAB-SFEPR.
    *Work Scheduling
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP24'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-SFCPF'.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MARC-FEVOR'
                                  ITAB-FEVOR.
    perform bdc_field       using 'MARC-LGPRO'
                                  ITAB-LGPRO.
    perform bdc_field       using 'MARC-SFCPF'
                                  ITAB-SFCPF.
    perform bdc_field       using 'MARC-DZEIT'
                                  ITAB-DZEIT.
    *Check for Conversation Factor
              if ITAB-MEINS ne iTAB-ausme and iTAB-umren gt  0
                                          and iTAB-umrez gt  0.
              perform bdc_dynpro      using 'SAPLMGMM' '0510'.
              perform bdc_field       using:
                                      'BDC_OKCODE'    '=ENTR',
                                      'RMMZU-UMREN'   ITAB-UMREN,
                                      'RMMZU-UMREZ'   ITAB-UMREZ.
            endif.
    perform bdc_field       using 'MARC-LGPRO'
                                  itab-LGPRO.
    perform bdc_field       using 'MARC-DZEIT'
                                  itab-DZEIT.
    *Accounting
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SP26'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MARA-SPART'
                                  ITAB-SPART.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MBEW-STPRS'.
    perform bdc_field       using 'MBEW-BKLAS'
                                  ITAB-BKLAS.
    perform bdc_field       using 'MBEW-VPRSV'
                                  ITAB-VPRSV.
    perform bdc_field       using 'MBEW-STPRS'
                                  ITAB-STPRS.
    IF ITAB-VPRSV = 'S'.
    perform bdc_field       using 'MBEW-STPRS' "FILLS STD PRICE
                                  ITAB-VERPR.
    ELSEIF ITAB-VPRSV ='V'.
    perform bdc_field       using 'MBEW-VERPR' "FILLS VALUE
                                  ITAB-VERPR.
    ENDIF.
    *Cost Estimate
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  ITAB-MAKTX.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-PRCTR'.
    perform bdc_field       using 'MARA-MEINS'
                                  ITAB-MEINS.
    perform bdc_field       using 'MBEW-EKALR'
                                  ITAB-EKALR.
    perform bdc_field       using 'MARC-LOSGR'
                                  ITAB-LOSGR.
    perform bdc_transaction using 'MM01'.
    REFRESH BDCDATA.
        else.
             w_record = w_record + 1.
        endif.
    ENDLOOP.
    ENDFORM.
    form Upload.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
       CODEPAGE                      = ' '
       FILENAME                      = ' '
       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.
    ENDFORM.
    form batch_job.
        uline.
          format color col_heading.
            if w_trecord gt 0.
            Write:/ 'Background Job has been Created for ',
                  w_trecord right-justified, 'Semi-Fin', 80 ''.
            write:/ 'Please follow the following steps to run this job',
                                                               80 ''.
            write:/ 'as listed below.', 80 ''.
            format color col_normal.
            skip.
            write:/05 '1.Goto Transaction SM35', 80 ''.
            write:/05 '2.Select your Session Name', 80 ''.
            write:/05 '3.Click On Execute Button', 80 ''.
           endif.
           if w_record gt 0.
             format color col_negative.
             write:/ w_record ,'records already existed', 80 ''.
             format color off.
           endif.
        uline.
    endform.

  • Creation of Plant Specific Views while creating or changing the Material

    Hi,
    When saving a material (MM01/MM02), based on data in custom table, I have to extend the material for different plants and plant specific views such as
    1.     Purchasing
    2.     Foreign Trade Import
    3.     MRP1
    4.     MRP2
    5.     MRP3
    6.     Forecasting
    7.     Parts F&P Data (custom view)
    8.     Accounting 1
    How can I achieve this? Is there any FM or BAPI that can be used to extend material for a plant and its specific views?
    Also please suggest me the user exit or BADI which has to be used to achieve this functionality?
    Best Regards,
    Kumar

    We can use the BAPI, BAPI_MATERIAL_SAVEDATA to extend material to different views.

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How to: Select a Specific Timeline Displayed in Project Online when having multiple timelines within the Enterprise Project

    Currently I have an Enterprise Project which has 6 custom timelines and I want to know how to select a specific timeline to be displayed on the Project specific SharePoint site.
    I'll provide some background for you so you understand my issues... I have created a "template" project with 6 custom timelines. From that project I created multiple new projects - which they all have the 6 custom timelines. These projects are
    all stored in the Project Center. The problem I am having is I don't understand how to select a specific timeline to show on the project specific SharePoint site. They all seem to be displaying 1 of the 6 timelines (in no particular order). I was thinking
    maybe if I had edited a project and saved it while it was displaying a specific timeline it would display the last selected timeline on the SharePoint site, but it doesn't seem to be doing that.
    Is there a way to select a specific timeline to display on the SharePoint site?  Also, is there a way for a user to cycle through the numerous timeline view on the project specific SharePoint site?
    I await your help!! :)

    Michelle_Sm --
    I ran into this problem at the company where I used to work.  One of our PMs had created multiple Timeline views, and wanted a specific custom Timeline view to show up in the Project Site for that project.  I could not see any way to make that
    happen.  We had one of our SharePoint developers look into the issue, and he could not see any way to make this happen either.  So, I am thinking this is not possible to do.  But I would gladly welcome others in this forum to tell us the trick,
    if there is one!  :)  Hope this helps.
    Dale A. Howard [MVP]

  • How to find the position of view in MM02 transaction for coding BDC?

    Hi Guys,
    Is there any FM or BAPI Available to find the position of the view in MM02 transaction. I tried FM SELECTION_VIEWS_FIND. But getting inconsistent results
    i.e Some materials it is giving correct positions but for others i am getting wrong position. So my BDC is getting failed.
    Thanks in advance.
    Vinod.

    Hi,
    data : i_t133a like t133a occurs 0 with header line,
          ch(1),
           viewno(2) type n.
    clear viewno.
      select * from t133a into corresponding fields of table i_t133a
                    where bilds = '21' and guifu like 'SP%'  .
      loop at i_t133a .
        ch = i_t133a-pstat.
        if mara-vpsta na ch .
          delete i_t133a     .
          continue .
        endif .
      endloop.
      sort i_t133a by guifu ascending .
      loop at i_t133a .
        viewno = viewno + 1 .
        if i_t133a-guifu = 'SP01'.  "FOR BASIC DATA1                CHANGES              ACCORDINGLY REFER TABLE T133A TO FIND VTHE VALUE
          exit .
        endif .
      endloop .
    reward if usefull

  • Transaction SE16: Field selection (User-Specific Settings) is NOT working for ALL tables

    Hi Guru’s,
    I have an issue in Transaction SE16, Field selection (User-Specific Settings) is NOT working in Tables (ALL tables).
    Following is the screenshot attached for your kind reference,
    That is in the initial screen of transaction SE16 if I choose Filed Name or Filed Label only the technical details (Field Names) are appearing and not the descriptions like Client, Purchasing Doc, and Company Code Doc. Category Document Type etc…
    Right now I am using ECC6 and EHP7 SAP system.
    Please help me to resolve this issue by implementing any OSS note or User Role creations or any technical changes required in system.
    Hope the requirement is clear and in case need any clarification please revert back.
    NOTE: Right now in Development System we don’t have any successful user to compare the settings.
    Regards,
    Kumar.S

    Thanks Patra.
    Even I searched in SAP portal and couldn't able to find the relevant OSS note.
    Following is my BASIS team response,
    "Only you can view Table Field values from higher release"
    Can you suggest / guide on this comment as well.
    Looking forward to your speedy response.
    Regards,
    Kumar.S

  • Keep 3D objects selected in all views?

    I've looked in the manual but I often miss the obvious search criteria.
    One of the cool features of After Effects is that an object is shown as selected in all 3D views. Switching views leaves the object selected along with its motion path.
    Is this not possible in Motion? It's making me really cranky.
    Another thing I can do in AE is tell the app to always preview a specific view. That's usually the Active Camera but it's easily changed. With Motion, the preview seems to always be the last view I was working in. That's making me cranky, too.
    bogiesan

    Hmm, clicking on the upper left corner in each viewport, where there is a black button/drop down list of possible views, seems to work. An object selected in the timeline will remain selected when changing window or viewport focus this way. You can also use the camera view icons in the lower left corner. Thanks. How did you know that? In the manual someplace? I love the Motion manual. No, really, I do.
    editorial: That's a stupid way of switching window focus. I'm starting to understand how Motion thinks, though. When I click into a window, Motion assumes I'm clicking into the scene and therefore deselecting everything. Except applications like AE assume the user is intelligent, the first click is merely selecting the view and is not meant to deselect everything.
    Thanks again TCY, very helpful. Greenie for you!
    bogiesan

  • Logic to get the view in MM02

    Hi,
    I would just like to ask if there is an easier way to get the selection views in MM02. There are different views per material and I need to insert the logic in getting the view to a custom program. The custom program will be used for performing a BDC transaction that's why I need to get the logic for the views.

    Hi
    Try using the function module SELECTION_VIEWS_FIND
    * Material views ....................................................
      data:  l_vpsta like t130m-pstat.
      select single vpsta
             into   l_vpsta
             from   mara
             where  matnr = p_matnr.
    * Get View sequence .................................................
      data: l_bild  like t133a-bilds,
            lt_bild like mbildtab occurs 0 with header line.
    * Screen Sequence for Standard Industry tab pages in material master
      l_bild = '21'.
    * Get screen sequence
      call function 'SELECTION_VIEWS_FIND'
        exporting
          bildsequenz     = l_bild
          pflegestatus    = l_vpsta
        tables
          bildtab         = lt_bild
        exceptions
          call_wrong      = 1
          empty_selection = 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.
    Shiva

  • How to add a specific view to a folder in Finder?

    Hello Everyone,
    I was wondering if there is a possibillity to add a specific view to a specific folder in Finder.
    I know this sounds abstract, let me explain:
    In OS 10.5 there are now 4 views for the Finder:
    - Icons
    - List
    - Columns
    - Cover Flow
    Usually I prefer icons, but for my movies and pictures folders I prefer Cover Flow.
    It would be handy to preset Cover Flow as view for the movies and pictures folders while other folders remain unaffected and still view as icons, instead of constantly having to change the view.
    Is there any way to accomplish what I am trying to do?
    Thanks Beforehands

    Lawrence,
    What you want to do is possible.
    Open your folder (the one you want to "customize"), then choose View>Show View Options. At the top, you will see a check-box labeled "Always open in xxx view," "xxx' being whatever view is currently set for the open window. Change the view on the window, using the icon in the Toolbar, to set your desired view, then enable the checkbox in the View Options. Close the View Options, then close the window.
    Initially, changing the view on this one window will change your view globally. Not a problem; just change the global setting back to your desired view when you open the next Finder window.
    Scott

  • How to select a specific cell in a JTable?

    Hi there,
    in a JTable, I would like to select a specific cell (to highlight it) from a JButton.
    Here a sample code...
    Who could help me to fill it?
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TableSelection{
        public static void main (String args[]) {
          JFrame frame = new MyFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.show();
    class MyFrame extends JFrame{
      public MyFrame(){
        setTitle("TableSelection");
        setSize(WIDTH,HEIGHT);
        DefaultTableModel myModel = new DefaultTableModel(2,2);
        JTable myTable = new JTable(myModel);
        myTable.setCellSelectionEnabled(true);
        JButton button00 = new JButton("select 0,0");
        button00.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent event){
         System.out.println("selection of cell (0,0)");
         //--- what code is required to select the cell(0,0)?
        JButton button11 = new JButton("select 1,1");
        button11.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent event){
         System.out.println("selection of cell (1,1)");
         //--- what code is required to select the cell(1,1)?
        Box myBox = new Box(BoxLayout.Y_AXIS);
        myBox.add(new JScrollPane(myTable));
        myBox.add(button00);
        myBox.add(button11);
        getContentPane().add(myBox, BorderLayout.CENTER);
      private static final int WIDTH=200;
      private static final int HEIGHT=200;
    }Thanks a lot for your help.
    Denis

    Use the addColumnSelectionInterval(int index1, int index2)method ~ http://java.sun.com/j2se/1.4/docs/api/javax/swing/JTable.html#addColumnSelectionInterval(int,%20int)
    and the addRowSelectionInterval(int index1, int index2) method ~ http://java.sun.com/j2se/1.4/docs/api/javax/swing/JTable.html#addRowSelectionInterval(int,%20int)
    Hope that helped.
    afotoglidis

Maybe you are looking for

  • IPod Nano Is Not Recognised on Computer

    Hello. My iPod has been working fine for a good while, but then it stopped being able to connect to my computer. It can charge on the mains, but the iPod screen does not change to 'please do not disconnect' while it is plugged in and the iPod does no

  • How to do a BC site with email accounts at previous hosting

    i have a question. i have a client that needs another Web site to replace their actual one. (hosted somewhere else) but they dont want to move thier email accounts... in other words i just need make the site hosting. (and new design of course) how do

  • Issue in populating dynamic values in smartform

    Hi Experts, I am facing some serious alignment issue while populating dynamic values in smartform. Through table, I am populating  dynamic values in smart form. If my internal table contains 20 records , first 10 records are populating in first page

  • A question about VM

    Hi,everybody My question is how does OnCard VM works. It interprets CAP, or compiles and then executes? If OnCard VM is a interpreter, how can it ensure the speed of performance? Thanks in advance.

  • Resource semaphore troubleshoot

    Hi Resource semaphore Problem is coming in the SQL Server 2008 ....  For this troubleshoot I am not able to do Insert and Update In the SQL Server 2008 ... Please help... Thank You