Skip to Content
author's profile photo Former Member
Former Member

how can i used pai in screen 1000 to change the select-options field?

hi,all.

I want used pai to change the select-options field,but it can't works.

the mainly code is:

REPORT ZTEST99.

TABLES :MARA,MAKT,MARC.

SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TITLE0 .

select-options:s_matnr for mara-matnr,

s_werks for marc-werks MODIF ID ID1.

SELECTION-SCREEN END OF BLOCK B0.

parameters:p_flag as checkbox.

at selection-screen OUTPUT.

LOOP AT SCREEN.

IF P_FLAG = 'X' .

IF screen-group1 = 'ID1'.

screen-input = '0'.

ELSE.

screen-input = '1'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

START-OF-SELECTION.

CALL SCREEN 1000.

************

when i click p_flag,then i want to change s_werks from OBLIGATORY to no OBLIGATORY.

how can i realized?

Thanks for all.

Sun

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:22 AM

    Hi,

    REPORT ZTEST99.

    TABLES :MARA,MAKT,MARC.

    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TITLE0 .

    select-options:s_matnr for mara-matnr,

    s_werks for marc-werks MODIF ID ID1.

    SELECTION-SCREEN END OF BLOCK B0.

    parameters:p_flag as checkbox user-command ucm.

    at selection-screen OUTPUT.

    LOOP AT SCREEN.

    IF P_FLAG = 'X' .

    IF screen-group1 = 'ID1'.

    screen-input = '0'.

    screen-required = '0'.

    ELSE.

    screen-input = '1'.

    screen-required = '1'

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Try this it will work.

    Thanks,

    Rajinikanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:17 AM

    Hi ,

    I don t think it it possible to set a field as obligatory and then reset it back to non obligatory ,i.e. once a field is set as obligatory it remains obligatory.

    So what i would suggest is to do this check in the program, in the AT selection screen event, check if the check box is checked if it is then check if there is a value in the field.

    Regards

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 10:35 AM

    check the below code.

    REPORT ZTEST99.

    TABLES :MARA,MAKT,MARC.

    SELECTION-SCREEN BEGIN OF BLOCK B0 WITH FRAME TITLE TITLE0 .

    select-options:s_matnr for mara-matnr,

    s_werks for marc-werks MODIF ID ID1.

    SELECTION-SCREEN END OF BLOCK B0.

    parameters:p_flag as checkbox user-command 'cmd'.

    at selection-screen .

    if p_flag = 'X'.

    if s_werks is initial.

    message e208(00) with 'enter value in werks'.

    endif.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:48 PM

    Hi ,

    change your code like this.

    Change in your code:

    SELECTION-SCREEN BEGIN OF SCREEN 100.

    SELECT-OPTIONS : s_matnr for mara-matnr,

    s_werks for marc-werks MODIF ID ID1.

    SELECTION-SCREEN END OF SCREEN 100 .

    At selection-screen.

    if sy-dynnr = '100'.

    IF P_FLAG = 'X' .

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1'.

    screen-required = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    else.

    LOOP AT SCREEN.

    IF screen-group1 = 'ID1'.

    screen-required = 1.

    ENDIF.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    my code :

    REPORT Z50871_SELECTOPS_DYNAMIC.

    PARAMETERS : CH_EBELN AS CHECKBOX,

    CH_VBELN AS CHECKBOX.

    DATA: V_EBELN TYPE EKKO-EBELN,

    V_VBELN TYPE VBAK-VBELN.

    SELECTION-SCREEN BEGIN OF SCREEN 100.

    SELECT-OPTIONS : EBELN FOR V_EBELN MODIF ID G1,

    VBELN FOR V_VBELN MODIF ID G2.

    SELECTION-SCREEN END OF SCREEN 100 .

    AT SELECTION-SCREEN OUTPUT.

    IF SY-DYNNR = 100.

    IF CH_EBELN = 'X' AND

    CH_VBELN = ''.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 EQ 'G1'.

    SCREEN-ACTIVE = '1'.

    ELSE.

    SCREEN-ACTIVE = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ELSEIF CH_VBELN = 'X' AND

    CH_EBELN = '' .

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 EQ 'G2'.

    SCREEN-ACTIVE = '1'.

    ELSE.

    SCREEN-ACTIVE = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ELSEIF CH_EBELN = 'X' AND CH_VBELN = 'X'.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 EQ 'G1'

    OR SCREEN-GROUP1 EQ 'G2' .

    SCREEN-ACTIVE = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    ENDIF.

    AT SELECTION-SCREEN.

    IF SY-DYNNR = 1000.

    IF CH_EBELN = 'X' OR CH_VBELN = 'X'.

    CALL SELECTION-SCREEN 100.

    ELSE.

    MESSAGE I000(Z50871MSG) WITH 'Please select atleast one checkbox'.

    ENDIF.

    ENDIF.

    regards

    Sandeep Reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 12:42 AM

    hi,all

    Thank you Very much .

    The problem has been solved

    IF you have not get the points,please contact me

    Sun

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.