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

At-selection-screen modification

Former Member
0 Likes
1,827

Hi Experts,

I am doing the selection screen modification. The selection screen is designed such as i have two radio buttons 1. header & 2. Item anb beside header radio button i have field sales document number and beside item radio button sales item number field.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-005.
SELECTION-SCREEN: position 32.
parameter:p_sh type c radiobutton group rg.                "Sales header
selection-screen: comment 35(15) for field p_sh.
selection-screen: comment 60(20) for field p_vbeln.
parameter:p_vbeln like vbak-vbeln MODIF ID gp5.            "Sales Document
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: position 32.
parameter:p_si type c radiobutton group rg.                "Sales Item
selection-screen: comment 35(15) for field p_si.
selection-screen: comment 60(20) for field p_posnr.
parameter:p_posnr like vbap-posnr MODIF ID gp6.            "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: skip.

This is the selection screen code where for sales document i have assiged Modif id GP5 for Item Modif id GP6. so when i check radio button p_sh ( header ) then sales document ( p_vbeln) shoudl be active for input .

if i check p_si (item) then both saleds document (p_vbeln) and p_posnr both have different group names i.e GP5 & GP6 should be active. i.e screen-inpu = 1.

I have written the following code for header but for item i am unable to make screen-input = 1 for two different groups. how to do that?

 LOOP AT SCREEN.

    IF ( P_SH NE 'X' AND SCREEN-GROUP1 EQ 'GP5' ) OR
       ( P_SI NE 'X' AND SCREEN-GROUP1 EQ 'GP6' ).

      screen-input = 0.
      MODIFY SCREEN.
      ENDIF.
    ENDLOOP. 

This code is working when i click header radio button but for when i click item radio button (p_si) only item field is active i am unable to make sales docuemnt active at same time. please help me in this regard.

Regards,

sunil kairam.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,782

Hi,

Try this.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) TEXT-005.
SELECTION-SCREEN: POSITION 32.
PARAMETER:P_SH TYPE C RADIOBUTTON GROUP RG USER-COMMAND CMD DEFAULT 'X'.                "Sales header
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SH.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_VBELN.
PARAMETER:P_VBELN LIKE VBAK-VBELN MODIF ID GP5.            "Sales Document
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: POSITION 32.
PARAMETER:P_SI TYPE C RADIOBUTTON GROUP RG.                "Sales Item
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SI.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_POSNR.
PARAMETER:P_POSNR LIKE VBAP-POSNR MODIF ID GP6.            "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: SKIP.


AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ) .
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Thanks & Regards

Rahul

18 REPLIES 18
Read only

Former Member
0 Likes
1,782

Hi, Sunil!

At first u should define first radio button with user-command key word to activate PAI (and of course PBO then) event.

parameter:p_sh type c radiobutton group rg user-command radio_fcode.

Then just describe PBO event.

at selection-screen output.
  LOOP AT SCREEN.
    check screen-GROUP1 eq 'GP6'.
    if p_si eq 'X'.
      screen-input = 1.
    else.
      screen-input = 0.
    endif.
    MODIFY SCREEN.
  ENDLOOP.

have a good luck!

Peter Plenkov

Read only

0 Likes
1,782

Hi Peter,

Thanks for your quick response.

I have declared the USER-COMMAND key word in my first radio button which is not showin in my earlier code.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-002.
SELECTION-SCREEN: position 32.
Parameters: p_ct type c radiobutton group rg default 'X'
                                        USER-COMMAND mod.        "Central Texts
selection-screen: comment 35(15) for field p_ct.
selection-screen: comment 60(20) for field p_kunnr.
parameter:p_kunnr like kna1-kunnr MODIF ID gp1.                   "Customer
SELECTION-SCREEN: END OF LINE.

i just want to know that can we make screen-input = 1 for 2 differnt group names i.e gp5 & gp6 by checking only one radio button.

Regard,

Sunil kairam.

Read only

0 Likes
1,782

hI,

This is what i did..Please see



SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-005.
SELECTION-SCREEN: POSITION 32.
PARAMETER:p_sh TYPE c RADIOBUTTON GROUP rg USER-COMMAND ppt.                "Sales header
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD p_sh.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD p_vbeln.
PARAMETER:p_vbeln LIKE vbak-vbeln MODIF ID gp5.            "Sales Document
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: POSITION 32.
PARAMETER:p_si TYPE c RADIOBUTTON GROUP rg.                "Sales Item
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD p_si.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD p_posnr.
PARAMETER:p_posnr LIKE vbap-posnr."MODIF ID gp6.            "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: SKIP.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-group1 EQ 'GP5'.
    IF p_si EQ 'X'.
      screen-input = 1.
    ELSE.
      screen-input = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

.

Regards,

nagaraj

Read only

0 Likes
1,782

Hi Nagaraj,

Thanks for the response.

But if i try as what u mentioned above then if the radio buttion p_sh is checked the item field p_posnr will be in active. .i.e sceen-input will be 1 for item field.

my requirement is like if i check the header radio button p_sh then only field p_vbeln should be as input field and item field p_posnr should not be input field. When i check the radio buttion p_si then both p_vbeln and p_posnr should be input field. Thant's why i decaled two groups for each field.

Is this possible??

Thanks in advance.

Regards,

Sunil kairam.

Read only

0 Likes
1,782

Hi,

The code specified by Peter is correct for your requirement..Please check the code .

Regards,

Nagaraj

Read only

0 Likes
1,782

removed

Edited by: sunil kairam on Oct 1, 2009 3:44 PM

Read only

former_member404244
Active Contributor
0 Likes
1,782

removed...

Read only

Former Member
0 Likes
1,784

Hi,

Try this.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) TEXT-005.
SELECTION-SCREEN: POSITION 32.
PARAMETER:P_SH TYPE C RADIOBUTTON GROUP RG USER-COMMAND CMD DEFAULT 'X'.                "Sales header
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SH.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_VBELN.
PARAMETER:P_VBELN LIKE VBAK-VBELN MODIF ID GP5.            "Sales Document
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: POSITION 32.
PARAMETER:P_SI TYPE C RADIOBUTTON GROUP RG.                "Sales Item
SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SI.
SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_POSNR.
PARAMETER:P_POSNR LIKE VBAP-POSNR MODIF ID GP6.            "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: SKIP.


AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ) .
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Thanks & Regards

Rahul

Read only

0 Likes
1,782

Hi Rahul,

the code u have written

AT SELECTION-SCREEN OUTPUT.
 
  LOOP AT SCREEN.
 
    IF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ) .
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ).
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

is working fine... but my concern is before i un check any of the radio buttion both fields input-screen should be 0. Can you help me on this.

Regards,

Sunil kairam.

Read only

0 Likes
1,782

HI Sunil,

as both the radio buttons belong to the same group so we can check only one at a time..the requirement which you specified earlier should work fine with Peters code. I don't understand where you are facing the problem.

else you can try other way .

Create two radio buttons , one radio button having two fields header and item and the other radiobutton is having only header.

Header radio btton is checked by default. so the header field (vbeln) is ready for input and at the same time the item radio button is uncehcked and both the fields are in display mode. when i click on item radio button the two fileds now ready for input and the header radio button field is disabled..

Regards,

Nagaraj

Read only

0 Likes
1,782

Hi Nagraj,

The requirement is like this,

Selection-screen code:

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-002.
SELECTION-SCREEN: position 32.
Parameters: p_ct type c radiobutton group rg default 'X'
                                        USER-COMMAND mod.        "Central Texts
selection-screen: comment 35(15) for field p_ct.
selection-screen: comment 60(20) for field p_kunnr.
parameter:p_kunnr like kna1-kunnr MODIF ID gp1.                   "Customer
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: begin of line.
SELECTION-SCREEN: position 32.
parameters: p_cp type c radiobutton group rg.                  "Contact Person
selection-screen: comment 35(15) for field p_cp.
SELECTION-SCREEN: end of line.

