Friday, July 12, 2013
Previously we worked on how to handle check boxes on table control. Now I would like to explain how to handle radio buttons on Table control display.
Steps
- Define one internal table(IT_0001) in TOP include and structure should have one field RADBUT type C.
*&---------------------------------------------------------------------* *& Include MZTEST_TABLE_CTRLTOP Module Pool SAPMZTEST_TABLE_CTRL *& *&---------------------------------------------------------------------* PROGRAM SAPMZTEST_TABLE_CTRL. TYPES: BEGIN OF TY_0001, RADBUT TYPE C, PERNR TYPE PA0001-PERNR, BUKRS TYPE PA0001-BUKRS, ENAME TYPE PA0001-ENAME, END OF TY_0001. DATA: IT_0001 TYPE STANDARD TABLE OF TY_0001, WA_0001 TYPE TY_0001. DATA OK_CODE TYPE SY-UCOMM. CONTROLS TC_WITH_RAD TYPE TABLEVIEW USING SCREEN '1001'.
PROCESS BEFORE OUTPUT. MODULE GET_DATA. LOOP AT IT_0001 INTO WA_0001 WITH CONTROL TC_WITH_RAD. ENDLOOP. PROCESS AFTER INPUT. LOOP AT IT_0001. MODULE READ_TABLE_CONTROL. ENDLOOP. MODULE USER_COMMAND_1001.
*&-------------------------------------------------------------------* *& Module GET_DATA OUTPUT *&-------------------------------------------------------------------* * text *--------------------------------------------------------------------* MODULE GET_DATA OUTPUT. IF IT_0001 IS INITIAL. SELECT DISTINCT * FROM PA0001 INTO CORRESPONDING FIELDS OF TABLE IT_0001 UP TO 400 ROWS. SORT IT_0001 BY PERNR PERNR BUKRS ENAME. DELETE ADJACENT DUPLICATES FROM IT_0001 COMPARING ALL FIELDS. ENDIF. ENDMODULE. " GET_DATA OUTPUT
*&-------------------------------------------------------------------* *& Module READ_TABLE_CONTROL INPUT *&-------------------------------------------------------------------* * text *--------------------------------------------------------------------* MODULE READ_TABLE_CONTROL INPUT. MODIFY IT_0001 FROM WA_0001 INDEX TC_WITH_RAD-CURRENT_LINE. ENDMODULE. " READ_TABLE_CONTROL INPUT
*&-------------------------------------------------------------------* *& Module USER_COMMAND_1001 INPUT *&-------------------------------------------------------------------* * text *--------------------------------------------------------------------* MODULE USER_COMMAND_1001 INPUT. CASE OK_CODE. WHEN 'DISPLAY'. LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 1001. LOOP AT IT_0001 INTO WA_0001 WHERE RADBUT = 'X'. WRITE:/ WA_0001-PERNR, WA_0001-BUKRS, WA_0001-ENAME. ENDLOOP. WHEN OTHERS. ENDCASE. ENDMODULE. " USER_COMMAND_1001 INPUT
- Create transaction code and execute.
- Select the record and click on "Display selected record" button.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
This article is a great example of opportunity cost….if the gov plans to train workers,
ReplyDeletespending must be cut from some other program, which could discourage economic growth.
SAP APO Online Training
Solved my issue. thank you.
ReplyDelete