<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Maintenance View issues with an ABAP program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408549#M1547726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I tried using the update statement as follow: UPDATE j_1btxjurt FROM wa_j_1btxjurt.&lt;/P&gt;&lt;P&gt;and it is not inserting any records since it is getting a RC of 4..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Nov 2010 13:39:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-05T13:39:27Z</dc:date>
    <item>
      <title>Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408547#M1547724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to update a Maintenance view(V_JURIC) from a txt file. I created an ABAP module to do this and when I update the tables that compose the view(TABLE_A and TABLE_B), the view is not completely getting updated in the last field. Any suggestions? Here is  sample of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zbr_loc_mast_data_1 MESSAGE-ID fb.

TABLES: j_1btxjurt,
        j_1btxjur.

DATA wa_j_1btxjurv TYPE j_1btxjurv.

DATA wa_j_1btxjurt TYPE j_1btxjurt.

DATA wa_j_1btxjur TYPE j_1btxjur.

DATA: BEGIN OF i_j_1btxjurt OCCURS 2000.
        INCLUDE STRUCTURE j_1btxjurt.
DATA: END OF i_j_1btxjurt.

DATA: i_j_1btxjurv LIKE j_1btxjurv OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF rec OCCURS 0,
      tbl_name(10)     TYPE c,        " Table name(Constant 'J_1BTXJURV')
      field_2(1)       TYPE c,        " Constant "X"
      jur_code(10)     TYPE c,        " Jurisdiction code
      municip(60)      TYPE c,        " Municipality Name
END OF rec.

DATA: w_num_recs TYPE i.
      
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: in_file TYPE localfile OBLIGATORY
            DEFAULT 'C:\lista de municipios.txt'.
SELECTION-SCREEN END OF BLOCK block1.


START-OF-SELECTION.
  PERFORM read_file.
  IF sy-subrc = 0.
    PERFORM update_table.
  ENDIF.

END-OF-SELECTION.

*Summary

    WRITE: / 'Number of records read: ' COLOR COL_TOTAL INVERSE OFF INTENSIFIED ON,
         32 w_num_recs COLOR COL_POSITIVE INVERSE OFF
            INTENSIFIED ON.

  

*----------------------------------------------------------------------*
*       Form  read_file
*----------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM read_file.

  DATA: l_filename TYPE string.

  MOVE in_file TO l_filename.


  CALL METHOD cl_gui_frontend_services=&amp;gt;gui_upload
    EXPORTING
      filename                = l_filename
      filetype                = 'DAT'
*      HAS_FIELD_SEPARATOR     = SPACE
*      HEADER_LENGTH           = 0
*      READ_BY_LINE            = 'X'
*      DAT_MODE                = SPACE
*      CODEPAGE                = SPACE
*      IGNORE_CERR             = ABAP_TRUE
*      REPLACEMENT             = '#'
*      VIRUS_SCAN_PROFILE      =
*    IMPORTING
*      FILELENGTH              =
*      HEADER                  =
    CHANGING
      data_tab                = rec[]
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      not_supported_by_gui    = 17
      error_no_gui            = 18
      OTHERS                  = 19.
  .
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE e039 WITH in_file.
  ENDIF.

ENDFORM.                    " read_file

*----------------------------------------------------------------------*
*       Form  update_table
*----------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM update_table.

  CLEAR: w_num_recs,
         w_num_recs_btable,
         w_num_recs_atable,
         w_num_recs_inserted.


    LOOP AT rec.

    w_num_recs = w_num_recs + 1.

    MOVE 'BR'          TO wa_j_1btxjur-country.
    MOVE rec-jur_code  TO wa_j_1btxjur-taxjurcode.
    MOVE 'PT'          TO wa_j_1btxjurt-spras.
    MOVE 'BR'          TO wa_j_1btxjurt-country.
    MOVE rec-jur_code  TO wa_j_1btxjurt-taxjurcode.
    MOVE rec-municip   TO wa_j_1btxjurt-text.

    
    INSERT into j_1btxjurt values wa_j_1btxjurt.

    IF sy-subrc = 0.
      COMMIT WORK.
    ENDIF.

    INSERT into j_1btxjur values wa_j_1btxjur.

    IF sy-subrc = 0.
      COMMIT WORK.
    ENDIF.

  ENDLOOP.

  
  ENDFORM.                    " update_table&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Nov 5, 2010 9:24 AM - &lt;STRONG&gt;please use code tags&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 04:50:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408547#M1547724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T04:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408548#M1547725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Insert statement will only create new records in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Modify statement to create and update records in table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 06:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408548#M1547725</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2010-11-05T06:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408549#M1547726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I tried using the update statement as follow: UPDATE j_1btxjurt FROM wa_j_1btxjurt.&lt;/P&gt;&lt;P&gt;and it is not inserting any records since it is getting a RC of 4..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 13:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408549#M1547726</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T13:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408550#M1547727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's why Gautham mentioned MODIFY. With that statement a record either gets inserted or updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 13:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408550#M1547727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T13:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408551#M1547728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I used the MODIFY statement and it is inserting the records, but the last field in the view j_1btxjurv-text is blank. The corresponding table field j_1btxjurt-text is populated with the text characters. Any ideas on what else it can be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 14:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408551#M1547728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T14:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408552#M1547729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you don't have any error handling after the first insert. What is sy-subrc after the first insert?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 14:50:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408552#M1547729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408553#M1547730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The return code is 0 and the sy-dbcnt  is 1...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 14:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408553#M1547730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T14:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408554#M1547731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both tables J_1BTXJUR and J_1BTXJURT have records? And.. maybe a bit daft to ask: is your logon language the same as the SPRAS in J_1BTXJURT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 15:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408554#M1547731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T15:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408555#M1547732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK - so it doesn't appear in the view. Do the values appear in the underlying table (j_1btxjurt )?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 15:01:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408555#M1547732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T15:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408556#M1547733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahhhh, that was the problem.. I was logged in EN and the records are inserted in PT for portugues.. The problem is fixed.. Thanks for the help, the brain is getting old..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 15:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408556#M1547733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T15:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Maintenance View issues with an ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408557#M1547734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;MOVE 'PT'          TO wa_j_1btxjurt-spras.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe change that to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MOVE 'P'          TO wa_j_1btxjurt-spras.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 15:06:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/maintenance-view-issues-with-an-abap-program/m-p/7408557#M1547734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-05T15:06:44Z</dc:date>
    </item>
  </channel>
</rss>

