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: 

Dynamic select-options

Former Member
0 Kudos

Hi,

I have tried to write a generic - dynamic program that is proper for all tables to upload data into them.

The user enters the table name,selects a file and then executes the program, data is uploaded into tables. It is something very useful for Z tables, just one program to upload data for all tables.

What i need now is that, i want to use the entered table's key fields to select data and will show this data when clicked on a function key, but i dont know how to create a select-options depending on the entered table name's fields into parameter. It is ok and easy to get the all data of entered table but what if the user wants to enter some criteria???

Is there any idea on this?

Thanks.

deniz.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use fm POPUP_GET_VALUES

кu03B1ятu03B9к

4 REPLIES 4

former_member156446
Active Contributor
0 Kudos

if you create table maintainance generator.... that is what it does...ofcourse not form file though..

se11 > table name > utilities > table maintenance gen.

REPORT  zj_test LINE-SIZE 162.

PARAMETER: tabnam TYPE tabname16.

DATA: ddobjname TYPE ddobjname,
      string TYPE string.

DATA:  BEGIN OF gt_dfies OCCURS 30.
        INCLUDE STRUCTURE dfies.
DATA:  END OF gt_dfies.

ddobjname = tabnam.

CALL FUNCTION 'DDIF_FIELDINFO_GET'
  EXPORTING
    tabname              = ddobjname
   langu                = sy-langu
 TABLES
   dfies_tab            = gt_dfies
 EXCEPTIONS
   not_found            = 1
   internal_error       = 2
   OTHERS               = 3.

LOOP AT gt_dfies.
  CONCATENATE string gt_dfies-fieldname  INTO string SEPARATED BY '|'.
ENDLOOP.

WRITE: string.

need to create an dynamic internal table with all those fields and upload data from file to this structure.....

Note: the structure of the file and the fields of the tables need to match always...first vbeln 18 characters and posnr 4 characters.... for another table.. the file and the field need to be different...

naimesh_patel
Active Contributor
0 Kudos

Good idea.

You can try to create a select options like SE16N.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi,

Just check the link there are some code samples.

[Dynamic Selection|https://wiki.sdn.sap.com/wiki/x/SYJWAw]

[Dynamic Selection|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a07a330f-126c-2910-c684-d2a45f0f37dd]

Regards,

Gurpreet

Former Member
0 Kudos

use fm POPUP_GET_VALUES

кu03B1ятu03B9к