<?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 HELP IN USE PNP LOGICAL DATABASE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-use-pnp-logical-database/m-p/1919956#M382297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And I have 2 problem the first is that I have error that I don&amp;#146;t now how to solve like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.In Unicode programs, the "-" character cannot appear in names, as it1&lt;/P&gt;&lt;P&gt;does here in the name "PNP-SW-IGNORELOCKEDRECORDS".			&lt;/P&gt;&lt;P&gt;2.In Unicode programs, the "-" character cannot appear in names, as it		does here in the name "PNP-SW-ENQUEUEPERNR".&lt;/P&gt;&lt;P&gt;In Unicode programs, the "-" character cannot appear in names, as it3.		&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does here in the name "PNP-SW-AUTH-SKIPPED-RECORD".			&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I do&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;GET peras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: pernr.&lt;/P&gt;&lt;P&gt;NODES: peras.&lt;/P&gt;&lt;P&gt;INFOTYPES: 0000 NAME t_0000,&lt;/P&gt;&lt;P&gt;           0002 NAME t_0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;What im doing wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second problem in my  program I call to function before I use the pnpce I use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS so_date  FOR sy-datum  OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'YHR_GET_EMP_COURSE_SINGLE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    begda          = so_date-low&lt;/P&gt;&lt;P&gt;    endda          = so_date-high&lt;/P&gt;&lt;P&gt;    uname          = uname&lt;/P&gt;&lt;P&gt;    z_course_table = z_course_table&lt;/P&gt;&lt;P&gt;    switch_history = switch_history&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    itab_final     = itab_final&lt;/P&gt;&lt;P&gt;    it_final       = it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for that I call the function with so_date-low and high what I have to write begda and endda if I use pnpce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanke for your time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Feb 2007 07:58:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-12T07:58:12Z</dc:date>
    <item>
      <title>HELP IN USE PNP LOGICAL DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-use-pnp-logical-database/m-p/1919956#M382297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And I have 2 problem the first is that I have error that I don&amp;#146;t now how to solve like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.In Unicode programs, the "-" character cannot appear in names, as it1&lt;/P&gt;&lt;P&gt;does here in the name "PNP-SW-IGNORELOCKEDRECORDS".			&lt;/P&gt;&lt;P&gt;2.In Unicode programs, the "-" character cannot appear in names, as it		does here in the name "PNP-SW-ENQUEUEPERNR".&lt;/P&gt;&lt;P&gt;In Unicode programs, the "-" character cannot appear in names, as it3.		&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does here in the name "PNP-SW-AUTH-SKIPPED-RECORD".			&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I do&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;GET peras.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: pernr.&lt;/P&gt;&lt;P&gt;NODES: peras.&lt;/P&gt;&lt;P&gt;INFOTYPES: 0000 NAME t_0000,&lt;/P&gt;&lt;P&gt;           0002 NAME t_0002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;What im doing wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second problem in my  program I call to function before I use the pnpce I use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS so_date  FOR sy-datum  OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'YHR_GET_EMP_COURSE_SINGLE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    begda          = so_date-low&lt;/P&gt;&lt;P&gt;    endda          = so_date-high&lt;/P&gt;&lt;P&gt;    uname          = uname&lt;/P&gt;&lt;P&gt;    z_course_table = z_course_table&lt;/P&gt;&lt;P&gt;    switch_history = switch_history&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    itab_final     = itab_final&lt;/P&gt;&lt;P&gt;    it_final       = it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for that I call the function with so_date-low and high what I have to write begda and endda if I use pnpce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanke for your time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 07:58:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-use-pnp-logical-database/m-p/1919956#M382297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T07:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: HELP IN USE PNP LOGICAL DATABASE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-use-pnp-logical-database/m-p/1919957#M382298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer my demo code for PNP database.&lt;/P&gt;&lt;P&gt;also pls ensure u have provided LDB name in the attributes of the program say PNP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT  ZPPL_PREVEMPLOYERS   message-id rp
                             line-size 250
                             line-count 65.
*Program logic :- This Report is used to Download all the Previous
* Employer (IT0023) records of the employees

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Tables and Infotypes                                                *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
tables: pernr.

infotypes: 0000,
           0001,
           0002,
           0023.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Constants                                                           *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
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_pl03       like p0001-werks     value 'PL03'.


*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Selection-Screen                                                    *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
parameters: p_file  like rlgrap-filename default 'C:TempABC.xls',
            p_test  as checkbox default c_x               .

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Internal tables                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
* Internal Table for Output
data: begin of t_output occurs 0    ,
       pernr like pernr-pernr       ,
       nachn like p0002-nachn       ,
       vorna like p0002-vorna       ,
       orgeh_stext like p1000-stext ,
       plans_stext like p1000-stext ,
       begda like p0023-begda       ,
       endda like p0023-endda       ,
       land1 like p0023-land1       ,
       arbgb like p0023-arbgb       ,
       ort01 like p0023-ort01   .
