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: 

Auto selection of a value on selection screen field of a report program

former_member191434
Participant
0 Kudos
427

Dear Gurus,

I have encountered a case in a report program, if i select a vendor code in selection screen, simultaneously the region code of that vendor should come automatically to the next parameter(ie region code). Is it possible..if then how?

Thanks in Advance

Saif

1 ACCEPTED SOLUTION

Former Member
0 Kudos
104

Hi,

This is possible by screen modifiction.

Use

Loop at screen.

Modify........

Endloop.

For more details search in SDN and abapdocu.

Cheers,

Rudhir

8 REPLIES 8

Former Member
0 Kudos
105

Hi,

This is possible by screen modifiction.

Use

Loop at screen.

Modify........

Endloop.

For more details search in SDN and abapdocu.

Cheers,

Rudhir

Former Member
0 Kudos
104

you will need to create a help view for both fields and attach it to the fields at structure / table level.

You can find detailed instruction here in SDN itself.

-Raj

Former Member
0 Kudos
104

Hi Saifur,

write the code in the at selection-screen output.

Try this logic.

TABLES :

SCARR ,

SPFLI ,

SFLIGHT ,

SBOOK .

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME .

PARAMETERS :

P_FLIGHT RADIOBUTTON GROUP R1 ,

P_BOOK RADIOBUTTON GROUP R1 .

SELECTION-SCREEN END OF BLOCK B1 .

SELECT-OPTIONS S_FLDATE FOR SFLIGHT-FLDATE DEFAULT '20090101' TO

'20090131'.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME .

PARAMETERS :

P_TEMP1 RADIOBUTTON GROUP R2 MODIF ID SC1 ,

P_TEMP2 RADIOBUTTON GROUP R2 MODIF ID SC1 .

SELECT-OPTIONS S_CARRID FOR SCARR-CARRID MODIF ID SC1 .

SELECTION-SCREEN END OF BLOCK B2 .

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.

PARAMETERS :

P_TEMP01 RADIOBUTTON GROUP R3 MODIF ID SC2 ,

P_TEMP02 RADIOBUTTON GROUP R3 MODIF ID SC2 .

SELECT-OPTIONS S_BOOKID FOR SBOOK-BOOKID MODIF ID SC2 .

SELECTION-SCREEN END OF BLOCK B3 .

AT SELECTION-SCREEN OUTPUT .

IF P_FLIGHT = 'X' .

FL_FLAG = 1 .

LOOP AT SCREEN .

IF SCREEN-GROUP1 = 'SC2' .

SCREEN-ACTIVE = 0 .

MODIFY SCREEN .

ENDIF.

ENDLOOP.

ELSEIF P_BOOK = 'X' .

FL_FLAG = 2 .

LOOP AT SCREEN .

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-ACTIVE = 0 .

MODIFY SCREEN .

ENDIF.

ENDLOOP.

ENDIF .

On pressing Enter use sy-ucomm value onli to do that and then write the above logic for another select-option.

Much Regards,

Amuktha.

Edited by: Amuktha Naraparaju on Mar 12, 2009 1:24 PM

0 Kudos
104

Dear Amuktha,

Thanks for your early reply.

Is it possible to fill the value, without pressing the 'Enter' button. ie When vendor is selected, both vendor and region fill in the parameter fields.

Thanks & regards,

Saif

0 Kudos
104

Hi Saif,

It is possible to do so using user-command.

data :

p_r1 radiobutton group gr1 user-command 'ONLI',

p_r2 radiobutton group gr1 .

With this when you just click the radiobutton the other field will pop up.

Much Regards,

Amuktha.

Edited by: Amuktha Naraparaju on Mar 12, 2009 2:10 PM

0 Kudos
104

Hi,

If vendor is not a radiobutton then its not possible.

if its a radiobutton then what Amukta said will surely work

Regards,

Siddarth

Former Member
0 Kudos
104

i "at selection screen output" retrieve the value and loop at screen

and when the particular screen element is encountered assign it value and

modify screen.

кu03B1ятu03B9к

Former Member
0 Kudos
104

hi,

on the selection screen, once the user writes the vendor code and presses enter, it triggers at selection-screen event.

here modification of screen is not required....

so in

AT SELECTION-SCREEN. " event

write the select query to fetch the region code and assign it to the region field of the screen.

Regards,

Siddarth