12-13-2006 4:03 AM
The plant field already defined like
Select-options: SP$00003 for marc-werks "Defined in Abap Query
SP$00003 for this field we need to add the following code?
AT SELECTION-SCREEN ON werks.
z_tcode = sy-tcode.
z_pgnam = sy-repid.
*-----To select Transaction code for this report
IF z_tcode IS INITIAL.
SELECT SINGLE tcode
FROM tstc
INTO z_tcode
WHERE pgmna EQ z_pgnam.
ELSEIF z_tcode = c_tcode.
CONCATENATE '%' z_pgnam '%' INTO z_pgnam.
CLEAR z_tcode.
SELECT SINGLE tcode
FROM tstcp
INTO z_tcode
WHERE param LIKE z_pgnam.
ENDIF.
*-----To check Authority for given Plant Range
CALL FUNCTION 'Z_AUTHORITY_CHECK'
EXPORTING
itcode = z_tcode
field1 = c_werks
TABLES
t_field = werks
t_yesauth = t_yestab
t_noauth = t_notab.
12-13-2006 8:55 AM
Hi,
why don'T you insert your coding in the corresp. infoset of your query with trx. sq02?
A.