SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

print SMARTFORM



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
arazumbayev
Участник
Участник



Joined: 18 Dec 2012
Posts: 5

PostPosted: Wed Feb 06, 2013 11:55 am    Post subject: print SMARTFORM Reply with quote

u menya yest nijeukazannaya programma.ctobi perebrasival zakrivayusisya i otkrivayuwiysya shtati na itab i on normalnio rabotayet.

ya xocu button piostavit naverxu i nazvat k primeru 'PRINT'
pri najatiyi 'PRINT' polucat etu informasiyu iz smartforma.
mojete pomoc


Code:
*&---------------------------------------------------------------------*
*& Report  ZHRR_POST_MOVE
REPORT  ZHRR_POST_MOVE.
TYPE-POOLS  slis.
infotypes : 0001.
TABLES: hrp1001,hrp1000,hrp1005.
DATA gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA gs_fieldcat LIKE LINE OF gt_fieldcat.
DATA : org_assing TYPE zztorg WITH HEADER LINE.
DATA : is_0001  TYPE pa0001.
data nn TYPE i VALUE 0.
data it_sort     type  SLIS_T_SORTINFO_ALV WITH HEADER LINE.

DATA: BEGIN OF itab OCCURS 0
    ,  ORDER LIKE tkean-offset
    ,  objid LIKE hrp1001-objid
    ,  sobid LIKE hrp1001-sobid
    ,  stextv LIKE hrp1000-stext
    ,  stexts LIKE hrp1000-stext
    ,  stextd LIKE hrp1000-stext
    ,  tarix  LIKE hrp1001-begda
    ,  begda LIKE hrp1001-begda
    ,  endda LIKE hrp1001-endda
    ,  AEDTM LIKE hrp1002-AEDTM
*    ,  plans like p0001-plans
*    ,  stell like p0001-stell
*    ,  tabnr LIKE hrp1002-tabnr
*    ,  tline LIKE hrt1002-tline
*    ,  orgtx LIKE t527x-orgtx
    ,  actn(8)
    ,  say(10)
    ,  count1 LIKE tkean-offset
    ,  count2 LIKE tkean-offset
    ,  count3 LIKE tkean-offset
    ,  count4 LIKE tkean-offset
     , END OF itab.
DATA: a_itab  LIKE TABLE OF itab WITH HEADER LINE,
      b_itab  LIKE TABLE OF itab WITH HEADER LINE.
*******************
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.
SELECT-OPTIONS: t_begda FOR hrp1001-begda.
PARAMETERS:  p_AEDTM LIKE   hrp1002-AEDTM DEFAULT sy-datum.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN :  END OF BLOCK b1.

INITIALIZATION.
  t_begda-option = 'BT'.
  t_begda-sign = 'I'.
  t_begda-low  = sy-datum.
  t_begda-high = sy-datum.
  APPEND t_begda.

START-OF-SELECTION.

  SELECT  *   FROM hrp1001 INTO CORRESPONDING FIELDS OF TABLE a_itab
        WHERE  otype = 'S'
          AND  sclas = 'O'
          AND  plvar = '01'
*          AND ( objid = '30000123' )"OR objid = '30001033')
          AND ( begda IN t_begda ).
  SELECT  *   FROM hrp1001 INTO CORRESPONDING FIELDS OF TABLE b_itab
        WHERE  otype = 'S'
          AND  sclas = 'O'
          AND  plvar = '01'
          AND ( endda IN t_begda ).
*GET PERNR.
LOOP AT a_itab." where ( begda IN t_begda ).
CLEAR: itab.
*  itab-count = 1.
  itab-objid = a_itab-objid.
  itab-sobid = a_itab-sobid.
  itab-begda = a_itab-begda.
  itab-tarix = a_itab-begda.
  itab-actn  = 'Açılıb'.
    SELECT SINGLE AEDTM FROM hrp1002 INTO a_itab-AEDTM
        WHERE  begda = a_itab-begda.
  itab-AEDTM = a_itab-AEDTM.
********************************************************
itab-count1 = 1.
itab-count2 = 0.
itab-count4 = 0.
        SELECT SINGLE   ZNORM_U2 FROM hrp1005
                   INTO itab-count3
                   WHERE plvar = '01' AND
                         otype = 'S'  AND
                         objid = a_itab-objid  AND
                         begda <= a_itab-begda AND
                         endda >= a_itab-begda.
                      "AND                     langu = sy-langu.
