Download dynpro fields to flat file

Hi,
I have a requirement to capture the value of fields like customer, job name and functional location from a service notification (IW51-create/ IW52- change/ IW53 - display) and download them to a flat file.
As it is a common requirement for create, change and display of service notification, placing the user exit for reading the required data, upon save, will not be the best option.
Can someone suggest a better way to do this?
Thanks,
Rugmani.

Hi,
You can use dynp_values_read fn module to get all values during runtime.
DATA : l_progname TYPE sy-repid,
      l_dynnum TYPE sy-dynnr.
DATA : dynpread_tab LIKE STANDARD TABLE OF dynpread WITH HEADER LINE.
  l_progname = sy-repid.
  l_dynnum = sy-dynnr.
  CLEAR dynpread_tab.
  REFRESH dynpread_tab.
  dynpread_tab-fieldname = 'fieldname'.
  APPEND dynpread_tab. " apped all the fields in this table for which u want to get all the values at runtime.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = l_progname
      dynumb               = l_dynnum
    TABLES
      dynpfields           = dynpread_tab
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc <> 0.
  ENDIF.
dynpread_tab-fieldvalue will get the value of the field.
Once you get all the values - use GUI_Download fn module to download them to a flat file.
Award me points if it helps.
Thanks,
Sheel

Similar Messages

  • Fields in Flat File are separated by special characters

    hello every one,
       fIf fields in Flat File are separated by special characters
    and If Flat File is given in Excel sheet , how to handle this kind of issues.
    to Upload data into R/3 system, in BDC.
       If u have sample program ,please send it ot me and explain ?
    others give me hints...

    Hi,
    you can use the function module ALSM_EXCEL_TO_INTERNAL_TABLE .
    Check this sample code.
    hi,
    use the FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    PARAMETERS:
    P_INFL like RLGRAP-FILENAME.
    DATA:
    BEGIN OF T_DATA1 OCCURS 0,
    RESOURCE(25) TYPE C,
    DATE(10) TYPE C,
    DURATION TYPE P DECIMALS 2,
    ACTIVITY(25) TYPE C,
    B_NBILL(1) TYPE C,
    END OF T_DATA1,
    T_DATA TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE,
    BEGIN OF T_FINAL OCCURS 0,
    RESOURCE(25) TYPE C,
    DATE(10) TYPE C,
    DURATION(15) TYPE C,
    ACTIVITY(25) TYPE C,
    B_NBILL(10) TYPE C,
    END OF T_FINAL.
    DATA : HEADER TYPE XSTRING.
    Work Variables Declaration.
    CONSTANTS:
    W_Y TYPE C VALUE 'Y',
    W_N TYPE C VALUE 'N'.
    Work area.
    DATA:
    WA_DATA LIKE T_FINAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFL.
    PERFORM GET_FILENAME CHANGING P_INFL.
    START-OF-SELECTION.
    PERFORM UPLOAD_DATA_FROMEXCEL.
    FORM UPLOAD_DATA_FROMEXCEL.
    Downloading the data from presentation server
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = p_infl
    I_BEGIN_COL = 1
    I_BEGIN_ROW = 2
    I_END_COL = 8
    I_END_ROW = 1000
    TABLES
    INTERN = T_DATA
    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.
    ENDFORM. " upload_data_fromexcel
    *& Form process_data
    text
    FORM PROCESS_DATA .
    T_FINAL-RESOURCE = 'Resource'.
    T_FINAL-DATE = 'Date'.
    T_FINAL-DURATION = 'Duration'.
    T_FINAL-ACTIVITY = 'Activity'.
    T_FINAL-B_NBILL = 'Billable'.
    APPEND T_FINAL.
    SORT T_DATA BY ROW COL.
    LOOP AT T_DATA.
    CASE T_DATA-COL.
    WHEN 3.
    T_DATA1-RESOURCE = T_DATA-VALUE.
    WHEN 4.
    T_DATA1-DATE = T_DATA-VALUE.
    WHEN 5.
    T_DATA1-DURATION = T_DATA-VALUE.
    WHEN 6.
    t_data1-activity = t_data-value.
    WHEN 7.
    T_DATA1-B_NBILL = T_DATA-VALUE.
    ENDCASE.
    AT END OF ROW.
    COLLECT T_DATA1.
    ENDAT.
    ENDLOOP.
    LOOP AT T_DATA1.
    T_FINAL-RESOURCE = T_DATA1-RESOURCE.
    T_FINAL-DATE = T_DATA1-DATE.
    T_FINAL-DURATION = T_DATA1-DURATION.
    T_FINAL-ACTIVITY = T_DATA1-ACTIVITY.
    T_FINAL-B_NBILL = T_DATA1-B_NBILL.
    APPEND T_FINAL.
    ENDLOOP.
    ENDFORM. " process_data
    *& Form get_filename
    FORM GET_FILENAME CHANGING P_FILENAME.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    DEF_FILENAME = SPACE
    DEF_PATH = P_FILENAME
    MASK = ',. ,..'
    MODE = 'O' " O = Open, S = Save
    TITLE = BOX_TITLE
    IMPORTING
    FILENAME = P_FILENAME
    EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5.
    CASE SY-SUBRC.
    WHEN 1.
    MESSAGE I999 WITH
    'File selector not available on this windows system'(046).
    WHEN 2.
    MESSAGE E999 WITH
    'Frontend function cannot be executed in background'(047).
    WHEN 3.
    MESSAGE I999 WITH 'Selection was cancelled'(048).
    WHEN 4.
    MESSAGE E999 WITH 'Communication error'(049).
    WHEN 5.
    MESSAGE E999 WITH 'Other error'(050).
    ENDCASE.
    ENDFORM. " get_filename
    <b>Kindly Reward points if you found the reply helpful.</b>
    Cheers,
    CHAITANYA.

  • TCODE TO DOWNLOAD IDOC INTO A FLAT FILE

    Hi All,
       Please let me know if there is any tcode to download IDOC into a flat file..
    Regards,
    Kaveri

    try with we60 where you should have links to download the idoc type.
    Please check this:
    1. How to Download a Hierarchy to a Flat File
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
    2. How To Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0 Version 1.10
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    run the report RSEOUT00 with the idoc number, flat xml file will be generated at the location user/sap/XI/SYS/global/idoc_file
    Please rewrds if found help ful

  • Short dump while reading a currency field from Flat file into internal tabl

    Hi,
    I am getting a short dump........saying number conversion dump (while reading a currency value into field in internal table from a fixed lenght flat file).........
    Do I need to use a string variable to get the value from flat file or how ??
    Please suggest.

    Santosh,
    Thanks for your inputs,
    But my internal table type is of DEC (5,2) , I am getting that... it needs to be of type 'C'. Can you suggest.
    Ex :
    MOVE wa_temp-infile_string+106(8)  TO wa_item-QT_PERCENT
    This didnt work
    so i tried moving into a seperate variable
    MOVE wa_temp-infile_string+106(8)  TO v_percent.
    and then write to
    WRITE v_percent to  wa_item-QT_PERCENT.

  • Selecting fields for flat file input

    I've built a scenario that uses the File adapter to load a flat file into SAP and fully understand the concepts. My problem is that I have fixed length file I need to load which has 50+ fields per row. I only need 10 fields per row and those fields are spread throughout the row. Using fieldFixedlengths I specify the length of each field - and it appears they must be consecutive fields. How can I specify the fields that I need.
    For example my input file may be as follows
    AAAAAAABBBBBBBCCCCCCCDDDDDDEEEEEEE
    I only need AAAAAAA CCCCCCC and EEEEEEE. Is there a way to do this?

    Hi Robert,
    I don't know why you want to upload all junk data there apart from importing only relevent fields. if i am concered to do so, i'll do this in outside the XI BOX. If that file is in come fixed format or lets say its in csv format, just open that file into excel and then try to remove the row you don't want and then save it again to the same file format. and then import and map inside XI it will be simple.
    Also if you don't wanna to do this, then tell us what logic you wanna use to find which rows you don't want. I don't think if you are not sure or you already know what rows/fields u want.
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Could not find the fields in Flat file, But able to see the fields in receiver Communcication channel

    Hi All,
    My scenario is Proxy to file, After testing my scenario the flatfile is getting generated without any errors.
    I can able to see all the fields in receiver communication channel payload. But some fields are missing in flatfile which is generated after conversion.
    This is my structure below
    Record
    ---Header
          a
          b
          e
          g
    ---Trailer
          c
          d
    ---Details
          e
          f
    And here is my content  conversion below
    Header.fieldFixedLengths   2,4,6,7
    Header.endSeparator         'nl'
    Trailer.fieldFixedLengths     3,5
    Trailer.endSeparator           'nl'
    Details.fieldFixedLengths    6,7
    Details.endSeparator          'nl'
    Actually in header there are nearly 34 fields, I can able to see all the 34 fields in reciever CC, But in generated flat file I can able to see only first 30 fields remaing 4 are missing in flat file.
    it is like in the above structure In Header there are a,b,e,g fields.I am getting a, b fields e and f are missing in flatfile.
    Thanks in advance.
    Please suggest me the solution.
    Thanks & Regards,
    Satish

    Hi Satish
    As you said 4 fields values are missing out of 34. Are those fields values are coming as blank in the file or not at all coming.
    Ex:
    you have 4 fields a,b,e,g and in channels you have defined length as 2,4,6,7
    If values for fields a,b,e,g are coming as 1,22,33,44444 respectively then the flat file is generated as
    1-22--33----4444--- (Consider - as space here)
    Now if you say e and g value then is the flat file generated as
    1-22---------------
    or
    1-22--
    Regards
    Osman

  • Ignore unwanted field in flat file

    Hi experts,
    If I am loading a flat file but one of the field has to be ignored. Do I need to add it in Datasource and not map in transformation.

    You would need to add the field to the DataSource, so that reading the Flat File in would be correct. From that point forward, there would be no need to map it to target InfoProviders.
    Edited by: Dennis Scoville on Nov 4, 2009 12:28 PM

  • Need to read a field from flat file

    Hi All,
        In flat file i have  one field which may contain 100 enteries separated by delimanator ',' (comma).  There can be 1 , 10 or 100 enteries.   I need to put them in the internal table . Please suggest me .
        I have used the below logic .
    i split the field in 100 variables and then appending the internal table . the problem here is even if there is only one entry , the logic will append 99 blank enteries .  so can any one suggest , is there any other way do it . any Functon Modules available .
    Thanks.

    Hi Chetan,
    If i understand your requirement it is as below,
    Flat file.
    1,2,3,4,5,6,7,8,9,....
    1,2,3,4,5,6,7,8,9,....
    1,,,,,,,,,,,,,,,,,,,,
    Now you read the first line and split into an itab of type string, and you are worried about the third line where not all the fields have values and end up creating blank entries. to fix this, simply
    Sort the Itab, and use delete itab statement with the where clause as where column is ''.
    This should solve it.
    types: begin of t_data,
                line type string,
               end of data.
    data: li_file_line type standard table of t_data.
    split l_file_line at ',' into li_file_line.
    delete li_file_line where line = ''.

  • Download report into a flat file format

    Hi Friends,
    I would like to know your thoughts on what is the best practice most of you using to download a report into a flat file(NOT csv).
    In my application business users want a report to be downloaded into their local desktop (just like a .csv) but into a flat file and they have their byte specific format.
    My concerns :
    1) Is there any straight method to download a report into a flatfile (like it is now for CSV) from Apex 3.1.2 ?
    2) If I write my own code using UTL_FILE, can I let the user to save them to their desired directory on their desktop ?
    Your thoughts would definitely help me in delivering a right solution to the users in this regard.
    Thanks a lot.
    Raj.

    Raj:
    You could create a 'Before Header' page process to create this 'flat file'. The code for the page process will be something similar to declare
    v_file_name   VARCHAR2 (2000) := 'fixedFieldsFile.txt';
    --- Client Record Format
    f1 char(20);
    f2 char(20);
    f3 char(20);
    ---- End format
    begin
    OWA_UTIL.mime_header ('application/txt', FALSE);
    htp.p('Content-Disposition:attachment;filename="'|| v_file_name|| '"');
    OWA_UTIL.http_header_close;
    for c1 in (select * from emp) loop                           ----- The report query
    f1:= c1.empno;f2:=c1.ename;f3:=c1.sal;
    htp.p(f1||f2||f3);
    end loop;
    apex_application.g_unrecoverable_error:=true;
    exception when others then
    null;
    end; Varad

  • Field in Flat File DataSource

    I created a Flat File DataSource.
    In the DataSource, I enetered InfoObject 0OUTAGTARGT in the Fields tab ->InfoObject Template column. I want this InfoObject to be mapped
    into field KTWRT (Target Value) in R/3 table EKKO.
    However, when I enter the the InfoObject 0OUTAGTARGT and hit Enter key, system prompts me to copy the properties. I choose Copy.
    And then it says:
    Reference field 0DER_CURR was added automatically.
    Now I have ORDER_CURR entered in the Field column, with InfoObject Template 0ORDER_CURR.
    In the Field column, I replaced the field ORDER_CURR with WAERS (Currency field from R/3).
    When I save it, I hit the following:
    Missing currency field / unit field ORDER_CURR
    System expect the field ORDER_CURR to be entered in the Field column. But in my source file, there is no field call
    ORDER_CURR. It is actually WAERS.
    How can I overcome this?

    Maintain 0ORDER_CURR as it is needed by 0OUTAGTARGT.
    Next, simply map WAERS to the ORDER_CURR field.
    But it doesnt allow me to change. In DataSource ->Fields tab, I try to replaced the field ORDER_CURR with WAERS. When I click on Activate, I
    hit the following:
    Missing currency field / unit field ORDER_CURR
    Please help.

  • Date field in flat file

    I ve date filed in flat file, like this
    5/5/2007  12:00:00 AM
    1/1/2007  12:00:00 AM
    HOW could i take above date characteristic in my time dimension.
    I m new to bw.
    thanks
    KS

    Hi,
    The date format should be YYYYMMDD in flat file.
    IF the date format is not the above mentioned way, then you can change setting.
    Going to System in Menu
    System->User Profile->Own data.
    Under Owndata you can change the date format to your requirement.
    Check the below link also for detain info of coding:
    Mandatory for Date field
    Reg
    Pra

  • Loading Date fields from flat file to Oracle tables

    Hi,
    I have a flat file with a few date columns. I have given the format for the date field while creating the data store for the flat file. The format I used is 'YYYY-MM-DD'.
    But I get an error when I execute it after associating the module with LKM & IKM.
    The error message is as follows:
    org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
    File "<string>", line 3, in ?
    OS command has signalled errors
    Can anyone help me out.
    Thanks

    At the time of DataStore creation. You take that date field as string.
    After this, in interface, when you map this date field with table field. You should use CONVERT(<field name>,DATE) in expression editor.

  • Mapping problem - trying to map lowerlevel field to flat file

    Dear experts,
    I have a rpoblem mapping my data.
    my input-xml looks like this:
    . orderheader
    ...orderdetail (1..n)
    .....delivery header (1..n)
    .......delivery detail (1..n)
    .........invoice header (always max 1 per delivery detail)
    ...........invoice detail (always max 1 per invoiceheader)
    .......delivery detail
    etc
    I have a flat file as output which looks like this
    . RECORD
    ...ORDERNR
    ...ORDERPOSITION
    ...DELIVERYNUMBER
    ...DELIVERYPOSITION
    ...INVOICENUMBER
    ...INVOICEPOSITION
    If there are 2 invoicelines in the input xml, the outputfile should contain 2 records with all same data except invoiceposition. For each delivery-detail line a line in the outputfile must be created. So I mapped "deliverydetail" to RECORD. No problems here.
    Further I mapped invoicenumber (within the invoice header tag) to INVOICENUMBER.
    But when for instance deliverydetail 1 and 2 don't have an invoice, and deliverydetail 3 does, I see this invoicenumber not in record 3 but in record 1. Record 2 and 3 contain no invoicenumber.
    What am I doing wrong here?
    Thanks in advance,
    William

    Hi William,
    One header has multiple items, so here you have to use the oneAsMany node function.
    first input for oneasmany node function is Invoice number and 2nd and 3rd input is InvoiceDetail node.
    Regards
    Ramesh

  • Download SPRO hierarchy to flat file

    Hi,
    Is there a SAP standard object available which can download the SPRO tree to a file?
    Thanks.
    Chitrali

    I don't know any such object, but you may try to build a query on the following tables
    -     CUS_IMGACH      IMG Activities                     
    -     CUS_IMGACT      Text Table for IMG Activity        
    -     CUS_ACTOBJ     Customizing Activity - Object List
    -     CUS_ACTOBT     Customizing Activity - Object List
    -     TNODEIMG     Node table for the new IMG
    -     TNODEIMGR     References for the new IMG
    Regards

  • Date o/p probelm when download into flat file inf110 tcode in fi

    hi,
      when im create payment transaction in f110 tcode in fi , and selct the record and down load into flat file
    in flat file first line it shows run date same as we given in transaction,but in second line it shows same date as before
    but it shows different date example : firstline it shows 12 .10.2008 and second line 12.10.2008 is right o/p.
             but it shows as first line 12.10.2008,and seconde line 6.10.2008. why it show like that.

    Hi Ganesh,
    As per my understanding you have an issue with the date while downloading it into the Flat file.
    It is displaying the incorrect date in the second line in Flat file. 
    Are you downloading the data in Notepad or in the Excel sheet?
    Can you please elaborate the issue, if it is in Excel sheet then check if it is displaying multiple records for the same date.
    Ex :
                        Date                   Records
                 12 .10.2008             ad
                                             fg
                                             as
                 6.10.2008               we
                                            af
    Check if this is the case...
    Regards,
    Kittu

Maybe you are looking for

  • Webutil and intermedia

    Has anyone configured webutil to upload/download ordsys.ordimage datatypes instead of just straight blobs? Just wondering before I tackle it myself. Jeremy.

  • App Run As at standard users.

    Hi  I work & manage domain environment.  There is a particular file that I want to give it administrator privileges so that he can make changes to the system.  The file should work for users who do not have local administrator permission.  I prefer t

  • How to set cursor property from "snap-to-plot" to free?

    dear all, is there any one know how to set a cursor property from "snap-to-plot" to "free"? this cursor is in a XY graphy i couldn't find coresponding property in the XY graph property node thank you Jack

  • Consolidation Set

    Please explain me about consolidation sets in payroll.(In laymen terms).

  • Revision level issue in Material Master maintenance

    Hi All, When I try to change the revision level for a certain change number in our production client in the material master I get the following error Priority of revision level E is too small I have checked in CC13. But I could not find anything rele