ALV TREE to call transactions
Hi,
Can anybody give me any advise to do an ALV TREE to call my reports?
I have some reports and I want to call them from ALV Tree.
Thanks for your help.
Manuel
Hello Manuel,
Check out this in ur SAP system
Go to <b>se38</b> -
> <b>Environment</b>(menu) ---> Select <b>Examples</b> ---> select<b> Controls examples</b> and then look for <b>Tree Controls</b>.
There u will find ALV TREE examples.
I hope this will definitely help you.
<b>Dont forget to Reward points</b>
Thanks in advance,
Sachin
Similar Messages
-
Drill down to all screens of XK03 in ALV report from CALL TRANSACTION
HI!
I have created a vendor master report which calls the XK03 transaction when the vendor is clicked on on the ALV output. It takes me to the XK03 address screen and when I try clicking to go to the next screen it says the last screen is reached , 'Do you wnat to cancell processing'. I want to enable the program to goto the next screens as well like the controll screen and the accounting screen ect in my drill down on call transaction.
following si my code section which does it.
CASE rs_selfield-fieldname.
WHEN 'LIFNR'.
* Set parameter ID for transaction screen field
CHECK NOT wa_vend-lifnr IS INITIAL.
SET PARAMETER ID 'LIF' FIELD wa_vend-lifnr.
SET PARAMETER ID 'BUK' FIELD wa_vend-bukrs.
SET PARAMETER ID 'EKO' FIELD wa_vend-ekorg.
SET PARAMETER ID 'KDY' FIELD kdy_val.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN. "EC needed
ENDCASE.
ENDCASE.
Thanks and regards,
AaravHi,
Your code seems to be right.
Try writing the code as the below format.
CASE SY-UCOMM.
* CHECK FUNCTION CODE
WHEN '&IC1'.
* CHECK FIELD CLICKED ON WITHIN ALVGRID REPORT
IF SELFIELD-FIELDNAME = 'LIFNR'.
* READ DATA TABLE, USING INDEX ROW USER CLICKED ON
READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.
* SET PARAMETER ID FOR TRANSACTION SCREEN FIELD
SET PARAMETER ID 'BES' FIELD WA_FINAL-LIFNR.
* EXECUTE TRANSACTION 'XK03',AND SKIP INITIAL DATA ENTRY SCREEN.
CALL TRANSACTION 'XK03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
Thanks
Arbind -
Code for Hot spot in ALV report to call transaction
Hi,
I hv never use hot spot to link as a call transaction can u give the link or code how to make hot spot on a particular fields i am working on a ALV report in that report in the belnr coloumn when user click on belnr i want to call FB03 transaction ref. to that belnr number and fisacl year.
regards,
zafarHi,
In the fieldcatalog you will have to write the hotspot as shown below,
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'"----> this is important
i_callback_pf_status_set = 'PFSTATUS'
it_fieldcat = it_fieldcat
is_layout = it_layout
it_event_exit = it_eventexit
i_screen_start_column = 10
i_screen_start_line = 20
i_screen_end_column = 70
i_screen_end_line = 45
i_grid_title = 'Customer-Order Details'
TABLES
t_outtab = it_data.
then you will have to catch the user command as follows,
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: alv_vbeln TYPE vbeln,
mess_text(30) TYPE c,
txt_vbeln(10) TYPE c.
*User clicks a Order No. in ALV it passed to the following transaction.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_data INDEX rs_selfield-tabindex INTO wa_data.
alv_vbeln = wa_data-vbeln..
IF sy-subrc = 0.
CLEAR: mess_text, txt_vbeln.
SUBMIT zprogram
WITH pr_vbeln = alv_vbeln AND RETURN.
put your call transaction logic here
ENDIF.
ENDCASE.
ENDFORM. "user_command
Hope it helps you,
Regards,
Abhijit G. Borkar -
How to call transaction xd03 in alv using interactive
hi experts ,
i want code when i click on any value of kunner column in alv grid it call transaction xd03 .but it using interactive format on single click . please elp me
Moderator message : Not enough re-search before posting, requirements dumping is not allowed. Thread locked.
Edited by: Vinod Kumar on Nov 28, 2011 12:15 PMHi,
you have to define a handler for the event hotspot_click of class CL_GUI_ALV_GRID, if you are using that class. If you are using class CL_SALV_TABLE maybe class CL_SALV_EVENTS_TABLE may help you.
Regards,
Klaus -
can someone please help me ?
I can't find how the method add_node for a alv tree works:
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key =
i_relationship =
i_node_text =
is_outtab_line =
IMPORTING
e_new_node_key =
can someone please explain me the meaning of the parameters?
thanks in advanceHi Gabriele,
Check out the below sample code to use of the method add_node.
data: l_relat_node_key type lvc_nkey,
l_node_text type lvc_value,
ls_node_layout type lvc_s_layn,
ls_node_key like node_key,
new_node_key type lvc_nkey.
call method alv_tree_control->add_node
exporting i_relat_node_key = l_relat_node_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_node_layout = ls_node_layout
is_outtab_line = ls_tree
importing e_new_node_key = new_node_key.
* ID und Node_key in Tabelle gt_node_key abspeichern
ls_node_key-id = ls_tree-klnodetext-id.
ls_node_key-node_key = new_node_key.
append ls_node_key to l_node_key_tbl.
This might helpful for you.
Thanks,
Chidanand -
Call Transaction in ALV Tree Display on Double Click
Hi Experts,
How can i call any Transaction on Double clicking a field in ALV Tree?
I'm able to call the transaction when Double clicked a field but it is not reading the value of the field on which i double click. It calls the transaction skipping the first screen with always the same value of the field.
E.g : Whether i click on Purchase order no. 450000010 or 450000003 it displays the purchase order 4500000010 after it goes to ME23N transaction skipping the first screen.
I am Trying Method ITEM_DOUBLE_CLICK of Class CL_GUI_COLUMN_TREE
by passing the parameter NODE_KEY.But it's not working.
Thanks & Regards,
Vinit Ranjanhi
(also check u have refresh the field)
Check the demo program,In this double click the data fields it will display some field in screen,You can check it
BCALV_GRID_DND_TREE
Thanks
Edited by: dharma raj on Jun 17, 2009 7:41 PM -
Unable to Capture ALV output in an Internal Table, after CALL TRANSACTION
Dear all,
My requirement is to run multiple materials in T-code CK86_99 but as we know CK86_99 is only adequate to one material at a time.
So, I want to capture the Output of the T-code in my Internal table with respect to all the Material Numbers I use in the Select-Options of my Z Program.
Below is the Code I developed so far, but the Class
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lf_ref ).
is not capturing the Ouput...
Please have a look and enlighten me how it could be solved.
TABLES : mara.
DATA : BEGIN OF wa_mara,
matnr TYPE mara-matnr,
END OF wa_mara.
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_it_bdcdata LIKE LINE OF it_bdcdata,
it_mara LIKE TABLE OF wa_mara.
* BELNR(10).
FIELD-SYMBOLS:<fs_tab> TYPE ANY TABLE,
<fs_line> TYPE any.
DATA:lf_ref TYPE REF TO data,
lf_ref1 TYPE REF TO data.
SELECT-OPTIONS so_matnr FOR mara-matnr.
PARAMETERS p_werks LIKE t001w-werks.
*BELNR = 'Z92'. " Give Document Number here
SELECT matnr FROM mara INTO TABLE it_mara WHERE matnr IN so_matnr.
DATA opt TYPE ctu_params.
LOOP AT it_mara INTO wa_mara.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-program = 'SAPMKKB0'.
wa_it_bdcdata-dynpro = '0300'.
wa_it_bdcdata-dynbegin = 'X'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'KKB0-MATNR'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'KKB0-MATNR'.
wa_it_bdcdata-fval = wa_mara-matnr.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_CURSOR'.
wa_it_bdcdata-fval = 'KKB0-WERKS'.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'KKB0-WERKS'.
wa_it_bdcdata-fval = p_werks.
APPEND wa_it_bdcdata TO it_bdcdata.
CLEAR wa_it_bdcdata.
wa_it_bdcdata-fnam = 'BDC_OKCODE'.
wa_it_bdcdata-fval = 'OSNY'."'ONLI'."=CRET'.
APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-program = 'SAPLKKRSOO'.
* wa_it_bdcdata-dynpro = '0100'.
* wa_it_bdcdata-dynbegin = 'X'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-fnam = 'BDC_OKCODE'.
* wa_it_bdcdata-fval = 'BACK'."=CRET'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-program = 'SAPMKKB0'.
* wa_it_bdcdata-dynpro = '0300'.
* wa_it_bdcdata-dynbegin = 'X'.
* APPEND wa_it_bdcdata TO it_bdcdata.
* CLEAR wa_it_bdcdata.
* wa_it_bdcdata-fnam = 'BDC_OKCODE'.
* wa_it_bdcdata-fval = 'EXIT'."=CRET'.
* APPEND wa_it_bdcdata TO it_bdcdata.
opt-dismode = 'N'.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_true
data = abap_true ).
CALL TRANSACTION 'CK86_99' USING it_bdcdata OPTIONS FROM opt.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lf_ref ).
ASSIGN lf_ref->* TO <fs_tab>.
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE 'Unable to retrieve ALV data' TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).
IF <fs_tab> IS ASSIGNED.
CREATE DATA lf_ref1 LIKE LINE OF <fs_tab>.
ASSIGN lf_ref1->* TO <fs_line>.
ENDIF.
*LOOP AT <FS_TAB> ASSIGNING <FS_LINE>.
*ENDLOOP.Hi Abhay,
If you go to Transaction code SE93, enter the tcode "CK86_99" and click display, you may see the default value for transaction is "KKBB" and the screen field for P_SCREEN = 0300, P_TCODE = ck86_99.
You may need to copy the transaction code "KKBB" and go to SE93 again, enter the tcode for "KKBB" then click display, now you may see the program name is "RKKB1000".
Hope this answer your question.
Thanks
Hock Lin -
i am calling a transaction from alv i want to select the check boxes on th called transaction and go to the next screen how do i do that
Hello Chandan
You have to handle the DOUBLE_CLICK event either in your callback form routine (FM-based ALV) or event handler method for event USER_COMMAND (ABAP-OO based ALV).
If you call the transaction directly you will not have the authority check for this transaction. If you need this, you can use function module <b>ABAP4_CALL_TRANSACTION</b> instead.
If you want to open the transaction in a new window you can use the static method <b>CL_RECA_GUI_SERVICES=>CALL_TRANSACTION</b> (no authority check!).
Regards
Uwe -
How to resolve the error in bdc call transaction in ALV report
Dear Experts, i am executing the alv report program and in alv report program one bdc is there..
after executing output is showing in alv format but one button is there (update master)..when i am clicking update button the bdc is run but is not updated in the material master..after executing my bdc is not updated in mm02.
how to resove it?
CALL TRANSACTION 'MM02' USING BDCDATA MODE MODE
UPDATE 'S'
MESSAGES INTO MESSTAB.Hi Kaustav,
Looking at the code you attached, it appears to me that your BDC (Form USER_COMMAND) is not executed at all as you haven't passed the 'USER_COMMAND' in FM REUSE_ALV_GRID_DISPLAY for ALV display.
You must pass the importing parameter I_CALLBACK_USER_COMMAND of this FM as 'USER_COMMAND', only then this form will be executed and your BDC will run.
Thereafter, in case your BDC update fails, you can put a break-point in the form (at CALL TRANSACTION statement) and analyze the message table MESSTAB.
Hope it helps.
Regards,
Sapeksh -
Call transaction in ALV report
Dear Experts,
I want to call transaction HUMO from my ALV report on double click on Handling unit no.
I want to pass the Handling unit through my report and skip the first screen.
I try it using Call Transaction but the filed Handling unit doesn't have a parameter ID.
I also try it using Submit but the program is a function pool.
Can anyone please help me out in solving the issue.
Thanks in advance
Best regards
Ankur G.Hai,
This can be achieved by creating custom parameter id.
1.Go to the table maintenance generator of the table TPARA and go to the Maintain button through the transaction SM30.
Enter the table view name TPARA.
2.Click on the maintain button. The following information will appear. Click on the Tick button or the ENTER button to go to the next screen.
3.Enter the Set/Get parameter id as the parameter ID you want to create. Here, I will be creating the parameter Id as ZNAME_DATA1. Click on ENTER button.
4.It will ask for the text of the parameter Id. Enter the text of the parameter ID and click on the Save button.
5.Now go to the SE11 transaction for creating a data element and enter the parameter id at the Further Characteristics tab at the parameter Id section.
6.Activate the data element and use it with the program. It will act the same good as a standard one. -
Call Transaction in ALV GRID Display
Hi All,
i have an ALV list .( list of Invoices) i want to call trans.
VF03 from clicking the line .
i have also used User Command, events in ALV function .
as mention below , but cant able to call transaction.
in ALV line is selected but not working or moves to another Tcode as VF03 with parameter id .
please help me in this , if any body can ?
thanks in advance
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = G_INTERFACE_CHECK
I_CALLBACK_PROGRAM = GV_REPID
IT_FIELDCAT = GT_FIELDCAT[]
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_LAYOUT = LAYOUT_IN
IS_VARIANT = VARIANT_DETAIL
IT_EVENTS = EVENTCAT
I_CALLBACK_PF_STATUS_SET = 'SET_STATUS'
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_GRID_TITLE = 'Tax Report : GRN'
I_CALLBACK_TOP_OF_PAGE = 'page_header'
I_BACKGROUND_ID = 'ALV_BACKGROUND'
IS_PRINT = ALV_PRINT
IMPORTING
ES_EXIT_CAUSED_BY_USER = LS_EXIT_BY_USER
TABLES
T_OUTTAB = IT_VBRP
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-SGV4.
ENDIF.
NitinHI,
check the sample code which call the transaction VA02.
type-pools: slis.
types: BEGIN OF TY_KNA1,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1,
ORT01 TYPE ORT01,
END OF TY_KNA1.
TYPES: BEGIN OF TY_VBAK,
VBELN TYPE VBELN,
ERNAM TYPE ERNAM,
ERDAT TYPE ERDAT,
NETWR TYPE NETWR,
WAERK TYPE WAERK,
END OF TY_VBAK.
*&--WORK AREA & TABLE DECLARATION--
DATA: W_KNA1 TYPE TY_KNA1.
DATA: T_KNA1 TYPE STANDARD TABLE OF TY_KNA1 INITIAL SIZE 1.
DATA: W_VBAK TYPE TY_VBAK.
DATA: T_VBAK TYPE STANDARD TABLE OF TY_VBAK INITIAL SIZE 1.
*&--FIELDCAT TABLE & WORK AREA--
DATA: W_FCAT TYPE SLIS_FIELDCAT_ALV.
DATA: T_FCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: W_FCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA: T_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
*&--EVENT TABLE AND WORK AREA--
DATA: W_EVENTS TYPE SLIS_ALV_EVENT.
DATA: T_EVENTS TYPE SLIS_T_EVENT.
DATA: W_EVENTS1 TYPE SLIS_ALV_EVENT.
DATA: T_EVENTS1 TYPE SLIS_T_EVENT.
*&--COMMENT TABLE & WORK AREA--
DATA: W_COMMENT TYPE SLIS_LISTHEADER.
DATA: T_COMMENT TYPE SLIS_T_LISTHEADER.
DATA: W_COMMENT1 TYPE SLIS_LISTHEADER.
DATA: T_COMMENT1 TYPE SLIS_T_LISTHEADER.
APPENDING FCAT -
W_FCAT-COL_POS = 1.
W_FCAT-FIELDNAME = 'KUNNR'.
W_FCAT-SELTEXT_M = 'CUST. NO'.
W_FCAT-HOTSPOT = 'X'. "HOT SPOT HAND SYMBOL
W_FCAT-EMPHASIZE = 'C119'. "FOR COLORING THE COLUMN 1
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 2.
W_FCAT-FIELDNAME = 'NAME1'.
W_FCAT-SELTEXT_M = 'CUST. NAME'.
APPEND W_FCAT TO T_FCAT.
W_FCAT-COL_POS = 3.
W_FCAT-FIELDNAME = 'ORT01'.
W_FCAT-SELTEXT_M = 'CITY'.
APPEND W_FCAT TO T_FCAT.
W_FCAT1-COL_POS = 1.
W_FCAT1-FIELDNAME = 'VBELN'.
W_FCAT1-SELTEXT_M = 'ORDER NO'.
W_FCAT1-EMPHASIZE = 'C519'.
APPEND W_FCAT1 TO T_FCAT1.
CLEAR W_FCAT.
W_FCAT1-COL_POS = 2.
W_FCAT1-FIELDNAME = 'ERNAM'.
W_FCAT1-SELTEXT_M = 'NAME OF PARTY'.
APPEND W_FCAT1 TO T_FCAT1.
W_FCAT1-COL_POS = 3.
W_FCAT1-FIELDNAME = 'ERDAT'.
W_FCAT1-SELTEXT_M = 'DATE'.
APPEND W_FCAT1 TO T_FCAT1.
W_FCAT1-COL_POS = 4.
W_FCAT1-FIELDNAME = 'NETWR'.
W_FCAT1-SELTEXT_M = 'ORDER VALUE'.
APPEND W_FCAT1 TO T_FCAT1.
W_FCAT1-COL_POS = 5.
W_FCAT1-FIELDNAME = 'WAERK'.
W_FCAT1-SELTEXT_M = 'CURRENCY'.
APPEND W_FCAT1 TO T_FCAT1.
*&--APPEND COMMENTRY--
W_COMMENT-TYP = 'H'.
W_COMMENT-INFO = 'CUSTOMER DETAILS'.
APPEND W_COMMENT TO T_COMMENT.
CLEAR W_COMMENT.
*&--APPEND EVENTS TABLE--
W_EVENTS-NAME = 'TOP_OF_PAGE'.
W_EVENTS-FORM = 'TOPPAGE'.
APPEND W_EVENTS TO T_EVENTS.
W_EVENTS-NAME = 'USER_COMMAND'.
W_EVENTS-FORM = 'SUB2'.
APPEND W_EVENTS TO T_EVENTS.
W_EVENTS1-NAME = 'TOP_OF_PAGE'.
W_EVENTS1-FORM = 'TOPPAGE1'.
APPEND W_EVENTS1 TO T_EVENTS1.
CLEAR W_EVENTS1.
W_EVENTS1-NAME = 'USER_COMMAND'.
W_EVENTS1-FORM = 'SUB3'.
APPEND W_EVENTS1 TO T_EVENTS1.
SELECT-OPTIONS: CUSTNO FOR W_KNA1-KUNNR.
SELECT KUNNR
NAME1
ORT01 FROM KNA1 INTO TABLE T_KNA1
WHERE KUNNR IN CUSTNO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
*I_BACKGROUND_ID =
I_GRID_TITLE = 'CUSTOMER DETAILS'
IT_FIELDCAT = T_FCAT
IT_EVENTS = T_EVENTS
TABLES
T_OUTTAB = T_KNA1 .
FORM TOPPAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_COMMENT
I_LOGO = 'LOGO_ALV'.
ENDFORM. "END OF TOPPAGE SUB.
FORM SUB2 USING UCOMM LIKE SY-UCOMM FIELDS1 TYPE SLIS_SELFIELD.
READ TABLE T_KNA1 INTO W_KNA1 INDEX FIELDS1-TABINDEX.
SELECT VBELN
ERNAM
ERDAT
NETWR
WAERK
FROM VBAK
INTO TABLE T_VBAK
WHERE KUNNR = W_KNA1-KUNNR.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
*I_BACKGROUND_ID =
I_GRID_TITLE = 'LIST OF ORDERS'
IT_FIELDCAT = T_FCAT1
IT_EVENTS = T_EVENTS1
TABLES
T_OUTTAB = T_VBAK.
ENDFORM. "END OF SUB2.
FORM TOPPAGE1.
*&--APPEND COMMENTRYOF SECONDRY SCREEN--
W_COMMENT1-TYP = 'H'.
W_COMMENT1-INFO = 'LIST OF ORDERS'.
APPEND W_COMMENT1 TO T_COMMENT1.
W_COMMENT1-TYP = 'S'.
W_COMMENT1-KEY = 'CUSTOMER'.
W_COMMENT1-INFO = W_KNA1-KUNNR.
APPEND W_COMMENT1 TO T_COMMENT1.
CLEAR W_COMMENT.
W_COMMENT1-TYP = 'A'.
W_COMMENT1-INFO = W_KNA1-NAME1.
APPEND W_COMMENT1 TO T_COMMENT1.
CLEAR W_COMMENT1.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_COMMENT1
I_LOGO = 'LOGO_ALV'
REFRESH T_COMMENT1.
ENDFORM. "END OF TOPPAGE1
FORM SUB3 USING UCOMM LIKE SY-UCOMM FIELDS1 TYPE SLIS_SELFIELD.
READ TABLE T_VBAK INTO W_VBAK INDEX FIELDS1-TABINDEX.
SET PARAMETER ID 'VBAk' FIELD W_VBAK-VBELN.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDFORM.
reward if useful.
thanks and regards. -
Call transaction 'VL33N' on click of Inbound delivery number in ALV List.
Hi,
My ALV output is having Inbound delivery number.
If user clicks on one of the Inbound delivery it has to call transaction VL33N and display the user selected document.
Code:
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE gt_final INTO wa_final INDEX rs_selfield-tabindex.
if wa_final-vbeln is not initial.
FREE MEMORY ID 'VL'.
SET PARAMETER ID 'VL' FIELD WA_FINAL-VBELN.
CALL TRANSACTION 'VL33N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
I am setting the parameter id 'VL' by passing Inbound Delivery number.After that it is calling VL33N Screen but the Inbound delivery number is blank.In debugging i can see the SAP memory for 'VL' as the selected document number.
Why VL value is not transferred to Inbound Delivery number field in VL33 Eventhough Parameter id having value.
VL (10) <0180000057>
Thanks
Bhuvana
Edited by: Pulibhuvana on Nov 22, 2010 8:20 AMHi,
Removed Free statement.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE gt_final INTO wa_final INDEX rs_selfield-tabindex.
if wa_final-vbeln is not initial.
SET PARAMETER ID 'VL' FIELD rs_selfield-value.
CALL TRANSACTION 'VL33N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
In background VL is passing to VL03N Transaction instead of VL33N.
Outbound delivery and Inbound Delivery both are assigned to same paramer id.
Don't undestand if i'm calling VL33N Why the paramer value is passed to Outbound delivery transaction VL03N.
Please suggest me.
Thanks
Bhuvana -
Problem in call transaction in interactive ALV
Hi All
I am displaying ALV report.
I want to make it interactive. After clicking on REFBN (COBK-REFBN) it should open FB03 transaction.
I am using followng code:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = it_fieldcat
TABLES
T_OUTTAB = it_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 USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
READ TABLE it_final INDEX rs_selfield-tabindex INTO wa_final.
CASE F_UCOMM.
WHEN '&IC1'.
IF wa_final-refbn is not initial.
SET PARAMETER ID 'BLR' FIELD wa_final-REFBN.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
This code is not working. When I am double clicking on the REFBN field in my report nothing is happening.
Please help.
Thanks & Regards
DeeptiHello,
Try the below code
" while building the field catalog set the field HOPSPOT for the field REFBN
data: w_repid type syrepid.
w_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
others = 2.
IF SY-SUBRC = 0.
ENDIF.
FORM user_command USING f_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE f_ucomm.
WHEN '&IC1'.
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID 'BLR' FIELD rs_selfield-value.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
Hope this helps you.
Regards,
Sachinkumar Mehta -
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. -
Alv grid - call transaction 'ME22N' and reflect the change made in alv grid
Hi,
<u>Scenario</u>
I have an alv list which has fields Purchase document no. (EBELN) and Item delivery date (EINDT). EBELN field is hot spot enabled. when i click on that transaction 'ME22' is called. I have done this using USER_COMMAND subroutine.the code is given.
FORM USER_COMMAND *
Call transaction ME22N on clicking Document number *
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
DATA: F_SUBRC LIKE SY-SUBRC,
s_arseg like G_T_PORD. "the internal table used is G_T_PORD
CASE F_UCOMM.
WHEN '&IC1'.
IF i_selfield-fieldname = 'EBELN'.
READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
endform.
<u>Requirement</u>
After calling the transaction, If the user changes the Item delivery date (EINDT) at the ME22 transaction screen, the new date needs to be reflected in the ALV grid.
Plz help it is very urgent.The first method (using selfield-refresh = 'X'.) didn't work as the internal table doesnt get modified when the user make changes in Item delivery date(EINDT) at ME22 transaction screen. The 2nd method is OO,which can't be used in my case.
I tried calling the subroutine for populating the itab (G_T_PORD) and the subroutine for displaying the alv grid immediately after calling ME22N transaction. Still it is not reflecting the new date in the output alv. The code is given below.
FORM USER_COMMAND *
Call transaction ME22N on clicking Document number *
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
DATA: F_SUBRC LIKE SY-SUBRC,
s_arseg like G_T_PORD.
CASE F_UCOMM.
WHEN '&IC1'.
IF i_selfield-fieldname = 'EBELN'.
READ TABLE G_T_PORD INDEX i_selfield-tabindex INTO s_arseg.
SET PARAMETER ID 'BES' FIELD s_arseg-ebeln.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
refresh G_T_PORD.
perform F1000_POPULATE_PO.
perform F2000_DISPLAY_PO .
endform.
Maybe you are looking for
-
I am putting together a photobook. When I format it for 8'x10 hardcover some of the photos come up with a warning of low resolution. Is there anyway to preview how the pictures will print so I can figure if they are acceptable? Is there anything I
-
How to import form results into another form
I'd like a simplified online membership form at acrobat.com to collect new member information, then have an employee in another office be able to import that record into another, more graphical PDF form that would be printed and go in the new member
-
Missing Horizontal Photo Files - Thumbnails visible
I was going back through my iPhoto Library and came across a strange issue. It appears that a vast majority of my horizontal photo files are missing starting in July of this year and going back to 2005. The thumbnails show up but when I doubleclick I
-
Cannot register domain for email
I'm trying to register www.daoloc.com.vn with my Windows Live account so setup outlook.com email accounts. I get the following error: This domain name can't be used because it contains a protected word or inappropriate language. Please contact suppo
-
When down loading customer information it will not accept my serial no
I cannot complete downloading information on Adobe Photoshop Elementss 12 and Adobe Premier Elements 12 because it will not accept my serial no which I copies from my order.