SELECTION-SCREEN: begin of line.
SELECTION-SCREEN: position 32.
parameters: p_sd type c radiobutton group rg.                 "Sales & Distribution
selection-screen: comment 35(25) for field p_sd.
SELECTION-SCREEN: end of line.
SELECTION-SCREEN: skip.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) text-005.
SELECTION-SCREEN: position 32.
parameter:p_sh type c radiobutton group rg.                "Sales header
selection-screen: comment 35(15) for field p_sh.
selection-screen: comment 60(20) for field p_vbeln.
parameter:p_vbeln like vbak-vbeln MODIF ID gp5.            "Sales Document
SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: position 32.
parameter:p_si type c radiobutton group rg.                "Sales Item
selection-screen: comment 35(15) for field p_si.
selection-screen: comment 60(20) for field p_posnr.
parameter:p_posnr like vbap-posnr MODIF ID gp6.            "Sales Document Item
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: skip.

Here first 1 have 3 radio buttions if any one is check the field p_kunnr should be input ready and fields p_vbeln and p_posnr should be not ready for input.

when i check the radio button p_sh (header) only p_vbeln should be input ready and fields p_kunnr and p_posnr should be disabled.

when i check radio buttion p_si (item) field p_vbeln & p_posnr should be ready for input and p_kunnr should be not be active.

mean while in b/w i have differnt radio buttions but i am unable to paste code so i am taking example for this two only....

Hope it is clear..

Regards,

Sunil kairam.

Read only

0 Likes
1,782

Hi,

Check this piece of code changed a bit.


PARAMETERS : p_ct  RADIOBUTTON GROUP grp .
SELECT-OPTIONS : s_kunnr FOR kna1-kunnr, 
PARAMETERS : p_sh RADIOBUTTON GROUP grp.
SELECT-OPTIONS : s_vbeln  FOR vbak-vbeln,                 
PARAMETERS : p_si  RADIOBUTTON GROUP grp.
SELECT-OPTIONS : s_vbeln1  FOR vbak-vbeln,
                               s_posnr   for vbak-posnr.



IF p_ct  IS NOT INITIAL .

    LOOP AT SCREEN.

      CASE screen-name.

        WHEN 'S_KUNNR-LOW'.
          screen-input = 1.
          MODIFY SCREEN.
         WHEN 'S_KUNNR-HIGH'.
          screen-input = 1.
          MODIFY SCREEN.

           WHEN 'S_VBELN-LOW'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_VBELN-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_VBELN1-LOW'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_VBELN1-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.


        WHEN 'S_POSNR-LOW'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_POSNR-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.

    
      ENDCASE.

    ENDLOOP.


  ELSEIF p_sh IS NOT INITIAL.

    LOOP AT SCREEN.

      CASE screen-name.

        WHEN 'S_KUNNR-LOW'.
          screen-input = 0.
          MODIFY SCREEN.
         WHEN 'S_KUNNR-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.

           WHEN 'S_VBELN-LOW'.
          screen-input = 1.
          MODIFY SCREEN.

        WHEN 'S_VBELN-HIGH'.
          screen-input = 1.
          MODIFY SCREEN.

        WHEN 'S_VBELN1-LOW'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_VBELN1-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.


        WHEN 'S_POSNR-LOW'.
          screen-input = 0.
          MODIFY SCREEN.

        WHEN 'S_POSNR-HIGH'.
          screen-input = 0.
          MODIFY SCREEN.

    
      ENDCASE.

    ENDLOOP.

now one more ELSEIF p_si IS NOT INITIAL

now make s_vbeln1 and s_posnr as input 1 and rest others as input 0.

endif.

Regards,

Nagaraj

Read only

0 Likes
1,782

Hey Nagraj,

Its working fine now.. thanks for the solution.

Regards,

Sunil kairam.

Read only

0 Likes
1,782

>

