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

ALV Hotspot Problem

Former Member
0 Likes
2,786

Hi,

I have a ALV that displays fine. I am trying to enable hotspot at two of the columns BELNR(RBKP) and EBELN(RSEG). There is also a status field (RBKP-RBSTAT).

The hotspot that has been defined with EBELN works great. However, when I try to click the EBELN column, it goes to the MIR7 screen, without prefilling the doc number(which is BELNR).

Further as an added complexity, depending on the status (RBKP-RBSTAT), the called transaction should be either MIRO or MIR7.

Would appreciate if anybody has done anything on this before. I am using the classifical ALV.

Rajib

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • Check function code

CASE r_ucomm.

WHEN '&IC1'.

  • Check field clicked on within ALVgrid report

IF rs_selfield-fieldname = 'BELNR'.

  • Read data table, using index of row user clicked on

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

  • Execute transaction ME23N, and skip initial data entry screen

CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN.

ELSEIF rs_selfield-fieldname = 'EBELN'.

  • Read data table, using index of row user clicked on

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'BES' FIELD wa_it_alldata-ebeln.

  • Execute transaction ME23N, and skip initial data entry screen

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,873

Hi das,

below example code might help you.

http://sap.ittoolbox.com/code/d.asp?d=3411&a=s

regards,

venu.

Hi Everybody,

I am beginner in ABAP.

I try to create a report using hotspot in core ABAP.

Please help me how to do it.

My scenario is,

I should display the header detail of purchase order.

And to define hotspot for purchase doc no- EBELN.

If once i clicked the pur. doc. no the Item details should be displayed.

I wnt to get clear about the types to be declared and how to merge it.

I completed the code for purchase order header using grid dispaly.

Here is the code.

*&---------------------------------------------------------------------*

*& Report  ZTASK1

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZTASK1 no standard page heading message-id 001.

tables ekko.

type-pools slis.

data : begin of str occurs 0,

        ebeln type ebeln,

        aedat type erdat,

        ernam type ernam,

        lifnr type elifn,

        bukrs type bukrs,

   end of str.

select-options: pa_pur for ekko-ebeln obligatory,

                 pa_date for ekko-aedat no intervals no-extension.

data: wa_fct TYPE slis_fieldcat_alv,

        it_fct TYPE slis_t_fieldcat_alv.

select ebeln aedat ernam lifnr bukrs from ekko into table str where ebeln in pa_pur.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '1'.

          wa_fct-fieldname      = 'EBELN'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Puchase Doc. No.'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '2'.

          wa_fct-fieldname      = 'ERDAT'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Created Date'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

           wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '3'.

          wa_fct-fieldname      = 'ERNAM'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Created By'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '4'.

          wa_fct-fieldname      = 'LIFNR'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Vendor'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '5'.

          wa_fct-fieldname      = 'BUKRS'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Company Code'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

    I_CALLBACK_PROGRAM                = SY-REPID

    IT_FIELDCAT                       = IT_FCT

TABLES

     t_outtab                          = STR

  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.

11 REPLIES 11
Read only

Former Member
0 Likes
1,873

Hi Rajib,

add SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

along with SET PARAMETER ID 'BES' FIELD wa_it_alldata-ebeln.

before call transaction in ur ELSEIF rs_selfield-fieldname = 'EBELN' part.

u can also check the status field with wa_it_alldata-rbstat if u have one and call required transaction accordingly.

your code will look like

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'BELNR'.

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

  • Execute transaction ME23N, and skip initial data entry screen

if wa_it_alldata-status = 'whatever'.

CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN.

else.

CALL TRANSACTION 'MIR0' AND SKIP FIRST SCREEN.

endif.

ELSEIF rs_selfield-fieldname = 'EBELN'.

  • Read data table, using index of row user clicked on

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'BES' FIELD wa_it_alldata-ebeln.

  • Execute transaction ME23N, and skip initial data entry screen

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

hope this would solve ur problem.. or get back..

Regards,

Pradhiba

Read only

0 Likes
1,873

Pradhiba,

Thanks so much for your answer. One part of the problem has been solved i.e going to different screens based on the status.

