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

problem with OBLIGATORY

Former Member
0 Likes
2,536

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
Read only

Former Member
0 Likes
1,931

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
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,931

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

Read only

former_member150733
Contributor
0 Likes
1,931

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.

Read only

Former Member
1,931

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

Read only

Former Member
0 Likes
1,932

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

Read only

0 Likes
1,931

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

Read only

0 Likes
1,931

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

Read only

0 Likes
1,931

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

Read only

0 Likes
1,931

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

Read only

0 Likes
1,931

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

Read only

0 Likes
1,931

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