<?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 reporting difference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956588#M393656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the eaxact diff nbetween normal abap and hr abap.&lt;/P&gt;&lt;P&gt;could u all clarify me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Feb 2007 07:27:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-13T07:27:08Z</dc:date>
    <item>
      <title>reporting difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956588#M393656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the eaxact diff nbetween normal abap and hr abap.&lt;/P&gt;&lt;P&gt;could u all clarify me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 07:27:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956588#M393656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T07:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: reporting difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956589#M393657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HR Abap uses a lot of logical databases and cluster tables. You would use things like GET and PROVIDE when working with HR reports. This is only major difference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These links might help you..&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="153157"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1927349"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1979560"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1846994"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1771619"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 07:28:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956589#M393657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T07:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: reporting difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956590#M393658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer below links - &lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="153157"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1927349"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1979560"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1846994"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1771619"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for HR ABAP programs u have to specify the logical databsae name in the attributes of the program for e.g u can use PNP logical database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is one demo code for understnading the use of PNP logical database - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZPXX_DUPLICATES_PNP  message-id rp
                             line-size 250
                             line-count 65               .

tables: pernr.
infotypes: 0000,
           0001,
           0002,
           0105.
constants: c_1(1)       type c               value '1'   ,
           c_3(1)       type c               value '3'   ,
           c_i(1)       type c               value 'I'   ,
           c_x(1)       type c               value 'X'   ,
           c_eq(2)      type c               value 'EQ'  ,
           c_bt(2)      type c               value 'BT',
           xfield                            value 'X'.

parameters: p_file  like rlgrap-filename default 'C:TempPERNRS_LIST.xls',
            p_test  as checkbox default c_x.
data:  SEQNR like p0001-SEQNR.
Data : begin of itab occurs 0,
       pernr like pernr-pernr,
       endda like p0001-endda,
       SEQNR like p0001-SEQNR,
       end of itab.
Data : begin of pernr_list occurs 0,
       pernr like pernr-pernr,
       end of pernr_list.
*data: itab1 like standard table of itab with header line.

Initialization.
perform init_selction_screen.

at selection-screen .
* Check if Test run selected, download file name should be entered
  if p_test is initial.  "
    if p_file is initial.
      message e016 with 'Please enter file name'
                        'specifying complete path'.
    endif.
  endif.

Start-of-selection.

get pernr.

  clear itab.
* Read Infotype 0
  rp-provide-from-last p0000 space pn-begda pn-endda.
  check pnp-sw-found eq c_1.
* Check if employee is active
  check p0000-stat2 in pnpstat2.      "pernr Active
* Read Infotype 1
  rp-provide-from-last p0001 space pn-begda pn-endda.
  check pnp-sw-found eq c_1.
* Check if emp belongs to Active Group
  check p0001-persg in pnppersg.

  seqnr = 0.
  loop at p0001 where endda = '99991231'.
  seqnr = seqnr + 1.
    move: p0001-pernr to itab-pernr,
        p0001-endda to itab-endda,
        seqnr to itab-seqnr.
  append itab.
  endloop.
end-of-selection.

perform find_duplicates.
perform display_data.
* Downlaod the file
  if not PERNR_LIST[] is initial.
    if p_test eq space.
      perform download_file.
    endif.
  else.
    write: 'No records selected' color col_negative.
  endif.

*if not itab[] is initial.
*    if p_test eq space.
*      perform download_file.
*    endif.
*  else.
*    write: 'No records selected' color col_negative.
*  endif.

Top-of-page.

* Print Header
  perform print_header.




*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  init_selction_screen
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM init_selction_screen .
refresh: pnpwerks,
           pnppersg,
           pnpstat2.
  clear:   pnpwerks,
           pnppersg,
           pnpstat2.

*  pnpwerks-sign   = c_i.
*  pnpwerks-option = c_BT.
**  pnpwerks-low    = c_pl03.
*  append pnpwerks.

  pnppersg-sign   = c_i.
  pnppersg-option = c_EQ.
  pnppersg-low    = c_1.
  append pnppersg.

  pnpstat2-sign   = c_i.
  pnpstat2-option = c_EQ.
  pnpstat2-low    = c_3.
  append pnpstat2.

ENDFORM.                    " init_selction_screen
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display_data
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM display_data .
 data: i       type i,
       w_count type i.
 sort pernr_list.

* Print the report
  loop at pernr_list.
    i = sy-tabix mod 2.
    if i eq 0.
      format color col_normal intensified on.
    else.
      format color col_normal intensified off.
    endif.

    write:/2  pernr_list-pernr.

  endloop.

  uline.

  Describe table pernr_list lines w_count.
  Skip 2.

  if p_test = space and not PERNR_LIST[] is initial.
     Write:/ 'Total No of Records Downloaded: ' color col_total,
          w_count.
  endif.




ENDFORM.                    " display_data
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  download_file
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM download_file .
  DATA: full_file_name    TYPE string,
        z_akt_filesize    TYPE i     .

  full_file_name = p_file.

*  download table into file on presentation server
  CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download
    EXPORTING
      filename                = full_file_name
      filetype                = 'DAT'
      NO_AUTH_CHECK           = c_x
      codepage                = '1160'
    IMPORTING
      FILELENGTH              = z_akt_filesize
    CHANGING
      data_tab                = pernr_list[]
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      not_supported_by_gui    = 22
      error_no_gui            = 23
      OTHERS                  = 24.

*
  IF  sy-subrc               NE        0.
    MESSAGE e016 WITH 'Download-Error; RC:' sy-subrc.
  ENDIF.


ENDFORM.                    " download_file
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  find_duplicates
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM find_duplicates .
FIELD-SYMBOLS:   &amp;lt;itab&amp;gt; LIKE LINE OF itab,
                 &amp;lt;itab_old&amp;gt; LIKE LINE OF itab.
