Calling a transaction code on click on alv
how do i call a transaction on mouse double click on alv grid.
thanks
chinmaya
Can u please explain wid reef. to this code thnx
report ztst_chin_alv3.
tables : lfb1.
Declarations *
selection-screen begin of block a with frame title text-001.
select-options : bukrs for lfb1-bukrs.
select-options : lifnr for lfb1-lifnr.
selection-screen end of block a.
data: r_container type ref to cl_gui_custom_container.
data: r_grid type ref to cl_gui_alv_grid.
data: g_fieldcat type lvc_t_fcat.
data: w_fieldcat like line of g_fieldcat.
data: g_layout type lvc_s_layo.
data: ok_code like sy-ucomm.
data: gs_variant type disvariant.
data: t_selected type lvc_t_row.
data wa_selected like line of t_selected.
data: it_items like eban occurs 0.
data: it_sort type lvc_t_sort.
data: s_sort type lvc_s_sort.
data: h_test_alv type lvc_s_col.
data: begin of it_lfb1 occurs 0,
lifnr like lfb1-lifnr,
bukrs like lfb1-bukrs,
akont like lfb1-akont,
fdgrv like lfb1-fdgrv,
end of it_lfb1.
Initialization *
initialization.
at selection-screen.
ok_code = sy-ucomm.
case ok_code.
when 'BACK'.
leave program.
when 'CANCEL'.
leave program.
when 'EXIT'.
leave program.
when 'ONLI' or 'CRET'.
call screen 100.
when others.
endcase.
GetData *
module getdata output.
if sy-ucomm <> 'STOP'.
*refresh control container_1 from screen scr.
refresh it_lfb1.
clear bukrs.
clear lifnr.
select lifnr bukrs akont fdgrv
into corresponding fields of table it_lfb1
from lfb1
where
bukrs in bukrs
and lifnr in lifnr.
endif.
refresh bukrs.
refresh lifnr.
endmodule.
Create ALV *
module create_alv output.
gs_variant-report = sy-repid.
if r_container is initial.
create object r_container
exporting container_name = 'CONTAINER_1'.
create object r_grid
exporting i_parent = r_container.
endif.
*modify the headings in the field catalogue
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ztest_alv'
changing
ct_fieldcat = g_fieldcat[].
loop at g_fieldcat into w_fieldcat.
case w_fieldcat-fieldname.
when 'ZCURSTAT'.
w_fieldcat-scrtext_l = 'Prev.RelCode'.
w_fieldcat-scrtext_m = 'Prev.RelCode'.
w_fieldcat-scrtext_s = 'Prev.RelCode'.
w_fieldcat-reptext = 'Prev.RelCode'.
endcase.
modify g_fieldcat from w_fieldcat.
endloop.
call method r_grid->set_table_for_first_display
exporting
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
i_structure_name = 'ztest_alv'
is_variant = gs_variant
i_save = 'A'
I_DEFAULT = 'X'
is_layout = g_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
changing
it_outtab = it_lfb1[]
it_fieldcatalog = g_fieldcat[]
it_sort = 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.
call method r_grid->set_table_for_first_display
exporting i_structure_name = 'ztest_alv'
is_layout = g_layout
is_variant = gs_variant
i_save = 'A'
changing it_outtab = it_lfb1[]
it_fieldcatalog = g_fieldcat[].
*ELSE.
CALL METHOD r_grid->refresh_table_display
EXPORTING i_soft_refresh = ' '.
endmodule.
STATUS *
module status output.
set pf-status '0100'.
endmodule.
User Commands *
module user_command input.
ok_code = sy-ucomm.
case ok_code.
when 'BACK'.
call screen '1000'.
when 'CANCEL'.
leave program.
when 'EXIT'.
leave program.
endcase.
endmodule.
ALV Layout *
module layout output.
g_layout-zebra = 'X'.
g_layout-sel_mode = 'A'.
g_layout-grid_title = ''.
g_layout-detailtitl = ''.
endmodule.
MODULE sort_itab *
module sort_itab output.
*break-point.
*data s_Sort type lvc_s_sort.
perform sort_itab.
endmodule.
FORM sort_itab *
form sort_itab.
s_sort-spos = '1'.
s_sort-fieldname = 'FDGRV'.
s_sort-up = 'X'.
append s_sort to it_sort.
clear s_sort.
endform.
Select Rows *
form get_selected_rows.
call method r_grid->get_selected_rows
importing et_index_rows = t_selected.
if t_selected is initial.
call function 'WS_MSG'
exporting
msg_type = 'E'
text = 'Select Line'
titl = 'Select Line'.
sy-ucomm = 'STOP'.
endif.
endform.
This is Test code.
*class lcl_event_receiver definition.
*public section.
methods:
handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column.
private section.
*endclass.
*class lcl_event_receiver implementation.
method handle_double_click.
**endmethod.
*endclass.
Similar Messages
-
Dear Expert,
Is that possible to call a transaction code using a webdynpro for abap. I have a button in my program where when i click on the button, it need to all up the su01 screen.
My coding is as below
method ONACTIONEDIT_APPRAISAL .
LEAVE TO TRANSACTION 'SU01'.
endmethod.
However when i run this program, and click ont he button, the system return a short dump.
Any idea?
Thanks,
Regards,
BryanDear Suman or anyone,
I have solve this using the navigate_absolute method, however the NAVIGATION_MODE seem that does not works.
Code begin*
method ONACTIONEDIT_APPRAISAL .
data lr_componentcontroller type ref to ig_componentcontroller .
data l_api_componentcontroller type ref to if_wd_component.
data lr_port_manager type ref to if_wd_portal_integration.
lr_componentcontroller = wd_this->get_componentcontroller_ctr( ).
l_api_componentcontroller = lr_componentcontroller->wd_get_api( ).
lr_port_manager = l_api_componentcontroller->get_portal_manager( ).
Data:
target type string.
Data:
nmode type string.
target = 'pcd:portal_content/mysap/Appraisal/PPPM_PAGE'.
nmode = 'INPLACE'.
call method lr_port_manager->navigate_absolute
exporting
NAVIGATION_MODE = nmode
navigation_target = target
endmethod.
*code end
I have tried to use the INPLACE navigation mode, but it still display it in a new portal page. Anyway to control it? Do i need to define a area so that the target will show in that particular area?
Please help me...
Thanks
Regards,
Bryan -
Hi Expert,
i want to call MR21 transaction code from program with filling plant ,company code and material from the production order
my first question is
is it possible to call MR21 with filling material?
if possible then how ?
Thanks,
MahipalHi,
you just need to change the MODE.
N
Screens are not displayed. You must choose this mode when you run the BDC in a background job.
A
All screens are displayed. On each screen, a little popup is displayed with the next recorded function, the user has to press Enter to execute it.
E
By default, screens are not displayed, except if an error occurs, or if the end of BDC data is reached although the recorded transaction was not exited
Do not forget to click on "Correct Answer", to close the topic.
Rachid. -
Call a transaction code in dynamic action
Hi
How can we call a transaction code in a dynamic action.
TC XD01 is populated when changes is happen in IT0006 subtype 03.
Regards
WSHi,
Please find the below threads which may help you.
Problem in calling dynamic actions in BDC
Create Dynamic Action
Triggering Dynamic actions when updating an Infotype using a FM
Thanks & Regards,
Sandip Biswas. -
Calling a transaction code in between the program and use the output
Hi frnds,
i want to call a transaction code in between the program and pass the input .After getting the output, use that output in the programHi Navin,
Why don't you sit with ABAPer he can explain better.
Regards,
HAri. -
Problem with calling we02 transaction code from web dynpro
Hello everyone,
I want to skip the initial screen of we02 tcode for this i have created the URL, provided the idoc number and
used the function code DYNP_CODE=ONLI for execute button.
DATA : FINAL_URL TYPE STRING.
CONCATENATE 'host' '.port' '/sap/bc/gui/sap/its/webgui?~transaction=we02 DOCNUM-LOW='
ls_itab-docnum ';CREDAT-low=' ' ' ';DYNP_OKCODE=ONLI'
into FINAL_URL.
I am trying to pass the idoc number internally and click on execute button...so that the end user can see the idoc display directly, rather than clicking the execute button manually. But, unfortunately the function code for execute buttong (ONLI) is not working. In WE02 tcode, provided input values are appeaing correctly but not triggering the execute button.
Please help!
Thanks in advance...Hi Rohit.,
Did u tried my previous reply., Use., & ~OKCODE=ONLI .,
http://host:8000/sap/bc/gui/sap/its/webgui?sap-system-login-basic_auth=X&sap-client=800&sap-language=EN&transaction=we02&okcode=ONLI
tis will work.,
Thanks & Regards
Kiran -
ALV Grid Calling Transaction Code
Hello Everybody
Can anyone help me about my problem in using ALV Grid calling a transaction code...?Here is the sample code below..
IF rs_selfield-fieldname = 'BELNR'.
SET PARAMETER ID 'BLN' FIELD rs_selfield-value.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
the main problem is how can I set my parameter id for company since
my rs_field-value is for the column BELNR ( document # field only)
it returns error when i set this code since i have no value to pass for rs_selfield for company code
SET PARAMETER ID 'BUK' FIELD
Help
thanks in advance
aVaDuDzHi,
*"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 points if helpful.
regards,
kiran kumar k. -
Calling billing and delivery transactions when i click the button in webdyn
Hi,
How to call the transactions like billing and delivery when i click the button.I am developing a webdynpro alv report in that 2 buttons are there.one is confirmation and another is cancel.
I want to call the billing transaction when i press the confirmation button?Hi Lakshmi,
It is not possible to directly call a transaction code from a wev application. Calling a transaction involves launching of SAP Dynpros which is not supported by WDA frame work.
One possible ways is to use transactional iViews in Portal. We can Associate a transaction code to this and when called, it launches the same in an R/3 Screen.
If you are using portal as a triggerring point of your web dynpro applications, then the below requirement is achieved by doing the following.
1. Create a BDC report program to call transaction CAT2 skipping the first screen.
2. The report has the same input parameters as that of the transaction CAT2.
3. Associate a transaction to the report program sat 'ZCAT2'.
In the event handler of the button in your web dynpro do that following
Data declarations
Local Internal tables(lt_)
lt_bus_parameter_list TYPE wdy_key_value_table,
lt_launcher_parameter_list TYPE wdy_key_value_table,
Local Work area's(ls_)
ls_keyvalue_pair TYPE wdy_key_value,
Local Variables(l_)
l_pcdpageurl TYPE string,
l_componentcontroller TYPE REF TO if_wd_component,
l_port_manager TYPE REF TO if_wd_portal_integration.
Constants(c_)
CONSTANTS:
c_transaction_code TYPE string VALUE 'ZCAT2',
c_okcode TYPE string VALUE 'F8',
c_param1 TYPE string VALUE 'P_Data_Entry_Profile',
c_param2 TYPE string VALUE 'P_person_number'.
l_componentcontroller = wd_this->wd_get_api( ).
l_port_manager = l_componentcontroller->get_portal_manager( ).
Fill all the business parameters
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = c_param1.
ls_keyvalue_pair-value = 'Data Entry Profile'.
APPEND ls_keyvalue_pair TO lt_bus_parameter_list .
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = c_param2.
ls_keyvalue_pair-value = 'Person Number'.
APPEND ls_keyvalue_pair TO lt_bus_parameter_list .
Fill the launcher parameters for the transaction
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'AutoStart'.
ls_keyvalue_pair-value = 'Yes'.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'GuiType'.
ls_keyvalue_pair-value = 'WinGui'.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'OkCode'.
ls_keyvalue_pair-value = c_okcode.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'System'.
ls_keyvalue_pair-value = 'SAP_R3_HumanResources'.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'TCode'.
ls_keyvalue_pair-value = c_transaction_code.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'Technique'.
ls_keyvalue_pair-value = 'SSF'.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
CLEAR ls_keyvalue_pair.
ls_keyvalue_pair-key = 'WinGui_Type'.
ls_keyvalue_pair-value = 'Shortcut'.
APPEND ls_keyvalue_pair TO lt_launcher_parameter_list.
SAP has provided us with customizing table to maintain the path for the iView.Here Resource_key is the key field to get the path.
We create a new entry in this table using which we uniquely identify the path of the iVew that needs to be launched.
get the url of the pcd page for the common transaction iView
SELECT SINGLE b~text
INTO l_pcdpageurl
FROM t7xssserstring AS b
INNER JOIN t7xssserres AS a
ON a~respcdpage = b~guid
WHERE a~ressource = /rio/zcl_hse_constants=>c_common_resource.
Navigate to the Injury Illness details
CALL METHOD l_port_manager->navigate_absolute
EXPORTING
navigation_target = l_pcdpageurl
navigation_mode = l_port_manager->co_show_external
use_sap_launcher = abap_true
business_parameters = lt_bus_parameter_list
launcher_parameters = lt_launcher_parameter_list.
The folowing is the flow of the program:
When user clicks a button to launch transaction CAT2, the event handler associated to it called.
Here we populate an internal table with the parameters to call transaction ZCAT2 and the iView is launched by calling navigate_absolute method with the right path.
I am not very much sure as to how the iViews are set up but there is a provision to read the key valure pair there. The values are read and the tranzation ZCAT2 is called which will inturn launch CAT2 transaction.
By adding Skip First screen statement we can get in the details directly.
Hope this helps.
Regards,
Sravan Varagani -
Calling Transaction code & returning back to calling program
Hi,
I have requirement as below
Write the report to call the transaction code say for example different tcode (1000 in number) need to be executed and after every tcode execution it should return back to calling report. I tried using "CALL TRANSACTION 'ABC' AND SKIP FIRST SCREEN" it does execute the tcode but need the user interaction to return back to report, where here i want do this programatically.
can someone please help me & what is possible ways this can be do able.
Thanks,
John.There are two method of BDC
1- Call transaction method
2- BDC Session method
In this case you can use call tansaction method.
Syntax- call tansaction abc using gt_bdcdata.
Do the recording with t-code SHDB for that particular transaction and after the necessary modification use it in your program.
Please check f1 help of call transaction for details. -
Create transaction code for abap report
Hello,
don't know if this is the correct subforum (sorry in advance).
I have created a ABAP Report in SE38 having a SELECTION-SCREEN.
Now I would like to have a Transaction code to refer to the report. So that I can call the Transaction and then get the selection screen to use the abap report.
How can I do this the simplest way? I can't find anything in google, can you give me some hints?hi
goto se93
give transaction code and click create
select the second radio button(transaction code for reports)
give short description and press enter
after that give your program name
and select the gui check boxes as required for html ,java,
and save it
you can use the transaction code
REGARDS
PRASANTH -
Interaction with transaction codes with interactive reports
hi..
i want to call a transaction code from the report which i prepared.for example...if im displaying the list of order no.of a customer as output ,then when i want to make some changes in the order details ..instead of going to transcode VA02 ..i want the transcation has to open when i double click the order number.Hi,
you have to do some thing like this ...
REPORT ZTETS_CURSOR .
DATA: FIELD(20),
VALUE(10).
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 100 ROWS
INTO TABLE ITAB.
TOP-OF-PAGE.
WRITE:(10) 'VBELN',
(6) 'POSNR'.
END-OF-SELECTION.
LOOP AT ITAB.
WRITE: /(10) ITAB-VBELN,
(6) ITAB-POSNR.
ENDLOOP.
AT LINE-SELECTION.
GET CURSOR FIELD FIELD VALUE VALUE.
IF FIELD = 'ITAB-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = VALUE
IMPORTING
OUTPUT = VALUE.
SET PARAMETER ID 'AUN' FIELD VALUE.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
Regards
vijay -
Create a Transaction code for a Report
Hi
I have created a report through report painter. How can i create a transaction code for the report.
Thanks
JHi,
T.Code: SE93 - Maintain Transaction
Transaction Code = Zxxxxxx
Click on Create.
Short Text = Name of Report
Click on the radio button for 'Transaction with Parameters'
Press Enter.
Transaction = GR55
Parameters Window...
Screen Field : Screen field can be viewed in technical information screen of the report group to which report belongs for which t.code is to created.
Value: Report Group
Click on Save.
Now you have a custom transaction for the report(s) in a report group.
Hope this helps.
Please assign points to say thanks. -
Requirement: Open Transaction code in SAP GUI from WD ABAP application
Hello All,
I have a WD ABAP application which is accessed from SAP GUI and Portal. In SAP GUI, there is report which calls the application URL.
In the WD application, I need to call a transaction code. At this juncture, I made use of the ITS url. But,, the SSO does not work in SAP GUI.It works only in portal.
As a solution,we identified the entry point i.e. SAP GUI or portal. Then, based on entry from SAP GUI, we tried to call the transaction code using call transaction statement. But, that replaced the wd application. We instead wanted it as a popup or atleast another session.
Now, how do we open a transaction from WD screen in another session?
Also, can we setany configurations in the system to make sure the SSO works for all the transactions i.e. ITS used in SAP GUI.?
Thank you.
Regards,
SharathHi,
This question gets asked many times.
Depending on the circumstances, this can be achieved with varying degree of success
So here is some code that might help you.
This can (does) load a Windows GUI.
Some things to consider.
1. Browser settings can get in the way a bit, asking the user if they want to open a ".sap" file
2. The user may have a SAP session open so consider adding a "/o" to the system code.
3. The Custom variable might want to contain a [Options] section for "Re-use"
4. The SAPLogon_ID may be required if using SSO (SNC)
I have modified the code below, but you will get the idea.
JS
* Create the shortcut contents
call function 'SWN_CREATE_SHORTCUT'
exporting
i_system_command = lv_com
i_saplogon_id = lv_logon_id
i_sysid = sy-sysid
i_client = sy-mandt
i_user = sy-uname
i_custom = lv_custom
importing
shortcut_string = lv_string
exceptions
inconsistent_parameters = 1
others = 2.
* Convert to xstring to execute....
call method cl_http_utility=>if_http_utility~encode_utf8
exporting
unencoded = lv_string
receiving
encoded = lv_xstring
exceptions
others = 1.
* Now call to open the shortcut.
lv_file_name = 'mytrans.sap'.
lv_mime = 'application/x-sapshortcut'.
call method cl_wd_runtime_services=>attach_file_to_response
exporting
i_filename = lv_file_name
i_content = lv_xstring
i_mime_type = lv_mime
i_in_new_window = abap_true. -
Transaction and SPRO transaction codes in SNC
Hi,
Can anybody provide the transaction codes used in SNC and also SPRO transaction codes.
ThanksDear Vaibhav,
Some transactions:
/SAPAPO/MAT1, /SAPAPO/PRT_LOCPROD, /SAPAPO/LOC3, /SAPAPO/TL1, /SAPAPO/MTI2, /SAPAPO/RELHSHOW, /SAPAPO/RELHDELETE, /SCA/KANBANMDV, /SCA/SUPAREAV, /SCA/UPDRESPTIME, /SCA/SCHEDCFG, /SCA/SNIALERTSWRITE, /SCMB/48000030, /SCMB/15000010, /SCA/BIF_EVSTA_C, /SCA/52000046, /SCA/52000012, /SCA/SNIALERTSWRITE, /SCMB/ALEN_ALERT_DEL, /SCA/94000326, /SAPAPO/REPLCTRL, /SCA/FCSTMR, /SAPAPO/PROM_EVENT, /SAPAPO/SCMB_MP32, /SAPAPO/MP_CBPF, /SAPAPO/PROM_PATT, /SAPAPO/PROM_OFFSET, /SAPAPO/PROM_PROF, /SAPAPO/PROMMR, /SCA/94000263, /SCA/DELCLOSEDKNBN, /SCA/09000444, /SCA/60000197, /SCA/60000198, /SCA/FCST_OUT, /SCA/DMD_INF_OUT,
You can see the transaction codes by clicking on the icon at bottom right corner of the SAP screen. You can note down and maintain a list of codes you use.
Search the forum or internet for general transaction codes for SNC APO.
Regards
Naveen -
Display users of a transaction code
How can I display a listing of user-ids with access to the Transport Management system? The t-code for the Transport Management System is " stms "
Transaction Code : SUIM
Expand "User"
Expand "Users by Complex Selection Criteria"
Execute "By Transaction Authorizations"
Enter Transaction Code "STMS"
Click on "Execute"
Hope this help.
Maybe you are looking for
-
Urgent How to print 4 times?
I one page having 2 labels on it. One main window and and 2 secondary windows. In secondary windows there is template which forms label. If I have 5 item qun. I have to display 5 labels. Applied loop to secondary window but its not happening. How to
-
Wie kann ich auf Camera Raw 8.7 updaten? Photoshop Elements 13 (inc. Premiere) mit Camera Raw 8.6 und Windos7 64bit Wenn ich auf Hilfe-Aktualisierungen gehe, sagt das Programm, dass ich den Adobe Application Manager benötige. Dieser lässt sich auch r
-
Undoing twin Mail account?
I was having trouble downloading messages from my university pop account after recently switching to a new machine and stupidly decided to create a new account with a different label but the same settings to see if there was some hidden problem. When
-
Learning eCommerce function to add to a Muse Site
Hi, I'm new to Muse and constructing websites. I have a Team Membership which give the five WebBasics. If I wish to learn about adding the Business Catalyst functions such as eCommerce. Do I have to upgrade the WebBasics to WebCommerce packages. Or i
-
Why is my available hard disk space disappearing?
Hi, Occasionally my hard disk space will start disappearing for no apparent (to me) reason. I'll have 15 gigs of available hard disk space that will disappear, and I'll get messages that I'm running out of disk space, interfering with what I'm doing