Application Development and Automation 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: 
Read only

set pf-status

Former Member
0 Likes
1,900

hi ALV masters,

i have one issue regarding set pf-status.

i have the output list in my report. there i have created menu option Execute and also push button execute.

But surprisingly, i'm not getting any result when i press execute eitherfrom menu or pushbutton.

Please gimme some sample code.

Thanks,

Praveen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,651

hi

Check the program <b>BCALV_TEST_GRID_TOOLBAR</b>

Regards

Sailaja.

hi ALV masters,

i have one issue regarding set pf-status.

i have the output list in my report. there i have created menu option Execute and also push button execute.

But surprisingly, i'm not getting any result when i press execute eitherfrom menu or pushbutton.

Please gimme some sample code.

Thanks,

Praveen

13 REPLIES 13
Read only

Former Member
0 Likes
1,652

hi

Check the program <b>BCALV_TEST_GRID_TOOLBAR</b>

Regards

Sailaja.

Read only

0 Likes
1,651

hi friends,

this is my code.

set pf-satus 'stat'.

case sy-ucomm.

when ' stat'.

write:/ 'success'.

endcase.

Plz correct if it is wrong.

Read only

0 Likes
1,651

Hi,

r u doing that using oops i.e., classes if yes,

MODULE user_command_0200 INPUT.

CASE sy-ucomm.

WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT

regards,

kiran kumar k

Read only

0 Likes
1,651

Hi,

I hope you already know it but FYI

Always in ABAP what ever u write btw qoutes i.e ' ' use CAPITALS

set pf-satus 'STAT'.

case sy-ucomm.

when ' STAT'.

write:/ 'success'.

endcase.

Plz chk this

Read only

0 Likes
1,651

set pf-satus 'STAT'.

case sy-ucomm.

when ' EXEC'.

write 'success'.

endcase.

this is my code and i'm surprised the control is not moving anywhere.

i have defined the menu bar and pushbuttons well in the status.

Plz help me

Message was edited by:

praveen reddy

Read only

0 Likes
1,651

Just copy paste:

REPORT ZTEST.

parameter p_dummy(1).

initialization.

set pf-status 'STAT'.

AT SELECTION-SCREEN.

case sy-ucomm.

when 'EXEC'.

MESSAGE 'Success' type 'I'.

endcase.

Regards,

Ravi

Read only

0 Likes
1,651

Hey u cant use write stmt ..get some data and display another ALV..or call some transaction

santhosh

Read only

0 Likes
1,651

friends - looks like i have misled you.

Myne is a normal report - not an ALV one.

i have list and then in that, i have created one pushbutton (EXECUTE) in appl. tool bar and surprisingly - i am not getting anything while pressing that.

Please send me some sample code for this.

thanks

Praveen

Message was edited by:

praveen reddy

Read only

0 Likes
1,651

Hi,

You have to use AT USER-COMMAND event.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EXECUTE'.

write your code here that you want to display after clicking the pushbutton.

ENDCASE.

Reward is useful,

Regards,

Tanmay

Read only

0 Likes
1,651

hi tanmay,

this is what i'm doing right now.

but i couldn't get the logic triggered.

in fact, the control is not reaching at user-cmd at all.

what could be the prob..

also note that after when 'EXECUTE', i'm writing a write stmt.

is this causing the prob..?

Thanks,

Praveen

Read only

Former Member
0 Likes
1,651

Hi,

Try the following code n let me know.

report yh645_secndry_alv.

type-pools: slis.

data: fieldcat type slis_t_fieldcat_alv,

fieldcat_ln like line of fieldcat,

fs_layout type slis_layout_alv,

t_layoout like standard table

of fs_layout.

data: begin of fs_spfli,

carrid type spfli-carrid,

connid type spfli-connid,

countryfr type spfli-countryfr,

cityfrom type spfli-cityfrom,

airpfrom type spfli-airpfrom,

countryto type spfli-countryto,

cityto type spfli-cityto,

airpto type spfli-airpto,

