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

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • 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

  • 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

  • HT5361 I can't shut down my computer because it says mail is open.  It says to close mail and continue shut down.  Problem is I can't open or close mail now.  Can't shut down my computer at all.  What can I do?

    I can't shut down my computer because it says mail is open.  It says to close mail and continue shut down.  Problem is I can't open or close mail now.  Can't shut down my computer at all.  What can I do?

    If you cannot get mail to quit/force quit, you can always remove power from your Mac.
    NOTE: removing power is a bad idea, and can result in data loss, but sometimes it is the only thing left to do.
    Press and hold the power button for 5 to 10 seconds, and the Mac will power off.
    When you power back on, the Mac should reboot.

  • Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Refer below link once
    App doesn’t open | Progress wheel spins continually

  • 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

  • Firefox crashing when i wanna open or close a tab or a window, also while wanna open any page, now what to do for solving the problem?

    Firefox crashing when i wanna open or close a tab or a window, also while wanna open any page, now what to do for solving the problem?

    Disable McAfee siteadvisor and check the problem still persist or not?

  • My iTunes, whenever I try to open it, come up with a window that says iTunes has encountered a problem and now has to close sorry for the inconvienence.

    My iTunes, whenever I try to open it, come up with a window that saysiTunes has encountered a problem and now has to close sorry for theinconvienence.

    Generate another of those errors, and click the "Click here" link in the error message box.
    What modname and modver do you see for the error? (Precise spelling, please.)
    If the error is a BEX and you thus aren't seeing a modname or modver, let us know what P1 through P9 items are being listed for the error.

  • I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch.

    I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch, it Should be having so much problems. Thanks for your help.
    iPad, iOS 7.0.4

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

Maybe you are looking for