data: tabix like sy-tabix.
sort itab by pernr endda seqnr.
LOOP AT itab ASSIGNING &amp;lt;itab&amp;gt;.
    IF &amp;lt;itab&amp;gt;-seqnr = 2.
      tabix = sy-tabix - 1.
      READ TABLE itab ASSIGNING &amp;lt;itab_old&amp;gt; INDEX tabix.

      IF sy-subrc = 0.
      pernr_list-pernr = &amp;lt;itab_old&amp;gt;-pernr.
      append pernr_list.
       CLEAR: &amp;lt;itab_old&amp;gt;-pernr,
              &amp;lt;itab_old&amp;gt;-endda,
              &amp;lt;itab_old&amp;gt;-seqnr.

      ENDIF.
*      msg = xfield.
    ENDIF.
    IF &amp;lt;itab&amp;gt;-seqnr &amp;gt; 1.
      DELETE itab.
    ENDIF.
  ENDLOOP.



ENDFORM.                    " find_duplicates
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  print_header
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM print_header .

  skip 1.
  Uline.

  format Intensified on color col_heading.
  write:/1   'Personal Number'.


  format intensified off color off.

  uline.


ENDFORM.                    " print_header
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the same program can be written in ABAP as follows  - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZPXX_DUPLICATES_NO_PNP   message-id rp
                                 line-size 250
                                 line-count 65                     .

parameters: p_file  like rlgrap-filename default 'C:TempPERNRS_LIST.xls',
            p_test  as checkbox default 'X',
            p_es    like p0000-STAT2 default '3',
            p_eg    like p0001-PERSG default '1'.

Data : begin of itab occurs 0,
       pernr like pernr-pernr,
       endda like p0001-endda,
       end of itab.
Data : begin of pernr_list occurs 0,
       pernr like pernr-pernr,
       end of pernr_list.
data : itab1 type range of itab WITH HEADER LINE,
       itab2 like standard table of itab with header line.
DATA: DUPCOUNT TYPE I,
      ORICOUNT TYPE I,
      NEWCOUNT TYPE I,
      TOTALHIT TYPE I VALUE 0.

at selection-screen .
* Check if Test run selected, download file name should be entered
  if p_test is initial.  "
    if p_file is initial.
      message e016 with 'Please enter file name'
                        'specifying complete path'.
    endif.
  endif.

Start-of-selection.

select pernr endda into corresponding fields of table itab
from pa0001
where endda = '99991231' and persg = p_eg and
pernr in ( select pernr from pa0000 where STAT2 = p_es
           and endda = '99991231' ).

if sy-subrc = 0.
sort itab by pernr.
itab2[] = itab[].

DESCRIBE TABLE ITAB LINES ORICOUNT.
DELETE ADJACENT DUPLICATES FROM ITAB2.
DESCRIBE TABLE ITAB2 LINES NEWCOUNT.

DUPCOUNT = ORICOUNT - NEWCOUNT.


  ITAB1-SIGN   =  'I'.
  ITAB1-OPTION   =  'EQ'.
  ITAB1-LOW  = '00000000'.

  APPEND ITAB1.

loop at itab.

IF NOT ITAB-PERNR IN ITAB1.
  ITAB1-SIGN   =  'I'.
  ITAB1-OPTION   =  'EQ'.
  ITAB1-LOW  = ITAB-PERNR.

  APPEND ITAB1.

ELSE.
  pernr_list-pernr = itab-pernr.
  append pernr_list.
  TOTALHIT = TOTALHIT + 1.
  IF DUPCOUNT EQ TOTALHIT.
   EXIT.
  ENDIF.
ENDIF.
endloop.

else.
MESSAGE e016 WITH 'Database Read Failed'.
endif.
end-of-selection.


perform display_data.
* Downlaod the file
  if not pernr_list[] is initial.
    if p_test eq space.
      perform download_file.
    endif.
  else.
    write: 'No records selected' color col_negative.
  endif.

Top-of-page.

* Print Header
  perform print_header.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  display_data
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM display_data .
data:  i       type i,
       w_count type i.
 sort pernr_list.

* Print the report
  loop at pernr_list.
    i = sy-tabix mod 2.
    if i eq 0.
      format color col_normal intensified on.
    else.
      format color col_normal intensified off.
    endif.

    write:/2  pernr_list-pernr.

  endloop.

  uline.

  Describe table pernr_list lines w_count.
  Skip 2.

  if p_test = space and not PERNR_LIST[] is initial.
     Write:/ 'Total No of Records Downloaded: ' color col_total,
          w_count.
  endif.




ENDFORM.                    " display_data
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  download_file
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM download_file .
  DATA: full_file_name    TYPE string,
        z_akt_filesize    TYPE i     .

  full_file_name = p_file.

*  download table into file on presentation server
  CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download
    EXPORTING
      filename                = full_file_name
      filetype                = 'DAT'
      codepage                = '1160'
    IMPORTING
      FILELENGTH              = z_akt_filesize
    CHANGING
      data_tab                = pernr_list[]
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      not_supported_by_gui    = 22
      error_no_gui            = 23
      OTHERS                  = 24.

*
  IF  sy-subrc               NE        0.
    MESSAGE e016 WITH 'Download-Error; RC:' sy-subrc.
  ENDIF.


ENDFORM.                    " download_file
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  print_header
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM print_header .
  skip 1.
  Uline.

  format Intensified on color col_heading.
  write:/1   'Personal Number'.


  format intensified off color off.

  uline.



ENDFORM.                    " print_header

amit
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 08:08:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reporting-difference/m-p/1956590#M393658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T08:08:09Z</dc:date>
    </item>
  </channel>
</rss>

