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

Passing selection screen values to the next report using CALL TRANSACTION

Former Member
0 Likes
7,745

Hi experts,

I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.

I want to display in the next report the selections that the user previously selected.

First report:


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.

CALL TRANSACTION 'ZKKBC_PKO_2'.

Anyone can help me?

Thanks,

Lawrence

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,633

Anyone can help?

Hi experts,

I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.

I want to display in the next report the selections that the user previously selected.

First report:


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.

CALL TRANSACTION 'ZKKBC_PKO_2'.

Anyone can help me?

Thanks,

Lawrence

19 REPLIES 19
Read only

Former Member
0 Likes
3,633

HI,

1. Find out the PID ( Parameter IDs ) of the variables .

2. Pass the values into these parameter ids before you call the transaction.

3. call transaction in the normal way

The second way is that you can write a small BDC only for the first screen of the transaction and pass the values

Hope this helps,

Raj

Read only

Former Member
0 Likes
3,633

Hi

Use SET PARAMETER ID in your first program. 
" Just go to the Screen painter of the Selection Screen and in the attribute of these fields add below PARAMETER IDs
for COEP-PERIO use VPE as PARAMETER ID
for COEP-GJAHR use GJR as PARAMETER ID
for WERKS          use WRK as PARAMETER ID

Cheerz

Ram

Read only

Former Member
0 Likes
3,633

Hi,

If the transaction fields ZKKBC_PKO_2 has parameter id.You can find parameter id in Data element of the field.

You can pass the values like.

SET PARAMETER ID 'KUN' FIELD COMP.

here the value of COMP will be passed to parameter id field 'KUN'.Then call the transaction.

CALL TRANSACTION 'ZKKBC_PKO_2'.

If you dont hvae fileds with parameter id the use BDC via Call transaction method.

regards,

Shanmugavel Chandrasekaran

Read only

0 Likes
3,633

Hi Shanmugavel,

It works for me now. but now i wanna put the value in the selection screen. So when the user reaches the next screen the values can be displayed.

Can this be done?

Thanks,

Lawrence

Read only

0 Likes
3,633

Did you get any chance to read [this document|http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm]?

Read only

0 Likes
3,633

Hi experts,

What i did is this:

Using SET PARAMETER

in the first report

 
SET PARAMETER ID 'WRK' FIELD COMP.
SET PARAMETER ID 'VPE' FIELD PERIOD.
SET PARAMETER ID 'GJR' FIELD YEAR.

CALL TRANSACTION 'ZKKBC_PKO_2'.

Second Report


SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: WRK     LIKE AFRU-WERKS.
PARAMETERS: VPE     LIKE COEP-PERIO.
PARAMETERS: GJR     LIKE COEP-GJAHR.
SELECTION-SCREEN END OF BLOCK blk1.

Using SUBMIT

First Report


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
SELECTION-SCREEN END OF BLOCK b1.

SUBMIT ZCO_PRDCOST_ACTUAL_2 VIA SELECTION-SCREEN USING SELECTION-SETS OF PROGRAM 'ZCO_PRDCOST_ACTUAL_1' AND RETURN.

Second Report:


GET PARAMETER ID 'WRK' FIELD comp.
GET PARAMETER ID 'VPE' FIELD COEP-PERIO.
GET PARAMETER ID 'GJR' FIELD YEAR.

Either this 2 ways i still cannot get the first report selection values on the 2nd report. Can someone help me see if my codes is correcT?

Read only

Former Member
0 Likes
3,633

Hi,

Please try to use SUBMIT program instead of CALL TRANSACTION.

Hope this helps,

Regards,

Chandravadan

Read only

Former Member
0 Likes
3,633

hi ,

if it is executable kind of program then you can use this thread

if it is module pool kind of tcode then you can use parameter id for this program.

the answer is in the same thread

cheers

s.janagar

Read only

Former Member
0 Likes
3,633

hi,

set the parameter id.

pass the value in the call transaction statement...

Read only

Former Member
0 Likes
3,634

Anyone can help?

Read only

0 Likes
3,633

<li>You can use Memory id with Parameters statement, it works. <li>Calling program

SET PARAMETER ID 'WRK' FIELD comp.
SET PARAMETER ID 'VPE' FIELD period.
SET PARAMETER ID 'GJR' FIELD year.

CALL TRANSACTION 'ZKKBC_PKO_2'.
<li>In Called program
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: wrk     LIKE afru-werks MEMORY ID wrk.
PARAMETERS: vpe     LIKE coep-perio MEMORY ID vpe.
PARAMETERS: gjr     LIKE coep-gjahr MEMORY ID gjr.
SELECTION-SCREEN END OF BLOCK blk1.
Thanks Venkat.O

Read only

0 Likes
3,633

Hi Venkat,

it works!! thanks.

last qn: how do i disable the 3 fields. I do not want the user to edit the information.

Read only

0 Likes
3,633

Anyone can help me with disabling my field?

Read only

0 Likes
3,633

Hi,

at selection-screen output.

loop at screen.
if screen-name = 'P_WERKS'. " 
SCREEN-INPUT = 0.
elseif screen-name = 'SECOND_PARAMETER'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ELSEIF 
SCREEN-INPUT = 0.
MODIFY SCREEN.
elseif screen-name = 'THIRD_PARAMETER'
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

Cheerz

Ram

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,633

>

> Anyone can help?

The reason no one's helping you is "Disabling Selection-Screen fields" is a FAQ. And answering it would be a forum rule violation

Read only

0 Likes
3,633

Hi,

Actually your codes can work. The fields are disabled but all the values are gone in the second screen.

Read only

0 Likes
3,633

Hi ,

did you try the following:

SUBMIT ZCO_PRDCOST_ACTUAL_2
           VIA SELECTION-SCREEN
           AND RETURN
          WITH WRK  = COMP
          WITH VPE  = PERIOD
          WITH GJR = GJAHR.

Read only

0 Likes
3,633

Yes. I did try the following. Now the values get passed to the next report. And i manage to disable the fields. But the problem is when i disabled my fields all the values in it get lost as well...

Guys any ideas for this?

Read only

ThomasZloch
Active Contributor
0 Likes
3,633

I'll leave this open due to everybody's efforts so far, but please search for existing anwers before posting the next question!

Thanks

Thomas