> Here first 1 have 3 radio buttions if any one is check the field p_kunnr should be input ready and fields p_vbeln and p_posnr should be not ready for input.

>

> when i check the radio button p_sh (header) only p_vbeln should be input ready and fields p_kunnr and p_posnr should be disabled.

>

> when i check radio buttion p_si (item) field p_vbeln & p_posnr should be ready for input and p_kunnr should be not be activ

.

As i understand, u mean this:

at selection-screen output.
  LOOP AT SCREEN.
    screen-input = 0.
    case screen-group1.
      when 'GP1'.
        if p_ct eq 'X' or p_cp eq 'X' or p_sd eq 'X'.
          screen-input = 1.
        endif.
      when 'GP5'.
        if p_si eq 'X' or p_sh eq 'X'.
          screen-input = 1.
        endif.
      when 'GP6'.
        if p_si eq 'X'.
          screen-input = 1.
        endif.
      when others.
        continue.
    endcase.
    MODIFY SCREEN.
  ENDLOOP.

Read only

Former Member
0 Likes
1,782

HI SUNIL,

USE THIS ITS WORKING FINE

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(30) text-005.

SELECTION-SCREEN: position 32.

parameter:p_sh type c radiobutton group rg. "Sales header

selection-screen: comment 35(15) for field p_sh.

selection-screen: comment 60(20) for field p_vbeln.

parameter:p_vbeln like vbak-vbeln MODIF ID gp5. "Sales Document

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: position 32.

parameter:p_si type c radiobutton group rg. "Sales Item

selection-screen: comment 35(15) for field p_si.

selection-screen: comment 60(20) for field p_posnr.

parameter:p_posnr like vbap-posnr MODIF ID gp6. "Sales Document Item

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: skip.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ) .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ELSEIF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).

SCREEN-INPUT = 0.

MODIFY SCREEN.

ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' AND SCREEN-GROUP1 EQ 'GP5').

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

REGARDS

RAVI

Read only

Former Member
0 Likes
1,782

HI SUNIL ,

IF YOU HAVE 2 RADIO BUTTONS I THINK IT IS NOT POSSIBLE

ONE SHOULD BE DEFAULT.

REGARDS

Read only

0 Likes
1,782

Hi Ravi,

I have more than 2 radio buttions . I am unable to paste code.

Thanks ,

Sunil kairam.

Read only

Former Member
0 Likes
1,782

HI SUNIL ,

CHECK THIS

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: POSITION 32.

PARAMETER:P_SH2 TYPE C RADIOBUTTON GROUP RG USER-COMMAND CMD DEFAULT 'X'. "Sales Item

SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SH2. "Sales Document Item

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(30) TEXT-005.

SELECTION-SCREEN: POSITION 32.

PARAMETER:P_SH TYPE C RADIOBUTTON GROUP RG. "Sales header

SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SH.

SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_VBELN.

PARAMETER:P_VBELN LIKE VBAK-VBELN MODIF ID GP5. "Sales Document

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN: POSITION 32.

PARAMETER:P_SI TYPE C RADIOBUTTON GROUP RG. "Sales Item

SELECTION-SCREEN: COMMENT 35(15) FOR FIELD P_SI.

SELECTION-SCREEN: COMMENT 60(20) FOR FIELD P_POSNR.

PARAMETER:P_POSNR LIKE VBAP-POSNR MODIF ID GP6. "Sales Document Item

SELECTION-SCREEN: END OF LINE.

SELECTION-SCREEN: SKIP.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ) .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ELSEIF ( P_SH EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).

SCREEN-INPUT = 0.

MODIFY SCREEN.

ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP6' ).

SCREEN-INPUT = 1.

MODIFY SCREEN.

ELSEIF ( P_SI EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' ).

SCREEN-INPUT = 1.

MODIFY SCREEN.

ELSEIF ( P_SH2 EQ 'X' AND SCREEN-GROUP1 EQ 'GP5' OR SCREEN-GROUP1 EQ 'GP6' ).

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.