FB50 upload data err."Item 1000 should be created maximum 999

REPORT ZBDC_TAB_CTRL_FB50 . DATA: I_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE. ****Header Internal Table DATA: BEGIN OF T_HEAD OCCURS 0, BLDAT(10) TYPE C, BUDAT(10) TYPE C, END OF T_HEAD. ****Detail Internal Table DATA: BEGIN OF T_DET OCCURS 0, BLDAT(10) TYPE C, BUDAT(10) TYPE C, HKONT LIKE ACGL_ITEM-HKONT, SHKZG LIKE ACGL_ITEM-SHKZG, WRBTR(16) TYPE C, END OF T_DET. DATA: T_EXCEL LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE, IDX(2) TYPE C, FNAM(20) TYPE C, FVAL(40) TYPE C. ***Internal Table for Holding Messages DATA: BEGIN OF MSGTAB OCCURS 0. INCLUDE STRUCTURE BDCMSGCOLL. DATA: END OF MSGTAB. ** Parameter for locating the .xls file PARAMETER:P_FILE TYPE RLGRAP-FILENAME OBLIGATORY. ***Selection Block for Header Section SELECTION-SCREEN : BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001. PARAMETER: PBROW_HD TYPE I, PEROW_HD TYPE I, PBCOL_HD TYPE I, PECOL_HD TYPE I. SELECTION-SCREEN : END OF BLOCK BLK1. ***Selection Block for Detail Section SELECTION-SCREEN : BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002. PARAMETER: PBROW_DT TYPE I, PEROW_DT TYPE I, PBCOL_DT TYPE I, PECOL_DT TYPE I. SELECTION-SCREEN : END OF BLOCK BLK2. ****Selecting the AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE. CALL FUNCTION 'F4_FILENAME' * EXPORTING * PROGRAM_NAME = SYST-CPROG * DYNPRO_NUMBER = SYST-DYNNR * FIELD_NAME = ' ' IMPORTING FILE_NAME = P_FILE. START-OF-SELECTION. ***Selecting data from .xls for the header data CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING FILENAME = P_FILE I_BEGIN_COL = PBCOL_HD I_BEGIN_ROW = PBROW_HD I_END_COL = PECOL_HD I_END_ROW = PEROW_HD TABLES INTERN = T_EXCEL EXCEPTIONS INCONSISTENT_PARAMETERS = 1 UPLOAD_OLE = 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. ****For Header internal Table LOOP AT T_EXCEL WHERE ROW GT 0. CASE T_EXCEL-COL. WHEN 1. MOVE T_EXCEL-VALUE TO T_HEAD-BLDAT. WHEN 2. MOVE T_EXCEL-VALUE TO T_HEAD-BUDAT. ENDCASE. AT END OF ROW. APPEND T_HEAD. CLEAR T_HEAD. ENDAT. ENDLOOP. ***Selecting data from .xls for the detail data CALL fuNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING FILENAME = P_FILE I_BEGIN_COL = PBCOL_DT I_BEGIN_ROW = PBROW_DT I_END_COL = PECOL_DT I_END_ROW = PEROW_DT TABLES INTERN = T_EXCEL EXCEPTIONS INCONSISTENT_PARAMETERS = 1 UPLOAD_OLE = 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. ****For Detail internal Table LOOP AT T_EXCEL WHERE ROW GT 0. CASE T_EXCEL-COL. WHEN 1. MOVE T_EXCEL-VALUE TO T_DET-BLDAT. WHEN 2. MOVE T_EXCEL-VALUE TO T_DET-BUDAT. WHEN 3. MOVE T_EXCEL-VALUE TO T_DET-HKONT. WHEN 4. MOVE T_EXCEL-VALUE TO T_DET-SHKZG. WHEN 5. MOVE T_EXCEL-VALUE TO T_DET-WRBTR. ENDCASE. AT END OF ROW. APPEND T_DET. CLEAR T_DET. ENDAT. ENDLOOP. ***Populating i_bdcdata from the header internal table LOOP AT T_HEAD . PERFORM BDC USING 'H'. ***Populating i_bdcdata from the detail internal table LOOP AT T_DET WHERE BLDAT = T_HEAD-BLDAT AND BUDAT = T_HEAD-BUDAT. PERFORM BDC USING 'D'. ENDLOOP. PERFORM POPULATE_BDCTABLE USING:'' 'BDC_OKCODE' '=BU'. CALL TRANSACTION 'FB50' USING I_BDCDATA MODE 'A' UPDATE 'A'. ENDLOOP. &---- *& Form POPULATE_BDCTABLE &---- * text ---- * -->P_0011 text * -->P_0012 text * >P_0013 text ** FORM POPULATE_BDCTABLE USING VALUE(P_FLAG) VALUE(P_FNAM) VALUE(P_FVAL). IF P_FLAG = 'X'. I_BDCDATA-PROGRAM = P_FNAM. I_BDCDATA-DYNPRO = P_FVAL. I_BDCDATA-DYNBEGIN = 'X'. ELSE. I_BDCDATA-FNAM = P_FNAM. I_BDCDATA-FVAL = P_FVAL. ENDIF. APPEND I_BDCDATA. CLEAR I_BDCDATA. ENDFORM. " POPULATE_BDCTABLE *&* *& Form BDC *&* * text *--
* * >P_0416 text *--
* FORM BDC USING VALUE(P_VAL). ****For Header IF P_VAL = 'H'. DATA:L_BLDAT(10) TYPE C, L_BUDAT(10) TYPE C. CLEAR:L_BLDAT,L_BUDAT. WRITE: T_HEAD-BLDAT TO L_BLDAT, T_HEAD-BUDAT TO L_BUDAT. PERFORM POPULATE_BDCTABLE USING:'X' 'SAPMF05A' '1001', ' ' 'BDC_OKCODE' '=0006', ' ' 'BDC_CURSOR' 'ACGL_ITEM-WRBTR(01)', ' ' 'ACGL_HEAD-BLDAT' L_BLDAT, ' ' 'ACGL_HEAD-BUDAT' L_BUDAT . ****For Detail ELSEIF P_VAL = 'D'. IDX = IDX + 1. IF IDX = 1. CONCATENATE 'ACGL_ITEM-HKONT(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING: ' ' FNAM T_DET-HKONT. CONCATENATE 'ACGL_ITEM-SHKZG(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING ' ' FNAM T_DET-SHKZG. CONCATENATE 'ACGL_ITEM-WRBTR(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING ' ' FNAM T_DET-WRBTR. ELSE. IF IDX > 10. IDX = 10. ENDIF. PERFORM POPULATE_BDCTABLE USING: 'X' 'SAPMF05A' '1001', ' ' 'BDC_OKCODE' '=0006'. CONCATENATE 'ACGL_ITEM-HKONT(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING: ' ' FNAM T_DET-HKONT. CONCATENATE 'ACGL_ITEM-SHKZG(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING ' ' FNAM T_DET-SHKZG. CONCATENATE 'ACGL_ITEM-WRBTR(0' IDX ')' INTO FNAM. PERFORM POPULATE_BDCTABLE USING ' ' FNAM T_DET-WRBTR. ENDIF. ENDIF. ENDFORM. " BDC
Moderator message - Please observe the 2,500 character maximum for posts - post only the relevant portions of your code -  post locked
Edited by: Rob Burbank on Aug 31, 2009 10:26 AM

Hi,
You can create 999 line items only in one Document.
Thats the Standard.
You have to split your data in to 999 each.
just an example ..try to do like this......
DO.
    CLEAR: bdcdata,gt_itab,count.
    REFRESH: bdcdata, gt_itab.
    DESCRIBE TABLE itab LINES l_line.
    IF l_line = 0.
      EXIT.
    ENDIF.
*get 900 materials from the itab
    LOOP AT itab.
      APPEND itab TO gt_itab.
      DELETE itab.
      count = count + 1.
      IF count = 900.
        EXIT.
      ENDIF.
    ENDLOOP.
    LOOP AT gt_itab.
      AT FIRST.
        PERFORM bdc_dynpro    
      AT LAST.
        PERFORM bdc_transaction TABLES msg
                                USING  'FB50' trans p_mode 'S'.
error handling..
Enddo.
Thnx
Rahul

Similar Messages

  • Error mensage: F5734 Item 1000 should be created, a maximum 999.......

    Hello Friends!!!
    We're using NewGL and Document splliting actived ECC 6.0
    When we're trying to execute the T-code F-51, show error mensage below:
    Error mensage: F5734 Item 1000 should be created, a maximum 999 items are allowed
    We selected in GL account one line item no case it can't exceed more than 999 line items
    The system creates exchange rate difference lines automatically per account combination.
    We want to clear this FI document, but It's impossible.
    Please suggest to solve the problem
    Best Regards, Delfim

    Hello Delfim,
    Usually the system seems to detect that an FI document shall be created with more than 999 line items (= message F5138). Then the system seems to cancel automatic postings (= message F5311).
    Finally, the system concludes that item 1000 should be created and rejects the posting (= message F5734).
    In order to locate the reason for this, can you please check whether the number of line items in the posting would truly exceed 999 in the entry view.
    You have to add the line item for the bank account plus line items to be cleared plus line items for cash discounts plus possibly line items for VAT adjustment of cash discounts.
    If the number of line items in the posting would truly exceed 999 in the entry view, please view the following notes:
    note 166487
    note 25727
    Please check also note 36353 for further information about Summarization.
    I hope it helps to resolve your problem
    Best Regards,
    Vanessa Barth.

  • Item 1000 should be created; a maximum of 999 item

    Hi Experts,
    while creating the idoc in ECC we are getting error message Item 1000 should be created; a maximum of 999 item. this is problem is occuring when we process the large file from SAP PI. the condition is large file should not be split.
    to resovle this we have implemented SAP Note-36353 and tested the problem is not resolved.
    can you please advise the solution.
    Best Regards,
    krushi.

    Hi,
    Check below link it might help you.
    https://scn.sap.com/thread/1226684

  • Uploading data from excel for profit center creation

    hey hi..well i m a begginner of SAP ABAP..
    IF anyone can help me out how to solve my problem..
    I have to upload data from excel using  gui_upload  and create it using BAPI_PROFITCENTER_CREATE
    and maintain log....
    I m not able to knw how to use that..
    Thanx in advace......
    Moderator message: sorry, these forums cannot replace ABAP training, please search for available information/documentation or attend classes.
    Edited by: Thomas Zloch on Jun 22, 2011 1:13 PM

    Hi,
      Check my previous post for the same question for referance
    Re: Excel to itab
    Guess this will help you.
    Regards,
    Ram.

  • How to upload vendor open item data.

    How to upload vendor open item data.

    HI Bhanu
    There are many threads on it.
    You can check the below one
    http://scn.sap.com/thread/3547986
    Regards
    Pankaj Pandey

  • IS THERE ANY SUITABLE BAPI'S To Upload data to F-02  ..OR we should use BDC

    HI FRIENDS,
    IS THERE ANY SUITABLE BAPI'S To Upload data to F-02  ..OR we should use BDC..
    WAITING FOR UR REPLY?
    THANKS.
    KIRAN

    Hi,
    I need to change the BDC program which is already written for F-02 in 4.7E.The changes are like I need to add 8 new posting keys, Kindly let me know how I can do it ,if already have the coding for the same please share with me.
    Thanks in advance,
    Jyoti

  • Upload sales order item data

    Hi All,
    I need to upload sales order item data.Could you please tell me the steps in R/3 to replicate data BW.
    Thanks
    Raj

    Hi,
    Steps to upload sales order item:
    1) Maintain extract structure (LBWE)
    2) Maintain Datasource. (LBWE)
    3) Replicate datasource in BW
    4) Assign Infosources (RSA1 - BW)
    5) Maintain comm struc/transfer rules (RSA1 - BW)
    6) Maintain infocubes and update rules (RSA1 - BW)
    7) Activate extract structures (LBWE)
    8) Delete setup tables / setup extraction (For deleting – LBWG and for setup use OLI7BW).
    9) Infopackage for delta init
    10) Set up periodic V3 update (LBWE)
    11) InfoPackage for delta load.
    Hope this helps.
    PB

  • Uploading data

    Hi sap gurus,
    1) What r the datas we  have to upload before golive
    2) How can i divided to upload data, like open items, cleard items $ balances like this
    thanku
    raj

    Hello Ramesh,
    initially you need to upload in Development and check everything is working fine and uploaded properly. You need to create master data in each client. You cannot transport master data. Initially upload in development then if everything is fine upload the same file in production.
    For uploading you need to create 5 GL masters you create one account group for upload accounts. In which you create 5 GL masters with following data Tax Category:* Line Item Display: Yes, Open Item Display: Yes, Sort: 0001(Gl), 012(Vend),031(Cust)018(Asst) etc, FSG: g001.
    Under that grp you need to create all 5 accounts. All are balance sheet Accounts. GL Balance Upload Ac, Customer Balance Upload Ac, Vendor Master Upload Ac, Asset Master Upload Ac, Material Upload Ac. You should take the trail balance of the company and chose all gl accounts with balances. Use LSMW upload GL balance upload.
    Ex-Salaries: these GLu2019s always shows debit balances. When upload GLu2019s the entry will be
    Salaries A/c Dr
    To GL Upload A/c
    Ex-Vendor Account: Vendor balances always shows credit balance and client want to upload line item wise ex line items are: 1000, 2000, and 3000 then
    Vendor Upload Ac Dr
    To Vendor Ac 1000 To Vendor Ac 2000 To Vendor Ac 3000 
    Ex-Customer Account: Customer balances always shows debit balance
    Customer A/c Dr
    To Customer upload A/c
    Ex-Assets: for assets you need to use AS91 which will create asset master data and upload balance in Asset master data and for uploading GL balance you use TC-OASV/OA97. System does not create any accounting entries.
    Ex-Materials: for material initial upload use TC-MB1C and movement type will be 561
    After upload block all the 5 gl masters which you have created for upload donu2019t show this Gl in Financial statement versions.
    Thanks
    Para

  • Uploading data from R/3 to CRM

    Hi Gurus,
    We have the following scenario:
    Our customer master data is created and maintained in R/3.  Now we need to create and maintain in CRM.
    1.  we need to bring R/3 customer to crm and start maintaining only in crm
    2.  there should not be any number overlap
    eg. 1000 customers in r/3 starting no. 1 to 1000, we need to bring this customer to crm and start maintaining in crm.  then from cusotomer no. 1001 onwards need to create from crm.
    Can anybody help me on the steps to be followed and the configuration settings to be maintained. How the number ranges have to be maintained and what settings should be done in CRM and R/3 before transfering the data.
    Also the steps on how to upload data from R/3 to CRM??
    Thanks.
    Divya Gupta

    Hi Divya,
    Create 2 different number ranges and groupings and assignement in CRM system
    For Ex:
    Create a number range(External) with 1 to 1000 and create a grouping ABC and do the assignment(R/3 customers)
    Create a number range(Internal) with 1000 to 100000 and create grouping XYZ and do the assignment (New customers)
    we need to bring R/3 customer to crm and start maintaining only in crm
    Do the following settings in R/3 system to bring the customer data from R3 to CRM
    T Code: PIDE
    Select R/3->CRM: Assign Account Grp. to BP Classification
    Select the Account group which is created in R/3 for customers and set classification as B and select the grouping  as ABC(Defined).
    and start initial download in CRM system with T.Code R3as
    Load Object  =  CUSTOMER_MAIN
    Source Site (Sender)  = R/3
    Destination Site (Receiver) = CRM
    and Execute.
    It will bring the customer data from R3 to CRM.
    While creating new customers in CRM system select the grouping as XYZ to avoid overlaping.
    Regards
    Narayana

  • While uploading data for employee as a vendor (with their loans and advance

    Hi,
    We are going for one company live. We are not taking HR module as of now.
    We are creating employee as a vendor for all employees with outstanding loans and advances.
    Now while uploading initial data for these employee (created as vendor), business wants personal loan outstanding balances employee as a vendor wise.
    Generally in case of normal vendor, we treat like
    Vendor A/C Dr
    to takeover creditors a/C  Cr
    while going for initial upload.
    In above case what should we do if we want outstanding balances (personal loan) while initial balance upload?
    Thanks,
    Taral Patel

    Hi,
    You can create a separate employee vendor for Advances paid to them with an assignment to a separate recon account titled as Advance to Employees. Later, you can upload the entries by Debiting the Employee Advance Vendor account and crediting Vendor Upload Account.
    Advances paid to employees (recon account) will represent in the TB as a separate line item forming an MIS.
    Regards
    Hari

  • Uploading data in MM01 for different material types

    Hi,
    I have a doubt regarding uploading the data in MM01 for different material types.
    Generally in MM01, we have different views for different material types. The number of views will vary depending upon the material type that we select.
    I have a scenario, where in to upload the data, I have a flat file that consists of data for different message types. So, how to upload the data in such case.
    Can anyone help me on the same by providing explanation or sample code...? What would be the possible ways to upload data in such scenario.
    That would be of great help.
    Thanks & Regards,
    Pradeep.

    See the below code and use FM SELECTION_VIEWS_FIND..
    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 useful
    Thanks
    Seshu

  • Not able to Upload data in Demand Planning data view

    Hi
    I am trying to upload a csv  file in to Demand planning interactive planning through " Upload Data " functionality
    First I exported data from interactive planning , updated some data in file and again trying to upload same file.
    I am getting following error
    File cannot be uploaded
    Message no. /SAPAPO/SDP_UPLOAD009
    Diagnosis
    File  has no technical information or incorrect technical information.
    Procedure
    Save the file again locally. Make sure that the file has the technical information.
    Could u please suggest what needs to be done
    Thanks and regards,
    Nitin Lavhe

    Hello,
    For using the upload data functionality from interactive planning grid, you need to first download the data. While downloading the data, please check the check box for "Prepare the file for upload at later time", and then select the option of putting the technical setting into the file or into the system. Either way is okay. Then try uploading the same file.
    This should solve your problem.
    Thank you.
    Regards,
    Jacky Jain.
    SAP APO Architect.

  • How to upload data from  flat to ztables with in the same client by idocs

    Hi Experts,
                   I have a requirement in IDOCS, I need to create a custom IDOC .I  am working on IDES 4.6c. The reqirement is , there  are ztables with header and item data. say for example Authors and Books. I need to upload data from flat file which is available in presentation  server of the same client, which will updated in ztables by using idocs.  For this i need to do ale settings also. The client is 800. There is no other client available. With in the same client i need to do the above stuff.
                    For this requirement how to approach (step by step) to accomplish.
    Thanks in Advance.
    Regards
    J.S.Varma

    Hi,
      This is the procedure.
    create segments using we31. <b>don't forget to relaese it</b>
    create idoc using above segments using we30 <b>don't forget to relaese it</b>
    create message type using we81
    create function module to upload data using se37
    maintain process code using we42
    create  partner profiles we20.
    In the fm module itself write the code for downloading the data from presentation server by GUI_DOWNLOAD.
      Then update the database tables directly by insrt through other internal table in the same client itself.
    Thanks
    Manju

  • Upload data from excel file to "Fast Data Entry" in FB60

    Hi,
    I have a requirement from users, they want to load data of G/L accounts items in FB60 using "Fast Data Entry" from an excel file.
    I did some research and found out that the framework to transfer clipboard data into an SAP table(http://www.synactive.com/examples/example0016.html) seems to be the suitable solution.
    However, I still cannot make it work.
    Do you have any suggestion for my case ? How can I load data from an excel file to the transaction FB60?
    Thanks in advance,
    Hung

    Dear Hung,
    You can upload data through LSMW (Batch Input).
    But you need to convert your excel sheet into CSV format or txt format.
    Please take help of your ABAP team if required.
    This will accommodate your requirement.
    Regards
    Saurabh

  • Open PO items that should have been already delivered

    Hi,
    is there a transaction where you can see the open PO items that should have been delivered already up to a certain date? If a PO has several scheduling lines and also several confirmations were entered for the scheduling lines only quantities should be displayed were the delivery date is due (based on the selection date/usually the current date) on no GR was made so far.
    I tried already ME2N with selection parameter WE101 but this shows all open items (in past and future).
    And a problem I have in general is, that I dont see a direct link between the scheduling lines and the confirmations.
    Cheers
    Mathias

    ME2L gives the same result. I dont want to see the delivery schedules that are in the future but only the ones that are overdue (delivery date in the past and no GR received).
    I checked ME2V, as I did not know it. But this is for warehouse people I guess. It shows with volume/weight info what is expected as GR per day on document level.

Maybe you are looking for