data: end of t_output           .

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Variables                                                           *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

data: o_stext like p1000-stext,
      p_stext like p1000-stext.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Initialization                                                      *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
Initialization.
* Initialize Selection-Screen values
  perform init_selction_screen.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; AT Selection-screen                                                 *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
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.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Start-of Selection                                                  *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
Start-of-selection.

get pernr.

  clear t_output.

* 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 employee belongs to PL03
  check p0001-werks in pnpwerks.  "belongs to PL03
* Check if emp belongs to Active Group
  check p0001-persg in pnppersg.

* Read Infotype 2
  rp-provide-from-last p0002 space pn-begda pn-endda.
  check pnp-sw-found eq c_1.

* Read Org Unit Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
     EXPORTING
          OTYPE                   = 'O'
          objid                   = p0001-orgeh
          begda                   = p0001-begda
          endda                   = p0001-endda
          reference_date          = p0001-begda
     IMPORTING
          object_text             = o_stext
      EXCEPTIONS
          nothing_found           = 1
          wrong_objecttype        = 2
          missing_costcenter_data = 3
          missing_object_id       = 4
          OTHERS                  = 5.

*Read Position Text.
CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
     EXPORTING
          OTYPE                   = 'S'
          objid                   = p0001-plans
          begda                   = p0001-begda
          endda                   = p0001-endda
          reference_date          = p0001-begda
     IMPORTING
          object_text             = p_stext
     EXCEPTIONS
          nothing_found           = 1
          wrong_objecttype        = 2
          missing_costcenter_data = 3
          missing_object_id       = 4
          OTHERS                  = 5.

* Gather all the required information related to the emp
  move: pernr-pernr to t_output-pernr,
        o_stext to t_output-orgeh_stext,
        p_stext to t_output-plans_stext,
        p0002-nachn to t_output-nachn,
        p0002-vorna to t_output-vorna.

* Gather previous Employee details
  loop at p0023.
    move-corresponding p0023 to t_output.
    append t_output.
  endloop.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; End-of Selection                                                    *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
end-of-selection.

  perform print_report.

* Downlaod the file
  if not t_output[] is initial.
    if p_test eq space.
      perform download_file.
    endif.
  else.
    write: 'No records selected' color col_negative.
  endif.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Top-of-page                                                         *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
Top-of-page.

* Print Header
  perform print_header.

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  download_file
*&amp;amp;---------------------------------------------------------------------*
* Description :
*----------------------------------------------------------------------*
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                = t_output[]
    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

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  print_report
*&amp;amp;---------------------------------------------------------------------*
*Description:
*----------------------------------------------------------------------*
FORM print_report .
  data: i       type i,
        w_count type i.
  sort t_output.

* Print the report
  loop at t_output.
    i = sy-tabix mod 2.
    if i eq 0.
      format color col_normal intensified on.
    else.
      format color col_normal intensified off.
    endif.

    write:/1     t_output-pernr          ,
           10     t_output-vorna(25)     ,
           35    t_output-nachn(25)      ,
           61   t_output-orgeh_stext     ,
           102  t_output-plans_stext     ,
           143  t_output-begda           ,
           154   t_output-endda          ,
           168   t_output-land1          ,
           178   t_output-arbgb(40)      ,
           219   t_output-ort01          ,
           249   space              .

  endloop.

  uline.

  Describe table t_output lines w_count.
  Skip 2.

  Write:/ 'Total No of Records Downloaded: ' color col_total,
          w_count.

ENDFORM.                    " print_report

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  print_header
*&amp;amp;---------------------------------------------------------------------*
*Description:
*----------------------------------------------------------------------*
FORM print_header .

  skip 1.
  Uline.

  format Intensified on color col_heading.


  write:/1   'Pers. #'        ,
         10   'Last Name'     ,
         35   'First Name'    ,
         61   'Org Unit'      ,
         102  'Position'      ,
         143  'Beg Date'      ,
        154   'End Date'      ,
        168   'Cntry Key'     ,
        178   'Prev Employer' ,
        219  'City'           ,
        249   space          .


  format intensified off color off.

  uline.


ENDFORM.                    " print_header

*eject
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  init_selction_screen
*&amp;amp;---------------------------------------------------------------------*
*Description:
*----------------------------------------------------------------------*
FORM init_selction_screen .

  refresh: pnpwerks,
           pnppersg,
           pnpstat2.
  clear:   pnpwerks,
           pnppersg,
           pnpstat2.

  pnpwerks-sign   = c_i.
  pnpwerks-option = c_EQ.
  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

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 08:07:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-use-pnp-logical-database/m-p/1919957#M382298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T08:07:37Z</dc:date>
    </item>
  </channel>
</rss>

