2012 Dec 28 10:48 AM
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.
2012 Dec 28 12:03 PM
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.
2012 Dec 28 12:03 PM
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
2012 Dec 28 2:09 PM
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
2012 Dec 29 6:17 AM
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
2012 Dec 31 6:27 AM
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.
2012 Dec 31 6:42 AM
Check with standard program : DEMO_LIST_SET_CURSOR_2, this will guide you to put cursor on required field.
2012 Dec 31 7:14 AM
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