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: 

Call transaction SM30 with 'Enter conditions' radio-button selection

Former Member
0 Kudos

Hi,

Could we call SM30 txn from a report program with radio button' 'Enter conditions' selected and also pass the condition values through any parameter id or any syntax form of 'CALL TRANSACTION'?

The objective is to allow user to maintain only certain specific table entries through a custom transaction which calls SM30.

Thanks in advance!!

Regards

Deepthi.

3 REPLIES 3

Former Member
0 Kudos

Hi,Deepthi,

you can refer the below code, hope it is useful to you.

CALL FUNCTION 'VIEW_GET_DDIC_INFO'

EXPORTING

VIEWNAME = G_TABLE “View's name

TABLES

SELLIST = T_VIMSELLIST

X_HEADER = T_VIMDESC

X_NAMTAB = T_VIMNAMTAB

EXCEPTIONS

NO_TVDIR_ENTRY = 1

TABLE_NOT_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

**

PERFORM PREPARE_SELECTION_DATA.

CALL FUNCTION 'VIEW_MAINTENANCE'

EXPORTING

VIEW_ACTION = 'U' "UPDATE

VIEW_NAME = G_TABLE

TABLES

X_HEADER = T_VIMDESC

X_NAMTAB = T_VIMNAMTAB

DBA_SELLIST = T_VIMSELLIST

EXCL_CUA_FUNCT = T_VIMEXCLFUN

EXCEPTIONS

MISSING_CORR_NUMBER = 1

NO_DATABASE_FUNCTION = 2

NO_EDITOR_FUNCTION = 3

NO_VALUE_FOR_SUBSET_IDENT = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM PREPARE_SELECTION_DATA .

T_VIMSELLIST-VIEWFIELD = 'BNAREA'.

T_VIMSELLIST-OPERATOR = 'EQ'.

T_VIMSELLIST-VALUE = P_BNAREA.

T_VIMSELLIST-AND_OR = 'AND'.

T_VIMSELLIST-TABIX = 2.

APPEND T_VIMSELLIST.

T_VIMSELLIST-VIEWFIELD = 'BUKRS'.

T_VIMSELLIST-OPERATOR = 'EQ'.

T_VIMSELLIST-VALUE = P_BUKRS.

T_VIMSELLIST-AND_OR = ''.

T_VIMSELLIST-TABIX = 3.

APPEND T_VIMSELLIST.

ENDFORM.

Regards.

Former Member
0 Kudos

yes we can do so.....

but plz make ur requirement more clear

thnks

sahil

0 Kudos

Sahil,

The following is the requirement -

1)We have a report program with a selection screen with fields like Fiscal year and month.

2) We have a custom transaction(type - parameter txn) which is a wrapper of SM30 for a table X

3)The user enters values for fiscal year and period

4)We want the report program to pass the above user input to SM30 of table X and provide table entries with key fields = user-input for user maintenance.

Regards

Deepthi.