Application Development 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: 

problem with OBLIGATORY

Former Member
0 Kudos

Hi. I have a problem.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS werks TYPE werks_d OBLIGATORY.
PARAMETERS lifnr TYPE lifnr OBLIGATORY.
SELECT-OPTIONS mblnr FOR zvratka_prijemky-mblnr_311.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK b1.


INITIALIZATION.
  sscrfields-functxt_01 = text-013 .

I added a FUNCTION KEY 1. I need it after click to launch some program. But I have OBLIGATORY parameters and when I click the button, I receive a warning that I not all obligatory fields are filled. I can't remove the OBLIGATORY parameter, it's necessary. How to solve this problem? Greetings. P.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

For the FUNCTION KEY make the function type as 'E' and then add your code to call another program in the event block AT SELECTION-SCREE ON EXIT-COMMNAD.

try like this

AT SELECTION-SCREE ON EXIT-COMMNAD.

PARAMETERS werks TYPE werks_d OBLIGATORY.

PARAMETERS lifnr TYPE lifnr OBLIGATORY.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS mblnr FOR zvratka_prijemky-mblnr_311.

SELECTION-SCREEN: FUNCTION KEY 1.

SELECTION-SCREEN END OF BLOCK b1.

if useful reward some points.

with regards,

Suresh.A

10 REPLIES 10

0 Kudos

Hi,

For the FUNCTION KEY make the function type as 'E' and then add your code to call another program in the event block AT SELECTION-SCREE ON EXIT-COMMNAD.

Regards,

Sesh

former_member150733
Contributor
0 Kudos

The function key you added must be given the Function Type as 'E'. Then you can use the at exit-command variant of at selection screen to exit the program.

Former Member

Hi,

Instead of checking the obligatory check in the screen field

check in the at selection screen if not werks is initial and sy-ucomm = 'ONLI'

then proceed ur logic or goto some logic.

but remove obligatory definition and check it in further processing

Regards,

Nandha

regard if it helps

Former Member
0 Kudos

hi,

For the FUNCTION KEY make the function type as 'E' and then add your code to call another program in the event block AT SELECTION-SCREE ON EXIT-COMMNAD.

try like this

AT SELECTION-SCREE ON EXIT-COMMNAD.

PARAMETERS werks TYPE werks_d OBLIGATORY.

PARAMETERS lifnr TYPE lifnr OBLIGATORY.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS mblnr FOR zvratka_prijemky-mblnr_311.

SELECTION-SCREEN: FUNCTION KEY 1.

SELECTION-SCREEN END OF BLOCK b1.

if useful reward some points.

with regards,

Suresh.A

0 Kudos

Thanks for replying. But where to set that 'E' property?

0 Kudos

Hi

U can't assign the characteristic to your function code, so you need to delete the OBLIGATORY option and manage it in the event AT SELECTION-SCREEN.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS werks TYPE werks_d.
PARAMETERS lifnr TYPE lifnr.
SELECT-OPTIONS mblnr FOR zvratka_prijemky-mblnr_311.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK b1.
 
 
INITIALIZATION.
  sscrfields-functxt_01 = text-013 .

AT SELECTION-SCREEN.

 IF SSCRFIELDS-UCOMM = 'FC01'. 
    ... 
 ELSE.
   IF WERKS IS INITIAL.
     MESSAGE E208(00) WITH 'Insert the Plant'.
   ENDIF.
   
   IF LIFNR IS INITIAL.
     MESSAGE E208(00) WITH 'Insert Vendor Code'.
   ENDIF.
 ENDIF.

Max

0 Kudos

YOu must have created the GUI Status / PF-Status.

Go To SE41 & give program name & GUI Status Name (which contains the FUnction Key)

Double Click on the Function Key to make the changes.

Message was edited by:

Anish Thomas

0 Kudos

But that button is not in the STATUS GUI, it's in the code.

0 Kudos

Hi

<b>DON'T CHANGE THE STATUS</b>, it's a std one and used for all reports with a selection-screen.

Use the event AT SELECTION-SCREEN to check of the user has filled the mandatory inputs just as I explianed you in my previous answer.

Max

0 Kudos

How to do such thing?

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS werks TYPE werks_d.
PARAMETERS lifnr TYPE lifnr.
SELECT-OPTIONS mblnr FOR zvratka_prijemky-mblnr_311.
SELECTION-SCREEN: FUNCTION KEY 1.
SELECTION-SCREEN END OF BLOCK b1.


INITIALIZATION.
  sscrfields-functxt_01 = text-013 .
AT SELECTION-SCREEN.
 IF SSCRFIELDS-UCOMM = 'FC01'.
   WRITE: 'some text'.
 ELSE.
   IF WERKS IS INITIAL.
     MESSAGE E208(00) WITH 'Insert the Plant'.
   ENDIF.

   IF LIFNR IS INITIAL.
     MESSAGE E208(00) WITH 'Insert Vendor Code'.
   ENDIF.
 ENDIF.

in that situation I receive a message that no documents were found (so I assume that programm continued working), text doesn't show on the screen