fltime type spfli-fltime,

deptime type spfli-deptime,

arrtime type spfli-arrtime,

distance type spfli-distance,

distid type spfli-distid,

fltype type spfli-fltype,

period type spfli-period,

checkbox,

color(3),

end of fs_spfli.

data:

begin of fs_table,

carrid type spfli-carrid,

connid type spfli-connid,

end of fs_table.

data: begin of fs_sflight,

check,

color(3).

include type sflight.

data:end of fs_sflight.

data:

begin of fs_table1,

carrid type sflight-carrid,

connid type sflight-connid,

fldate type sflight-fldate,

end of fs_table1.

data:

t_spfli like standard table

of fs_spfli.

data:

t_table like standard table

of fs_table.

data:

t_table1 like standard table

of fs_table1.

data:

t_sflight like standard table

of fs_sflight.

data:

t_sbook like standard table

of sbook.

data t_layout type slis_layout_alv.

select *

into corresponding fields of table t_spfli

from spfli.

perform start_list_viewer.

perform get_spfli_details.

&----


*& Form SUB1

&----


  • text

----


  • -->RT_EXTAB text

----


form sub1 using rt_extab type slis_t_extab.

data: flight type slis_extab.

flight-fcode = 'SFLIGHT'.

append flight to rt_extab.

set pf-status 'SFLIGHT'. " EXCLUDING RT_EXTAB.

endform. "SUB1

&----


*& Form START_LIST_VIEWER

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form start_list_viewer .

data: pgm like sy-repid.

pgm = sy-repid.

fs_layout-box_fieldname = 'CHECKBOX'.

fs_layout-info_fieldname = 'COLOR'.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = pgm

i_callback_pf_status_set = 'SUB1'

i_callback_user_command = 'USER_COMMAND'

i_structure_name = 'SPFLI'

is_layout = fs_layout

tables

t_outtab = t_spfli

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.

endform. " START_LIST_VIEWER

*******Process Call Back Events (Begin)**************************

form user_command using ucomm like sy-ucomm

selfield type slis_selfield.

case ucomm.

when 'SFLIGHT'.

selfield-refresh = 'X'.

perform get_spfli_details.

select *

from sflight

into corresponding fields of table t_sflight

for all entries in t_table

where carrid eq t_table-carrid

and connid eq t_table-connid.

perform display_sflight.

when 'SBOOK'.

selfield-refresh = 'X'.

perform get_sflight_details.

select *

from sbook

into corresponding fields of table t_sbook

for all entries in t_table1

where carrid eq t_table1-carrid

and connid eq t_table1-connid

and fldate eq t_table1-fldate.

perform display_sbook.

endcase.

endform. "USER_COMMAND

&----


*& Form SUB2

&----


  • text

----


  • -->RT_EXTAB text

----


form sub2 using rt_extab type slis_t_extab.

data: flight type slis_extab.

flight-fcode = 'SBOOK'.

append flight to rt_extab.

set pf-status 'SBOOK'. " EXCLUDING RT_EXTAB.

endform. "SUB2

&----


*& Form DISPLAY_SFLIGHT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_sflight .

data: pgm like sy-repid.

pgm = sy-repid.

clear t_layout.

fs_layout-box_fieldname = 'CHECK'.

fs_layout-info_fieldname = 'COLOR'.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = pgm

i_callback_pf_status_set = 'SUB2'

i_callback_user_command = 'USER_COMMAND'

i_structure_name = 'SFLIGHT'

is_layout = fs_layout

tables

t_outtab = t_sflight

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.

endform. " DISPLAY_SFLIGHT

&----


*& Form GET_SPFLI_DETAILS

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_spfli_details .

loop at t_spfli into fs_spfli.

if fs_spfli-checkbox = 'X'.

fs_spfli-color = 'C51'.

fs_spfli-checkbox = '1'.

fs_table-carrid = fs_spfli-carrid.

fs_table-connid = fs_spfli-connid.

append fs_table to t_table.

