‎2010 Jun 18 2:56 AM
Hello gurus,
I need to display all fields of a table (ex. KNA1) as check boxes on my program PROG1 selection screen.
Any thoughts?
‎2010 Jun 18 4:48 AM
Hi Adrian ,
Instead making the checkbox in a selection screen . you can follow the below way as coded.
First FM Will get the Fields of KNA1.
second FM will use the fields and show it in a screen with check box.
Second will fm return the tables rett_name_tab ( it_return_fields) wil have the all the fields. Field FLAG2 of RETT_NAME_TAB
is not initial then its selected by the user.
You can directly delete the ITAB RETT_NAME_TAB where FLAG2 is not initial. finally you have only the selected fields in RETT_NAME_TAB which is selected by user on the screen.
CALL FUNCTION 'DD_GET_NAMETAB'
EXPORTING
* STATUS = 'A'
tabname = 'KNA1'
* GET_ALL = ' '
* IMPORTING
* F_STATUS =
* R_MODEFLAG =
* R_STATUS =
* X030L_WA =
TABLES
x031l_tab = it_kna1_fields
* EXCEPTIONS
* NOT_FOUND = 1
* NO_FIELDS = 2
* OTHERS = 3
.
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 FUNCTION 'RS_DATABROWSE_FIELDSELECT'
EXPORTING
tabname = 'KNA1'
action_2 = 'X'
* IMPORTING
* OKCODE =
TABLES
name_tab = it_kna1_fields
rett_name_tab = it_return_fields
* TAB2_FIELD =
.
‎2010 Jun 18 1:41 PM
Hello Prasath,
Your suggestion looks good. One question. Our idea is to save a report variant with our selections. If I get the KNA1 fields in a popup would I be able to save a report variant with those selections? Please let me know.
Waiting...
‎2010 Jun 18 2:15 PM
Moderator message - almost duplicate post locked This is the second post on the same subject I've locked. Repeated violations of forum rules can result in your account being deleted. Please read and and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again. Rob