VK11,

Hi Experts,
I have to create Condition Records using VK11.
Please suggest me BAPI or function module for this, as i dont want to use bdc fot this.
Regards
Mohit

Hi Mohit.
I would like to suggest a few,
/SAPTRX/CONDITION_COPY          Copy/create condition records           
/SAPTRX/CONDITION_DELETE       Delete condition records                  
/SAPTRX/CONDITION_EDITOR       Call condition editor                     
/SAPTRX/CONDITION_EVALUATOR    Evaluate data against conditions          
/SAPTRX/CONDITION_HTML_SHOW    Show HTML popup for condition ID          
/SAPTRX/CONDITION_HTML_TEXT    Get HTML text for condition ID            
/SAPTRX/CONDITION_SAVE         Save condition records                    
/SAPTRX/CONDITION_TRANSPORT    Create transport for condition records  
MM_CONDITION_RECORDS_READ     
CONDITION_RECORD_CANCEL       
CONDITION_RECORD_CONVERT      
CONDITION_RECORD_READ         
BAPIs related to condition records:
BAPI_CMPGN_DET_CONDITIONS      BAPI for Campaign Determination Condition Records
BAPI_FREEGOODS_CONDITIONS      BAPI for Free Goods Usage Condition Records   
Hope that's usefull.
Good Luck & Regards.
Harsh Dave
Edited by: Harsh Dave on Jul 14, 2008 5:05 PM