modify t_spfli from fs_spfli.

endif.

endloop.

endform. " GET_SFLIGHT_DETAILS

&----


*& Form GET_SFLIGHT_DETAILS

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_sflight_details .

loop at t_sflight into fs_sflight.

if fs_sflight-check = 'X'.

fs_sflight-color = 'C71'.

fs_sflight-check = '1'.

fs_table1-carrid = fs_sflight-carrid.

fs_table1-connid = fs_sflight-connid.

fs_table1-fldate = fs_sflight-fldate.

append fs_table1 to t_table1.

modify t_sflight from fs_sflight.

endif.

endloop.

endform. " GET_SFLIGHT_DETAILS

&----


*& Form DISPLAY_SBOOK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_sbook .

data: pgm like sy-repid.

pgm = sy-repid.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = pgm

i_structure_name = 'SBOOK'

tables

t_outtab = t_sbook

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.

endform. " DISPLAY_SBOOK

Even u can do that using classes i.e., oops concepts

*"Table declarations...................................................

TABLES:

rbkp, " Document Header Invoice receipt

rseg, " Document Item: Incoming Invoice

eban, " Purchase Requisition

t001w. " Plants/Branches

*"Selection screen elements............................................

PARAMETERS:

p_gjahr LIKE rbkp-gjahr. " Fiscal Year

SELECT-OPTIONS:

s_belnr FOR rbkp-belnr, " Document number of an invoice

s_bldat FOR rbkp-bldat, " Document Date in Document

s_budat FOR rbkp-budat, " Posting Date in the Document

s_werks FOR rseg-werks. " Plant

*" Data declarations...................................................

"----


  • Work variables *

"----


DATA:

w_flag1 TYPE c VALUE '0', " Flag variable 1

w_flag2 TYPE c VALUE '0', " Flag variable 2

w_index1 TYPE sy-tabix. " Index variable

"----


  • Field String to hold Document Header Invoice receipt *

"----


DATA:

BEGIN OF fs_rbkp,

belnr TYPE rbkp-belnr, " Document number of an invoice

gjahr TYPE rbkp-gjahr, " Fiscal Year

bldat TYPE rbkp-bldat, " Posting Date in the Document

budat TYPE rbkp-budat, " Posting Date in the Document

lifnr TYPE rbkp-lifnr, " Different invoicing party

END OF fs_rbkp,

"----


  • Internal table to hold Document Header Invoice receipt *

"----


t_rbkp LIKE STANDARD TABLE OF fs_rbkp.

"----


  • Field String to hold Document Item: Incoming Invoice *

"----


DATA:

BEGIN OF fs_rseg,

belnr TYPE rseg-belnr, " Document number of an invoice

ebeln TYPE rseg-ebeln, " Purchasing Document Number

wrbtr TYPE rseg-wrbtr, " Amount in document currency

END OF fs_rseg,

"----


  • Internal table to hold Document Item: Incoming Invoice *

"----


t_rseg LIKE STANDARD TABLE OF fs_rseg.

"----


  • Field String to hold Purchase Requisition *

"----


DATA:

BEGIN OF fs_eban,

banfn TYPE eban-banfn, " Purchase requisition number

ernam TYPE eban-ernam, " Person who Created the Object

afnam TYPE eban-afnam, " Name of requisitioner/requester

badat TYPE eban-badat, " Requisition (request) date

ebeln TYPE eban-ebeln, " Purchase order number

END OF fs_eban,

"----


  • Internal table to hold Purchase Requisition *

"----


t_eban LIKE STANDARD TABLE OF fs_eban.

"----


  • Field String to hold Desired Data *

"----


DATA:

BEGIN OF fs_final,

ebeln TYPE rseg-ebeln, " Purchasing Document Number

banfn TYPE eban-banfn, " Purchase requisition number

badat TYPE eban-badat, " Requisition (request) date

bldat TYPE rbkp-bldat, " Posting Date in the Document

lifnr TYPE rbkp-lifnr, " Different invoicing party

