Open/Transfer/close Dataset and delimiting

Hi people hi have a situation regarding open/transfer/close dataset and delimits.
I have a submit program that calls any other via variants. It works fine with using list_to_memory, convert to ascii, and open dataset. I can download the report in excel format to an application server.
Problem is that the reports arent delimited properly in the excel report. Usually there is a vertial line "|" placed after each column and it would be eazy to mauiplate it during viewing the actual file.
However I want this done automatically. My question is, is there a way to delimit the list before/during using open/transfer/close dataset?
My solution before was to convert the vertical lines to a comma and just save the file as a CSV file. Problem here is the data could be affected as comma is being used normally. So the excel report would get messed up.
Hope I get some help soon. Thanks guys and good day.

Lets say you have fields A, B, C and D to be transfered to the dataset. You can use the below logic.
concatenate a b c d into l_text separated by '$'.
transfer l_text to dsn.
Now, when you open the text file in excel it would ask you whether the file is delimeted or fixed width...if you select delimited..in the next screen you would be able to select the delimiter.
Regards
Anurag

Similar Messages

  • How to apply WWW_LIST_TO_HTML - Open/Transfer/Close Dataset to ALV Reports

    hello people! So far I have done some good progress regarding this thanks to many of you people. I do have some hurdles and one of them involves ALV Reports. So far I use
    WWW_LIST_TO_HTML - to temporarly store the list report to a table known as ihtml.
    and Open/Transfer/Close data set to send the file to the application server using the syntax below
    <b>OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    LOOP AT ihtml.
      TRANSFER ihtml TO file.
    ENDLOOP.
    CLOSE DATASET file.</b>
    So far the program works fine in the report with the expection if its one that generates an ALV Report.
    My question is that is there a way to successfully run the program the way it was mentioned above using ALV? If so what techniques do you guys suggest?
    <b>Note:</b> Also please note the report and transfering/writing of the file has to be done during background processing.
    Hope I get some replies soon as many of you have been most helpful thank you and good day.

    Hi chad,
    1. yes u are right
    2. it will give this error only.
    3. the reason is, the www_list_to_html
       is exected after list display,
    4. the code comes there when
       we press BACK, and at that time
       no list is there in memory.
    <b>5. So we have to use some workaround.
    6. END_OF_LIST
    7. We have to use this EVENT
       and inside this event,
       we have to export to HTML.</b>
    8. I tried and it works FANTASTIC
    9. Just copy paste this program.
          (it will show a alv list of t001,
        and write the HTML file also)
      ( i have used END_OF_LIST event)
    10.
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    Select
    SELECT * FROM t001 INTO TABLE itab.
    *-------  Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    DATA : alvev TYPE slis_t_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        i_list_type = 0
      IMPORTING
        et_events   = alvev.
    PERFORM alv_setevent USING 'END_OF_LIST' 'ITAB'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = SY-REPID
       i_callback_user_command = alvcallback_formname
        it_events               = alvev[]
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    form itab_end_of_list.
    Display
    data : ht like table of W3HTML.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
    EXPORTING
    list_index = sy-lsind
    TABLES
    HTML = ht
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        filename                        = 'd:\my.html'
      tables
        data_tab                        = ht
    endform.
    *=============This Function Links the Event Name To The Specified Form
    FORM alv_setevent USING value(eventname) value(alvitabname).
      DATA: tempev TYPE slis_alv_event.
      DATA : formname(30) TYPE c.
      TRANSLATE eventname TO UPPER CASE.
      CONCATENATE alvitabname '_' eventname INTO formname.
      TRANSLATE formname TO UPPER CASE.
      LOOP AT alvev INTO tempev WHERE name = eventname.
        tempev-form = formname.
        MODIFY  alvev FROM tempev.
      ENDLOOP.
    ENDFORM.                    "alv_setevent
    regards,
    amit m.

  • Open/Transfer/Close Dataset file not downloading

    Hello people apologies if this running rampant for me. I did post this from an attatched topic of mine but im guessing, due to its number or replies, that many people felt that it was pretty much covered. It was but another problem has riseng during my initial question.
    My plan is to download a report in a file, (hopefully in background), as it is. Obviously WS_Download would not work because (1) it doesnt seem to function in background proccessing and (2) the layout is not aligned properly. After checking this out, in this forums as well as other sits, I realized Open Dataset ought to be the best approach. Im not touching the more complex ones yet you because I plan to take this step by step. 
    So far I have searched the net and stuff and decided that I will use WWW_LIST_TO_HTML since I want to download it the way it is. I am also going to use open/close dataset as many of you have mentioned.
    SO far Im just trying it out with a simple report program to see its funcitonalities. My code goes like this.
    <b>REPORT Z**** NO STANDARD PAGE HEADING LINE-COUNT 100 .
    DATA: IFIELDS TYPE TABLE OF W3FIELDS WITH HEADER LINE.
    *DATA: ihtml TYPE TABLE OF w3html WITH HEADER LINE.
    DATA: IHTML TYPE TABLE OF W3_HTML WITH HEADER LINE.
    DATA: BEGIN OF I_TAB OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    END OF I_TAB.
    SELECT-OPTIONS: SO_MATNR FOR I_TAB-MATNR.
    SELECT MATNR MAKTX
    FROM MAKT
    INTO TABLE I_TAB
    WHERE MATNR IN SO_MATNR..
    LOOP AT I_TAB.
    WRITE: / I_TAB-MATNR,
    I_TAB-MAKTX.
    ENDLOOP.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
    EXPORTING
    list_index = sy-lsind
    TABLES
    HTML = IHTML.
    DATA: FILE TYPE LOCALFILE.
    FILE = '/usr/test.html'.
    OPEN DATASET FILE FOR OUTPUT IN BINARY MODE.
    LOOP AT IHTML.
    TRANSFER IHTML TO FILE.
    ENDLOOP.
    CLOSE DATASET FILE.</b>
    NOw the problem now though is that the file isnt downloading or saving at all. I cant seem to get what is wrong since the path does exist and the this seems the universal way to implement the program. Im guessing the problem lies in the file name, because everything seems to work fine. Hope to hear again soon. Sorry if people have see this twice. Again my sinceriest apologies.

    for example,  open IE,  in the address bar, I enter
    \SXXXXXX
    ,   SXXXXXX is my host name.  I hit enter.  now i see folders, one of which is USR,  then I click on the usr folder and there is my file that I created with your program. 
    Maybe ask your basis person what the host name is.
    Regards,
    Rich Heilman

  • PRoblem regarding Submit - Open/Transfer/Close Dataset

    Hello again, I know I keep asking the same topic (regarding datasets) for the past week. Its been a new topic for me. However, I have a program which I am testing that is shown below.
    <b>REPORT ZPROG_COOL7 NO STANDARD PAGE HEADING.
    DATA: ITAB_LIST TYPE STANDARD TABLE OF ABAPLIST WITH HEADER LINE.
    PARAMETERS: PNAME TYPE SYCPROG. (this does nothing yet ...)
    SUBMIT ZPROGRAM EXPORTING LIST TO MEMORY AND RETURN
                        USING SELECTION-SET 'CEDEX'.
    CALL FUNCTION 'LIST_FROM_MEMORY'
         TABLES
              LISTOBJECT = ITAB_LIST
       EXCEPTIONS
            NOT_FOUND  = 1
            OTHERS     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'WRITE_LIST'
           TABLES
                LISTOBJECT = ITAB_LIST.
    ENDIF.
    DATA: LD_FILENAME TYPE LOCALFILE.
    DATA: I_MONTH TYPE TABLE OF T247 WITH HEADER LINE.
    DATA: IHTML   TYPE TABLE OF W3HTML  WITH HEADER LINE.
    CALL FUNCTION 'WWW_LIST_TO_HTML'
       EXPORTING
           list_index = sy-lsind
         TABLES
              HTML       = IHTML.
    CLEAR IHTML.
    LD_FILENAME = '
    H******\SAPReport\death.html'.
    OPEN DATASET LD_FILENAME FOR OUTPUT  IN BINARY MODE.
    LOOP AT IHTML.
      TRANSFER IHTML TO LD_FILENAME.
    ENDLOOP.
    CLOSE DATASET LD_FILENAME.
    CLEAR: LD_FILENAME.</b>
    As you can see it is suposed to get a list from a diffrent program, write the list, and then transfer the list into a directory in the SAP application server. This all works fine on foreground but in Background Proccessing the story is diffrent.
    Here is the problem:
    If Iam to send a job in background, the report will generate fine if you view the spool list <b>but there HTML file that is supposed to be saved becomes blank.</b> Is there a way to solve this issue? Thank you all take care, and good day.

    I am concerned that his part does not work in background.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    LISTOBJECT = ITAB_LIST
    * EXCEPTIONS
    * NOT_FOUND = 1
    * OTHERS = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF SY-SUBRC = 0.
    CALL FUNCTION 'WRITE_LIST'
    TABLES
    LISTOBJECT = ITAB_LIST.
    ENDIF.
    DATA: LD_FILENAME TYPE LOCALFILE.
    DATA: I_MONTH TYPE TABLE OF T247 WITH HEADER LINE.
    DATA: IHTML TYPE TABLE OF W3HTML WITH HEADER LINE.
    <b>CALL FUNCTION 'WWW_LIST_TO_HTML'
    * EXPORTING
    * list_index = sy-lsind
    TABLES
    HTML = IHTML.
    CLEAR IHTML.</b>
    LD_FILENAME = '\H******SAPReportdeath.html'.
    OPEN DATASET LD_FILENAME FOR OUTPUT IN BINARY MODE.
    LOOP AT IHTML.
    TRANSFER IHTML TO LD_FILENAME.
    ENDLOOP.
    CLOSE DATASET LD_FILENAME.
    CLEAR: LD_FILENAME.
    I ran across this before and I did find a solution, I'll get back.
    Regards,
    Rich Heilman

  • Insert space between records from open .. close dataset

    I am generating a file that contains different information for a business partner with the aid of datasets. I want my records to look like this ...
    partner1 BPname1 address1 contact info1   - from table1
    partner2 BPname2 address2 contact info2
    partner1 agency1 address1 insurance obj1  - from table2
    partner2 agency2 address2 insurance obj2
    But the one I am seeing in the generated file in AL11 is like this ...
    partner1 BPname1 address1 contact info1
    partner2 BPname2 address2 contact info2
    partner1 agency1 address1
    partner2 agency2 address2
    I want to see a space between records from tables 1 and 2.
    Code:
    OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
    IF SUBRC = 0
       LOOP AT TABLE1
         TRANSFER TABLE1 TO FILE
       ENDLOOP
       CLOSE DATASET
       OPEN DATASET FILE APPENDING
       IF SUBRC = 0
         TRANSFER TABLE2 TO FILE
       ELSE
         MESSAGE ERROR
       ENDIF
    ELSE
       MESSAGE ERROR
    ENDIF
    CLOSE DATASET
    Thanks.

    Hi Cor,
    Here is my code to create datagridview (see below)
    By the way, I would like to ask if i will always declare this code every time i will do the insert , update and delete records. Let say i have separate buttons for every process. its possible to create one time and i will call this function.
    Another question. can i put a auto number in the first column of Datagridview upon adding of records.
    Dim conn As New System.Data.OleDb.OleDbConnection() conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\jov\Desktop\FeedBackSystem\FBSystems\FBSystems\Data\KPI.accdb"
    form load event (DataGridView)
        Dim dt As New DataTable        Private cma As CurrencyManager = DirectCast(BindingContext(dt), CurrencyManager)        'Set Data GridView
            With dgvReport            dt.Columns.Add("ItemNumber", GetType(String))            dt.Columns.Add("ReportName", GetType(String))            dt.Columns.Add("Ratings", GetType(String))            dt.Columns.Add("Comment", GetType(String))            AddHandler cma.CurrentChanged, AddressOf CurrentChanged            .ReadOnly = True
                .MultiSelect = False
                .AllowUserToAddRows = False
                .AllowUserToDeleteRows = False
                dgvReport.DataSource = dt            For Each c As DataGridViewColumn In dgvReport.Columns                c.Width = 200            Next
            End With
    This is the code to insert records from textbox to datagridview
    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
    Dim i As Integer
    dt.Rows.Add(txtItemNo.Text, CmbReportName.Text, CmbRate.Text, txtComment.Text)
    End Sub

  • When i open or close tabs and when i scroll up down ......some blinkings of firefox are there.... tell me what to do???

    Laptop Acer aspire 5732Z
    Windows 7
    2 GHZ dual core
    2 GB RAM
    160 GB hard disk

    Hi elamothe! It sounds like you just have VoiceOver turned on for your Mac. You can find VoiceOver by going to ''System Preferences->Universal Access->Seeing'' on your Mac, not in Firefox. This will allow you to disable VoiceOver.
    CMD + F5 will toggle the setting as well.
    Hopefully this helps!

  • How can I get my trash to empty?  Window opens but closes immediately.

    How can I get my trash to empty?  Window opens but closes immediately and there are nearly 9000 items there.

    Hold your click a little longer on the Trash in dock and a popup will appear. Choose Empty Trash.

  • Open and Close Dataset problem

    Hi All,
    I am facing a weird problem in transferring data to application server.
    I have used Open dataset to write my file in text format to the application server.
    Now everything works fine when small amount of data is there.When the number of records increases and when it takes lot of time , the format of the text file is completely distorted.
    I have used tab as the delimiter. Please suggest me some solution for this.
    Is this due to the time taken?
    Regards.

    Hi
    in the above program , when i had created 1st i had same problem
    then i had worte the logic likethis
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    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.
    <b>loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.</b>
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.
    with the bold letters above
    i had wrote that logic for that
    reward if usefull

  • OPEN DATASET and TRANSFER

    Hi all,
    I open Dataset in Text Mode with default encoding and trying to transfer data from an internal table to TEXT file in application server.
    But my internal table has 1 numeric field, so while transfering i am getting error stating: "cannot write Non-chracter field".
    So, is there any way to write Non-character fields also using same OPEN Dataset and TRANSFER Statements.
    Help will be rewarded.
    Sachin

    Hi  Saching..
    As per UNICODE We cannot transfer Numeric fields to file .
    So We must convert the Record to Character format.
    This is the Modified code. Changes are in BOLD.
    TABLES: ZSACHIN_STUDENT.
    PARAMETERS:
    OUTFILE(20) DEFAULT 'sachin_test.txt'
    LOWER CASE.
    TYPES: BEGIN OF st_student,
    ID TYPE ZSACHIN_STUDENT-ID,
    NAME TYPE ZSACHIN_STUDENT-NAME,
    ADDRESS TYPE ZSACHIN_STUDENT-ADDRESS,
    STATE TYPE ZSACHIN_STUDENT-STATE,
    CITY TYPE ZSACHIN_STUDENT-CITY,
    STATUS TYPE ZSACHIN_STUDENT-STATUS,
    END OF st_student.
    DATA : it_student TYPE STANDARD TABLE OF st_student,
    it_student_wa TYPE st_student.
    <b>DATA: V_RECORD(200) TYPE C.</b>
    OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding default.
    IF sy-subrc <> 0.
    message e001(z_error).
    endif.
    SELECT * FROM ZSACHIN_STUDENT INTO
    CORRESPONDING FIELDS OF TABLE it_student.
    <b>LOOP AT it_student INTO it_student_wa.
    <b>CONCATENATE IT_student_wa-name
                             IT_student_wa-address
                             IT_student_wa-state
                             IT_student_wa-city
                             IT_student_wa-status
                             INTO V_RECORD
       SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    TRANSFER V_RECORD TO OUTFILE.</b>
    ENDLOOP.</b>
    CLOSE DATASET OUTFILE.
    Here SEPARATED BY is for generating  TAB delimiter .
    <b>Reward if Helpful</b>

  • Open data and close dataset

    code required for  how to upload to application server and download it from application server using open dataset and closedataset.

    Hello bharath,
    Check out this code:
    EPORT Z_CRM_REP_SCORE100 no standard page heading message-id zmsgap.
    *&     Type Declaration
    Types: Begin of t_file,
           BPEXT type BU_BPEXT,               "External Number of Business Partner
           NAME_FIRST type BU_NAMEP_F,        "First Name
           NAME_LAST type BU_NAMEP_L,         "Last Name
           CITY1 type AD_CITY1,               "City
           COUNTRY type AD_COMCTRY,           "Country
           TEL_NUMBER type AD_TLNMBR1,        "Telephone Number
           End of t_file.
    Types: Begin of t_but000,                "External Number of Business Partner
           PARTNER type BU_PARTNER,
           BPEXT type BU_BPEXT,
           NAME_FIRST type BU_NAMEP_F,       "First Name
           NAME_LAST type BU_NAMEP_L,        "Last Name
           PERSNUMBER type AD_PERSNUM,       "Person Number
           ADDRCOMM type BU_ADDRCOMM,        "Address Number
           end of t_but000.
    Types: Begin of t_adr2,
           ADDRNUMBER type AD_ADDRNUM,       "Address Number
           PERSNUMBER type AD_PERSNUM,       "Person Number
           COUNTRY type AD_COMCTRY,          "Country
           TEL_NUMBER type AD_TLNMBR,        "Telephone Number
           End of t_adr2.
    Types: Begin of t_adrc,
           ADDRNUMBER type AD_ADDRNUM,       "Address Number
           CITY1 type AD_CITY1,              "City
           End of t_adrc.
    *&      Internal tables and Work Areas Declaration
    Data: it_file type standard table of t_file,
          wa_file type t_file,
          it_sapdata type standard table of t_file,
          wa_sapdata type t_file,
          it_output type standard table of t_file,
          wa_output type t_file,
          it_but000 type standard table of t_but000,
          wa_but000 type t_but000,
          it_adr2 type standard table of t_adr2,
          wa_adr2 type t_adr2,
          it_adrc type standard table of t_adrc,
          wa_adrc type t_adrc.
    *Variable Declaration for file path
    Data:gv_path type SAPB-SAPPFAD value 'C:\FILE.TXT',
         gv_path1 type string value 'file1.txt'.
    *Variable Declaration for index.
    Data: gv_tabix type sy-tabix.
    *Variable Declaration for Line selection.
    Data: v_fieldname type BUT000-BPEXT,
           v_fieldvalue type BU_BPEXT.
    *Calling subroutine to create flat file in application server.
    Perform f_file_to_server.
    *Calling subroutine to fetch values from flat file into an internal table.
    Perform f_dataset.
    *&      Event Start-of-Selection.
    Start-of-Selection.
    *Calling subroutine to fetch values from table BUT000 into an internal table.
      Perform f_select_but000.
    *Calling subroutine to fetch values from table ADR2 into an internal table.
      Perform f_select_adr2.
    *Calling subroutine to fetch values from table ADRC into an internal table.
      Perform f_select_adrc.
    *&      Event End-of-Selection.
    End-of-Selection.
    *Calling subroutine to fill an internal table with SAP data.
      Perform f_fill_sapdata.
    *Calling subroutine to compare the values between I_SAPDATA and I_FILE.
      Perform f_compare.
    *&      Event At Line Selection.
    At Line-Selection.
    *Checking for list index.
      Case sy-lsind.
    *When list index is 1.
        When '1'.
    *Get the value of external number and apss it to the field value..
          Get Cursor Field v_fieldname value v_fieldvalue.
    *Passing field value to field name.
          wa_sapdata-BPEXT = v_fieldvalue.
          If v_fieldname = 'WA_SAPDATA-BPEXT'.
    *Taking only that value whose External Number exist in the internal table IT_BUT000.
            Read Table it_but000 into wa_but000 with key BPEXT = v_fieldvalue binary search.
    *Checking if value exist.
            If sy-subrc eq 0.
    *If it exists then call BP transaction to change the values for that particualr BP according to Aries data.
              Set Parameter id 'BPA' FIELD WA_BUT000-partner.
              Call Transaction 'BP' and skip first screen..
            Endif.                                                        "End of Sy-subrc check.
          Endif.
        Endcase.
    *&      Form  f_file_to_server
    *       This module is used to create flat file in application server
    *       by using function module ARCHIVFILE_CLIENT_TO_SERVER .
    FORM f_file_to_server .
    *Calling function module to create flat file in application server.
      CALL FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER'
        EXPORTING
          PATH       = GV_PATH
          TARGETPATH = 'FILE1.TXT '
        EXCEPTIONS
          ERROR_FILE = 1
          OTHERS     = 2.
    *checking if file is created successfully
      IF SY-SUBRC <> 0.
    *If file is not created then display a message.
        Message E009.
      ENDIF.                 "End of Sy-subrc check.
    ENDFORM.                    " f_file_to_server
    *&      Form  f_dataset
    *       This module is used to fetch values from flat file,stored in
    *       application server, into an internal table it_file.
    FORM f_dataset .
    *Opening file from application server.
      Open dataset gv_path1 for input in text mode encoding default.
    *Reading the file.
      While sy-subrc eq 0.
        Read dataset gv_path1 into wa_file.
        Append wa_file to it_file.
        Clear wa_file.
      Endwhile.
    *closing the file in application server.
      Close dataset gv_path1.
    ENDFORM.                    " f_dataset
    *&      Form  f_select_but000
    *       This module is used to select values from table BUT000 into an
    *       internal table i_but000.
    FORM f_select_but000 .
    *Selecting values from table BUT000.
      Select PARTNER
             BPEXT
             NAME_FIRST
             NAME_LAST
             PERSNUMBER
             ADDRCOMM
             From but000 into table it_but000
             where TYPE = '1'
             and BPEXT ne ''
             and ADDRCOMM ne ''.
    *Checking if values are fetched in the internal table.
      If sy-subrc eq 0.
        sort it_but000 by BPEXT PERSNUMBER .
      Endif.                           " End of Sy-subrc check.
    ENDFORM.                    " f_select_but000
    *&      Form  f_select_adr2
    *       This module is used to select values from table ADR2 into an
    *       internal table i_adr2 corresponding to the values in i_but000.
    FORM f_select_adr2 .
    *Checking if internal table i_but000 is not empty.
      If not it_but000[] is initial.
    *Selecting values from table ADR2.
        Select ADDRNUMBER
               PERSNUMBER
               COUNTRY
               TEL_NUMBER
               into table it_adr2
               from adr2
               for all entries in it_but000
               where PERSNUMBER = it_but000-PERSNUMBER.
    *Checking if values are fetched in the internal table.
        If sy-subrc eq 0.
          sort it_adr2 by ADDRNUMBER.         " End of Sy-subrc check.
        Endif.
      Endif.                                  "End of internal table check.
    ENDFORM.                    " f_select_adr2
    *&      Form  f_select_adrc
    *      This module is used to select values from table ADRC into an
    *      internal table i_adrc on the basis of values in i_adr2.
    FORM f_select_adrc .
    *Checking if internal table i_but000 is not empty.
      If not it_adr2[] is initial.
    *Selecting values from table ADRC.
        Select ADDRNUMBER
               CITY1
               from adrc
               into table it_adrc
               for all entries in it_adr2
               where ADDRNUMBER = it_adr2-ADDRNUMBER.
    *Checking if values are fetched in the internal table.
        If sy-subrc eq 0.
          sort it_adrc by ADDRNUMBER.         " End of Sy-subrc check.
        Endif.
      Endif.                                  "End of internal table check.
    ENDFORM.                    " f_select_adrc
    *&      Form  f_fill_sapdata
    *       This module is used to fill values in internal table i_sapdata
    *       with the values selected from BUT000,ADRC and ADR2.
    FORM f_fill_sapdata .
    *Checking if internal table it_but000 is not empty.
      If not it_but000[] is initial.
        Loop at it_but000 into wa_but000.
    *Filling the values of internal table IT_BUT000 into workarea of IT_SAPDATA.
          wa_sapdata-BPEXT = wa_but000-BPEXT.
          wa_sapdata-NAME_FIRST = wa_but000-NAME_FIRST.
          wa_sapdata-NAME_LAST = wa_but000-NAME_LAST.
    *Taking only those values whose Person Number exist in the internal table IT_ADR2.
          Read  table it_adr2 into wa_adr2 with key PERSNUMBER = wa_but000-PERSNUMBER Binary Search.
    *If value exists then populate those values in work area of IT_SAPDATA.
          If sy-subrc eq 0.
            wa_sapdata-COUNTRY = wa_adr2-COUNTRY.
            wa_sapdata-TEL_NUMBER  = wa_adr2-TEL_NUMBER .
    *Taking only those values whose Address Number exist in the internal table I_ADRC.
            Read table it_adrc into wa_adrc with key ADDRNUMBER = wa_adr2-ADDRNUMBER Binary Search.
    *If value exists then populate that value in work area of I_SAPDATA.
            If sy-subrc eq 0.
              wa_sapdata-CITY1 = wa_adrc-CITY1.
            Endif.                              "End of Sy-subrc Check.
          Endif.                                "End of Sy-subrc Check.
    *Inserting workarea of sapdata into its internal table.
          Append wa_sapdata to it_sapdata.
    *Clearing all workareas.
          Clear: wa_adrc,wa_adr2,wa_sapdata.
        Endloop.
      Endif.                                      "End of internal table check.
    *Clearing workarea.
      Clear wa_but000.
    ENDFORM.                    " f_fill_sapdata
    *&      Form  f_compare
    *       This module is used to compare values between the Aries data
    *       and SAP data and display those values which are different.
    FORM f_compare .
    *Checking if internal table it_sapdata is not empty.
      If not it_sapdata[] is initial.
        Loop at it_sapdata into wa_sapdata.
    *Taking only those values whose External Number exist in the internal table IT_FILE.
          Read table it_file into wa_file with key BPEXT = wa_sapdata-BPEXT.
    *Comparing the workareas of two internal tables
          If wa_sapdata ne wa_file.
    *Checking if values of work area donot match then write the header.
            Write: / sy-uline(120).
            Format color 1.
            Write: /1 'External Number' Centered.
            Format Hotspot on.
            Write: 17 wa_sapdata-BPEXT.
            Format Hotspot off.
            Write: 47 sy-vline,
               48 'Aries data' Centered,
               80 sy-vline,
               81 'SAP data' Centered,
               120 sy-vline.
            WRITE: / sy-uline(120).
    *Checking if first name in the aries data and SAP data does not match.
            If wa_sapdata-NAME_FIRST ne wa_file-NAME_FIRST.
    *If it doesnt match then display it using subroutine.
              Perform f_write using 'First Name' wa_file-NAME_FIRST  wa_sapdata-NAME_FIRST.
            Endif.                                                                              " End of Sy-subrc check.
    *Checking if last name in the aries data and SAP data does not match.
            If wa_sapdata-NAME_LAST ne wa_file-NAME_LAST.
    *If it doesnt match then display it using subroutine.
              Perform f_write using 'Last Name' wa_file-NAME_LAST  wa_sapdata-NAME_LAST.
            Endif.                                                                              " End of Sy-subrc check.
    *Checking if city in the aries data and SAP data does not match.
            If wa_sapdata-CITY1 ne wa_file-CITY1.
    *If it doesnt match then display it using subroutine.
              Perform f_write using 'City' wa_file-CITY1  wa_sapdata-CITY1.
            Endif.                                                                             " End of Sy-subrc check.
    *Checking if country in the aries data and SAP data does not match.
            If wa_sapdata-COUNTRY ne wa_file-COUNTRY.
    *If it doesnt match then display it using subroutine.
              Perform f_write using 'Country' wa_file-COUNTRY  wa_sapdata-COUNTRY.
            Endif.                                                                             " End of Sy-subrc check.
    *Checking if phone number in the aries data and SAP data does not match.
            If wa_sapdata-TEL_NUMBER ne wa_file-TEL_NUMBER.
    *If it doesnt match then display it using subroutine.
              Perform f_write using 'Phone Number' wa_file-TEL_NUMBER  wa_sapdata-TEL_NUMBER.
            Endif.                                                                            " End of Sy-subrc check.
          Endif.                                                                               "End of Equality check.
        Endloop.
    *Clearing workareas.
        Clear: wa_sapdata, wa_file.
      Endif.                                                                                "End of internal table check.
    ENDFORM.                    " f_compare
    *&      Form  f_write
    *       This module is used to display the field names which has been
    *       changed in SAP from Aries data.
    *      -->P_field_name   text
    *      -->P_Aries_data   text
    *      -->P_SAP_data     text
    FORM f_write  USING    VALUE(P_field_name)
                           VALUE(P_Aries_data)
                           VALUE(P_SAP_data).
      Format color 2.
      Write : /1 P_field_name,
              47 sy-vline.
      Format color off.
      Write: 48 P_Aries_data,
             80 sy-vline,
             81 P_SAP_data,
             120 sy-vline.
      WRITE: / sy-uline(120).
    ENDFORM.                    " f_write
    Please reward points if helpful.
    Regards,
    Aditi

  • Open dataset and close dataset

    Hi
    I need to write log file in fileshare.
    I am using the following FM to create the file.
    Z_FILE_OPEN_OUT_UNICODE'
    I have following qns
    1. do i need to use open dataset and close dataset stmts, even I create the files with the FM?

    Hi,
    you can fill in the name of the FM in transaction SE37, then click 'Display' and look at the source code and the 'Tables' tab.
    It's a custom build FM, so you might have to look at the import parameters it needs... ( Tab 'Import' and 'Tables' ).
    To answer your question, as the name of the FM suggests it will write the file for you, so no open/close dataset. Please doublecheck tab 'Source code' and you might find these statements there...
    hope that helps,
    Rolf

  • Script to open and close CD and DVD

    Hi everyone,
    My MAC has an internal CD burner and an external DVD burner. I would like to know if it could possible to create two scripts that, by clicking , it would open or close (depending of the status) my CD and another one for my DVD burner.
    I look at the list of functions, and I could find only eject. I new to Automator.
    Thanks a lot

    Bruno,
    I believe you will find what you want at the following discussion forum item:
    http://discussions.apple.com/thread.jspa?messageID=1337938

  • When I close Firefox and then try to open it, it says it is already running and I have to close it which I can't do. The only way to open it is to first restart my computer which is a pain. If I can't fix this I will use an other brouser!

    I am not sure what more I can tell you. I close firefox. So when I click on the icon it should allow me to open it again but I get a message that says it is already running. Either close it out which I can't do since I already did that or restart the computer.

    Try holding control, alt and delete down in succession and then a dialogue box will appear with windows task manager. Once open click on the Processes Tab and look for firefox.exe. Highlight this and then click end process. It should come up with a warning but just click Yes. This should then close firefox and allow you to reopen it from your desktop without shutting down your computer. Hope this helps.

  • I use an iMac (27" 3.4) and have problems with the Magic Mouse. It does not use contact, but opens useless and unrelated submenus with every click, even on the empty desktop. I can't shift, open or close pages. Has anyone out there the same problem?

    I use an iMac 27" (mid 2011). Until recently I had OSX 10.6.8 installed, but both, the HDD and SSD had to be replaced, and I lost all the memory.
    After the repair through Apple Care I had OSX 10.7.5. (Lion) installed, which developed a Magic Mouse problem.
    Unlike with most users, I have no problems with connection, but grapple with a different kind of erratic behaviour.
    All fancy stuff is turned off in the mouse preferences. When I try to move, open or close pages, unrelated submenus pop up and hinder the
    required task. No matter how often I click, these menus stay there, and they even come up when clicking on the bare desktop.
    It renders the mouse absolutely useless, as no work can be done with it.
    The first 'Magic Mouse' had depleted batteries every few days, despite switching it off after use.
    I was supplied a new Mouse, which does better battery-wise, but the problems are the same. I can't get a result by clicking on any link, due to
    the pop-up menus, so both 'Magic Mice' are totally useless.
    At present I am using the old USB mouse from my Mac Pro, and that works still o.k.
    The problem are not the mice, but the software. The first 2 weeks after installation of OSX 10.7.5 the Magic Mouse worked though.
    I have no idea as to what the reason may be.
    Has anyone in the community ever experienced that particular problem. Any hint would be welcomed.
    Thank you!

    Not using any mouse pad, I have a very smooth desktop. But I just tried to use a sheet of A4 printing paper, but no result, the problem persisted.
    Someone on this forum suggested, that USB3 may interfere with the magic mouse.
    I have 2 LaCie HDD's about 70 cm away from the mouse, I use them on Thunderbolt. But in operation or not - the result is the same, the mouse plays up! Just now I was clicking the desktop and the mouse created a new folder!!
    Thanks for the advice, Bee
    Cheers, Gerd

  • When i close firefox and want to use it later i get a warning saying cannot open firefox close it first this keeps happening all the time any ideas to solve this problem? i have 2 mchines one on xp and one on windows 7

    i have 2 pcs one with xp and the other with windows 7 heres the problem
    when i close firefox and say go back to it say in 10 mins i get a error message saying to close firefox before opening!!! but firefox window is closed but the processes still say its running in task manager so to correct this i have to end process on firefox. this seems to be happening now every time in the last few days i have upgraded firefox to the latest version. any ideas on how to solve this problem.

    see if this helps you : [https://support.mozilla.org/en-US/kb/Firefox%20is%20already%20running%20but%20is%20not%20responding Firefox is already running but is not responding]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

Maybe you are looking for

  • MacPro sees 16g mem but Activity Monitor Only Shows 8 Gig

    I have 4 simms of 4GB mem in my 2008 MacPro. I always thought all was ok as "About this Mac" shows 16GB of mem. But when I run Activity Monitor, the System Memory pie chart says I have 8GB. Is there another way to confirm how much mem is being recogn

  • Upgraded to 10.10.1. Can't use Davinci Resolve lite now. DPDecoder keeps quitting unexpectedly.

    Davinci Resolve Lite will open but will not display video. Worked fine before the upgrade to 10.10.1 I have reported to apple but I desperately need to finish my project! Can anyone help? thanks mc

  • Selection of BOM with Production version

    Hello friends, I have Finish product say A with two alt. BOM and Production Version 1 & 2 i have semi-finish product say B  with two alt. BOM 1 and 2 in the BOM of the Product A Now when i create PIR in MD61 for product A with production version 2 se

  • Adobe error and we could not able to solve this

    If we select a single item in the comment field, multiple edits were selected in the page. Please refer the attached screenshot. Number 1 and 2 indicates the edits that highlights when we select 1 item in the comment field which is indicated by numbe

  • JSF RI license

    Hello, We had a discussion lately about JSF license. Is there any restriction using JSF Reference Implementation (which is included in Studio Creator) in production environment? I hope not:). Juraj