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

Make the fields mandatory in the output using INPUT ON

Former Member
0 Likes
1,611

Hi Experts,

In the report, two fields are coded for output like this

    IF pa_eco = 'X'.                                       

    WRITE  97 it_auftr-zz_herkl INPUT ON.                 
    WRITE 105 it_auftr-zz_stawn INPUT ON.   

In these 2 fields, user will enter the data on the output. Now I need to make these two fields are mandatory.

I attached the output screen.

Please help me. 

Thanks & Regards,

Murali Krishna.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,471

Hi Krishna,

Is it a screen program or executable program with alv list display....If screen program means..we can do it..

so confirm, i can help in that.

Regards,

Praveen Reddy

Hi Experts,

In the report, two fields are coded for output like this

    IF pa_eco = 'X'.                                       

    WRITE  97 it_auftr-zz_herkl INPUT ON.                 
    WRITE 105 it_auftr-zz_stawn INPUT ON.   

In these 2 fields, user will enter the data on the output. Now I need to make these two fields are mandatory.

I attached the output screen.

Please help me. 

Thanks & Regards,

Murali Krishna.

6 REPLIES 6
Read only

Former Member
0 Likes
1,472

Hi Krishna,

Is it a screen program or executable program with alv list display....If screen program means..we can do it..

so confirm, i can help in that.

Regards,

Praveen Reddy

Read only

0 Likes
1,471

Hi Praveen,

This is general executable report, we are not used alv and module pool.

I need to make the fields are mandatory  or place the cursor in the empty field( showed in screen shot ).

Regards,

Murali Krishna.

Message was edited by: MURALI KRISHNA

Read only

0 Likes
1,471

Hi Krishna,

As i have seen some push button on application toolbar to do next process.

So for them you mate written code in AT USER COMMAND event in the program.

Do add code as i mentioned below for particular push button. surely it will work.

find the line position in the output of your output screen and pass to the read statement as below.

For reference, go through below code.

   DATA: input_field TYPE c LENGTH 100,
      line_num TYPE i.

START-OF-SELECTION.
  WRITE 'Input text:'.
  SET BLANK LINES ON.
  FORMAT INPUT .
  WRITE / input_field.
  FORMAT INPUT OFF.

set PF-STATUS 'ZTEST'.
at USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'NEXT'.
    line_num = sy-lilli.
   READ LINE line_num FIELD VALUE input_field.
     IF input_field is INITIAL.
     MESSAGE 'Enter value in input' TYPE 'E'.
    ENDIF.
       WRITE:   'The input was:',
           /  input_field.
  ENDCASE.

Thanks,

Regards,

Praveen Reddy

Read only

0 Likes
1,471

Hi Praveen,

In my program, every thing is going fine as you said.( that code is already developed ).

It will display a popup message when the user not entered the respective value in the field.

I need to place the cursor after showing that message . Please find the screen shot below, when we are click on continue, it will come back to normal screen, after that, I want to place the cursor , on that input field.

Thanks & Regards,

Murali Krishna.

Read only

0 Likes
1,471

Check with standard program : DEMO_LIST_SET_CURSOR_2, this will guide you to put cursor on required field.

Read only

0 Likes
1,471

Check this piece of code which stays in the same screen after the message.

DATA: input_field TYPE c LENGTH 100,
       line_num TYPE i.

START-OF-SELECTION.
   WRITE 'Input text:'.
   SET BLANK LINES ON.
   FORMAT INPUT.
   WRITE / input_field.
   FORMAT INPUT OFF.
   WRITE / '>>> OK <<<' COLOR 5 HOTSPOT.

AT LINE-SELECTION.
   IF sy-lisel = '>>> OK <<<'.
     line_num = sy-lilli - 1.
     READ LINE line_num FIELD VALUE input_field.
     IF input_field IS NOT INITIAL.
       WRITE:   'The input was:',
              /  input_field.
     ELSE.
       MESSAGE i888(sabapdocu) with 'Enter something'.

       set CURSOR field input_field.

     ENDIF.
   ENDIF.


thanks.

Message was edited by: Aswatha Narayana SA