However, I still see the first screen(i.e it's not skipping the data entry screen) when I go to MIR6.

Rajib

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-fieldname = 'BELNR'.

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

  • Execute transaction ME23N, and skip initial data entry screen

if wa_it_alldata-rbstat = '5'.

CALL TRANSACTION 'MIRO' AND SKIP FIRST SCREEN.

else.

CALL TRANSACTION 'MIR6' AND SKIP FIRST SCREEN.

endif.

ELSEIF rs_selfield-fieldname = 'EBELN'.

  • Read data table, using index of row user clicked on

READ TABLE it_alldata_f INTO

wa_it_alldata INDEX rs_selfield-tabindex.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'RBN' FIELD wa_it_alldata-belnr.

  • Set parameter ID for transaction screen field

SET PARAMETER ID 'BES' FIELD wa_it_alldata-ebeln.

  • Execute transaction ME23N, and skip initial data entry screen

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDCASE.

ENDFORM.

Read only

0 Likes
1,873

Hi Rajib,

I am not familiar with Transaction MIR6.

But when u execute MIR6 directly, what all do you pass in the selection screen? all those should be set using SET PARAMETER before using CALL TRANSACTION then only it will skip the first screen. You can find the parameter ids of all those fields by using F1, F9 on those fields.

Regards,

Pradhiba

Read only

Former Member
0 Likes
1,874

Hi das,

below example code might help you.

http://sap.ittoolbox.com/code/d.asp?d=3411&a=s

regards,

venu.

Read only

0 Likes
1,873

On transaction(MIR6), there is a checkbox(Invoices verified online) that needs to be selected, to view the result based on the doc number.

wonder if it is possible to do it automatically....as it has no parameter id.

Rajib

Read only

0 Likes
1,873

since it has no parameter id defined, you cannot use set parameter id.

altrnate approach could be to use

using "bdc_data"

CALL TRANSACTION 'MIR6' USING bdcdata_tab OPTIONS FROM opt.

for sample program check out the ABAP key word documentation for "CALL TRANSACTION"

Regards

Raja

Read only

0 Likes
1,873

Hi,

If it is not having parameter id,then you can use SUBMIT .

Submit [standard program of the transaction] with field = value and return.

Read only

0 Likes
1,873

Submit can only used with type 1 (executable) program.

Regards

Raja

Read only

0 Likes
1,873

Hi All,

Thanks so much for your replies.

I was able to bypass "MIR6" by "MIR4" as I would be displaying only the parked or posted invoice.

It would be interesting to investigate the option "CALL TRANSACTION 'MIR6' USING bdcdata_tab OPTIONS FROM opt."

Rajib

Read only

Former Member
0 Likes
1,873

Hi,

TO make hotspot, enable that in the fieldcatalog as

if w_fieldcat-fieldname = 'MATNR' OR w_fieldcat-fieldname = 'CHARG'.
  w_fieldcat-hotspot = 'X'.
endif.
  APPEND w_fieldcat TO i_fieldcat.
  CLEAR w_fieldcat.

FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
  read table i_output into w_output index rs_selfield-tabindex.
  lv_matnr = w_output-matnr.
  lv_werks = w_output-werks.
  lv_lgort = w_output-lgort.
  lv_charg = w_output-charg.
  SET PARAMETER ID 'MAT' FIELD lv_matnr.
  SET PARAMETER ID 'WRK' FIELD lv_werks.
  SET PARAMETER ID 'LAG' FIELD lv_lgort.
  SET PARAMETER ID 'CHA' FIELD lv_charg.
CASE sy-ucomm.

    when '&PICK'.             "Batch Field(the function code in screen painter)

      CALL TRANSACTION 'MSC3N' AND SKIP FIRST SCREEN .

    when '&CLICK'.            "Stock/Requirements

      CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN .
  Clear:     lv_matnr,
             lv_werks,
             lv_lgort,
             lv_charg.
ENDFORM.

This is for classical ALV. If for oops ALV it will be different.

Get back to me if u need more help on this.

Read only

0 Likes
1,873

Hi Everybody,

I am beginner in ABAP.

I try to create a report using hotspot in core ABAP.

Please help me how to do it.

My scenario is,

I should display the header detail of purchase order.

And to define hotspot for purchase doc no- EBELN.

If once i clicked the pur. doc. no the Item details should be displayed.

I wnt to get clear about the types to be declared and how to merge it.

I completed the code for purchase order header using grid dispaly.

Here is the code.

*&---------------------------------------------------------------------*

*& Report  ZTASK1

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZTASK1 no standard page heading message-id 001.

tables ekko.

type-pools slis.

data : begin of str occurs 0,

        ebeln type ebeln,

        aedat type erdat,

        ernam type ernam,

        lifnr type elifn,

        bukrs type bukrs,

   end of str.

select-options: pa_pur for ekko-ebeln obligatory,

                 pa_date for ekko-aedat no intervals no-extension.

data: wa_fct TYPE slis_fieldcat_alv,

        it_fct TYPE slis_t_fieldcat_alv.

select ebeln aedat ernam lifnr bukrs from ekko into table str where ebeln in pa_pur.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '1'.

          wa_fct-fieldname      = 'EBELN'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Puchase Doc. No.'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '2'.

          wa_fct-fieldname      = 'ERDAT'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Created Date'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

           wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '3'.

          wa_fct-fieldname      = 'ERNAM'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Created By'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '4'.

          wa_fct-fieldname      = 'LIFNR'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Vendor'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

          wa_fct-row_pos        = '1'.

          wa_fct-col_pos        = '5'.

          wa_fct-fieldname      = 'BUKRS'.

          wa_fct-tabname        = 'EKKO'.

          wa_fct-seltext_m      = 'Company Code'.

          append wa_fct to it_fct.

          CLEAR WA_FCT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

    I_CALLBACK_PROGRAM                = SY-REPID

    IT_FIELDCAT                       = IT_FCT

TABLES

     t_outtab                          = STR

  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.