Conversion program

Hi Abapers,
My requirement is to read an excel input file from PC and for a each pernr(personnel number) and check against infotype 2001-absences, and read other fields from excel, if it is valid record then i should update the nfotype 2001 with this records else write to error report.
How can i achieve this? kindly help me to accomplish this functionality.. please give some sample code...
Excel Fields:
1. personnel No.
2. First name
3. last name
4. absence type
5. absence from date
6. absence to date
7. absence hours
Kindly help me with sample code..
Points are sure...

Try this it may give you hint.
DATA : BEGIN OF I0585_1 OCCURS 0,
PERNR(8),
BEGDA(8),
ENDDA(8),
ACOPC(1),
SBS01(2),
SBD01(2),
PCN01(12),
ACN01(12).
DATA : END OF I0585_1.
DATA: PERSONALDATAKEY LIKE BAPIPAKEY OCCURS 0 WITH HEADER LINE.
DATA: OPERATION LIKE PSPAR-ACTIO.
get pernr.
perform checkoperation.
PERFORM UPLOADTXT.
PERFORM INFOTYP_UPD.
*& Form CHECKOPERATION
text
--> p1 text
<-- p2 text
FORM CHECKOPERATION.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
PERNR = PERNR-PERNR
INFTY = '0585'
TABLES
INFTY_TAB = I0585
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2.
DESCRIBE TABLE I0585 LINES RECNO.
IF RECNO > 0.
MOVE 'MOD' TO OPERATION .
ENDIF.
IF RECNO = 0.
MOVE 'INS' TO OPERATION .
ENDIF.
BREAK-POINT.
ENDFORM. " CHECKOPERATION
*& Form UPLOADTXT
text
--> p1 text
<-- p2 text
FORM UPLOADTXT.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:\TEMP\I0585.TXT'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = I0585_1
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 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.
BREAK-POINT.
LOOP AT I0585_1.
MOVE-CORRESPONDING I0585_1 TO I0585.
APPEND I0585.
ENDLOOP.
ENDFORM. " UPLOADTXT
*& Form INFOTYP_UPD
text
--> p1 text
<-- p2 text
FORM INFOTYP_UPD.
LOOP AT I0585.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0585'
NUMBER = I0585-PERNR
VALIDITYEND = I0585-ENDDA
VALIDITYBEGIN = I0585-BEGDA
RECORD = I0585
OPERATION = OPERATION
NOCOMMIT = ' '
IMPORTING
RETURN = SUCCFLAG
KEY = PERSONALDATAKEY
EXCEPTIONS
OTHERS = 0.
ENDLOOP.
ENDFORM. " INFOTYP_UPD
HR_INFOTYPE_OPERATION
SAP Developer Network Blog: Yet another "from database or internal table to Excel"
SAP Developer Network Blog: Downloading data into Excel with Format Options
SAP Developer Network Blog: Manipulate Excel with OLE & ABAP
Message was edited by:
        Karthikeyan Pandurangan