wrbtr TYPE rseg-wrbtr, " Amount in document currency

afnam TYPE eban-afnam, " Name of requisitioner/requester

ernam TYPE eban-ernam, " Name of Person who Created the

" Object

END OF fs_final,

"----


  • Internal table to hold Desired Data *

"----


t_final LIKE STANDARD TABLE OF fs_final.

"----


  • INITIALIZATION *

"----


INITIALIZATION.

p_gjahr = sy-datum+0(4).

"----


  • AT SELECTION-SCREEN EVENT *

"----


AT SELECTION-SCREEN.

IF s_belnr IS INITIAL OR s_bldat IS INITIAL OR s_budat IS INITIAL.

MESSAGE ' (Invoice) Add Creation Date .' TYPE 'E'.

ENDIF. " IF S_BELNR...

"----


  • AT SELECTION-SCREEN ON FIELD EVENT *

"----


AT SELECTION-SCREEN ON s_werks.

SELECT SINGLE werks " Plant

FROM t001w

INTO t001w

WHERE werks IN s_werks.

IF sy-subrc NE 0.

MESSAGE 'Invalid plant' TYPE 'E'.

ENDIF. " IF SY-SUBRC NE 0.

"----


  • START-OF-SELECTION EVENT *

"----


START-OF-SELECTION.

PERFORM get_purchaserequistion.

LOOP AT t_rseg INTO fs_rseg.

READ TABLE t_rbkp INTO fs_rbkp WITH KEY belnr = fs_rseg-belnr

BINARY SEARCH.

IF sy-subrc EQ 0.

READ TABLE t_eban INTO fs_eban WITH KEY ebeln = fs_rseg-ebeln

BINARY SEARCH.

IF sy-subrc EQ 0.

IF fs_rbkp-bldat LE fs_eban-badat.

DELETE t_rseg INDEX sy-tabix.

ENDIF. " IF FS_RBKP-BLDAT...

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF SY-SUBRC EQ 0

ENDLOOP. " LOOP AT T_RSEG...

LOOP AT t_rbkp INTO fs_rbkp.

WHILE w_flag1 EQ '0'.

READ TABLE t_rseg INTO fs_rseg WITH KEY belnr = fs_rbkp-belnr

BINARY SEARCH.

w_index1 = sy-tabix.

IF sy-subrc EQ 0.

WHILE w_flag2 EQ '0'.

READ TABLE t_eban INTO fs_eban WITH KEY ebeln = fs_rseg-ebeln

BINARY SEARCH.

IF sy-subrc EQ 0.

fs_final-bldat = fs_rbkp-bldat.

fs_final-lifnr = fs_rbkp-lifnr.

fs_final-ebeln = fs_rseg-ebeln.

fs_final-wrbtr = fs_rseg-wrbtr.

fs_final-banfn = fs_eban-banfn.

fs_final-badat = fs_eban-badat.

fs_final-afnam = fs_eban-afnam.

fs_final-ernam = fs_eban-ernam.

APPEND fs_final TO t_final.

CLEAR fs_final.

DELETE t_eban INDEX sy-tabix .

ELSE.

w_flag2 = '1'.

DELETE t_rseg INDEX w_index1.

ENDIF. " IF SY-SUBRC EQ 0

ENDWHILE. " WHILE W_FLAG2...

w_flag2 = '0'.

ELSE.

w_flag1 = '1'.

ENDIF. " IF SY-SUBRC EQ 0

ENDWHILE. " WHILE W_FLAG1...

w_flag1 = '0'.

ENDLOOP. " LOOP AT T_RBKP...

CLASS lcl_event_receiver DEFINITION DEFERRED.

  • Declare reference variables to the ALV grid and the container

DATA :

cust_con TYPE scrfname VALUE 'BCALVC_TOOLBAR_D100_C1',

cont_on_dialog TYPE scrfname VALUE 'BCALVC_TOOLBAR_D101_C1',

ref1 TYPE REF TO cl_gui_custom_container,

