How to update data using BAPI for MD61

Hello,
IN my zprogram i used to bapis for uploading data from flat file to sap-system
1)BAPI_requirement_create
2)BAPI_requirement_change
i)my program is taking data from my flat file but it is wipping out old data i nned to update not to overwrite is there any BAPI for this query
ii)One more thing if data is already entered in on date (i.e 10.07.2009) and when he upload data from flat file for another date same month (12.07.2009) old date data sholud not removed ...
Please reply me if my query is not understand..
Thanks in advance..

Assuming you have your new requirements in table IT_REQ.
You could do something like:
DATA: it_req TYPE TABLE OF BAPISSHDIN.
DATA: l_req TYPE BAPISSHDIN.
DATA: it_req_out TYPE TABLE OF bapisitmeo.
DATA: l_req_out TYPE bapisitmeo.
*   Get existing requirements
    CLEAR it_req_out[].
    CALL FUNCTION 'BAPI_REQUIREMENTS_GETDETAIL'
         EXPORTING
              material         = p_matnr
              plant            = p_werks
              requirementstype = p_bedae
              version          = p_versb
              reqmtsplannumber = ''
         TABLES
              requirements_out = it_req_out[]
              return           = lt_return[].
*   Append old requirements to requirements table
    LOOP AT it_req_out INTO l_req_out.
      MOVE: l_req_out-date_type TO l_req-date_type,
            l_req_out-req_date TO l_req-req_date,
            l_req_out-req_qty TO l_req-req_qty,
            l_req_out-unit TO l_req-unit.
      APPEND l_req TO it_req.
    ENDLOOP.
*   Change requirements
    CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
         EXPORTING
              material                 = p_matnr
              plant                    = p_werks
              requirementstype         = p_bedae
              version                  = p_versb
              reqmtsplannumber         = ''
              vers_activ               = p_vervs
         TABLES
              requirements_schedule_in = it_req[]
              return                   = lt_return[].

