2009 Mar 06 9:59 PM
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.
2009 Mar 06 11:54 PM
2009 Mar 06 10:09 PM
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...
2009 Mar 06 10:12 PM
Good idea.
You can try to create a select options like SE16N.
Regards,
Naimesh Patel
2009 Mar 06 10:47 PM
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
2009 Mar 06 11:54 PM