Skip to Content
0
Former Member
Dec 13, 2006 at 04:03 AM

ABAP Query

40 Views

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.