ref2 TYPE REF TO cl_gui_alv_grid,

event_receiver TYPE REF TO lcl_event_receiver,

fcat TYPE lvc_t_fcat,

wa TYPE lvc_s_fcat,

wa_layo TYPE lvc_s_layo.

CALL SCREEN 200.

  • class lcl_event_receiver: local class to define and handle own

*functions......................................................

  • Definition:

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_toolbar

FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive,

handle_user_command

FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

PRIVATE SECTION.

ENDCLASS. "lcl_event_receiver DEFINITION

  • class lcl_event_receiver (Implementation)

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_toolbar.

  • In event handler method for event TOOLBAR: Append own functions

  • by using event parameter E_OBJECT.

DATA: ls_toolbar TYPE stb_button.

*....................................................................

  • E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.

  • append a separator to normal toolbar

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

  • append an icon to show booking table

CLEAR ls_toolbar.

MOVE 'PORDER' TO ls_toolbar-function.

MOVE icon_employee TO ls_toolbar-icon.

MOVE 'Show Bookings' TO ls_toolbar-quickinfo.

MOVE 'PONUMBER' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

  • append a separator to normal toolbar

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

  • append an icon to show booking table

CLEAR ls_toolbar.

MOVE 'PREQUISITION' TO ls_toolbar-function.

MOVE icon_employee TO ls_toolbar-icon.

MOVE 'Show Bookings' TO ls_toolbar-quickinfo.

MOVE 'PRNUMBER' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD. " handle_toolbar

*----


METHOD handle_user_command.

*Event handler method for event USER_COMMAND:

CASE e_ucomm.

WHEN 'PORDER'.

CALL TRANSACTION 'ME23N'.

WHEN 'PREQUISITION'.

CALL TRANSACTION 'ME53N'.

ENDCASE.

ENDMETHOD. " handle_user_command

*----


ENDCLASS. " lcl_event_receiver

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


MODULE status_0200 OUTPUT.

SET PF-STATUS 'GUI'.

SET TITLEBAR 'TITLE'.

IF sy-ucomm = 'BACK'.

LEAVE PROGRAM.

ENDIF.

PERFORM form_fcat.

PERFORM form_layo.

IF ref1 IS INITIAL.

CREATE OBJECT ref1

EXPORTING

  • PARENT = ref1

container_name = 'CUST_CON'

  • STYLE =

  • LIFETIME = lifetime_default

  • REPID =

  • DYNNR =

  • NO_AUTODEF_PROGID_DYNNR =

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

OTHERS = 6

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

IF ref2 IS INITIAL.

CREATE OBJECT ref2

EXPORTING

  • I_SHELLSTYLE = 0

  • I_LIFETIME =

i_parent = ref1

  • I_APPL_EVENTS = space

  • I_PARENTDBG =

  • I_APPLOGPARENT =

  • I_GRAPHICSPARENT =

  • I_NAME =

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

OTHERS = 5

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL METHOD ref2->set_table_for_first_display

  • EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

  • I_STRUCTURE_NAME =

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT = 'X'

  • is_layout = wa_layo

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

CHANGING

it_outtab = t_final

it_fieldcatalog = fcat

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CREATE OBJECT event_receiver.

SET HANDLER event_receiver->handle_user_command FOR ref2.

SET HANDLER event_receiver->handle_toolbar FOR ref2.

*Call method 'set_toolbar_interactive' to raise event TOOLBAR.

CALL METHOD ref2->set_toolbar_interactive.

ENDIF.

ENDMODULE. " STATUS_0200 OUTPUT

----


  • Form FORM_FCAT *

----


  • text *

----


FORM form_fcat.

CLEAR fcat.

CLEAR wa.

wa-fieldname = 'EBELN'.

wa-col_pos = 1.

wa-scrtext_l = ' PURCHASE ORDER NUMBER'.

APPEND wa TO fcat.

CLEAR wa.

wa-fieldname = 'BANFN'.

wa-col_pos = 2.

