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

Double click on ALV Report using Module Pool Program

Former Member
0 Likes
2,844

Hi Friends,

               I am working on a module pool programming where i need to develop few screens based on radio buttons in initial screen .

                  rb1 - create

                  rb2- change

                  rb3 - Report

              if Report option is selected, report needs to be displayed, again double clicking on a field(eg, Material) in the report should call change screen based on material which was double clicked.

how should i achieve this please suggest.

regards,

Lokesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,139

I'd declare rb1, rb2 and rb3 as CHAR1 with values of space or 'X'. If possible, make them a radio group. If not, make them checkboxes and add logic that exactly one will be set. Then write this code:

case 'X'.

when rb1.

   " create logic

  when rb2.

   " change logic

when rb3.

   submit xyz ... and return. " or do you mean call the module in display mode?

endcase.

If you need to differentiate the mode, set a flag TRTYP (like SAP does). They use 'H' for create (hinzufügen), 'V' for change (verändern) and 'A' for display (anzeigen). In the PBO of a screen, loop at screen and set fields to no input in mode 'A'. I think it's SCREEN-OUTPUT = '0'. Don't forget to modify SCREEN inside the loop.

If very little information gets passed from the ALV, you may be better off to write a stand-alone module pool transaction and pass key values via SPA/GPA (set/get parameter).

Regards,

Wolfgang

10 REPLIES 10
Read only

Former Member
0 Likes
2,140

I'd declare rb1, rb2 and rb3 as CHAR1 with values of space or 'X'. If possible, make them a radio group. If not, make them checkboxes and add logic that exactly one will be set. Then write this code:

case 'X'.

when rb1.

   " create logic

  when rb2.

   " change logic

when rb3.

   submit xyz ... and return. " or do you mean call the module in display mode?

endcase.

If you need to differentiate the mode, set a flag TRTYP (like SAP does). They use 'H' for create (hinzufügen), 'V' for change (verändern) and 'A' for display (anzeigen). In the PBO of a screen, loop at screen and set fields to no input in mode 'A'. I think it's SCREEN-OUTPUT = '0'. Don't forget to modify SCREEN inside the loop.

If very little information gets passed from the ALV, you may be better off to write a stand-alone module pool transaction and pass key values via SPA/GPA (set/get parameter).

Regards,

Wolfgang

Read only

0 Likes
2,139

thanks for ur reply,

please suggest at interactive part i,e  double click action on a field in report.

how do i find on which field data double click action was performed in modulepool

regrads,

Lokesh

Read only

0 Likes
2,139

Look at the callback routine (find an existing ALV for that). The user command is something like '%IC2' (not 100% sure). The callback gives you a parameter (structure) that has index information on the row and it also has information on the field. You may need to re-read the data table for the ALV using that index to get the proper line.

Code a 'WHEN' for that user command, put a breakpoint and have a look at the data. Click a few different fields and rows and you'll figure it out.

Wolfgang

Read only

0 Likes
2,139

Hi,

    I am displaying ALV in a screen( PBO) in modulepool using custom container, Now how to capture the double click action on any row or a particular field. based on that i need to call another screen.

Please suggest

Read only

0 Likes
2,139

Check sy-ucomm for click/double click. See this thread

Read only

0 Likes
2,139

Hi,

Basically it is a Report that is displayed in PBO screen , Now what is the code i need to build in PAI while double clicking on a row or a field,

please eloberate.

Read only

0 Likes
2,139

In you PAI, add a condition to check the action(sy-ucomm).

You can simply add

IF sy-ucomm = '&IC1'. "&IC1 is double click

     "your processing/logic here.

ENDIF.

Read only

0 Likes
2,139

Sorry,

IT did not worked,

I am working in modulepool and displaying report in one screen-PBO using custom container using cl_gui_alv_grid class , please consider all these things while providing solution.

code in PAI for double clicking report field.??

Read only

0 Likes
2,139

ok. I got your point now. This sample program will surely solve your issue:

BCALV_GRID_05

Note: Update the Logic on this part for double click:

(Use the '&IC1' in sy-ucomm to check for double click.

METHOD handle_user_command.

     DATA: lt_rows TYPE lvc_t_row.

     CASE e_ucomm.

       WHEN 'BOOKINGS'.

         CALL METHOD grid1->get_selected_rows

                  IMPORTING et_index_rows = lt_rows.

         CALL METHOD cl_gui_cfw=>flush.

         IF sy-subrc ne 0.

* add your handling, for example

           CALL FUNCTION 'POPUP_TO_INFORM'

                EXPORTING

                     titel = g_repid

                     txt2  = sy-subrc

                     txt1  = 'Error in Flush'(500).

         else.

                   perform show_booking_table tables lt_rows.

         ENDIF.

     ENDCASE.

   ENDMETHOD.                           "handle_user_command


Reference thread:


Read only

0 Likes
2,139

for click on field fucnctionality

declaration-

data:R_UCOMM LIKE SY-UCOMM,

RS_SELFIELD TYPE SLIS_SELFIELD

******************************Conatiner& grid  DECLARATIONS****************************************

DATA:I_FCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV,

     W_LAYOUT TYPE SLIS_LAYOUT_ALV,

     W_DISVARIANT TYPE DISVARIANT,

     I_SORT TYPE SLIS_T_SORTINFO_ALV,

     LV_GRID_TITLE TYPE LVC_TITLE,

     LW_FCAT TYPE SLIS_FIELDCAT_ALV.

you have to check hotspot filed in field catalog = 'X'

  LW_FCAT-FIELDNAME = 'DOKNR'.

  LW_FCAT-TABNAME = 'IT_FINAL'.

  LW_FCAT-SELTEXT_L = 'PDF Doc.No.'.

  LW_FCAT-NO_ZERO    = 'X'.

  LW_FCAT-HOTSPOT = 'X'.

  APPEND LW_FCAT TO I_FCAT.

  CLEAR : LW_FCAT.

  LW_FCAT-FIELDNAME = 'DOKNR'.

  LW_FCAT-TABNAME = 'IT_FINAL'.

  LW_FCAT-SELTEXT_L = 'PDF Doc.No.'.

  LW_FCAT-NO_ZERO    = 'X'.

  LW_FCAT-HOTSPOT = 'X'.

  APPEND LW_FCAT TO I_FCAT.

  CLEAR : LW_FCAT.

FORM USER_COMMAND USING

      SY_UCOMM TYPE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.

  CASE SY_UCOMM.

    WHEN '&IC1'.   "here we capture sy-code of field

      CLEAR WA_FINAL.

      READ TABLE IT_FINAL INTO WA_FINAL INDEX SELFIELD-TABINDEX.

      PERFORM DISPLAY_FILE_DIALOG USING WA_FINAL-EMPNO.

      IF SY-SUBRC = 0.

ENDIF.

    WHEN OTHERS.

  ENDCASE.

  CASE SY-UCOMM.

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

      LEAVE TO SCREEN 0.

  ENDCASE.

ENDFORM.                    "user_com