‎2007 Jun 08 5:49 AM
Hello Friends,
I am taking TABLE name as input parameter.
I have find out which are Key fields in the specified table.
Now I want those key fileds to be as select-options on next screen.
I have tried for this, and somehow able to get one selection option out of this key fileds on next screen.
please help.
Regards,
Amol C.
*-- I always award points to helpful answer.
‎2007 Jun 08 6:03 AM
hi
good
Variant 14
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
Addition
... ID id
Effect
This variant is allowed only in the database include program DBldbSEL . It informs you for which logical database tables additional selections are supported. If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a psuhbutton called 'Dynamic selections' appears on the selection screen. On pressing this button, the user branches to a dialog Taste where it is possible to enter selections for the fields of the relevant tables in the logical database. You can define the field list in two different ways:
Via a selection view defined for the purpose:
You can maintain selection views within the logical database maintenance transaction. They consist of a set of fields from logical database tables which are divided into groups. It is also possible to preselect fields. Customers can overlay these selection views with their own (i.e. in this case, the system searches first for the customer selection view and only accesses the SAP selektion view if no customer-specific view exists).
If a preselection has already been made in the selection view, the user immediately sees the selection screen for the preselected fields and can enter selections. Otherwise, a fields must be selected first.
Via all fields of all tables
In this case, the user must first choose the tables and then select the fields for which additional selections are to be made before branching to the selection screen to enter the dynamic selections.
The database access programm SAPDBldb then receives the WHERE clauses generated from the user entries in the form of a complex data object DYN_SEL .
Addition
... ID id
Effect
Similar to the addition 2 ( SKIP ). This allows you to exclude tables from the possibility of dynamic selection via the selection screen versions.
Note
The exact definition of the object DYN_SEL is stored in the TYPE-POOL RSDS and is as follows:
TYPES: BEGIN OF RSDS_WHERE,
TABLENAME LIKE RSDSTABS-PRIM_TAB,
WHERE_TAB LIKE RSDSWHERE OCCURS 5,
END OF RSDS_WHERE.
...
TYPES: BEGIN OF RSDS_TYPE,
CLAUSES TYPE RSDS_WHERE OCCURS 5,
TEXPR TYPE RSDS_TEXPR,
TRANGE TYPE RSDS_TRANGE,
END OF RSDS_TYPE.
DATA DYN_SEL TYPE RSDS_TYPE.
The object DYN_SEL thus contains a component ( CLAUSES ) which is an internal table. Each line of this internal table contains a table name ( TABLENAME ) and another table ( WHERE_TAB ) which contains the WHERE clauses for the table ( TABLENAME ).
You can find the structure of the other components in the type pool RSDS .
TEXPR contains the selections in a format which allows storage and can be used for the "freely callable" function modules when entering dynamic selections ( FREE_SELECTIONS_INIT , FREE_SELECTIONS_DIALOG ). TRANGE contains the selections in the form of RANGES tables which can be used with the IN operator in SELECT , CHECK and IF .
thanks
mrutyun^
‎2007 Jun 08 6:03 AM
hi
good
Variant 14
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab.
Addition
... ID id
Effect
This variant is allowed only in the database include program DBldbSEL . It informs you for which logical database tables additional selections are supported. If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a psuhbutton called 'Dynamic selections' appears on the selection screen. On pressing this button, the user branches to a dialog Taste where it is possible to enter selections for the fields of the relevant tables in the logical database. You can define the field list in two different ways:
Via a selection view defined for the purpose:
You can maintain selection views within the logical database maintenance transaction. They consist of a set of fields from logical database tables which are divided into groups. It is also possible to preselect fields. Customers can overlay these selection views with their own (i.e. in this case, the system searches first for the customer selection view and only accesses the SAP selektion view if no customer-specific view exists).
If a preselection has already been made in the selection view, the user immediately sees the selection screen for the preselected fields and can enter selections. Otherwise, a fields must be selected first.
Via all fields of all tables
In this case, the user must first choose the tables and then select the fields for which additional selections are to be made before branching to the selection screen to enter the dynamic selections.
The database access programm SAPDBldb then receives the WHERE clauses generated from the user entries in the form of a complex data object DYN_SEL .
Addition
... ID id
Effect
Similar to the addition 2 ( SKIP ). This allows you to exclude tables from the possibility of dynamic selection via the selection screen versions.
Note
The exact definition of the object DYN_SEL is stored in the TYPE-POOL RSDS and is as follows:
TYPES: BEGIN OF RSDS_WHERE,
TABLENAME LIKE RSDSTABS-PRIM_TAB,
WHERE_TAB LIKE RSDSWHERE OCCURS 5,
END OF RSDS_WHERE.
...
TYPES: BEGIN OF RSDS_TYPE,
CLAUSES TYPE RSDS_WHERE OCCURS 5,
TEXPR TYPE RSDS_TEXPR,
TRANGE TYPE RSDS_TRANGE,
END OF RSDS_TYPE.
DATA DYN_SEL TYPE RSDS_TYPE.
The object DYN_SEL thus contains a component ( CLAUSES ) which is an internal table. Each line of this internal table contains a table name ( TABLENAME ) and another table ( WHERE_TAB ) which contains the WHERE clauses for the table ( TABLENAME ).
You can find the structure of the other components in the type pool RSDS .
TEXPR contains the selections in a format which allows storage and can be used for the "freely callable" function modules when entering dynamic selections ( FREE_SELECTIONS_INIT , FREE_SELECTIONS_DIALOG ). TRANGE contains the selections in the form of RANGES tables which can be used with the IN operator in SELECT , CHECK and IF .
thanks
mrutyun^