Application Development 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: 

Interactive ALV Block List

Former Member
0 Kudos

Hi,

I am using 2 tables and using the following FMs,

REUSE_ALV_BLOCK_LIST_INIT

REUSE_ALV_BLOCK_LIST_APPEND and

REUSE_ALV_BLOCK_LIST_DISPLAY

When I double click, all the values in rs-selfield gets populated except the fieldname SEL_TAB_FIELD or FIELDNAME. I am not sure why this is happening.

Could you please suggest?

Best Regards.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

I guess, those fields are not getting updated in the ALV block list.

If you see the standard test report BALVBT01, you will find the same behaviour.

You can try to track it down by the Tablename (RS_SELFIELD-TABNAME), Table index (RS_SELFIELD-TABINDEX) and the Value (RS_SELFIELD-VALUE).

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos

I guess, those fields are not getting updated in the ALV block list.

If you see the standard test report BALVBT01, you will find the same behaviour.

You can try to track it down by the Tablename (RS_SELFIELD-TABNAME), Table index (RS_SELFIELD-TABINDEX) and the Value (RS_SELFIELD-VALUE).

Regards,

Naimesh Patel

0 Kudos

Thanks Naimesh for your reply. But what is the solution for this? I have to use ALV Block only, coz tables need to be displayed as different sections with different titles.

Also, I can get the record using the rs_selfield-tabindex field, but I want the fieldname, coz the doub clilck should be valid in only few fields only.

Please suggest.

Best Regards.

0 Kudos

I think we have to live with this limitation. I have tried to implement the GET CURSOR FIELD... but it didn't get that field name. Actually, I had debugged the the point from where it calls the perform in our program and surprisingly it didn't catch the field name after the GET CURSOR ... in std ALV.

One way is: Give Hotspot for the columns and based on the values derive the Column name.

I know this is not the good idea but, we have to do something like this to get to know the proper field.

Regards,

Naimesh Patel

0 Kudos

Thanks Naimesh for the suggestion. I tried by setting the hotspot, it didn't populate the fieldname. Any other suggestion?

Best Regards.

Former Member
0 Kudos

Hi Experts.

when I i tried this block alv list display, it's not taking the user command & field selection in the following program ,if i give { IF IS_SELFIELD-FIELDNAME NE 'MATNR' }'. like this interactive is working otherwise if give {IF IS_SELFIELD-FIELDNAME EQ 'MATNR'.} interactive is not working . can u help me to solve this problem.

TABLES: MARA, MAKT, MARD.

*provide type-pools

SET PF-STATUS 'SCREEN'.

TYPE-POOLS: SLIS.

*provide select-options

SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.

*provide data objects

DATA: V_REPID TYPE SY-REPID,

ucomm like sy-ucomm,

WA_MARA_FIELD TYPE SLIS_FIELDCAT_ALV, "it is for field catalog

WA_MAKT_FIELD TYPE SLIS_FIELDCAT_ALV,

WA_MARD_FIELD TYPE SLIS_FIELDCAT_ALV,

WA_MARA TYPE MARA,

WA_MAKT TYPE MAKT,

WA_MARD TYPE MARD,

IT_MARA_FIELD TYPE SLIS_T_FIELDCAT_ALV,

IT_MAKT_FIELD TYPE SLIS_T_FIELDCAT_ALV,

IT_MARD_FIELD TYPE SLIS_T_FIELDCAT_ALV,

IT_MARA TYPE TABLE OF MARA,

IT_MAKT TYPE TABLE OF MAKT,

IT_MARD TYPE TABLE OF MARD,

V_LAYOUT TYPE SLIS_LAYOUT_ALV,

IT_EVENTS TYPE SLIS_T_EVENT, "it is for events

WA_EVENTS TYPE SLIS_ALV_EVENT.

V_REPID = SY-REPID.

*is_selfield TYPE slis_selfield. "#EC CALLED

perform builfieldcat.

perform dataretrieval.

perform datadisp.

&----


*& Form builfieldcat

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM builfieldcat .