****************************************************
      SELECT SINGLE stext FROM hrp1000
                   INTO itab-stextv
                   WHERE plvar = '01' AND
                         otype = 'S'  AND
                         objid = a_itab-objid  AND
                         begda <= a_itab-begda AND
                         endda >= a_itab-begda AND
                         langu = sy-langu.

      SELECT SINGLE stext FROM hrp1000
                INTO itab-stexts
                WHERE plvar = '01' AND
                     otype = 'O'  AND
                     objid = a_itab-sobid  AND
                     begda <= a_itab-begda AND
                     endda >= a_itab-begda AND
                     langu = sy-langu.
*      SORT a_itab BY sobid.
********
          DATA : lv_orgeh LIKE p0001-orgeh.
          lv_orgeh = a_itab-sobid.
        CLEAR : org_assing,org_assing[] .
      CALL FUNCTION 'Z_ERP_HR_LAST_ORGEH'
        EXPORTING
          orgeh      = lv_orgeh
          date       = a_itab-begda
        CHANGING
          org_assing = org_assing[].
      READ TABLE org_assing INDEX 1.
      itab-stextd = org_assing-obtxt.
      IF itab-stextd = itab-stexts.
        CLEAR : itab-stexts.
      ENDIF.
APPEND itab.
ENDLOOP.
********************VEZIFELERIN BAGLANMASI
LOOP AT b_itab.
*  itab-count = 1.
  itab-objid = b_itab-objid.
  itab-sobid = b_itab-sobid.
  itab-begda = b_itab-begda.
  itab-endda = b_itab-endda.
  itab-tarix = b_itab-endda.
  itab-actn  = 'Bağlanıb'.
    SELECT SINGLE AEDTM FROM hrp1002 INTO b_itab-AEDTM
        WHERE  begda = itab-begda.
  itab-AEDTM = b_itab-AEDTM.
********************************************************
itab-count1 = 0.
itab-count2 = 1.
itab-count3 = 0.
        SELECT SINGLE   ZNORM_U2 FROM hrp1005
                   INTO itab-count4
                   WHERE plvar = '01' AND
                         otype = 'S'  AND
                         objid = b_itab-objid  AND
                         begda <= b_itab-begda AND
                         endda >= b_itab-begda.
                      "AND                     langu = sy-langu.
****************************************************
      SELECT SINGLE stext FROM hrp1000
                   INTO itab-stextv
                   WHERE plvar = '01' AND
                         otype = 'S'  AND
                         objid = b_itab-objid  AND
                         begda <= b_itab-begda AND
                         endda >= b_itab-begda AND
                         langu = sy-langu.

      SELECT SINGLE stext FROM hrp1000
                INTO itab-stexts
                WHERE plvar = '01' AND
                     otype = 'O'  AND
                     objid = b_itab-sobid  AND
                     begda <= b_itab-begda AND
                     endda >= b_itab-begda AND
                     langu = sy-langu.
*      SORT a_itab BY sobid.
********
*          DATA : lv_orgeh LIKE p0001-orgeh.
          lv_orgeh = b_itab-sobid.
        CLEAR : org_assing,org_assing[] .
      CALL FUNCTION 'Z_ERP_HR_LAST_ORGEH'
        EXPORTING
          orgeh      = lv_orgeh
          date       = b_itab-begda
        CHANGING
          org_assing = org_assing[].
      READ TABLE org_assing INDEX 1.
      itab-stextd = org_assing-obtxt.
      IF itab-stextd = itab-stexts.
        CLEAR : itab-stexts.
      ENDIF.
APPEND itab.
ENDLOOP.
LOOP AT itab.
nn = nn + 1.
    IF sy-subrc = 0.
     itab-order = nn.
    ENDIF.
modify itab.
ENDLOOP.
**    sort itab by itab-TABNR.
END-OF-SELECTION.

it_sort-spos = 01.
it_sort-fieldname = 'ORDER'.
it_sort-UP            =  'X'.
it_sort-SUBTOT        = 'X'.
APPEND it_sort.

   CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'ORDER'.
    gt_fieldcat-edit = 'X'.
