Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

doubt in pf status..its urgent

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

why is the moderator is removing any problem..? we didnt understand u r question can u a bit specific?

0 Kudos

hi satish

jus exeute my code u wil get a screen wil mulitple invoice numbers..I want to select the check box and press copy button.so dat it has to take those selected field to the next screen and display it..But here if i press copy button its not working..

plz help me out..

Cheer's

Asha

Former Member
0 Kudos

Hi Asha,

First of all, read help on the FM parameter I_CALLBACK_USER_COMMAND using the FM Documentation button in SE37, if you haven't done so already. This will definitely give you a clear idea on using user PF status in ALV.

I think, when a user PF status is used, you need to provide code in the routine passed to the parameter I_CALLBACK_USER_COMMAND (in your case Form UCOMM) for the function codes that are defined in the user PF status as ALV has no idea about these function codes. So, you need to provide the code for sy-ucomm value for COPY in the form routine UCOMM.

Hope this helps.

Thanks

Sanjeev

0 Kudos

Hi Sanjeev

In se37 there is no such FM I_CALLBACK_USER_COMMAND...can u tel me the FM which is used to perform action on single click...

Cheers

Asha

0 Kudos

Hi,

It's not a FM its a parameter in FM reuse_alv_grid_display

uncomment the parameter

Regards

0 Kudos

hi KPN

ya thats ok..but how to use user command to make the entries display if i click COPY.please execute my code and tel me the solution.

Cheers

asha

Former Member