Similar Messages

  • How to update the Weekly data using BAPI for MD61

    Hi All,
    i have used two BAPI's in my Z program to upload data from flat file to sap-system (BAPI_REQUIREMENTS_GETDETAIL and BAPI_REQUIREMENTS_CHANGE) and i uploaded the Monthly Data from the flat file on sap system successfully.
    but i have to also upload the Weekly Data on the sap system using BAPI.
    is there any BAPI for the same or what can be the solution for the uploading weekly data on sap system ?
    Please reply me.
    Thanks in advance..
    Edited by: Prajapati_Shyam on Dec 29, 2010 4:19 PM

    Hi Jovito,
    thanks for your reply,
    i developed a Z program to upload monthly data as well as weekly data into tcode MD61 by selecting the radio button weekly or monthly but i am not able to upload the weekly data as i didnt' get any BAPI OR any other logic to upload weekly data Or not able to use the existing BAPI BAPI_Requirement_create , because the upload file is in monthly format.
    MD61 tcode can be used for both data (Monthly or weekly data).
    can you suggesst me any BAPI to upload the weekly data or any other logic for the same
    thanks & regards
    Prajapati

  • How to compress data use jzlip for j2me or others Compression Techniques

    I want to capture audio use mmapi and upload to a server ,but wav is too large for me,how can I compress it?thanks!

    Hi,
    I tried this trigger method to compress. It does not work. I get an invalid argument error.
    I however figured a complete solution using forms: Here it is:
    to compress and store:
    Just put it to the table and use an update statement like this:
    UPDATE dlo_channa_documents
    SET da_document = UTL_COMPRESS.LZ_COMPRESS( da_document ) WHERE pk = :DLO_CHANNA_DOCUMENTS.pk;
    Now to uncompress and show
    (1.) Create a temp table with blob column
    (2.) Insert record to temp table like this:
         INSERT INTO dlo_channa_temp_blob
         SELECT v_next_val, UTL_COMPRESS.LZ_UNCOMPRESS( da_document )
         FROM dlo_channa_documents
         WHERE pk = :dlo_channa_documents.pk;     
    (3.) Now use webutil_file_transfer.db_to_client to transfer from temp table to client hdd and show using
         CLIENT_HOST( 'cmd /C start ' ||      v_saved_file_name_full_path); -- Open the document in Word
    Edited by: Channa on Feb 26, 2010 4:02 AM

  • Error in uploding data using bapi for me51n("urgent")

    i am getting the error "error in function,000 does not exist"
    i am sending u the code & txt file plz check it out and let me know..
    REPORT  zrv_bapi_pr.
    DATA: BEGIN OF itab OCCURS 0,
                bsart(4),
               ."Purchase requisition document type
                txz01(40),
               ."Short text
                menge(13),
               ."Purchase requisition quantity
                meins(3),
               ."Purchase requisition unit of measure
                eeind LIKE bapiebanc-deliv_date,
               ."Item delivery date
                wgbez(9),
               ."Material Group
                name1(4),
               ."Plant
                ekgrp(3),
               ."Purchasing Group
                afnam(12),
               ."Name of requisitioner/requester
                bednr(10),
               ."Requirement Tracking Number
                knttp(1),
               ."Account assignment category
                sakto(10),
               ."G/L Account Number
                ps_posid(8),
               ."Work Breakdown Structure Element (WBS Element)
                editor(132),
               ."Text line
          END OF itab.
    DATA: itab_bapiebanc  LIKE bapiebanc  OCCURS 0 WITH HEADER LINE.
    DATA: itab_bapiebkn   LIKE bapiebkn   OCCURS 0 WITH HEADER LINE.
    DATA: itab_bapiebantx LIKE bapiebantx OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF errmsg OCCURS 10.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF errmsg.
    DATA: errflag.
    CALL FUNCTION 'UPLOAD'
      EXPORTING
        filename = 'C:\Documents and Settings\sap\Desktop\New Text Document (2).txt'
        filetype = 'DAT'
      TABLES
        data_tab = itab.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      EXIT.
    ENDIF.
    LOOP AT itab.
      itab_bapiebanc-doc_type       =    itab-bsart.
      itab_bapiebanc-short_text     =    itab-txz01.
      itab_bapiebanc-quantity       =    itab-menge.
      itab_bapiebanc-unit           =    itab-meins.
      itab_bapiebanc-deliv_date     =    itab-eeind.
      itab_bapiebanc-plant          =    itab-name1.
      itab_bapiebanc-pur_group      =    itab-ekgrp.
      itab_bapiebanc-preq_name      =    itab-afnam.
      itab_bapiebanc-trackingno     =    itab-bednr.
      itab_bapiebanc-mat_grp        =    itab-wgbez.
      itab_bapiebanc-acctasscat     =    itab-knttp.
      itab_bapiebkn-g_l_acct        =    itab-sakto.
      itab_bapiebkn-wbs_elem_e      =    itab-ps_posid.
      itab_bapiebantx-text_line     =    itab-editor.
      APPEND itab_bapiebkn.
      APPEND itab_bapiebanc.
      APPEND itab_bapiebantx.
    ENDLOOP.
    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
      TABLES
        requisition_items              = itab_bapiebanc
        requisition_account_assignment = itab_bapiebkn
        requisition_item_text          = itab_bapiebantx
        return                         = errmsg.
    LOOP AT errmsg.
      IF errmsg-type EQ 'E'.
        WRITE:/'Error in function', errmsg-message.
        errflag = 'X'.
      ELSE.
        WRITE:/ errmsg-message.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *LOOP AT itab_bapiebanc.
    WRITE:/   itab_bapiebanc-doc_type,
          itab_bapiebanc-short_text,
          itab_bapiebanc-quantity,
          itab_bapiebanc-unit ,
        itab_bapiebanc-deliv_date,
        itab_bapiebanc-plant,
        itab_bapiebanc-pur_group,
        itab_bapiebanc-preq_name,
        itab_bapiebanc-trackingno,
        itab_bapiebanc-mat_grp,
          100 itab_bapiebanc-acctasscat.
    *ENDLOOP.
    *LOOP AT itab_bapiebkn.
    WRITE:/
                 itab_bapiebkn-g_l_acct,
                 itab_bapiebkn-wbs_elem_e.
    *ENDLOOP.
    *LOOP AT itab_bapiebantx.
    WRITE:/ itab_bapiebantx-text_line.
    *ENDLOOP.
    txt file
    NB     MOTOR     2     EA     20.04.2006     18000000     0020     010     SANGEETE     J505     P     4000     J525.2.2     crompton greaves make,3 phase motor

    Hi Ravi,
    Please use FM <b>GUI_UPLOAD</b> instead of FM UPLOAD (obsolete).
    call function 'GUI_UPLOAD'
      exporting
        filename            = 'C:Documents and SettingssapDesktopNew Text Document (2).txt'
        filetype            = 'DAT'
      tables
        data_tab            = itab.
    loop at itab.
    endloop.
    I think your error is related to line item in internal table <b>itab_bapiebanc</b>. You need to increment for each loop.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Upload data using bapi for migo

    dear all,
    i 'm faching froblem with migo
    my requriment is : if u give one PO,is the input. under one PO  we have a 1....N Bom s under one BOM we have  a 1...N line items OK  but quenty field was chaning accourding to our requriment. we need FOR BOM QNTY and LINE ITEM QNTY  was chnging how  it is possible or not please give me possiblites to me
    i will be waiting for reply.
    regards
    eswar

    Issue is Fixed!

  • Upload the data using bapi

    hi,
    i am new for bapi , can anyone tell me how to upload data using bapi with example?
    plz tell how to find bapi & how to use in coding to upload the data?

    Hi ,
             To find Bapi There a tcode Bapi which will take you to bapi Explorer From there you can find required
              the Bapi Function Module and its Documentation .
      [  www.sap-img.com/abap/bapi-step-by-step-guidance.htm ]
    [http://www.sappro.com/tag.cfm?session=&tag=bapi%20programming]
    [https://wiki.sdn.sap.com/wiki/display/Snippets/SalesordercreationusingBAPI]
    Regards
    Nilesh

  • For transaction code MD61, I want to upload data using BAPI

    Hi,
    for transaction code MD61, I want to upload data using BAPI.
    Which BAPi I ll call ?
    Can anyone suggest me how to do it with any simple example program ?

    Refer the thread for details about coding-
    BAPI_REQUIREMENTS_CREATE
    Reards,
    Amit

  • Error while updating AFS weights & measures material master data using BAPI

    Hello ABAP experts,
    Please help me in finding the right way in updating AFS weights & measures data (/AFS/MARM) data using BAPI /AFS/BAPI_MATERIAL_SAVE_DATA.
    I'm populating the following table parameters of the BAPI,
    1. SKUUNITSOFMEASURE with /AFS/MARM records
    s_bapi_marm-ALT_UNIT = 'EA'.
    s_bapi_marm-ALT_UNIT_ISO = 'EA'.
    s_bapi_marm-grid_value = 'XXXXS'.
    *s_bapi_marm-STOCK_CATEGORY = '01000'.
    s_bapi_marm-volume  = '10'.
    s_bapi_marm-GROSS_WT  = '10'.
    s_bapi_marm-NET_WEIGHT  = '10'.
    append s_bapi_marm to t_bapi_marm.
    2. UNITSOFMEASURE with MARM records
    s_bapi_uom-ALT_UNIT = 'EA'.
    s_bapi_uom-ALT_UNIT_ISO = 'EA'.
    s_bapi_uom-NUMERATOR = '1'.
    s_bapi_uom-DENOMINATR = '1'.
    s_bapi_uom-UNIT_OF_WT = 'KG'.
    s_bapi_uom-VOLUMEUNIT = 'CCM'.
    append s_bapi_uom to t_bapi_uom.
    But the BAPI returns me an error "Stock Category & is not valid in Category structure  &"
    Let me know if you have any inputs on this one.
    Thanks,
    Partha.

    Hi VAMSHI,
    I have your same error but I don't know how to solve it. We have active "material split valuation" and valuation type is mandatory field if using ACCOUNTING and COSTING views.
    Please, let me know.
    Thanks in advance.
    GB

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • Interface Using BAPI for Uploading shipment datas

    Can any1 send me the example code for Inbound Interface using BAPI for Uploading shipment datas.please kindly send me the programs which u using with BAPI

    Hi
    Except hiring (or new joinee) for all other actions you can use below Function Module.
    HR_INFOTYPE_OPERATION.
    ~~~Ganesh Kumar K.

  • I am unable to upload the customer master data using BAPI.?

    Hi Guru's,
    i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1)
    Please guide me how upload the data...
    Thanks in iadvance
    Srinivas...

    Hello Srinivas
    This BAPI does not allow to create a new customer from scratch but only to copy an existing customer to a new one and change its address data.
    The reference customer has to be provided using IMPORTING parameter PI_COPYREFERENCE. See also the BAPI documentation for more details.
    The BAPI does the same like transaction XD01 with Reference.
    Regards
      Uwe

  • How can I find a bapi for perticular tcode?

    hi,
    How can I find a bapi for perticular tcode?
    Thank you
    ASHOK KUMAR

    HI Ashok
    If you mean that you need to know what BAPI's a particular tranx uses, which I can only assume that's what you mean, then you should access the code behind the transaction and search for 'CALL'. That normally is the standard method that think that most people use. 
    Suppose you want to find the bapi for creating a sales order, you usually use transaction VA01 for this. 
    <b>1. Find out the package of the transaction.</b> 
    Start Va01 go to system --> status. 
    Double click on transaction 
    Package is VA 
    Open this package in SE80 
    Open business engineering-->Business object types 
    Find the BO which sounds the most appropriate 
    I would suggest BUS2032 Sales Order 
    Double click. 
    Open methods. 
    Find the released method with from data or something similar in the name 
    , Createfromdat2 
    Position the cursor in it and click the program button 
    Scroll down to find the bapi used in this method 
    With this way you can also find out programs and FM's 
    <b>2. Start va01 go to system-->status </b>
    Double click transaction VA01 
    Double click on package 
    Read the application component. (this is SD-SLS Sales) 
    Then open the transaction BAPI 
    Sales and distribution>Sales>sales order 
    createfromdat2 
    Regards
    Preeti
    <b>
    Please reward for useful reply</b>

  • How to create material using BAPI  Methods?

    hi,
    how to create material master dat using BAPI?
    could u guide me
    i will be waiting for reply.
    REGARDS
    ESWAR.

    Hi eswar,
    Try this code to create gods mmovement...
    DATA: GOODSMVT_HEADER LIKE BAPI2017_GM_HEAD_01,
          " Material Document Header Data
          GOODSMVT_CODE LIKE BAPI2017_GM_CODE,
          " Assign code to transaction for BAPI goods movement
          MATERIALDOCUMENT LIKE BAPI2017_GM_HEAD_RET-MAT_DOC,
          " Number of Material Document
          GOODSMVT_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER
          LINE,
          " Create Material Document Item
          RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE
          " Return table for messages
    *Fill values in header
    GOODSMVT_HEADER-PSTNG_DATE = '20030825'.
    GOODSMVT_HEADER-DOC_DATE = '20030802'.
    *Fill GOODSMVT_CODE
    GOODSMVT_CODE-GM_CODE = '05' .
    *Fill Item Table
    GOODSMVT_ITEM-MATERIAL = '100-100'.
    GOODSMVT_ITEM-PLANT = '1000'.
    GOODSMVT_ITEM-STGE_LOC = '0001'.
    GOODSMVT_ITEM-MOVE_TYPE = '501'.
    GOODSMVT_ITEM-ENTRY_QNT = '50'.
    GOODSMVT_ITEM-ITEM_TEXT = 'Test Sanket'.
    *GOODSMVT_ITEM-COSTCENTER = '1000'.
    APPEND GOODSMVT_ITEM.
    *Create Good's movement
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        GOODSMVT_HEADER  = GOODSMVT_HEADER
        GOODSMVT_CODE    = GOODSMVT_CODE
      IMPORTING
        MATERIALDOCUMENT = MATERIALDOCUMENT
      TABLES
        GOODSMVT_ITEM    = GOODSMVT_ITEM
        RETURN           = RETURN.
    *Commit BAPI
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT = 'X'.
    *Display Goods movement number
    FORMAT COLOR 6 INVERSE ON.
    READ TABLE RETURN WITH KEY TYPE = 'E'.
    IF SY-SUBRC = 0.
      WRITE: /,'ERROR! Goods movement not created'.
    ELSE.
      WRITE: /,'Goods movent number',MATERIALDOCUMENT COLOR 5,
               'posted for material',GOODSMVT_ITEM-MATERIAL.
    ENDIF.
    FORMAT COLOR OFF INVERSE OFF.
    try this on report program and create a goods movement.
    Sanket.

  • Please provide me how change the Materil using BAPI...?

    Hi Guru's,
    could please provide me how change the Materil using BAPI...
    please provide the BPAI name and step by step process...
    if ou provide any program logic that would be helpfull to me...
    thanks in advance
    Srinivas....

    Hi,
    THis is code .
    *& Report Zs_MATMAS_BAPI
    *& This program demonstrates how easy it is to create Material master
    *& data using BAPI_MATERIAL_SAVEDATA
    *& The program also generates a report post-execution displaying errors
    *& as well as successful uploads
    REPORT Zs_MATMAS_BAPI.
    TABLES
    FLAGS *
    DATA: F_STOP. " Flag used to stop processing
    DATA DECLARATIONS *
    DATA : V_EMPTY TYPE I, " No. of empty records
    V_TOTAL TYPE I. " Total no. of records.
    STRUCTURES & INTERNAL TABLES
    *BAPI structures
    DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
    BAPI_MAKT LIKE BAPI_MAKT, " Material Description
    BAPI_MARA1 LIKE BAPI_MARA, " Client Data
    BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
    BAPI_MARC1 LIKE BAPI_MARC, " Plant View
    BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
    BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
    BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
    BAPI_RETURN LIKE BAPIRET2. " Return Parameter
    *--- Internal table to hold excel file data
    DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *--- Internal table to hold Matetrial descriptions
    DATA: BEGIN OF IT_MAKT OCCURS 100.
            INCLUDE STRUCTURE BAPI_MAKT.
    DATA: END OF IT_MAKT.
    *--- Internal to hold the records in the text file
    DATA : BEGIN OF IT_DATA OCCURS 100,
                WERKS(4), " Plant
                MTART(4), " Material type
                MATNR(18), " Material number
                MATKL(9) , " Material group
                MBRSH(1), " Industry sector
                MEINS(3), " Base unit of measure
                GEWEI(3), " Weight Unit
                SPART(2), " Division
                EKGRP(3), " Purchasing group
                VPRSV(1), " Price control indicator
                STPRS(12), " Standard price
                PEINH(3), " Price unit
                SPRAS(2), " Language key
                MAKTX(40), " Material description
                END OF IT_DATA.
    SELECTION SCREEN. *
    SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
    PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
    'C:\Material_master.XLS'.
    PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
    PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
    PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
    P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
    P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
    P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK SCR1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *--- Validating file
      PERFORM VALIDATE_FILE USING P_FILE.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--- Perform to convert the Excel data into an internal table
      PERFORM CONVERT_XLS_ITAB.
      IF NOT IT_DATA[] IS INITIAL.
    *--- Perform to delete Header lines
        PERFORM DELETE_HEADER_EMPTY_RECS.
      ENDIF.
    END OF SELECTION. *
    END-OF-SELECTION.
    *--- Perform to upload Material Master data
      PERFORM UPLOAD_MATMAS.
    Form : validate_input_file
    Description : To provide F4 help for file if read from PC
    FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = F_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC  0.
        MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
      ENDIF.
    ENDFORM. " validate_input_file
    *& Form CONVER_XLS_ITAB
    text
    FORM CONVERT_XLS_ITAB.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = P_FILE
          I_BEGIN_COL = P_BEGCOL
          I_BEGIN_ROW = P_BEGROW
          I_END_COL   = P_ENDCOL
          I_END_ROW   = P_ENDROW
        TABLES
          INTERN      = IT_INTERN.
      IF SY-SUBRC  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--- Perform to move the data into an internal data
      PERFORM MOVE_DATA.
    ENDFORM. " CONVERT_XLS_ITAB
    *& Form MOVE_DATA
    text
    FORM MOVE_DATA.
      DATA : LV_INDEX TYPE I.
      FIELD-SYMBOLS <FS>.
    *--- Sorting the internal table
      SORT IT_INTERN BY ROW COL.
      CLEAR IT_INTERN.
      LOOP AT IT_INTERN.
        MOVE IT_INTERN-COL TO LV_INDEX.
    *--- Assigning the each record to an internal table row
        ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS>.
    *--- Asigning the field value to a field symbol
        MOVE IT_INTERN-VALUE TO <FS>.
        AT END OF ROW.
          APPEND IT_DATA.
          CLEAR IT_DATA.
        ENDAT.
      ENDLOOP.
    ENDFORM. " MOVE_DATA
    *& Form DELETE_HEADER_EMPTY_RECS
    To delete the Header and empty records
    FORM DELETE_HEADER_EMPTY_RECS.
      DATA: LV_TABIX LIKE SY-TABIX.
      IF NOT P_HEADER IS INITIAL.
        LOOP AT IT_DATA.
          IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
            DELETE IT_DATA FROM 1 TO P_HEADER.
    P_HEADER = 0.
            EXIT.
          ENDIF.
        ENDLOOP.
      ENDIF.
      CLEAR IT_DATA.
    *--- To delete the empty lines from internal table
      LOOP AT IT_DATA.
        LV_TABIX = SY-TABIX.
        IF IT_DATA IS INITIAL.
          V_EMPTY = V_EMPTY + 1.
          DELETE IT_DATA INDEX LV_TABIX..
        ENDIF.
      ENDLOOP.
      CLEAR IT_DATA.
    *--- Total no of recs in file
      DESCRIBE TABLE IT_DATA LINES V_TOTAL.
      IF V_TOTAL = 0.
        MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
        F_STOP = 'X'.
        STOP.
      ENDIF.
    ENDFORM. " DELETE_HEADER_EMPTY_RECS
    *& Form UPLOAD_MATMAS
    to upload Material Master data
    FORM UPLOAD_MATMAS .
      LOOP AT IT_DATA.
    Header
        UNPACK IT_DATA-MATNR TO IT_DATA-MATNR.
        BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
        BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
        BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
        BAPI_HEAD-BASIC_VIEW = 'X'.
        BAPI_HEAD-PURCHASE_VIEW = 'X'.
        BAPI_HEAD-ACCOUNT_VIEW = 'X'.
    Material Description
        REFRESH IT_MAKT.
        IT_MAKT-LANGU = IT_DATA-SPRAS.
        IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
        APPEND IT_MAKT.
    Client Data - Basic
        BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
        BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
        BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
        BAPI_MARA1-DIVISION = IT_DATA-SPART.
        BAPI_MARAX-MATL_GROUP = 'X'.
        BAPI_MARAX-BASE_UOM = 'X'.
        BAPI_MARAX-UNIT_OF_WT = 'X'.
        BAPI_MARAX-DIVISION = 'X'.
    Plant - Purchasing
        BAPI_MARC1-PLANT = IT_DATA-WERKS.
        BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
        BAPI_MARCX-PLANT = IT_DATA-WERKS.
        BAPI_MARCX-PUR_GROUP = 'X'.
    Accounting
        BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
        BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
        BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
        BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEWX-PRICE_CTRL = 'X'.
        BAPI_MBEWX-STD_PRICE = 'X'.
        BAPI_MBEWX-PRICE_UNIT = 'X'.
    *--- BAPI to create material
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
        HEADDATA = BAPI_HEAD
        CLIENTDATA = BAPI_MARA1
        CLIENTDATAX = BAPI_MARAX
        PLANTDATA = BAPI_MARC1
        PLANTDATAX = BAPI_MARCX
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA = BAPI_MBEW1
    VALUATIONDATAX = BAPI_MBEWX
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA = BAPI_MVKE1
    SALESDATAX = BAPI_MVKEX
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
        IMPORTING
        RETURN = BAPI_RETURN
        TABLES
        MATERIALDESCRIPTION = IT_MAKT
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
        IF BAPI_RETURN-TYPE = 'E'.
          WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-MATNR.
        ELSEIF BAPI_RETURN-TYPE = 'S'.
          WRITE: 'Successfully created material' ,IT_DATA-MATNR.
        ENDIF.
      ENDLOOP.
    ENDFORM. " UPLOAD_MATMAS
    Thanks
    Sarada

  • A relative synced my iphone with his laptop without me knowing. It had a passcode on the phone but the sync still worked. I have since found out he is quite IT knowledgeable and has been known to track other peoples phones.  How is this data useful to him

    A relative synced my iphone with his laptop without me knowing. It had a passcode on the phone but the sync still worked. I have since found out he is quite IT knowledgeable and has been known to track other peoples phones that he wants to know information about.  How is my data useful to him and can he restore this data on another iPhone and run it parallel to mine? I have had people send me messages which I have not received. These have been screen shot to me later including time and I have just not got them. I had 4 weeks worth of messages go missing from my phone..I know that he synced my phone because his work laptops I'd came up in my settings. Also if the above can be done can he change the settings on my actual phone and access my location without placing tracking software on my phone.  Can someone please help here as I can't restore a backup to my phone for obvious reasons and refuse to change my number because of this loser.

    Connect the device to the computer.
    In iTunes, select the content desired to sync.
    Sync.
    This is all described in the User's Guide, reading it may be a good place to start.

Maybe you are looking for

  • Help with creating multiple events for a single button

    I have a basic gui that is used to view a query. There is a JTextArea where the infromation from the query displays. Now i also have JTextAFields that correspond to each column from the table that i am querying from. I have an edit button that will t

  • Discoverer help

    Hi all, I am registering 2 function with the Discover Administrator ,do i need to refresh the bussiness area?will it produce any error, if i am not refreshing ,if so can you please tell me what error it will give? Regards senthil

  • How do you open a DVD/file in another search engine

    how do you open a DVD/file in another search engine?

  • Embedded Image from different anonymous web application broken

    Hi,  I have two web applications, one is NTLM and another will be NTLM & anonymous. User uploaded images into anonymous web application and embedded the images in a post (custom html box) from NTLM web application. When user try to load the images fr

  • NI USB 845x SPI communication with Max1108

    Hi, I'm trying to communicate with the Max1108 (datasheet attached) when using 8451 Test Panel I get random results,only once i got expected results and i captured this moment(i cant reproduce it somehow)  I followed this code, http://forums.ni.com/n