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: 

use RS_TABLE_LIST_CREATE

Former Member
0 Kudos

Hi abbapers,

I want to use the FM RS_TABLE_LIST_CREATE:

CALL FUNCTION 'RS_TABLE_LIST_CREATE'
         EXPORTING
              table_name         = 'BKPF'
    *         ACTION             = 'ANZE'
    *         WITHOUT_SUBMIT     = ' '
    *         GENERATION_FORCED  =
    *         NEW_SEL            =
    *         NO_STRUCTURE_CHECK = ' '
    *         DATA_EXIT          = ' '
    *    IMPORTING
    *         PROGNAME           =
    *    TABLES
    *         SELTAB             =
    *    EXCEPTIONS
    *         TABLE_IS_STRUCTURE = 1
    *         TABLE_NOT_EXISTS   = 2
    *         DB_NOT_EXISTS      = 3
    *         NO_PERMISSION      = 4
    *         NO_CHANGE_ALLOWED  = 5
    *         OTHERS             = 6
              .

If I pass the parameter table_name, I obtain the select options of this table, but I want select other select options in function the tabla that I obtain with other code:

call function 'DDIF_FIELDINFO_GET'
         exporting
              tabname        = 'BKPF'
        importing
             x030l_wa       = x030l
        tables
             dfies_tab      = i_dfies.

    refresh %_tab2.

    loop at i_dfies.
      clear %_tab2.
      move-corresponding i_dfies to %_tab2.
      %_tab2-dtyp = i_dfies-datatype.
      if not i_dfies-keyflag is initial.
        %_tab2-flag1 = fkey.
      endif.
      %_tab2-exid = i_dfies-inttype.
      %_tab2-exlength = i_dfies-outputlen.
      %_tab2-dblength = i_dfies-leng.
      append %_tab2.
    endloop.

  LOOP AT %_TAB2.
    MOVE %_TAB2 TO RETT_%_TAB2.
    APPEND RETT_%_TAB2.
  ENDLOOP.

  IMPORT %_TAB2_FIELD %_TAB2_SORT FROM MEMORY ID SY-REPID.

  DESCRIBE TABLE %_TAB2_FIELD LINES COUNT.

  IF NOT COUNT IS INITIAL.
    REFRESH %_TAB2.

    LOOP AT %_TAB2_FIELD.
      %_TAB2 = %_TAB2_FIELD.
      APPEND %_TAB2.
    ENDLOOP.
  ENDIF.

 do.
   clear count.
   read line sy-index field value input_entry.
   if sy-subrc ne 0.
     exit.
   endif.
   if not count is initial.
     read line sy-index field value sy-lisel into my_lisel.
     my_lisel+1(1) = 'X'.
     modify line sy-index field value sy-lisel from my_lisel.
   endif.
 enddo.

I view the next post, but I dont understand the DATABROWSE-GEN_FLAG ¿contain value ' ' or 'X'.?

the code DATABROWSE-GEN_FLAG:

3 REPLIES 3

Former Member
0 Kudos

Hi

DATABROWSE-GEN_FLAG was space, here the developer needed to display the SE16 selection-screen for a certain table.

DATABROWSE-GEN_FLAG is to force the generation of the program: if somebody has just run se16 for a certain table, the program is generated so it doesn't need to generate it again, but if it needs to change the selection-screen has to be dysplayed it should be better to generate it again.

Max

0 Kudos

Hi Max,

Ok, then if I want select other select option, How do it?

Thanks.

0 Kudos

Hi

U need to set NEW_SEL parameter, in this case the system'll show a popup where it can select the new field for selection-screen:

CALL FUNCTION 'RS_TABLE_LIST_CREATE'
  EXPORTING
    TABLE_NAME               = 'BKPF'
*   ACTION                   = 'ANZE'
*   WITHOUT_SUBMIT           = ' '
    GENERATION_FORCED        = 'X'
    NEW_SEL                  = 'X'

If you generate a new selection-screen, the system generate the program again so probably GENERATION_FORCED = 'X' is useless.

Max