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

doubt in loop at screen

Former Member
0 Likes
779

i am using two dates in the selection screen one is ERDAT and another is BNDDT.

these two fileds are obligatory.

i am using radiobutton to enable these field. look at my coding


  IF p0 = 'X'.
    LOOP AT SCREEN.
      IF screen-name = 'S_BNDAT-LOW' OR
         screen-name = 'S_BNDAT-HIGH' OR
         screen-group1 = 'SC1'.
         screen-input = '0'.
        MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ENDIF.

  IF p1 = 'X'.
    LOOP AT SCREEN.
      IF screen-name = 'S_ERDAT-LOW' OR
         screen-name = 'S_ERDAT-HIGH' OR
         screen-group1 = 'SC1'.
        screen-active = '0'.
         MODIFY SCREEN.
        CLEAR screen.
      ENDIF.
    ENDLOOP.
  ENDIF.

if i select p1 ,the screen displays error message like fill in all required entry.

if the fileds are not obligatory its working fine.

how to over come this.

Regards,

Bala

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:48 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
749

Hi ,

When you use obligatory you cannot hide the fields in selection screen. So remove the word obligatory.

If input is not given to your field then display some error message manually.

Place ur error message in


AT SELECTION-SCREEN.

IF p_erdat is initial.
message text-001 type 'E'.

ELSEIF p_bnddt is initial.
message text-002 type 'E'.
ENDIF.  

Thanks,

Srilakshmi.

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:49 PM

5 REPLIES 5
Read only

former_member404244
Active Contributor
0 Likes
749

Hi,

if u are making the fields obligatory then u cannot do ur requirement, as SAP checks it first .So don't make the fields obligatory and then see..

Regards,

Nagaraj

Read only

Former Member
0 Likes
749

Instead of marking the field as OBLIGATORY explicitely, use LOOP AT SCREEN to do that.

Set SCREEN-REQUIRED = 1 to mark a field obligatory

Read only

Former Member
0 Likes
749

True,

If the fields are mandatory,its not possible to hide them.Right..

Making fields invisible will work only if u want to enter only one of the two fields..

Read only

Former Member
0 Likes
750

Hi ,

When you use obligatory you cannot hide the fields in selection screen. So remove the word obligatory.

If input is not given to your field then display some error message manually.

Place ur error message in


AT SELECTION-SCREEN.

IF p_erdat is initial.
message text-001 type 'E'.

ELSEIF p_bnddt is initial.
message text-002 type 'E'.
ENDIF.  

Thanks,

Srilakshmi.

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:49 PM

Read only

Former Member
0 Likes
749

hi..

step 1) just use "MODIFY ID " for the field in your selection-screen to make it into one group.

EX:

select-options: s_cajo for tcj_documents-cajo_number

modif id cas.

step2) in your at selection-screen .

just loop the screen and make it required..as follows:

EX:


    loop at screen.
      if screen-group1 = 'CAS'.
        screen-required = 1.
       screen-input     = 0.
        screen-active    = 1.
        endif.
      modify screen.
    endloop.

I think it will helps you..

UR's

GSANA

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:49 PM