wa-scrtext_l = 'PURCHASE REQUISITION NUMBER'.

APPEND wa TO fcat.

CLEAR wa.

wa-fieldname = 'BADAT'.

wa-col_pos = 3.

wa-scrtext_l = 'PR CREATION DATE'.

APPEND wa TO fcat.

CLEAR wa.

wa-fieldname = 'BLDAT'.

wa-col_pos = 4.

wa-scrtext_l = 'INVOICE DATE'.

APPEND wa TO fcat.

CLEAR wa.

wa-fieldname = 'LIFNR'.

wa-col_pos = 5.

wa-scrtext_l = 'VENDOR NUMBER'.

APPEND wa TO fcat.

wa-fieldname = 'WRBTR'.

wa-col_pos = 6.

wa-do_sum = 'X'.

wa-scrtext_l = ' PO AMOUNT'.

APPEND wa TO fcat.

wa-fieldname = 'AFNAM'.

wa-col_pos = 7.

wa-scrtext_l = 'REQUISITIONER'.

APPEND wa TO fcat.

wa-fieldname = 'ERNAM'.

wa-col_pos = 8.

wa-scrtext_l = 'PR CREATOR'.

APPEND wa TO fcat.

ENDFORM. " FORM_FCAT

----


  • Module USER_COMMAND_0200 INPUT *

----


  • text *

----


MODULE user_command_0200 INPUT.

CASE sy-ucomm.

WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT

----


  • FORM FORM_LAYO *

----


  • There are no interface parameters to be passed to this subroutine.*

----


FORM form_layo.

CLEAR wa_layo.

wa_layo-zebra = 'X'.

wa_layo-grid_title = 'GRID TITLE'.

wa_layo-no_toolbar = 'X'.

ENDFORM. " FORM_LAYO

----


  • FORM GET_PURCHASEREQUISITION *

----


  • This subroutine selects all the Purchase requisitions from table *

  • EBAN for all the selected Invoices based on the Purchase orders. *

----


  • There are no interface parameters to be passed to this subroutine. *

----


FORM get_purchaserequistion.

SELECT belnr " Document number of an invoice

gjahr " Fiscal Year

bldat " Posting Date in the Document

budat " Posting Date in the Document

lifnr " Different invoicing party

FROM rbkp

INTO TABLE t_rbkp

WHERE belnr IN s_belnr

AND gjahr EQ p_gjahr

AND bldat IN s_bldat

AND budat IN s_budat.

IF NOT t_rbkp[] IS INITIAL.

SELECT belnr " Document number of an invoice

ebeln " Purchasing Document Number

wrbtr " Amount in document currency

FROM rseg

INTO TABLE t_rseg

FOR ALL ENTRIES IN t_rbkp

WHERE belnr EQ t_rbkp-belnr

AND werks IN s_werks.

ENDIF. " IF NOT t_rbkp[] IS INITIAL...

IF NOT t_rseg[] IS INITIAL.

SELECT banfn

ernam

afnam

badat

ebeln

FROM eban

INTO CORRESPONDING FIELDS OF TABLE t_eban

FOR ALL ENTRIES IN t_rseg

WHERE ebeln EQ t_rseg-ebeln.

ENDIF. " IF NOT t_rseg[] IS INITIAL...

ENDFORM. " GET_PURCHASEREQUISITION

reward if helpful.

regards,

kiran kumar k.

Message was edited by:

kiran kumar

Read only

Former Member
0 Likes
1,651

Hi,

Use CAPs in the place of FCT Codes and Statuses small and check.

set pf-satus 'ABC'.

case sy-ucomm.

when ' UPDT'.

<do /....>

reward if useful

regards

Anji

Read only

Former Member
0 Likes
1,651

hi friends,

i hav found that this is a small mistake - when we use'EXEC' as function text, it is performing some predefined operation.

we should change 'EXEC' to 'EXE1' or...i.e.,

replace the 'C' in 'EXEC' by any other character.

Thanks for your help - i'll assign points to all of you.