Skip to Content
0
Former Member
Jan 09, 2008 at 01:12 PM

doubt in pf status..its urgent

28 Views

hi all

Can anyone help me out in copying the selected and displaying it in next screen.In my PF status COPY button is not working but back is working..here is my code..

*&---------------------------------------------------------------------*
*& Report  ZSUB
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZSUB.
tables : vbpa,vbrk,vbrp.
type-pools : slis,icon.
data : begin of itab_vbrk occurs 0,
       vbeln like vbrk-vbeln,
       netwr like vbrk-netwr,
       waerk like vbrk-waerk,
       vkorg like vbrk-vkorg,
       vtweg like vbrk-vtweg,
       kunag like vbrk-kunag,
       bstnk_vf like vbrk-bstnk_vf,
       fkart like vbrk-fkart,
       erdat like vbrk-erdat,
       ernam like vbrk-ernam,
       end of itab_vbrk.

data : begin of itab_vbrp occurs 0,
       aubel like vbrp-aubel,
       vgbel like vbrp-vgbel,
       end of itab_vbrp.

data : begin of itab_vbpa occurs 0,
       kunnr like vbpa-kunnr,
       end of itab_vbpa.

data : begin of itab_final occurs 0,
       vbeln like vbrk-vbeln,
       netwr like vbrk-netwr,
       waerk like vbrk-waerk,
       vkorg like vbrk-vkorg,
       vtweg like vbrk-vtweg,
       kunag like vbrk-kunag,
       bstnk_vf like vbrk-bstnk_vf,
       fkart like vbrk-fkart,
       erdat like vbrk-erdat,
       ernam like vbrk-ernam,
       aubel like vbrp-aubel,
       vgbel like vbrp-vgbel,
       kunnr like vbpa-kunnr,
       select type checkbox,
       icon(4) type c ,
       tinvamt  LIKE vbrk-netwr,     "Tax Invoice Amount
       tinvlines(4),                 "Total Invoice Lines
        ttaxlines(4),                 "Total Tax Invoice Lines
        alines,                       "Select All Lines

       end of itab_final.
*CONTROLS TC1 TYPE TABLEVIEW USING SCREEN 1000.
*CONTROLS TC2 TYPE TABLEVIEW USING SCREEN 1000.


data : d_fieldcat type slis_t_fieldcat_alv,
       d_fieldcat_wa type slis_fieldcat_alv.

select vbeln vkorg kunag bstnk_vf fkart netwr waerk erdat ernam from vbrk into corresponding fields of table itab_final.
if not itab_vbpa[] is initial.
select kunnr from vbpa into corresponding fields of table itab_final.
endif.


d_fieldcat_wa-fieldname = 'VBELN'.
d_fieldcat_wa-seltext_l = 'INVOICE'.
d_fieldcat_wa-col_pos = 1.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'VKORG'.
d_fieldcat_wa-seltext_l = 'SALES ORG'.
d_fieldcat_wa-col_pos = 2.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'KUNAG'.
d_fieldcat_wa-seltext_l = 'SOLD-TO'.
d_fieldcat_wa-col_pos = 3.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'KUNNR'.
d_fieldcat_wa-seltext_l = 'BILL-TO'.
d_fieldcat_wa-col_pos = 4.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'BSTNK_VF'.
d_fieldcat_wa-seltext_l = 'REFERENCE NO.'.
d_fieldcat_wa-col_pos = 5.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'FKART'.
d_fieldcat_wa-seltext_l = 'INVOICE TYPE'.
d_fieldcat_wa-col_pos = 6.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'NETWR'.
d_fieldcat_wa-seltext_l = 'NET VALUE'.
d_fieldcat_wa-col_pos = 7.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'WAERK'.
d_fieldcat_wa-seltext_l = 'CURRENCY'.
d_fieldcat_wa-col_pos = 8.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'ERDAT'.
d_fieldcat_wa-seltext_l = 'CREATED ON'.
d_fieldcat_wa-col_pos = 9.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'ERNAM'.
d_fieldcat_wa-seltext_l = 'CREATED BY'.
d_fieldcat_wa-col_pos = 10.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'SELECT'.
d_fieldcat_wa-seltext_l = 'SELECT'.
d_fieldcat_wa-edit = 'X'.
d_fieldcat_wa-checkbox = 'X'.
d_fieldcat_wa-col_pos = 11.
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.

data : gd_repid type sy-repid.
gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = gd_repid
   I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
*   I_CALLBACK_USER_COMMAND           = 'UCOMM'
*   I_CALLBACK_TOP_OF_PAGE            = ' '
*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*   I_CALLBACK_HTML_END_OF_LIST       = ' '
*   I_STRUCTURE_NAME                  =
*   I_BACKGROUND_ID                   = ' '
   I_GRID_TITLE                      = 'CREATE TAX INVOICE NUMBER_SAP INVOICE SELECTION SCREEN'
*   I_GRID_SETTINGS                   =
*   IS_LAYOUT                         =
    IT_FIELDCAT                       = d_fieldcat
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
*   I_SAVE                            = ' '
*   IS_VARIANT                        =
*  IT_EVENTS                         = gt_event[]
*   IT_EVENT_EXIT                     =
*   IS_PRINT                          =
*   IS_REPREP_ID                      =
*   I_SCREEN_START_COLUMN             = 0
*   I_SCREEN_START_LINE               = 0
*   I_SCREEN_END_COLUMN               = 0
*   I_SCREEN_END_LINE                 = 0
*   I_HTML_HEIGHT_TOP                 = 0
*   I_HTML_HEIGHT_END                 = 0
*   IT_ALV_GRAPHICS                   =
*   IT_HYPERLINK                      =
*   IT_ADD_FIELDCAT                   =
*   IT_EXCEPT_QINFO                   =
*   IR_SALV_FULLSCREEN_ADAPTER        =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = itab_final
* EXCEPTIONS
*   PROGRAM_ERROR                     = 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.



form SET_PF_STATUS using rt_extab type slis_t_extab.
 set pf-status 'NEW'.

 endform.

<REMOVED BY MODERATOR>

ASHA....

Edited by: Alvaro Tejada Galindo on Jan 9, 2008 8:22 AM