*gt_fieldcat-UP            =  'X'.
*gt_fieldcat-SUBTOT        = 'X'.
    gt_fieldcat-col_pos     = 3.
    gt_fieldcat-outputlen   = 10.
    gt_fieldcat-seltext_s   = 'ORDER'.
    gt_fieldcat-seltext_m   = 'ORDER'.
    gt_fieldcat-seltext_l   = 'ORDER'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'STEXTV'.
    gt_fieldcat-col_pos     = 4.
    gt_fieldcat-outputlen   = 20.
    gt_fieldcat-seltext_s   = 'Vəzifənin adı'.
    gt_fieldcat-seltext_m   = 'Vəzifənin adı'.
    gt_fieldcat-seltext_l   = 'Vəzifənin adı'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'STEXTS'.
    gt_fieldcat-col_pos     = 5.
    gt_fieldcat-outputlen   = 20.
    gt_fieldcat-seltext_s   = 'Şöbə/bölmə'.
    gt_fieldcat-seltext_m   = 'Şöbə/bölmə'.
    gt_fieldcat-seltext_l   = 'Şöbə/bölmə'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'STEXTD'.
    gt_fieldcat-col_pos     = 8.
    gt_fieldcat-outputlen   = 20.
    gt_fieldcat-seltext_s   = 'Struktur'.
    gt_fieldcat-seltext_m   = 'Struktur'.
    gt_fieldcat-seltext_l   = 'Struktur'.
    APPEND gt_fieldcat TO gt_fieldcat.
***    CLEAR gt_fieldcat.
***    gt_fieldcat-fieldname   = 'ORGTX'.
***    gt_fieldcat-col_pos     = 10.
***    gt_fieldcat-outputlen   = 25.
***    gt_fieldcat-seltext_s   = 'Strukturun Adı'.
***    gt_fieldcat-seltext_m   = 'Strukturun Adı'.
***    gt_fieldcat-seltext_l   = 'Strukturun Adı'.
***    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'TARIX'.
    gt_fieldcat-col_pos     = 15.
    gt_fieldcat-outputlen   = 10.
    gt_fieldcat-seltext_s   = 'Tarix'.
    gt_fieldcat-seltext_l   = 'Tarix'.
    APPEND gt_fieldcat TO gt_fieldcat.
***    CLEAR gt_fieldcat.
***    gt_fieldcat-fieldname   = 'AEDTM'.
***    gt_fieldcat-col_pos     = 20.
***    gt_fieldcat-outputlen   = 10.
***    gt_fieldcat-seltext_s   = 'AEDTM'.
***    gt_fieldcat-seltext_l   = 'AEDTM'.
***    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
    gt_fieldcat-fieldname   = 'ACTN'.
    gt_fieldcat-col_pos     = 25.
    gt_fieldcat-outputlen   = 8.
    gt_fieldcat-seltext_s   = 'Vəziyyət'.
    gt_fieldcat-seltext_l   = 'Vəziyyət'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
****    gt_fieldcat-do_sum ='X'.
    gt_fieldcat-fieldname   = 'COUNT1'.
*****  gt_fieldcat-key         = 'X'.
    gt_fieldcat-col_pos     = 30.
    gt_fieldcat-outputlen   = 8.
    gt_fieldcat-seltext_s   = 'Verilir'.
    gt_fieldcat-seltext_l   = 'Verilir'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
****    gt_fieldcat-do_sum ='X'.
    gt_fieldcat-fieldname   = 'COUNT2'.
*****  gt_fieldcat-key         = 'X'.
    gt_fieldcat-col_pos     = 35.
    gt_fieldcat-outputlen   = 8.
    gt_fieldcat-seltext_s   = 'Ixtisar olunur'.
    gt_fieldcat-seltext_l   = 'Ixtisar olunur'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
****    gt_fieldcat-do_sum ='X'.
    gt_fieldcat-fieldname   = 'COUNT3'.
*****  gt_fieldcat-key         = 'X'.
    gt_fieldcat-col_pos     = 40.
    gt_fieldcat-outputlen   = 8.
    gt_fieldcat-seltext_s   = 'Verilir'.
    gt_fieldcat-seltext_l   = 'Verilir'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.
****    gt_fieldcat-do_sum ='X'.
    gt_fieldcat-fieldname   = 'COUNT4'.
*****  gt_fieldcat-key         = 'X'.
    gt_fieldcat-col_pos     = 45.
    gt_fieldcat-outputlen   = 8.
    gt_fieldcat-seltext_s   = 'Ixtisar olunur'.
    gt_fieldcat-seltext_l   = 'Ixtisar olunur'.
    APPEND gt_fieldcat TO gt_fieldcat.
    CLEAR gt_fieldcat.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING"i_structure_name = 'gs_fieldcat'
        i_callback_program = sy-repid
        it_fieldcat        = gt_fieldcat[]
        i_grid_title       = 'Acilib baglanan vezifeler'
        IT_SORT            = it_sort[]
      TABLES
        t_outtab           = itab.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.