WA_MARA_FIELD-COL_POS = 1.

WA_MARA_FIELD-FIELDNAME = 'MATNR'.

WA_MARA_FIELD-REF_TABNAME = 'MARA'.

APPEND WA_MARA_FIELD TO IT_MARA_FIELD.

CLEAR WA_MARA_FIELD.

WA_MARA_FIELD-COL_POS = 2.

WA_MARA_FIELD-FIELDNAME = 'ERSDA'.

WA_MARA_FIELD-REF_TABNAME = 'MARA'.

APPEND WA_MARA_FIELD TO IT_MARA_FIELD.

CLEAR WA_MARA_FIELD.

WA_MARA_FIELD-COL_POS = 3.

WA_MARA_FIELD-FIELDNAME = 'ERNAM'.

WA_MARA_FIELD-REF_TABNAME = 'MARA'.

APPEND WA_MARA_FIELD TO IT_MARA_FIELD.

CLEAR WA_MARA_FIELD.

WA_MARA_FIELD-COL_POS = 4.

WA_MARA_FIELD-FIELDNAME = 'LAEDA'.

WA_MARA_FIELD-REF_TABNAME = 'MARA'.

APPEND WA_MARA_FIELD TO IT_MARA_FIELD.

CLEAR WA_MARA_FIELD.

ENDFORM. " builfieldcat

&----


*& Form dataretrieval

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM dataretrieval .

SELECT *

FROM MARA

INTO TABLE IT_MARA

WHERE MATNR IN S_MATNR.

ENDFORM. " dataretrieval

&----


*& Form datadisp

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM datadisp .

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

I_CALLBACK_PROGRAM = V_REPID

I_CALLBACK_PF_STATUS_SET = 'SCREEN'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • IT_EXCLUDING =

.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

IS_LAYOUT = V_LAYOUT

IT_FIELDCAT = IT_MARA_FIELD[]

I_TABNAME = 'MARA'

IT_EVENTS = IT_EVENTS[]

  • IT_SORT =

  • I_TEXT = ' '

TABLES

T_OUTTAB = IT_MARA.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

ENDFORM. " datadisp

&----


*& Form SECONDARY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


*FORM USER_COMM USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.

FORM user_command USING i_ucomm LIKE sy-ucomm is_selfield TYPE slis_selfield.

IF IS_SELFIELD-FIELDNAME NE 'MATNR'.

PERFORM DATARET2.

PERFORM BUILFIE2.

PERFORM DATADSP2.

ENDIF.

endform.

" SECONDARY

&----


*& Form DATARET2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM DATARET2 .

SELECT *

FROM MAKT

INTO TABLE IT_MAKT

WHERE MATNR IN S_MATNR.

ENDFORM. " DATARET2

&----


*& Form BUILFIE2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM BUILFIE2 .

WA_MAKT_FIELD-COL_POS = '1'.

WA_MAKT_FIELD-FIELDNAME = 'MATNR'.

WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.

APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.

CLEAR WA_MAKT_FIELD.

WA_MAKT_FIELD-COL_POS = 2.

WA_MAKT_FIELD-FIELDNAME = 'MAKTX'.

WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.

APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.

CLEAR WA_MAKT_FIELD.

WA_MAKT_FIELD-COL_POS = 3.

WA_MAKT_FIELD-FIELDNAME = 'MAKTG'.

WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.

APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.

CLEAR WA_MAKT_FIELD.

ENDFORM. " BUILFIE2

&----


*& Form DATADSP2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM DATADSP2 .

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

IS_LAYOUT = V_LAYOUT

IT_FIELDCAT = IT_MAKT_FIELD

I_TABNAME = 'MAKT'

IT_EVENTS = IT_EVENTS

  • IT_SORT =

  • I_TEXT = ' '

TABLES

T_OUTTAB = IT_MAKT

EXCEPTIONS

PROGRAM_ERROR = 1

MAXIMUM_OF_APPENDS_REACHED = 2

OTHERS = 3.

*display the data

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

ENDFORM. " DATADSP2

Regards.

Sridar.