Application Development and Automation 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: 
Read only

Urgent help: parameter passing.........

Former Member
0 Likes
1,184

Hi all,

I want to pass 5 parameters from a module-pool program to a transaction 'VL74'.

i.e. on a certain user-action 5 parameters from the calling program will fill-up the select-options of the called transaction 'VL74'. Can anybody suggest how to implement this. A bit of coding will be useful.

Regards,

Mainak.

8 REPLIES 8
Read only

Former Member
0 Likes
976

hi

you have to set SAP memory for that parameters..

and then call the transaction code

example:


SET PARAMETER ID 'XXX' FIELD var1.
SET PARAMETER ID 'YYY' FIELD var2.
SET PARAMETER ID 'ZZZ' FIELD var3.

CALL TRANSACTION 'VL74' AND SKIP FIRST SCREEN.

description:

you can get the PARAMETER ID for a field by clicking F1, go to Techical settings. Double click on the data element. Go to 'Further Characteristics'. You can find PARAMETER ID there.

example:

NAC is the PARAMETER ID for 'Output Type' of t-code VL74.

And the value you want to pass into that field is '0001'.

so you can code as


data: KSCHL type NA_KSCHL.
KSCHL = '0001'
SET PARAMETER ID 'NAC' FIELD kschl.
--
--
--

similarly set the PARAMETER ID for other fields also.

thx

pavan

Read only

Former Member
0 Likes
976

Hi Mainak

If you can find parameter-id's for all the 5 fields go by

SET PARAMETER ID <pid> FIELD <val>.

OR

As VL74 is a report transaction, you can use the approach:

SUBMIT SD70AV6A 
  WITH KSCHL = <kschl>
  ....

Hope this gives you an idea.

Regards

Eswar

Read only

Former Member
0 Likes
976

submit... WITH SELECTION-TABLE seltab

Effect

seltab is an internal table with the structure RSPARAMS.

This variant allows you to set the names and contents of the parameters and selection options dynamically at runtime.

You can use the function module RS_REFRESH_FROM_SELECTOPTIONS to read the contents of the parameters and selection options of the current program into an internal table seltab with the structure RSPARAMS. By using SUBMIT ... WITH SELECTION-TABLE seltab, you can then pass these values on directly.

-


Fetch all the fields into an internal table structure RSPARAMS and then use this command.

Seee if this can help you.

regards,

vijay.

Read only

Former Member
0 Likes
976

Hi ,

Check this out .

A sample program

First get the program for VL74 thru tstc and popluate in report1 or hard code the program name .

Program accessed

REPORT report1.

DATA text(10) TYPE c.

SELECTION-SCREEN BEGIN OF SCREEN 1100.

SELECT-OPTIONS: selcrit1 FOR text,

selcrit2 FOR text.

SELECTION-SCREEN END OF SCREEN 1100.

...

Calling program

REPORT report2.

DATA: text(10) TYPE c,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ABAP'.

APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'H'.

APPEND range_line TO range_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'K'.

APPEND range_line TO range_tab.

SUBMIT report1 USING SELECTION-SCREEN '1100'

WITH SELECTION-TABLE rspar_tab

WITH selcrit2 BETWEEN 'H' AND 'K'

WITH selcrit2 IN range_tab

AND RETURN.

Please reward if useful.

Read only

Former Member
0 Likes
976

Hi Mainak,

Go to transaction VL74 and check the parameter ID's of all the fields(On pressing F1 on the field you will get a subscreen in that you will get these parameter ID's) and use these parameters ID's in

SET PARAMETER ID 'XXX' FIELD var1.

SET PARAMETER ID 'YYY' FIELD var2.

SET PARAMETER ID 'ZZZ' FIELD var3.

After that call transaction

CALL TRANSACTION CODE 'VL74' AND SKIP FIRST SCREEN.

Read only

Former Member
0 Likes
976

You can use as below

SET PARAMETER ID 'BUK' FIELD wa-bukrs.
SET PARAMETER ID 'WRK' FIELD wa-werks.

similarly find the parameter id by doing F1 on the corresponding field > technical information you can get the ID.

CALL TRANSACTION 'VL74' AND SKIP FIRST SCREEN.

Hope this solves ur problem.

Rewars points if this helps.

Read only

0 Likes
976

Unfortunately....among the 5 parameters to be passed only parameter-ID of 1 field i.e output-type (in VL74) exists. So how to get the other ones. Even if i try to create new IDs....is it recommended?

Mainak.

Read only

Former Member
0 Likes
976

Hi ,

Check out my reply you don't require parameter Ids.