Similar Messages

  • Reg: LSMW Multiple line items of scale pricing in transaction VK11

    Hi,
    Iam using LSMW to upload price condition records(VK11)
    Totally Iam having two records which i have split as 2 flat files.
    one flat file with header details and another flat file with line items for scale quantity and scale pricing, something like below.
    Header flat file
    __ZPR3__
    __cust1__
    __Mat1__
    __AUD__
    __EA__
    __100__
    __10__
    __ZPR3__
    __cust2__
    __Mat2__
    __AUD__
    __EA__
    __300__
    __10__
    Line Item Flat file
    __cust1__
    __mat1__
    __95__
    __20__
    __cust1__
    __mat1__
    __90__
    __30__
    __cust1__
    __mat1__
    __85__
    __40__
    __cust1__
    __mat1__
    __80__
    __50__
    __cust1__
    __mat1__
    __75__
    __60__
    __cust2__
    __mat2__
    __70__
    __20__
    __cust2__
    __mat2__
    __65__
    __30__
    __cust2__
    __mat2__
    __60__
    __40__
    When i do the step of Read Data in LSMW iam getting the data correctly.
    in Display read data step i got the header data in yellow and its line item in blue.
    In Convert data step iam gettin as
    Transaction read = 2.
    Records read = 11.
    Transaction written = 2.
    Record written = 9.
    In Display Converted data step Iam getting every record as a higher level item (displayed in green)
    In Create Batch Input Session step Iam getting the message as 1 batch Input folder with 9 transactions
    Which is actually wrong because only two transaction only must be written.
    I think i migh have problem in Convert data step but iam not sure, can anyone help me what should be done.
    My requirement is to upload the two datas with multiple scale prices for transaction vk11.
    Kindly Help.
    Regards
    Naveen

    hi,
    For u r reqrmnt u can make use of direct input method.
    1)
    Object               0070   Condition record
    Method               0000
    Program name         RV14BTCI
    Program type         B   Batch input
    it make use of transaction VK15( alternate for vk11where instead of selecting combination u can directly input table name)
    2) create u r internal table structure with the following fields
         KSCHL               cond type
         KOTABNR          cond table
         VKORG             sales org
         VTWEG              distr chnnl
         KUNNR              customer
         MATNR              material num
         WERKS             plant
         WAERK             currency
         DATAB               from date
         DATBI                to date
         KSTBM              cond scale qty
         KBETR              rate
         LOEVM_KO       del ind
         KPEIN               cond pricing unit
    in the above if u dont require any fields u can omit but make sure u r using all key fields.
    i thnk in u r reqrmnt its customer specific pricing so customer, cond scale qty,rate r needed.
    deltion indicator is used to delete existing records.
    3)  maintain structure relations till BKOND3
    4)  for field mapping do Auto field mapping
         give Tcode VK15
         give value for VAKEY ( concate salesorg, plant,materialno,customer) 
    assign dates in standard format (YYYYMMDD)
    5) Run remaining steps like assigning files, read convert and all
    u r flat file structure shud be da same like u r internal table.
    if u r not givin values provide empty space.
    flat file
    zpr3   cust1   mat1   aud ea 100 10   95 20
    zpr3   cust1  mat1    aud ea 100 10   90 30
    zpr3   cust2  mat2    aud ea 300 10   70 20
    i hope it gives u some idea .
    if its useful rewrd me.

  • Output error message in VK11

    Hi,
    I need to put an authority check before saving in Tcode VK11.
    I used BADI SD_COND_SAVE_A to put the checking. I needed to output a message then go back to the same screen with the entered values in the screen still in it.
    How Can I make the program go back to the screen with its values.
    Below is my code:
          AUTHORITY-CHECK OBJECT 'V_KONH_VKO'
          ID 'ACTVT' FIELD c_activity
          ID 'VTWEG' FIELD v_spart.
          IF sy-subrc NE 0.
            MESSAGE w012(zsd) WITH v_material.   
          ENDIF.
    Thanks in advance!
    Regards,
    Marco

    Hi Kumar,
    Thanks for the reply.
    This is what Im looking for. But unfortunately it is having an error message ($$00000001 in function group) when ever I would change the values and hit the save button again.
    When I debug it, whats happening is that an internal table is not getting refresh in this process thus calling the error message. There is no way I can refresh this table because it is not present in the BADI.

  • Condition type not copied to invoice  when used from VK11

    Hi ,
    I have a peculiar situation in which when I add the sales price condition type ZA01 from VK11 in the sale order, the condition type does not get copied into the invoice. But when I add the condition manually in the Sale order the condition type is copied in the invoice.
    Can any one suggest what settings need to be made.
    Regards
    Rasheed

    Kindly check, in your condition type: Under Changes which can be made section see what you have maintained in Manual entries.
    If above is with option NO limitation then check whether any pricing procedure is maintain for your this Billing Type you are using.
    If helpful kindly reward.
    Take care.JP.

  • BAPI for VK11 ?

    Hi,
    Can anybody tell me the BAPI name with simple coding to update Condition types for different material, plant, region etc for tcode VK11.
    thanks
    n kumar

    HI
    VK11,
    vk11 bapi
    Regards
    Pavan

  • Generic BDC for VK11 - URGENT

    Hi
    Can any one tell me how to create <b>Generic BDC for  transaction VK11 (Creating condition records)</b>
    My actual requirement is like we need to create <b>condition record</b> for every material  with all the condition types exist for that material  for different key combinations . <b>A condition record for every material is to be created for different condition types and  different key combinations where material MATNR is a key field .For example we need to create condition records dynamically for condition types ZPR0, ZCM0 etc.. for different key combinations where matnr is a key field .</b>
    can anyone of you point out a way to me?
    Thanks in advance
    Shivakumar

    please   copy the  program and  use it 
    *  Report to Upload the pricing condtion records for materials.        *
    *  Program  : ZSDR_PRICE_UPLOAD                                        *
    *  Author   : girish.
    *  Description:                                                        *
    *  This report Creat pricing condition records for materials           *
    * Tables Used :                      SELECT UPDATE INSERT DELETE       *
    * MVKE                                                X                *
    * Input/Output Files:                                                  *
    * Transactions called:                                                 *
    * Includes:                                                            *
    * Run Frequency -                                                      *
    * Program History                                                      *
    * Date       Change No            Change Request   SAP Rel    NSC Rel  *
    *            Description                                               *
    *                                                  4.6C                *
    REPORT zsdr_price_upload  MESSAGE-ID zsdr_bdc_vk11  LINE-SIZE 150
    LINE-COUNT 75 .
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11) TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11)  TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
           END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr LIKE konp-kbetr,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            text(100) TYPE c,
            END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
            matnr   LIKE mara-matnr,
            msgtyp  LIKE bdcmsgcoll-msgtyp,
            msgid   LIKE bdcmsgcoll-msgid,
            msgnr   LIKE bdcmsgcoll-msgnr,
            text(100) TYPE c,
            END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
           matnr LIKE mvke-matnr,
           vkorg LIKE mvke-vkorg,
           vtweg LIKE mvke-vtweg,
           END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
            vkorg LIKE tvkov-vkorg,
            vtweg LIKE tvkov-vtweg,
            END OF type_tvkov.
    ** Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
           t_item TYPE STANDARD TABLE OF type_item,
           t_mvke TYPE STANDARD TABLE OF type_mvke,
           t_tvkov TYPE STANDARD TABLE OF type_tvkov,
           t_error TYPE STANDARD TABLE OF type_error,
           t_mtab TYPE STANDARD TABLE OF type_mtab.
    ** Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
           wa_item LIKE LINE OF t_item,
           wa_error LIKE LINE OF t_error,
           wa_mtab LIKE LINE OF t_mtab,
           wa_tvkov LIKE LINE OF t_tvkov,
           wa_mvke LIKE LINE OF t_mvke.
    **Rows for Table with Excel Data********
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA :  bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE.      " BDCDATA
    DATA :  tmess_mtab  LIKE  bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    **  SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    * END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
           v_kbetr(50) TYPE c, "used for line items
           v_dat1(50) TYPE c,  "used for line items
           v_dat(50) TYPE c.   "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
           v_lindx1(5) TYPE n  VALUE '01', "index counter for  13 records.
           v_item(5) TYPE c,  "To increment the line index
           v_pgedwn2  TYPE i . "For Pagedown Counter
    DATA:  v_currentrow TYPE i.  "For Current Row
    DATA  v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_fname.
      PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
      c_params-defsize = 'X'.
      c_params-dismode = 'N'.
      c_params-updmode = 'S'.
    ******Refresh
      PERFORM f_refresh.
    *********To upload File.
      PERFORM upload_file.
    ****User Confrimation only BDC will Process
      IF c_ans = '1'.
    ** *** BDC Process.
        PERFORM read_data.
      ELSE.
        FORMAT COLOR 3 INTENSIFIED .
        WRITE:/ 'Selected not to Process the Upload'.
        EXIT.
      ENDIF.
    ******On completion of  Process Refresh the Internal Table
      REFRESH :  t_xls_file,
                   t_header,
                   t_item,
                   t_mvke,
                   t_tvkov.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov.
    ***********Display Messages
      WRITE : /01 'Status',19 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_mtab INTO wa_mtab.
        WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
      ENDLOOP.
      SKIP 2.
      SORT t_error BY matnr.
      WRITE  AT 0(150) sy-uline.
      WRITE 'ERROR MESSAGES'.
      WRITE  AT 0(150) sy-uline.
      WRITE :/01 'Material.No',20 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
        WRITE:/01 wa_error-matnr,20 wa_error-text.
      ENDLOOP.
    *&      Form  get_filename
    *       text
    *      -->P_FILENAME  text
    FORM get_filename USING    p_fname.
    *****To read the file from Presentation Server
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        =  repid
        dynpro_number      ! ; =   syst-dynnr
          field_name          = p_fname
    *   STATIC              = ' '
        mask                = '*.XLS'
        CHANGING
          file_name           = p_fname
    EXCEPTIONS
       mask_too_long       = 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.
      ENDIF.
    ENDFORM.                    " get_filename
    *&      Form  upload_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM upload_file.
      DATA : frow VALUE 2 TYPE i,
             fcol VALUE 1 TYPE i,
             erow VALUE 10000 TYPE i,
             ecol VALUE 7  TYPE i,
             ecol1 VALUE 1 TYPE i,
             c_col1 TYPE i VALUE '0001',
             c_col2 TYPE i VALUE '0002',
             c_col3 TYPE i VALUE '0003',
           &nb! sp; c_col4 TYPE i VALUE '0004',
             c_col5 TYPE i VALUE '0005',
             c_col6 TYPE i VALUE '0006',
             c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_fname
                i_begin_col             = fcol
                i_begin_row             = frow
                i_end_col               = ecol
                i_end_row               = erow
           TABLES
                intern                  = t_xls_file
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE e000.
      ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
      IF t_xls_file[] IS INITIAL.
        FORMAT COLOR 6 ON INTENSIFIED ON.
        WRITE:/ 'No Data  Exists '.
        FORMAT COLOR OFF INTENSIFIED OFF.
        STOP.
      ELSE.
    * Sort table by rows and colums
        SORT t_xls_file BY row col.
    * Get first row retrieved
        READ TABLE t_xls_file INDEX 1.
    * Set first row retrieved to current row
        v_currentrow = t_xls_file-row.
    **Loop  to move data in internal Table
        LOOP AT t_xls_file .
    *   Reset values for next row
          IF t_xls_file-row NE v_currentrow.
            APPEND wa_header TO t_header.
            CLEAR wa_header.
            v_currentrow = t_xls_file-row.
          ENDIF.
          CASE t_xls_file-col.
            WHEN  c_col1.                              "Kschl
              wa_header-kschl = t_xls_file-value.
            WHEN c_col2.                              "Vkorg
              wa_header-vkorg = t_xls_file-value.
            WHEN c_col3.                              "vtweg
              wa_header-vtweg = t_xls_file-value.
            WHEN c_col4.                              "Matnr
              wa_header-matnr = t_xls_file-value.
            WHEN c_col5.                              "Kbetr
              wa_header-kbetr = t_xls_file-value.
            WHEN c_col6.                              "FROm
              wa_header-datab   = t_xls_file-value.
            WHEN c_col7.                              "TO
              wa_header-datbi   = t_xls_file-value.
          ENDCASE.
        ENDLOOP.
        APPEND wa_header TO t_header.
        CLEAR wa_header.
      ENDIF.
    ****To process the data
      PERFORM f_process.
    ENDFORM.                    " upload_file
    *&      Form  READ_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM read_data.
    ****To make Uniq Records in Header Level
      SORT t_header BY kschl vkorg vtweg.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
                                       kschl vkorg vtweg .
      SORT t_item BY vkorg vtweg matnr.
      DATA : wa1_item TYPE type_item.
      DATA : l_cnt TYPE i.
      DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
      LOOP AT t_header INTO wa_header.
        PERFORM bdc_dynpro      US! ING 'SAPMV13A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ANTA'.
        PERFORM bdc_field       USING 'RV13A-KSCHL'
                                      wa_header-kschl.
        PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV130-SELKZ(03)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=WEIT'.
        PERFORM bdc_field       USING 'RV130-SELKZ(03)'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KOMG-VKORG'.
        PERFORM bdc_field       USING 'KOMG-VKORG'
                                       wa_header-vkorg.
        PERFORM bdc_field       USING 'KOMG-VTWEG'
                                       wa_header-vtweg.
    ****To handle Line Items.
        LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
                                      vtweg = wa_header-vtweg.
          wa_item = wa1_item.
    ******Flag Set only After processing  first 14 records .
          IF flag = ' '.
            v_lindx  = v_lindx + 01.
            SHIFT  v_lindx LEFT DELETING LEADING '0'.
            v_item  = v_lindx .
            CONCATENATE 'KOMG-MATNR(' v_item ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF  v_item = 14.
              flag = 'X'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              CLEAR v_lindx.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
    ***Flag is Set  after Processing of 14 records.
    ****** TO process rest of Records
          IF flag = 'X'.
            v_pgedwn2  = v_pgedwn2 + 1.
            v_lindx1  = v_lindx1 + 01.
            SHIFT  v_lindx1 LEFT DE! LETING LEADING '0'.
            v_item  = v_lindx1 .
            CONCATENATE 'KOMG-MATNR(' v_it! em ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF v_pgedwn2 = 13.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              v_pgedwn2 = 0.
              v_lindx1 = 1.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
        ENDLOOP.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                   '=SICH'.
    ****** Calling Transaction after Processing All items.
        CALL TRANSACTION 'VK11' USING bdctab
                           OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
        REFRESH bdctab.
        CLEAR : bdctab.
        CLEAR : wa_item.
        CLEAR : wa1_item.
        CLEAR : wa_header.
        CLEAR : l_cnt.
        CLEAR : v_lindx1.
        CLEAR:  v_pgedwn2,v_lindx.
        LOOP AT tmess_mtab .
          l_cnt =  l_cnt + 1.
          READ TABLE t_item INTO wa_item INDEX l_cnt .
          CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
               EXPORTING
                    arbgb             = tmess_mtab-msgid
                    msgnr             = tmess_mtab-msgnr
                    msgv1             = tmess_mtab-msgv1
                    msgv2             = tmess_mtab-msgv2
                    msgv3             = tmess_mtab-msgv3
                    msgv4           !   = tmess_mtab-msgv4
               IMPORTING
                    msgtext           = wa_mtab-text
               EXCEPTIONS
                    message_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.
          ENDIF.
          wa_mtab-matnr   = wa_item-matnr.
          wa_mtab-msgtyp  = tmess_mtab-msgtyp.
          wa_mtab-msgid   = tmess_mtab-msgid.
          wa_mtab-msgn! r   = tmess_mtab-msgnr.
          APPEND wa_mtab TO t_mtab.
          CLEAR wa_mtab-text.
          CLEAR wa_item.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " READ_DATA
    *&      Form  BDC_DYNPRO
    *       text
    *      -->P_0300   text
    *      -->P_0301   text
    *        Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdctab.
      bdctab-program  = program.
      bdctab-dynpro   = dynpro.
      bdctab-dynbegin = 'X'.
      APPEND bdctab.
    ENDFORM.                    " BDC_DYNPRO
    *&      Form  BDC_FIELD
    *       text
    *      -->P_0305   text
    *      -->P_WA_HEADER_KSCHL  text
    *        Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdctab.
      bdctab-fnam = fnam.
      bdctab-fval = fval.
      APPEND bdctab.
    ENDFORM.                    " BDC_FIELD
    *&      Form  bdc_trc_ansaction
    *       text
    *      -->P_0527   text
    *&      Form  f_Process
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_process.
      DATA : l_todate(12) TYPE c,
             l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
      IF NOT t_header[] IS INITIAL.
       SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
                               IN t_header WHERE matnr = t_header-matnr AND
                                                 vkorg = t_header-vkorg AND
                                                     vtweg = t_header-vtweg.
      ENDIF.
    *********select Sales.org & Dist.channel.
      IF NOT t_header[] IS INITIAL.
        SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
                                    t_header WHERE vkorg = t_header-vkorg
                                               AND vtweg = t_header-vtweg.
      ENDIF.
    ***Checking for material in Sales Master Table
      SORT t_mvke BY matnr vkorg vtweg.
      SORT t_tvkov BY vkorg vtweg.
      LOOP AT t_header INTO wa_header.
        READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
                                                 vkorg = wa_header-vkorg
                                    ! ;  vtweg = wa_header-vtweg BINARY SEARCH.
        IF sy-subrc <> 0.
          wa_error = wa_header.
        &nb! sp; MOVE text-011 TO  wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ELSE.
    ********Date Validations
          IF ( wa_header-datab  NE ' ! ;  '  AND  wa_header-datbi NE  '  ' ) .
            l_todate = wa_header-datab.
            l_frdate = wa_header-datbi.
            REPLACE '.' INTO l_toda! te WITH ''.
            REPLACE '.' INTO l_todate WITH ''.
            CONDENSE l_todate NO-GAPS.
            REPLACE '.' INTO l_frdate WITH ''.
            REPLACE '.' INTO l_frdate WITH ''.
            CONDENSE l_frdate NO-GAPS.
            IF l_frdate < l_todate.
              wa_error = wa_header .
              MOVE text-012 TO wa_error-text.
              APPEND wa_error TO t_error.
              DELETE TABLE t_header FROM wa_header.
            ENDIF.
          ELSE.
            wa_error = wa_header .
            MOVE text-016 TO wa_error-text.
            APPEND wa_error TO t_error.
            DELETE TABLE t_header FROM wa_header.
          ENDIF.
        ENDIF.
    ********Rate Validation.
        IF wa_header-kbetr = '   '.
          wa_error = wa_header .
          MOVE text-017 TO wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ENDIF.
        READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
                                                   BINARY SEARCH.
        IF sy-subrc  = 0.
          READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
                                                       BINARY SEARCH.
          IF sy-subrc  <> 0.
            wa_error = wa_header.
            MOVE text-015 TO  wa_error-text.
            WRITE wa_header-vtweg TO wa_error-text+13(4).
            APPEND wa_error TO t_error.
          ENDIF.
        ELSE.
          wa_error = wa_header.
          MOVE text-013 TO  wa_error-text.
          WRITE wa_header-vkorg TO wa_error-text+9(4).
          APPEND wa_error TO t_error.
        ENDIF.
        CLEAR wa_header.
      ENDLOOP.
    *****Deleting Duplicate Material  Form Header "Flat File Data".
      SORT t_header BY kschl vkorg vtweg matnr.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
            kschl! vkorg vtweg matnr .
    *  ****Data Moving from Header to Item Level.
      t_item[] = t_header[].
    *To count No.of records in Item Table.
      DESCRIBE TABLE t_item  LINES v_count.
      CONCATENATE text-014 ' ' v_count INTO  v_bdc.
    ****Popup to get Confirmation from user to process BDC
      CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
                titlebar       = 'Confirmation of File Data'
                text_question  = v_bdc
                text_button_1  = 'Confirm'
                text_button_2  = 'Cancel Run'
                default_button = '1'
           IMPORTING
                answer         = c_ans.
      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_Process
    *&      Form  f_Refresh
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_refresh.
      REFRESH :  t_xls_file,
                 t_header,
                 t_item,
                 t_mvke,
                 t_tvkov,
                 t_error,
                 t_mtab.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov,
                 wa_error,
                 wa_mtab.
    ENDFORM.                    " f_Refresh
    reward  point s  if it is usefull ....
    girish

  • Generic BDC for VK11

    Hi
    Can any one tell me how to create <b>Generic BDC for  transaction VK11 (Creating condition records)</b>
    My actual requirement is like we need to create <b>condition record</b> for  every  material  with all the condition types exist for that material  for different key combinations dynamically . <b>A condition record for  every material is to be created for different condition types and  different key combinations dynamically where material MATNR is a key field</b>  for example i need to create a conditon record for condition type <b>ZPR0,ZPR1</b> etc dynamically for different key combinations.
    can anyone of you point out a way to me?
    Thanks in advance
    Shivakumar

    Hi
    Can any one tell me how to create <b>Generic BDC for  transaction VK11 (Creating condition records)</b>
    My actual requirement is like we need to create <b>condition record</b> for  every  material  with all the condition types exist for that material  for different key combinations dynamically . <b>A condition record for  every material is to be created for different condition types and  different key combinations dynamically where material MATNR is a key field</b>  for example i need to create a conditon record for condition type <b>ZPR0,ZPR1</b> etc dynamically for different key combinations.
    can anyone of you point out a way to me?
    Thanks in advance
    Shivakumar

  • Pricing condition MM in reference to a SD condition : vendor field in VK11?

    Hello everyone,
    I am facing a problem with a MM condition type which has been defined in the custo with a SD "Reference condition type" (Reference application "V").
    If I want to create the condition record for this condition, I have to use VK11 transaction instead of MEK1.
    When I use MEK1 transaction on a classic MM condition, if I go to the "details", I can seize a payment term or the vendor.
    But with the condition defined with a SD "Reference condition type", with VK11 transaction the field "vendor" is not reachable in the details tab.
    Is there a way to add the field "vendor" in the details tab of the transaction VK11 ?
    Thanks a lot for your help,
    Benjamin.

    You can create new access sequence and assgin the particular field in that aceess sequence

  • Pricing condition,automatic display without doing VK11 firstly, how ?

    Hi all, another question.
    I have a pricing condition in my sale order. and its value is determined by Pricing Conditions Routines with Conditions Value.
    How can it automatic display in the condition of my sale order, without doing VK11 firstly.
    My english is poor, so I hope u can understand these.

    Hi
    As I said in my previous thread , go to VOFM->Pricing, and check in the requirements if any standard requirements are meeting your requirement or not .If it is not meeting then create a new requirement with the help of  technical consultant.  and assign the requirement  in the Pricing  procedure requirement feild for the condition type and then check wheather it is capturing the price or not in the sales order and billing documents.
    Regards
    Srinath

  • Condition records in VK11

    Hi all,
    I need the clarifiaction for a scenario while creating condition record.
    In A911 table for a Material X and Plant 1004 there exist a condition record with Valid From 01/01/2008 and VAlid to 12/31/9999 .
    the entry in A911 is as below.
    Material Plant Valid From   Valid To    CondRecordNumber
    X           1004  01/01/2008 12/31/9999 0000999001
    In vk11 if i create a condition record for the same Material X and Plant 1004 with the Valid From date 01/15/2008 and Valid To date 01/17/2008  the entries in A911 is as follows
    Material Plant Valid From   Valid To    CondRecordNumber
    X           1004  01/01/2008 01/14/2008 0000999001
    X           1004  01/15/2008 01/17/2008  0000099987
    X           1004  01/18/2008 12/31/9999 0000999001
    You can notice that first and third row has the same condition number..bcoz of the second record the first record got spilitted and itself created the third row.
    My question is if i create a condiion record with this sceanion in Vk11 the records are stored in A911 table like this (shown above).
    But when i try to create the condition record with BAPI_PRICES_CONDITON.(where a condition record with valid from date 01/15/2008 and valdi to 01/17/2008)
    it is not creating the record..
    it only creates a record where the current dates does not fall within the range of any existing records in A911...
    if i am wrong anywheer in using the bapi.please let me know.
    actually bapi is working ..but not for the scenarion which i have explained.
    please help ..points will be rewarded

    Hi Hemavathi,
    I guess RCD is your system name and 230 your client. But what software are you running in your system (Menu: System->Status  field Component Version)?
    Regards,
    John.

  • Cannot save billing, when the sales price is not maintained in VK11

    Dear Expert,
    I want to block billing when the sales price is not maintained in VK11?
    How to block it?
    Thanks
    SAP Support

    Hi,
    We cannot have incompletion procedure at the billing document level.It will be happened at the sales order level.
    But we can control this one either by using the user exit or any ABAP code.
    Goto the T.Code "V/06".Select your condition type.Details.Maintain the value as "A" for the field "Manual entries".
    Goto the T.Code "V/08".Select your pricing procedure.Details.
    Maintain this condition type as required.
    Save.
    This ensures that it should fetch values for this condition type automatically i.e. from condition record.Else it will throw an error message.
    Regards,
    Krishna.

  • Restrict a t.code VK11 using Site as authorization object

    Hi all,
    We want to restrict VK11 t.code using Site as one of the authorizations. By default it has only Sales Org, Distr channel and division. I've added one more field for "Site" manually.
    We have defined specific values for Site in authorization objects. Still system does not restrict VK11 executed by  user as per site. It works with Sales org/Distr ch/Division. But it does not restrict Site-wise for that role.
    Please help.
    Regards,
    Ankush

    > I've never got past 'play dead' with such objects
    Yip, I know that feeling. It is like when you leave home for a long trip having packed everything you need, but you still have the feeling that you have forgotten something important behind and will kick yourself when you need it.
    > Can you please provide step by step instructions for that?
    There is no step-by-step procedure nor medication to take for it. You just have to wait for it to dawn on you...
    Enjoy the weekend and happy coding authority-checks,
    Julius
    ps: I heard that this feeling is also caused by the rising popularity of ABAP OO programming techniques, where the checks are often natively imbedded.

  • Automatic import of prices in VK11

    Is there standard transaction/program in SAP to import sales prices (netered manually in VK11 - condition PR00) from excel file?

    Hi,
    Please refer the below links...
    Bapi for VK11 & VK12
    Upload Price records for Condition Type using transaction VK11 and VK12
    you can done thru lsmw or BDC as well..
    Kuber

  • BAPI for T.Code: VK11

    How to find the BAPI for transfering data to VK11 T.code.
    Sunil.

    Refer this one -
    BAPI_PRICES_CONDITIONS
    Sample code -
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Regards,
    Amit
    Reward all helpful replies.

  • BAPI or BDC Program For pricing VK11

    Hi All,
       Is there any standard program for pricing VK11 using batch input or send me some coding on Bapi or BDC.
    Thanks in Advance.
    Arun.
    Edited by: Arun Kumaran on Dec 24, 2009 11:40 AM

    Hi,
    You can go for BAPI "BAPI_PRICES_CONDITIONS " instead of a BDC.. you could have search in forums first for these type of questions any ways
    See the link below..
    BDC (VK11)
    regards,
    NZR

  • Uploading of vk11 (pricing condition) transaction

    Hi friends,
    I have to upload data from legacy system to SAP using VK11 tcode , can use  LSMW for VK11 transaction ? . I have to use batch input standard program....
    when we open VK11 tranaction first its  asking for condition type ( KSCHL ) for each condition type the next screen is varying .
    is it  possible to do using recording.?
    otherwise
    is there any stanadard LSMW program for this ,in the batch input.
    what is that program how to use that  program.
    can any body help me in this regard.
    Regards,
    Jayan

    Hi,
    For pricing conditions you will be having the condition type and table name in the
    first screen of the VK11 transaction.
    In the second screen of VK11 you can see the fields will be varing based up on the
    table name you are specifying the first screen.
    You can use field VAKEY in the batch input program to pass all the values.
    For example:
    Your table name A601 contians three fields mentioned below.Leave the fields such as
    KAPPL,KSCHL,DATBI,DATAB,KBSTAT,KNUMH since these will be avialble for all the tables.
    the rest varing fields are
    VKORG     VKORG     CHAR     4
    VTWEG     VTWEG     CHAR     2
    SPART     SPART     CHAR     2
    KUNNR     KUNNR_V     CHAR     10
    KONDA     KONDA_V     CHAR     2
    MATNR     MATNR     CHAR     18
    KFRST     KFRST     CHAR     1
    You need to pass the value of all the fields to the VAKEY in the batch input program.
    using offset option mentioned below.
    VAKEY+0(4) = source-vkorg.
    VAKEY+4(2) = source-vkorg.
    VAKEY+6(2) = source-vkorg.
    VAKEY+8(10) = source-vkorg.
    VAKEY+18(18) = source-vkorg.
    VAKEY+ 36(1) = source-vkorg.
    Hope this will help you

Maybe you are looking for

  • General question

    I'm thinking of biting the bullet and signing off on Tmobile to switch to Verizon, I'm sick of the coverage, lack of phone updates, etc.  There's three people in my family and we all need data plans, and we're all Android users.  Just interested in h

  • CRYSTAL REPORT GRAPH WITH DATE AND TIME

    Post Author: Dino Dentone CA Forum: Charts and Graphs Dear forum, I am developing a Visual Studio .net 2005 Windows Form,i have a sql table with 2 field:1) DATA (date and time)2) Temperatura (numeric)I have to make a line graph with numeric data axes

  • Custom table cell renderer in a JTable is not called

    Hello, all, I have the following task: I need to select several cells in a column, change the value of those cells, and once the value changes, the color of these cells should change as well. I wrote a custom cell renderer, and registered it for the

  • Message in OO ALV Grid

    Hello, I have implemented an output display using OO ALV grid. At the point of data change I check the entered data and issue a message if necessary. after the message is issued the program exits immediately at any type of input(double click, enter e

  • Forecast future data

    Dear All Is it possible that we can perform various kinds of analysis like correlation analysis,regression analysis,volatility anlysis,statistical analysis etc.on historical data and forecast future price etc for using BI. If so please let me know ho