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

selection screen issue

Former Member
0 Likes
607

Hi all,

in my selection screen, initially i got only 2 parameter

for example:

customer ___________

shipment leg ________

if i enter the customer - ABC and shipment leg - 3 and press enter, i want to get 2 parameter(Distance and weight) 3 times(this is based on the value of the shipment leg) on the same screen . Is this possible???. Also there is no radiobutton.

After i press enter,

this has to come 3 times dynamically (Based on the value in shipment leg).

distance _________

weight ___________

distance _________

weight ___________

distance _________

weight ___________

Thanks,

Krishna

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
583

Try this. You have to define all the fields, and only make so many visable.




report zrich_0001.


parameters: p_cust(10) type c,
            p_ship(10) type c,
            p_dis1(10) type c modif id 1,
            p_wgt1(10) type c modif id 1,
            p_dis2(10) type c modif id 2,
            p_wgt2(10) type c modif id 2,
            p_dis3(10) type c modif id 3,
            p_wgt3(10) type c modif id 3,
            p_dis4(10) type c modif id 4,
            p_wgt4(10) type c modif id 4,
            p_dis5(10) type c modif id 5,
            p_wgt5(10) type c modif id 5,
            p_dis6(10) type c modif id 6,
            p_wgt6(10) type c modif id 6,
            p_dis7(10) type c modif id 7,
            p_wgt7(10) type c modif id 7,
            p_dis8(10) type c modif id 8,
            p_wgt8(10) type c modif id 8,
            p_dis9(10) type c modif id 9,
            p_wgt9(10) type c modif id 9.


at selection-screen output.

  loop at screen.

    if screen-group1 > p_ship.
      screen-active = '0'.
    endif.
    modify screen.
  endloop.

Regards,

Rich Heilman

Read only

0 Likes
583

Hello Mr. Heilman,

Thanks for your reply

But it will generate only upto 9 times if my value exceeds that, it also must be generated dynamically.

Is there any such option.

Best Regards

Krishna

Read only

0 Likes
583

You can not do it dynamically. What is the max number of the fields?

Regards,

Rich Heilman

Read only

0 Likes
583

For more fields, we need to change it a bit. Notice that the MODIF IDs have changed as well as the P_SHIP field.




report zrich_0001.

parameters: p_cust(10) type c,
<b>            p_ship(2) type n,</b>
            p_dis1(10) type c modif id 01,
            p_wgt1(10) type c modif id 01,
            p_dis2(10) type c modif id 02,
            p_wgt2(10) type c modif id 02,
            p_dis3(10) type c modif id 03,
            p_wgt3(10) type c modif id 03,
            p_dis4(10) type c modif id 04,
            p_wgt4(10) type c modif id 04,
            p_dis5(10) type c modif id 05,
            p_wgt5(10) type c modif id 05,
            p_dis6(10) type c modif id 06,
            p_wgt6(10) type c modif id 06,
            p_dis7(10) type c modif id 07,
            p_wgt7(10) type c modif id 07,
            p_dis8(10) type c modif id 08,
            p_wgt8(10) type c modif id 08,
            p_dis9(10) type c modif id 09,
            p_wgt9(10) type c modif id 09,
            p_dis10(10) type c modif id 10,
            p_wgt10(10) type c modif id 10,
            p_dis11(10) type c modif id 11,
            p_wgt11(10) type c modif id 11,
            p_dis12(10) type c modif id 12,
            p_wgt12(10) type c modif id 12,
            p_dis13(10) type c modif id 13,
            p_wgt13(10) type c modif id 13,
            p_dis14(10) type c modif id 14,
            p_wgt14(10) type c modif id 14,
            p_dis15(10) type c modif id 15,
            p_wgt15(10) type c modif id 15,
            p_dis16(10) type c modif id 16,
            p_wgt16(10) type c modif id 16,
            p_dis17(10) type c modif id 17,
            p_wgt17(10) type c modif id 17,
            p_dis18(10) type c modif id 18,
            p_wgt18(10) type c modif id 18,
            p_dis19(10) type c modif id 19,
            p_wgt19(10) type c modif id 19,
            p_dis20(10) type c modif id 20,
            p_wgt20(10) type c modif id 20.

at selection-screen output.

  loop at screen.

    if screen-group1 > p_ship.
      screen-active = '0'.
    endif.
    modify screen.
  endloop.

Regards,

Rich Heilman

Read only

0 Likes
583

Hello Heilman,

Thanks a Lot. It really solved my issue.

Regards,

KrishnaKumar

Read only

Former Member
0 Likes
583

Hello Krishna Kumar,

Here are the reasons why I would like you to go for a normal screen (defined through SE51) instead of a selection-screen.

1. You do not have any select-options anyways, so you don't really "need" the selection screen.

2. The correct UI element for your requirement will be either a table control or an ALV Grid. Because if the user enters the shipment leg as 15, then you would end up clutterring your screen.

3. You cannot have an ALV / Table control on the selection screen

4. It is technically not possible to have such dynamic number of elements on the screen.

Regards,

Anand Mandalika.

Read only

Former Member
0 Likes
583

Hi Krishnakumar,

Put all the required parameters( 2 initial parameters and the 3 set of new parameters ) as inivisible initially.

Whatever you want to display after pressing the ENTER key can be assigned to a group (say GR1). Do the following steps:

1) Define a global variable (say FLAG) which is initialised to zero.

2) In PBO , write like this

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'GR1' AND FLAG = 0.

SCREEN-ACTIVE = 0.

ELSE.

SCREEN-ACTIVE = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

3) At PAI, set the flag to 1 for the function code for ENTER Key.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN 'ENTER'.

FLAG = 1.

ENDCASE.

This will solve your problem.

Regards,

SP.

Read only

0 Likes
583

I have to agree with Anand here. A table control would be better for this.

Regards,

Rich Heilman