Similar Messages

  • Conversion program for the open sales orders

    Hi ,
         How to proceed for writing a conversion program for open sales order ??
    Please share if 've any document or idea.
    LSMW object: 0090, Method: 0000
    Business Object : BUS2032, Method : CREATEFROMDAT2,
    Message Type: SALESORDER_CREATEFROMDAT2
    Basic Type: SALESORDER_CREATEFROMDAT202
    Regards,
    Jyoti Shankar

    Dear Saso,
    I think, instead using Report: VA05/ VA05N; its better to use Report: VL10C
    In this report, you will get all the Sales Orders along with Materials - relevant for open delivery, along with Open Qty. and various other options can be selected from "Change Layout - (Ctrlt+F8)".
    Best Regards,
    Amit
    Note: Don't maintain any Field-Entry (while executing the Report: VL10N; in order to list all Sales Orders. But, if you want to list Sales Orders based upon some criterias, maintain the Field-entries, as reqd.

  • BW Upgrade "Execute the conversion programs for the product master "

    Hi BW Gurus,
                        We are in the process of upgrading BW 3.5 to BW 7.0. We did not get any conversion error in BW Dev but in BWQ we got error in one of ABAP program. The error message in log is :-
    "Value '######' of characteristic 0TIME is not a number with 000006 spaces"
    and job pertaining to the program is canceled in SM37.
    My question is, are we suppose to run any conversion program before or after the upgrade?
    Warm Regards,
    Anil

    Hi  Chandu,
    I am also looking for the same if u have fond a bapi for any other program please forward the information.
    Thanks & Regards,
    Basheer

  • VA41 Conversion program using BAPI's.

    Hi Friends,
    Could u please tell to develop/create conversion program to transfer data using BAPI's by using trx VA41(CREATE CONTRACT), I have Contract Document number(ID).
    This is one time conversion.
    Please tell step by step.
    Thanks in advance.
    Points rewarded for ur kind assistance.
    regard. Vishnu

    Hi Vishnu,
    There is a standard BAPI called <b>BAPI_CONTRACT_CREATEFROMDATA</b> available for VA41. Use that BAPI for the conversion. Get back to me if you got any doubts.
    Reward if useful.
    Thanks
    Aneesh.

  • Conversion program generated with errors

    in lsmw idoc method at the step 11 convert data iam getting error as conversion program generated with errors can some body help me .i assigned port ,partnertype and partner number and activated inbound processing but still getting this error.somebody pls help me its urgent.

    Hi Mamidi,
    Go to the LSMW you have choosen and if it is Recording Method you are getting this error.
    Select Goto-->Recordings.
    Select the Recording you have choosen in the Edit Mode.
    Click on the Defaults All Button and save the recording.
    Now go to the option Convert Data and check .
    You will receive a message ..Conversion program successfully generated.
    Thanks,
    Sri

  • Having a problem converting a PDF file to Words with Adobe's conversion program.

    Having a problem converting a PDF file to Words with Adobe's conversion program.

    See https://forums.adobe.com/docs/DOC-2412
    If you need more help, please ask in https://forums.adobe.com/community/acrobatdotcom/

  • UTF8 encoding Issue in the conversion program

    Hi all,
    Our requirement is to get data from a file stored in application server and update the SAP database.
    The flat file has some special characters such as u2122, ® etc.
    In the conversion program, we are using the encoding format as UTF-8. This means it will only handle UTF-8 file ( byte order mark (BOM) 8).
    After running the conversion program, we came to know that the special character u2122 is getting replaced wtih #.
    And when we modified the format of flat file to UTF-8 instead of ANSI or UTF-16 or 32.
    We were able to get the trademark symbol in correct look in addition with other special characters.
    Since this involves a manual of processing modifying the flat file to UTF-8 format and then running the conversion program for getting all the special characters in good look, we are thinking to make this process "automatic" in the conversion program itself i.e. whatever the format of flat file may be, we would convert that file to UTF with BOM 8 format and then go ahead with the next updating processes.
    So, can anybody let me know if we can make this an automatic process?  Can we convert each non UTF-8 record read from flat file to UTF-8 record in the program itself by any means and then update that record in the database? Is there any FM for this? Or can we convert the flat file to UTF-8 file programmatically irrespective of the original file formats?
    Any inputs on this would be greatly appreciated.
    Thanks,
    Shamim

    Sham,
    Try with the class CL_BCS_CONVERT and the method STRING_TO_SOLIX.
    Regards,
    Kiran Bobbala

  • Is there a FREE WMA conversion program?

    Hi everyone, quick question: Is there a WMA to MP3 Conversion program out there that is FREE? I've searched and searched but everything is a demo with an activation fee. If you know of any, can you give me the name and/or link please? Thank you VERY MUCH in advance.

    crafylady
    Welcome to the HP Community Forum.
    You listed your complete Product Information as Dell.
    So, assuming you mean a Dell Printer, the answer is No.  Smiling.
    If you mean a Dell computer and an HP Printer, then the Answser is a resounding, "Maybe", "Probably".
    The answer depends on the Printer Model and the Dell Operating System.
    You can find HP Printer Software installation instructions and help below.  Included is an example of the Scan a Document or Photo function that is relevant for many of the versions of the Printer software.
    Install Full Feature Software – Printer
    The printer's Support Pages also include your User Guide, videos, and lots of How-to links to useful documents.  There is also, in most cases for most printer modesl, an extensive "Troubleshooting" section.
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • BAPI or Conversion Program for Head Office/Branch functionality

    We are shifting our Vendors to Head Office/Branch functionality.  Our ordering vendor now becomes a Branch.  We need to transfer any open items left in the Ordering vendor account, and move them to the new Head Office account.
    Has somebody done this in their own company or client?  If yes, please advise your methodology, and if any BAPIs or conversion programs were used, please let us know.
    Thank you for your help.
    Core

    Hi
    Just Check the link below.
    http://help.sap.com/saphelp_45b/helpdata/en/5f/1faba54aee11d189740000e8322d00/frameset.htm
    Hope it helps.
    Regards
    Mohamed Mansoor

  • Conversion program to do movement type 202 and 309

    Hi everyone,
    I need to do a conversion program to upload current stock balance from 1 material to another material (Material to material transfer). This is because we have created a new material type, therefore i would need to move any current stock balance of 1 material (of a different material type) and create the material again in the new material type and transfer the current stock to it.
    Our consultant has decided upon using movement type 202 and 309 to do the goods movement required.
    Since MIGO could not be recorded, is there any other suggestion besides using ABAP program?
    Thanks in advance. Hope to get some feedback on this asap because this is urgent.

    Hi Bernard,
    You can check the direct input program RM07MMBL for goods movement.
    This is used in most of the cases to do a goods movement.
    Hope this helps
    Cheers
    VJ

  • Vendor Upload by conversion program

    HI Experts ,
    I am uploading vendor master data by conversion program , in that due to 1 field in Control data(customer - KUNNR ) I am unable to upload vendor.
    In this field when i give the customer number which is already referenced for another vendor , it gives a message that it is already referred to XXX vendor , though it is a warning message , it does not create vendor .But my session in SM30 shows success.
    But ultimate result is vendor does not get created.
    But when I give new customer or keeps blank, vendor gets created .
    please guide & advice on this problem. I need to enter data in this field .
    Thanks in advance

    HI
    thanks for your help.
    But this is happening not only in conversion program but also if i execute manually  FK01 , it does not save that vendor .
    Manual FK01 also not saving that vendor .
    What could be wrong ?
    Thanks in advance.
    Abhishek Govilkar

  • Would like to find out how a Pages document might be opened by a recipient that only has a PC with Windows and Microsoft Office.  Is there a conversion program?

    Hi!
    Would like to find out how a Pages document might be opened by a recipient that only has a PC with Windows and Microsoft Office.  Is there a conversion program?

    Making changes to PDF file: Apple Support Communities
    Have just noticed this in a thread today.   The link from Klaus1's post may allow you to use PDF and work on it.   I haven't tried it but it may give you some extra ammunition.

  • Data conversion program

    can u give idea about data conversion program for inventory management program stocks,which reads legacy extract file and the valuation master file from pc gets issue storage location valuation details and output a file with these details
    regards,
    phani

    Hi Phani,
    Make sure that the data from legacy system is stored in a TXT file in a specific format.
    In SAP, create a program to upload the file using FM GUI_UPLOAD. The structure of the internal table will be same as that of the file.
    Upload the data and update the necessary tables.
    Best regards,
    Prashant

  • Conversion program RFCONVTP not yet started ?

    Hi all,
    My requirement is to run the t-code FMZ1 , but while i am executing this transaction im getting one status messaage as " conversion program RFCONVTP not yet started". then I run that program with out test run, even though I am not able to execute the t-code FMZ1.
    please tell me how can i run the program RFCONVTP.
    Regards,

    There are a lot of SAP notes for this BAPI, and none says "don't use it", so you should be fine. You could send a message to SAP pointing them to the unreleased status.
    Thomas

  • Suggestion for IDoc creation and conversion program

    Hi Experts,
    I want to send the data from SAP to Non-SAP System. The Non-SAP System needs the text file with delimiter.
    So which way is better to send the data.
    Via a IDOc with ALE      OR
          Just download the file by the program and send it to Non-SAP System.
    Please suggest me, which option is best and cheapest and need the advantage and disadvantage for both the ways. And also how many hours will took to implement each scenarios.
    As per my knowledge, The Idoc with ALE will took 3 Days to build the setup and prepare the IDoc and Conversion program will took 1.5 days to prepare the file.
    Note:There are maximum 8 fields needs to send to the Non-SAP System from SAP. So not much information.
    Thanks in Advance,
    Warm Regards,
    Vijay

    Hi Gangisetty,
    For less no. of fields transfer there is no need at all to go with ALE.
    If there is some Standard Master Data to be transfered then IDOC comes very handy.
    But if requirement is to fetch data from different tables and some formatting before sending to Legacy System then you should go with conversion Report which will fetch all required data, format or manipulate as per requirement and then using outbound control it can send the flat file Common Shared FTP folder.
    Using Conversion Report which will required less development time and you can schedule it as per bussiness requirement.
    Using ALE-IDoc may consume some time as you need to create Partner Profile, Logical System etc and it might be required to have PI(XI) as middleware for some internal formatting etc.
    Though, Both ways are possible it's upto your call which way to go.
    As per info given by you i would suggest to by Conversion Report Method.
    Regards,
    Vivek

  • Local Currency conversion program(Standard) - Manually starting  Fill phase

    Hi experts
    I am having a problem running the local currency conversion program.
    The Analyse phase  completed with 3 warnings but can not start the Fill phase automatically . How can we start it off from this stage to the next (fill) stage or what could be the source of the error.
    all suggestions will be appreciated

    Hi,
    Try using the FM  'CONVERT_TO_LOCAL_CURRENCY'.
    For testing purpose Go to se11 and see the values is TCURR table.
    For eg : If you want the exchange rate as M (which is Month Begin Exchnage rate), the date you are passing to the FM should always Begin of the month.
    FORM calculate_currency
    USING
    lv_date LIKE wa_data-fldate "date is needed as on current date should be set exchange rate (be carefull with type i left my original)
    lv_foreign_amount LIKE lv_totalprice "number
    lv_foreign_currency LIKE wa_data-currency "currency identificator
    lv_local_currency TYPE c "currency identificator
    CHANGING
    lv_local_amount TYPE p. "number
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING
    CLIENT = SY-MANDT
    date = lv_date
    foreign_amount = lv_foreign_amount
    foreign_currency = lv_foreign_currency
    local_currency = lv_local_currency
    RATE = 0
    TYPE_OF_RATE = 'M'
    READ_TCURR = 'X'
    IMPORTING
    EXCHANGE_RATE =
    FOREIGN_FACTOR =
    local_amount = gv_local_amount
    LOCAL_FACTOR =
    EXCHANGE_RATEX =
    FIXED_RATE =
    DERIVED_RATE_TYPE =
    EXCEPTIONS
    no_rate_found = 1
    overflow = 2
    no_factors_found = 3
    no_spread_found = 4
    derived_2_times = 5
    OTHERS = 6
    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. "Calculate_currencytake a look on exceptions which you get after, it might be helpfull
    Please reward points if helpful.
    Regards
    rose

Maybe you are looking for

  • How can I resize an image in Preview?

    There has been lots of discussion about Preview but non really answers my question. If I resize an image and duplicate it the duplicate over rides the settings of the original - so now I have 2 images the same size which is not what I want. I want th

  • How do I insert a spreadsheet in a iweb page

    Is there a way to insert a spreadsheet in a iweb page? I need to insert a listing of names and addresses along with pictures for each line.  It is an officer listing with pictures for a club.

  • HT1349 Uploading iTunes on my Desktop PC

    I cannot load iTunes on my PC, I have copied the iTunes64setup to my desktop and before ITunes is fully loaded i get an error message "Errors occurred during installation..." it says to run installer again but I have done this several times with same

  • Combobox in the report forms, next page, other page, previous page...apex 3

    Hi, Is there a possibility to add a new option to that combo to "jump" not only to a page relative number, to a first letter of an word from a chosen field in the report ? You need to "jump" to some range of records in a specific page and the relativ

  • Wanting to switch from Entourage to Mail 2.0 Any advice appreciated.

    Greetings, I've been using Entourage 2004 for three years now - I'm a former Windows user. However, I am trying to migrate over to Mac only apps. I'm eager to switch over from Word and Excel but I need Windows environment compatibility. Anyway, is Ma